hallItem.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="hall-box-item">
  3. <view class="video-imgbox">
  4. <image class="video-img" :src="item.imgUrl" mode="scaleToFill" :lazy-load="true"></image>
  5. <image class="video-img-icon" src="@/static/image/hall/video_icon.png" mode="aspectFill"></image>
  6. </view>
  7. <view class="hall-box-info">
  8. <view class="hall-box-name">{{item.courseName}}</view>
  9. <view class="hall-box-desc">{{item.description}}</view>
  10. <view class="hall-box-footer">
  11. <view class="hall-box-footerl footer-flex">
  12. <image class="hall-box-img" :src="item.avatar"></image>
  13. <text>{{item.talentName}}</text>
  14. </view>
  15. <view class="hall-box-footerr footer-flex">
  16. <image class="hall-box-img" src="@/static/image/hall/zan_icon.png"></image>
  17. <text>{{ formatNum(item.likes) }}</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view v-if="item.isIntegral!=1" class="vip">VIP</view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. name: "hallItem",
  27. props: {
  28. item: {
  29. type: Object,
  30. default() {
  31. return { imgUrl:"",isIntegral:-1 };
  32. }
  33. }
  34. },
  35. data() {
  36. return {
  37. };
  38. },
  39. methods: {
  40. navTo(url) {
  41. uni.navigateTo({
  42. url: url
  43. });
  44. },
  45. formatNum(num){
  46. if(num>10000){
  47. return (num/10000.0).toFixed(1)+'万';
  48. }
  49. return num;
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. @mixin u-flex($flexD, $alignI, $justifyC) {
  56. display: flex;
  57. flex-direction: $flexD;
  58. align-items: $alignI;
  59. justify-content: $justifyC;
  60. }
  61. .vip{
  62. position: absolute;
  63. width: 54rpx;
  64. height: 20rpx;
  65. line-height: 20rpx;
  66. background: linear-gradient(94deg, #FFE9D0 0%, #E9BD97 100%);
  67. border-radius: 16rpx 0 16rpx 0;
  68. top: 0;
  69. left: 0;
  70. color:#333;
  71. font-size:18rpx ;
  72. text-align: center;
  73. font-weight: 500;
  74. font-style: italic;
  75. }
  76. .hall-box {
  77. @include u-flex(row, center, flex-start);
  78. flex-wrap: wrap;
  79. &-item {
  80. width: 342rpx;
  81. background: #FFFFFF;
  82. border-radius: 16rpx 16rpx 16rpx 16rpx;
  83. overflow: hidden;
  84. position: relative;
  85. .video-imgbox {
  86. width: 342rpx;
  87. height: 191rpx;
  88. background: #ECECEC;
  89. border-radius: 16rpx 16rpx 0rpx 0rpx;
  90. position: relative;
  91. overflow: hidden;
  92. }
  93. .video-img-icon {
  94. width: 48rpx;
  95. height: 48rpx;
  96. position: absolute;
  97. left: 50%;
  98. top: 50%;
  99. transform: translate(-50%, -50%);
  100. z-index: 1;
  101. }
  102. .video-img {
  103. width: 342rpx;
  104. height: 191rpx;
  105. // &::after {
  106. // content: "";
  107. // width: 48rpx;
  108. // height: 48rpx;
  109. // position: absolute;
  110. // left: 50%;
  111. // top: 50%;
  112. // transform: translate(-50%, -50%);
  113. // z-index: 1;
  114. // background-image: url("@/static/hall/video_icon.png");
  115. // background-repeat: no-repeat;
  116. // background-size: 100% 100%;
  117. // }
  118. }
  119. }
  120. &-info {
  121. padding: 22rpx 20rpx;
  122. font-family: PingFang SC, PingFang SC;
  123. font-weight: 400;
  124. font-size: 24rpx;
  125. color: #999999;
  126. }
  127. &-name {
  128. font-weight: 400;
  129. font-size: 28rpx;
  130. color: #222222;
  131. overflow: hidden;
  132. white-space: nowrap;
  133. text-overflow: ellipsis;
  134. }
  135. &-desc {
  136. overflow: hidden;
  137. white-space: nowrap;
  138. text-overflow: ellipsis;
  139. margin: 10rpx 0 18rpx;
  140. }
  141. &-footer {
  142. @include u-flex(row, center, space-between);
  143. width: 100%;
  144. }
  145. &-footerl {
  146. flex: 1;
  147. text {
  148. overflow: hidden;
  149. white-space: nowrap;
  150. text-overflow: ellipsis;
  151. }
  152. }
  153. &-img {
  154. width: 32rpx;
  155. height: 32rpx;
  156. margin-right: 8rpx;
  157. flex-shrink: 0;
  158. }
  159. }
  160. .footer-flex {
  161. overflow: hidden;
  162. @include u-flex(row, center, flex-start);
  163. }
  164. </style>