index copy.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <template>
  2. <view class="container">
  3. <div class="top">
  4. <div class="header">
  5. <img class="logo" src="/static/logo_big.png" alt="">
  6. <u--image
  7. class="border"
  8. :showLoading="true"
  9. :src="info.avatar || '/static/image/match/teams_avatar_ico@2x.png'"
  10. @click="go('/pages/Match/member/usermanger', true)"
  11. width="24px"
  12. height="24px"
  13. shape="circle"
  14. ></u--image>
  15. </div>
  16. <div class="title-box">
  17. <!-- Videos -->
  18. {{ $t('video.lab') }}
  19. </div>
  20. <div class="bar-list">
  21. <div class="item active">T20 match</div>
  22. <div class="item">india tour of new zeland</div>
  23. <div class="item">india tour of new zeland</div>
  24. </div>
  25. </div>
  26. <div class="banner-box">
  27. <img class="img" src="http://qiniu.onecric.tv/FvPGVpHDcUOL9UfPjLiEw_Kl4AhR.jpg" alt="">
  28. <div class="info-box">
  29. <div class="title text-clamp">1st T20I, India v New Zealand</div>
  30. <div class="tip">2023 Men's T20I Series | JSCA International Stadium Complex, Ranchi</div>
  31. </div>
  32. <img class="play" src="/static/image/live/play-icon.png" alt="">
  33. </div>
  34. <div class="type-box">
  35. <div class="type-item">
  36. <div class="type" @click="$toUrl('./list?type=' + 'T20s')">
  37. <div>T20s</div>
  38. <div class="see">
  39. <!-- See all -->
  40. {{ $t('video.lab1') }}
  41. </div>
  42. </div>
  43. <div class="list1">
  44. <div class="item">
  45. <div class="img-box">
  46. <u--image :showLoading="true" src="https://api.onecric.tv/upload/WechatIMG443.jpg" width="100%" height="105px">
  47. <template v-slot:loading>
  48. <image class="loading-list-img" src="/static/image/common/live-list-bg.png"></image>
  49. </template>
  50. </u--image>
  51. <img class="play" src="/static/image/live/play-icon.png" alt="">
  52. </div>
  53. <div class="body">
  54. <div class="title text-clamp">India v New Zealand</div>
  55. <div class="tip">2023 Men's T20I Series | 1st T20I</div>
  56. <div class="flex">
  57. <div class="live">
  58. <!-- Live -->
  59. {{ $t('video.lab2') }}
  60. </div>
  61. <div>JSCA Stadium Complex</div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="item">
  66. <div class="img-box">
  67. <u--image :showLoading="true" src="https://qiniu.onecric.tv/moren.png" width="100%" height="105px">
  68. <template v-slot:loading>
  69. <image class="loading-list-img" src="/static/image/common/live-list-bg.png"></image>
  70. </template>
  71. </u--image>
  72. <img class="play" src="/static/image/live/play-icon.png" alt="">
  73. </div>
  74. <div class="body">
  75. <div class="title text-clamp">India v New Zealand</div>
  76. <div class="tip">2023 Men's T20I Series | 1st T20I</div>
  77. <div class="flex">
  78. <div class="live">
  79. <!-- Live -->
  80. {{ $t('video.lab2') }}
  81. </div>
  82. <div>JSCA Stadium Complex</div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="type-item">
  89. <div class="type">
  90. <div>T20s</div>
  91. <div class="see">
  92. <!-- See all -->
  93. {{ $t('video.lab1') }}
  94. </div>
  95. </div>
  96. <div class="list1">
  97. <div class="item">
  98. <div class="img-box">
  99. <u--image :showLoading="true" src="https://api.onecric.tv/upload/WechatIMG443.jpg" width="100%" height="105px">
  100. <template v-slot:loading>
  101. <image class="loading-list-img" src="/static/image/common/live-list-bg.png"></image>
  102. </template>
  103. </u--image>
  104. <img class="play" src="/static/image/live/play-icon.png" alt="">
  105. </div>
  106. <div class="body">
  107. <div class="title text-clamp">India v New Zealand</div>
  108. <div class="tip">2023 Men's T20I Series | 1st T20I</div>
  109. <div class="flex">
  110. <div class="live">
  111. <!-- Live -->
  112. {{ $t('video.lab2') }}
  113. </div>
  114. <div>JSCA Stadium Complex</div>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="item">
  119. <div class="img-box">
  120. <u--image :showLoading="true" src="https://api.onecric.tv/upload/WechatIMG443.jpg" width="100%" height="105px">
  121. <template v-slot:loading>
  122. <image class="loading-list-img" src="/static/image/common/live-list-bg.png"></image>
  123. </template>
  124. </u--image>
  125. <img class="play" src="/static/image/live/play-icon.png" alt="">
  126. </div>
  127. <div class="body">
  128. <div class="title text-clamp">India v New Zealand</div>
  129. <div class="tip">2023 Men's T20I Series | 1st T20I</div>
  130. <div class="flex">
  131. <div class="live">
  132. <!-- Live -->
  133. {{ $t('video.lab2') }}
  134. </div>
  135. <div>JSCA Stadium Complex</div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="type-item">
  142. <div class="type">
  143. <div>
  144. <!-- Onecric Shows -->
  145. {{ $t('video.lab3') }}
  146. </div>
  147. </div>
  148. <div class="list1">
  149. </div>
  150. </div>
  151. </div>
  152. <u-empty v-if="obj.total == 0" mode="data" width="474" height="312" textSize="28" marginTop="100"
  153. :text="$t('common.nodata')" icon="/static/image/common/nodata.png">
  154. </u-empty>
  155. <div class="news-install">
  156. <install></install>
  157. </div>
  158. </view>
  159. </template>
  160. <script>
  161. import { numberToK } from '@/utils/util'
  162. import install from '@/components/install/install.vue'
  163. export default {
  164. components: {
  165. install
  166. },
  167. data() {
  168. return {
  169. // 初始化左右盒子
  170. leftList: [],
  171. rightList: [],
  172. // 初始化左右盒子高度
  173. leftH: 0,
  174. rightH: 0,
  175. obj: {
  176. total: 1
  177. },
  178. page: 1,
  179. status: 'loadmore'
  180. }
  181. },
  182. computed: {
  183. info() {
  184. return this.$store.state.info;
  185. },
  186. isLogin() {
  187. return this.$store.state.isLogin;
  188. },
  189. },
  190. onReady() {
  191. this.getList();
  192. },
  193. methods: {
  194. onTap(data,index) {
  195. let videoList_index =Number(index)
  196. this.$toUrl('./live?id=' + data.id+'&index='+videoList_index)
  197. },
  198. toUrl() {
  199. this.$toUrl('./publish')
  200. },
  201. // 获取数据
  202. getList() {
  203. // 设置状态为加载中
  204. this.status = 'loading';
  205. uni.$u.http.get('/api/Video/getList', {
  206. params: {
  207. page: this.page,
  208. type: 1
  209. }
  210. }).then(res => {
  211. // 获取到的数据,请注意数据结构
  212. // 第一页数据执行以下代码
  213. if (this.page == 1) {
  214. // 关闭下拉
  215. this.leftList=res.data
  216. // uni.stopPullDownRefresh();
  217. // 设置组件状态为 重置,可供下拉刷新这类需要重置列表功能时使用
  218. } else {
  219. this.leftList = this.leftList.concat(res.data || [])
  220. }
  221. this.obj = res;
  222. this.setList(res)
  223. }).catch(res => {})
  224. },
  225. numberToK(v) {
  226. return numberToK(v)
  227. },
  228. setList(obj) {
  229. let that = this;
  230. // obj.data.forEach(res => {
  231. // // 获取图片宽高
  232. // // console.log(res.flie[0].img);
  233. // uni.getImageInfo({
  234. // src: res.flie[0].img,
  235. // success: (image) => {
  236. // // console.log(res.src)
  237. // // 计算图片渲染高度
  238. // let showH = (50 * image.height) / image.width
  239. // // 判断左右盒子高度
  240. // if (that.leftH <= that.rightH) {
  241. // that.leftList.push(res)
  242. // that.leftH += showH
  243. // } else {
  244. // that.rightList.push(res)
  245. // that.rightH += showH
  246. // }
  247. // }
  248. // })
  249. // })
  250. let total = this.leftList.length + this.rightList.length;
  251. if (obj.total > total) {
  252. this.status = 'loadmore'
  253. } else {
  254. this.status = 'No more data'
  255. }
  256. },
  257. go(url, login) {
  258. if (this.isLogin == 2 && login) {
  259. this.$toUrl('/pages/login/login')
  260. return
  261. }
  262. this.$toUrl(url)
  263. },
  264. }
  265. }
  266. </script>
  267. <style lang="scss">
  268. page {
  269. background-color: #f3f3f3;
  270. }
  271. .container {
  272. padding-bottom: var(--window-bottom);
  273. }
  274. .top {
  275. position: sticky;
  276. top: 0;
  277. z-index: 999;
  278. .header {
  279. display: flex;
  280. align-items: center;
  281. justify-content: space-between;
  282. padding: 8rpx 16px 16rpx;
  283. background-color: #10044A;
  284. }
  285. .logo {
  286. height: 24px;
  287. }
  288. .border {
  289. border: 1px solid #CC2900;
  290. border-radius: 50%;
  291. }
  292. .title-box {
  293. height: 40px;
  294. background-color: #262E4A;
  295. padding: 0 16px;
  296. display: flex;
  297. align-items: center;
  298. color: #fff;
  299. font-weight: 500;
  300. font-size: 16px;
  301. }
  302. .bar-list {
  303. display: flex;
  304. align-items: center;
  305. flex-wrap: nowrap;
  306. overflow: auto;
  307. background-color: #fff;
  308. .item {
  309. padding: 12px 16px;
  310. font-weight: 500;
  311. font-size: 14px;
  312. color: #000000;
  313. white-space: nowrap;
  314. border-bottom: 2px solid transparent;
  315. &.active {
  316. border-color: #FF3300;
  317. }
  318. }
  319. }
  320. }
  321. .banner-box {
  322. position: relative;
  323. .img {
  324. width: 100%;
  325. display: block;
  326. }
  327. .info-box {
  328. position: absolute;
  329. top: 0;
  330. left: 0;
  331. right: 0;
  332. bottom: 0;
  333. background: linear-gradient(180deg, rgba(16, 4, 74, 0) 0%, #080031 100%);
  334. display: flex;
  335. flex-direction: column;
  336. justify-content: flex-end;
  337. padding: 26rpx 16px;
  338. .title {
  339. color: #fff;
  340. font-weight: 600;
  341. font-size: 26px;
  342. margin-bottom: 16px;
  343. }
  344. .tip {
  345. font-weight: 500;
  346. font-size: 16px;
  347. color: #C7C7C7;
  348. margin-bottom: 16px;
  349. }
  350. }
  351. .play {
  352. position: absolute;
  353. top: 50%;
  354. left: 50%;
  355. transform: translate(-50%, -50%);
  356. width: 46px;
  357. }
  358. }
  359. .type-box {
  360. padding: 0 0 16px 8px;
  361. .type-item {
  362. .type {
  363. padding: 26px 8px 10px 0;
  364. display: flex;
  365. align-items: center;
  366. justify-content: space-between;
  367. font-weight: 600;
  368. font-size: 18px;
  369. line-height: 1;
  370. color: #242424;
  371. .see {
  372. font-weight: 400;
  373. font-size: 14px;
  374. color: #4E4E4E;
  375. }
  376. }
  377. }
  378. .list1 {
  379. display: flex;
  380. flex-wrap: nowrap;
  381. overflow: auto;
  382. .item {
  383. background: #FFFFFF;
  384. box-shadow: 0px 4px 26px rgba(174, 174, 174, 0.16);
  385. border-radius: 4px;
  386. min-width: 214px;
  387. max-width: 214px;
  388. overflow: hidden;
  389. margin-right: 16px;
  390. .img-box {
  391. position: relative;
  392. .play {
  393. position: absolute;
  394. top: 50%;
  395. left: 50%;
  396. transform: translate(-50%, -50%);
  397. width: 46px;
  398. }
  399. }
  400. .loading-list-img {
  401. width: 100%;
  402. height: 105px;
  403. }
  404. }
  405. .body {
  406. padding: 12px 10px;
  407. .title {
  408. font-weight: 500;
  409. font-size: 14px;
  410. color: #242424;
  411. margin-bottom: 8px;
  412. }
  413. .tip {
  414. font-weight: 400;
  415. font-size: 12px;
  416. color: #4E4E4E;
  417. margin-bottom: 26px;
  418. }
  419. .flex {
  420. justify-content: space-between;
  421. font-weight: 400;
  422. font-size: 10px;
  423. color: #4E4E4E;
  424. .live {
  425. font-weight: 500;
  426. color: #FF3300;
  427. }
  428. }
  429. }
  430. }
  431. }
  432. .news-install {
  433. position: sticky;
  434. bottom: var(--window-bottom);
  435. z-index: 200;
  436. }
  437. </style>