live-list.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view class="margin-bottom zaiui-live-list-box" :class="show?'show':''">
  3. <view class="flex flex-wrap">
  4. <view class="basis-df padding-sm padding-right-xs">
  5. <block v-for="(item,index) in list_data" :key="index" v-if="index%2==0">
  6. <view class="margin-bottom-sm img-itme" @tap="listTap(item,index)">
  7. <!--背景图-->
  8. <image class="cover-img" :src="item.cover_img" lazy-load mode="widthFix"/>
  9. <!--观看人数-->
  10. <view class="cu-capsule round live-tag" v-if="item.tag">
  11. <view class='cu-tag bg-red sm'>
  12. <text class='cuIcon-all'/>
  13. </view>
  14. <view class="cu-tag sm">{{item.tag}}</view>
  15. </view>
  16. <!--鉴别中-->
  17. <view class="cu-capsule round live-tag-title" v-if="item.tag_title.length > 0">
  18. <view class='cu-tag bg-red sm'>
  19. <text class='cuIcon-all'/>
  20. <text>{{item.tag_title[0]}}</text>
  21. </view>
  22. <view class="cu-tag sm">{{item.tag_title[1]}}</view>
  23. </view>
  24. <!--预约中-->
  25. <view class='cu-tag sm bg-red round live-time-tag' v-if="item.tag_time">
  26. <text class='cuIcon-timefill'/>
  27. <text class="margin-left-xs">{{item.tag_time}}</text>
  28. </view>
  29. <!--红包-->
  30. <view class='cu-tag bg-red sm radius live-red-tag' v-if="item.tag_red">{{item.tag_red}}</view>
  31. <!--特惠-->
  32. <view class='cu-tag bg-gradual-red sm radius live-red-tag' v-if="item.tag_red_bg">{{item.tag_red_bg}}</view>
  33. <!--标题-->
  34. <view class="text-cut live-title" v-if="item.title">{{item.title}}</view>
  35. <!--主播信息-->
  36. <view class="live-user-info-box" v-if="item.name">
  37. <view class="user-box">
  38. <!--头像-->
  39. <image :src="item.avatar" mode="aspectFill" lazy-load class="cu-avatar sm round" v-if="item.avatar"/>
  40. <!--名称-->
  41. <view class="text-cut text-sm user-name">{{item.name}}</view>
  42. <!--点赞-->
  43. <view class="text-sm text-right live-appreciate" v-if="item.appreciate">
  44. <text class="cuIcon-appreciate"/>
  45. <text class="margin-left-xs">{{item.appreciate}}</text>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </block>
  51. </view>
  52. <view class="basis-df padding-sm padding-left-xs">
  53. <block v-for="(item,index) in list_data" :key="index" v-if="index%2!=0">
  54. <view class="margin-bottom-sm img-itme" @tap="listTap(item,index)">
  55. <!--背景图-->
  56. <image class="cover-img" :src="item.cover_img" lazy-load mode="widthFix"/>
  57. <!--观看人数-->
  58. <view class="cu-capsule round live-tag" v-if="item.tag">
  59. <view class='cu-tag bg-red sm'>
  60. <text class='cuIcon-all'/>
  61. </view>
  62. <view class="cu-tag sm">{{item.tag}}</view>
  63. </view>
  64. <!--鉴别中-->
  65. <view class="cu-capsule round live-tag-title" v-if="item.tag_title.length > 0">
  66. <view class='cu-tag bg-red sm'>
  67. <text class='cuIcon-all'/>
  68. <text>{{item.tag_title[0]}}</text>
  69. </view>
  70. <view class="cu-tag sm">{{item.tag_title[1]}}</view>
  71. </view>
  72. <!--预约中-->
  73. <view class='cu-tag bg-red sm round live-time-tag' v-if="item.tag_time">
  74. <text class='cuIcon-timefill'/>
  75. <text class="margin-left-xs">{{item.tag_time}}</text>
  76. </view>
  77. <!--红包-->
  78. <view class='cu-tag bg-red sm radius live-red-tag' v-if="item.tag_red">{{item.tag_red}}</view>
  79. <!--特惠-->
  80. <view class='cu-tag bg-gradual-red sm radius live-red-tag' v-if="item.tag_red_bg">{{item.tag_red_bg}}</view>
  81. <!--标题-->
  82. <view class="text-cut live-title" v-if="item.title">{{item.title}}</view>
  83. <!--主播信息-->
  84. <view class="live-user-info-box" v-if="item.name">
  85. <view class="user-box">
  86. <!--头像-->
  87. <image :src="item.avatar" mode="aspectFill" lazy-load class="cu-avatar sm round" v-if="item.avatar"/>
  88. <!--名称-->
  89. <view class="text-cut text-sm user-name">{{item.name}}</view>
  90. <!--点赞-->
  91. <view class="text-sm text-right live-appreciate" v-if="item.appreciate">
  92. <text class="cuIcon-appreciate"/>
  93. <text class="margin-left-xs">{{item.appreciate}}</text>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </block>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. <script>
  104. import _tool from '@/static/zaiui/util/tools.js';
  105. export default {
  106. name: 'live-list',
  107. props: {
  108. list_data: {
  109. type: Array,
  110. default: () => {
  111. return []
  112. }
  113. },
  114. show: {
  115. type: Boolean,
  116. default: true
  117. }
  118. },
  119. methods: {
  120. listTap(data,index) {
  121. this.$emit('listTap', {
  122. data,
  123. index
  124. });
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .zaiui-live-list-box {
  131. position: relative;
  132. width: 100%;
  133. display: none;
  134. .img-itme {
  135. position: relative;
  136. width: 100%;
  137. .cover-img {
  138. width: 100%;
  139. border-radius: 3%;
  140. }
  141. .live-tag,.live-tag-title,.live-time-tag {
  142. position: absolute;
  143. top: 18.18upx;
  144. left: 18.18upx;
  145. }
  146. .cu-capsule.round.live-tag-title .cu-tag, .cu-capsule.round.live-tag .cu-tag {
  147. &:last-child {
  148. background-color: rgba(14, 14, 14, 0.6);
  149. color: #FFFFFF;
  150. }
  151. }
  152. .live-time-tag {
  153. background: rgba(14, 14, 14, 0.6);
  154. }
  155. .live-red-tag {
  156. position: absolute;
  157. bottom: 123.63upx;
  158. left: 18.18upx;
  159. }
  160. .live-title {
  161. position: absolute;
  162. bottom: 72.72upx;
  163. left: 0;
  164. width: 100%;
  165. padding: 0 18.18upx;
  166. color: #FFFFFF;
  167. }
  168. .live-user-info-box {
  169. position: absolute;
  170. bottom: 18.18upx;
  171. left: 0;
  172. width: 100%;
  173. color: #FFFFFF;
  174. .user-box {
  175. position: relative;
  176. width: 100%;
  177. .cu-avatar {
  178. margin-left: 18.18upx;
  179. width: 43.63upx;
  180. height: 43.63upx;
  181. }
  182. .user-name {
  183. position: absolute;
  184. top: 3.63upx;
  185. width: 145.45upx;
  186. left: 72.72upx;
  187. }
  188. .live-appreciate {
  189. position: absolute;
  190. top: 3.63upx;
  191. right: 18.18upx;
  192. }
  193. }
  194. }
  195. }
  196. }
  197. .zaiui-live-list-box.show {
  198. display: block;
  199. }
  200. </style>