historyList.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <!-- 推荐 -->
  2. <template>
  3. <view class="list">
  4. <div>
  5. <div><img src="/static/image/live/detail01.png" />
  6. <!-- History -->
  7. {{ $t('live.title3') }}
  8. </div>
  9. <div>
  10. <!-- See More -->
  11. {{ $t('live.more1') }}
  12. </div>
  13. </div>
  14. <u-empty
  15. v-if="robot.length == 0"
  16. mode="data"
  17. width="474"
  18. height="312"
  19. textSize="28"
  20. marginTop="100"
  21. :text="$t('common.nodata')"
  22. icon="/static/image/common/nodata.png"
  23. >
  24. </u-empty>
  25. <!-- History -->
  26. <u-row>
  27. <u-col span="6">
  28. <view
  29. class="detail-video-li"
  30. style="position: relative"
  31. v-for="(item, index) in robot"
  32. :key="index"
  33. @click="historyLive(item)"
  34. >
  35. <u--image
  36. :showLoading="true"
  37. :src="item.img"
  38. width="100%"
  39. height="176rpx"
  40. >
  41. <template v-slot:loading>
  42. <image
  43. class="loading-list-img"
  44. src="/static/image/common/live-list-bg.png"
  45. ></image>
  46. </template>
  47. </u--image>
  48. <image
  49. src="/static/image/live/live-history-icon.png"
  50. mode=""
  51. class="history-icon"
  52. ></image>
  53. <view class="detail-video-content">
  54. <view class="detail-video-title text-clamp2">
  55. {{ item.Name }}
  56. </view>
  57. <view class="detail-video-right flex">
  58. <image
  59. class="detail-video-content-logo"
  60. :src="item.UserHead"
  61. mode="aspectFill"
  62. ></image>
  63. <view class="detail-video-info flex">
  64. <text class="text-clamp">{{ item.UserName }}</text>
  65. <image src="/static/image/live/detail-hot.png" mode=""></image>
  66. <!-- <view>{{item.Heat}}</view> -->
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </u-col>
  72. <u-col span="6">
  73. <view
  74. class="detail-video-li"
  75. style="position: relative"
  76. v-for="(item, index) in robot"
  77. :key="index"
  78. @click="historyLive(item)"
  79. >
  80. <u--image
  81. :showLoading="true"
  82. :src="item.img"
  83. width="100%"
  84. height="176rpx"
  85. >
  86. <template v-slot:loading>
  87. <image
  88. class="loading-list-img"
  89. src="/static/image/common/live-list-bg.png"
  90. ></image>
  91. </template>
  92. </u--image>
  93. <image
  94. src="/static/image/live/live-history-icon.png"
  95. mode=""
  96. class="history-icon"
  97. ></image>
  98. <view class="detail-video-content">
  99. <view class="detail-video-title text-clamp2">
  100. {{ item.Name }}
  101. </view>
  102. <view class="detail-video-right flex">
  103. <image
  104. class="detail-video-content-logo"
  105. :src="item.UserHead"
  106. mode="aspectFill"
  107. ></image>
  108. <view class="detail-video-info flex">
  109. <text class="text-clamp">{{ item.UserName }}</text>
  110. <image src="/static/image/live/detail-hot.png" mode=""></image>
  111. <!-- <view>{{item.Heat}}</view> -->
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. </u-col>
  117. </u-row>
  118. </view>
  119. </template>
  120. <script>
  121. import { numberToK } from "@/utils/util";
  122. export default {
  123. data() {
  124. return {
  125. robot: [],
  126. };
  127. },
  128. created() {
  129. this.getList();
  130. },
  131. methods: {
  132. // 点击history
  133. historyLive(item) {
  134. uni.navigateTo({
  135. url:`/pages/Live/history-detail?id=${item.Uid}&ID=${item.live_id}&MediaUrl=${item.MediaUrl}`
  136. });
  137. },
  138. toUrlLive(item) {
  139. gtag("event", "live_H5", {
  140. live_H5: "0",
  141. });
  142. if (item.islive == 0) {
  143. uni.$u.toast(this.$t('live.lab35'));
  144. } else {
  145. uni.navigateTo({
  146. url: `./live-detail?id=${item.live_id}&ID=${item.id}`,
  147. });
  148. }
  149. },
  150. getList() {
  151. uni.$u.http
  152. .get("/api/LivePlayBack/list", {})
  153. .then((res) => {
  154. this.robot = (res.list || []).slice(0, 6);
  155. });
  156. },
  157. },
  158. };
  159. </script>
  160. <style lang="scss">
  161. .detail-video-li {
  162. overflow: hidden;
  163. margin-top: 20rpx;
  164. border-radius: 12rpx;
  165. background-color: white;
  166. .loading-list-img {
  167. width: 100%;
  168. height: 176rpx;
  169. }
  170. .history-icon {
  171. position: absolute;
  172. right: 10rpx;
  173. bottom: 170rpx;
  174. width: 150rpx;
  175. height: 42rpx;
  176. }
  177. .detail-video-li-logo {
  178. width: 100%;
  179. height: 176rpx;
  180. display: block;
  181. }
  182. .detail-video-content {
  183. padding: 16rpx;
  184. .detail-video-content-logo {
  185. width: 40rpx;
  186. height: 40rpx;
  187. border-radius: 50%;
  188. margin-right: 24rpx;
  189. }
  190. .detail-video-title {
  191. width: 99%;
  192. height: 80rpx;
  193. color: #333;
  194. font-size: 28rpx;
  195. }
  196. }
  197. .detail-video-info {
  198. font-size: 24rpx;
  199. flex: 1;
  200. image {
  201. width: 24rpx;
  202. height: 24rpx;
  203. margin-right: 6rpx;
  204. }
  205. text {
  206. flex: 1;
  207. width: 100rpx;
  208. color: #9193b4;
  209. }
  210. view {
  211. color: #999;
  212. }
  213. }
  214. }
  215. .detail-video-right {
  216. flex: 1;
  217. min-width: 100px;
  218. }
  219. </style>