videoListBox.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="list-box">
  3. <van-cell @click='clickCell' :title="carVideoList.chapterName" />
  4. <view class="tabs-box">
  5. <view class="video-item" @click="gotoPaly(currentItem.list[0])">
  6. <view class="image-box">
  7. <view class="img-box">
  8. <image class="image" :src="currentItem.list[0].cover" mode="aspectFill"></image>
  9. </view>
  10. <image v-if="currentItem.list[0].permission==1" class="img-tip" :src="shikan"></image>
  11. <image v-if="currentItem.list[0].permission==2" class="img-tip" :src="vip"></image>
  12. <text>{{currentItem.list[0].duration}}</text>
  13. <m-icon class="icon" type="bofangshipin"></m-icon>
  14. </view>
  15. </view>
  16. <scroll-view class="tabs-bfc">
  17. <view class="tabs">
  18. <view class="tab" :class="{'tab-active':active===index}" @click="active=index" v-for="(item,index) in carVideoList.children"
  19. :key='index'>
  20. {{item.chapterName}}
  21. </view>
  22. </view>
  23. </scroll-view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import shikan from "@/assets/img/shikan.png";
  29. import vip from "@/assets/img/vip.png";
  30. export default {
  31. name: "video-listBox",
  32. props: {
  33. carVideoList: {
  34. type: Object,
  35. default: ()=>{
  36. return {}
  37. }
  38. },
  39. },
  40. data() {
  41. return {
  42. active: 0,
  43. shikan,
  44. vip
  45. };
  46. },
  47. computed: {
  48. currentItem() {
  49. console.log(this.carVideoList,'this.carVideoList')
  50. return this.carVideoList.children[this.active]
  51. }
  52. },
  53. methods: {
  54. gotoPaly(item) {
  55. this.$utils.route.goPage('/pages/carVideo/play', null, {
  56. carVideoItem: item
  57. })
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .list-box {
  64. margin-bottom: 10px;
  65. background-color: #FFFFFF;
  66. .tabs-box {
  67. padding: 5px 15px;
  68. border-radius: 10px;
  69. overflow: hidden;
  70. width: 100%;
  71. }
  72. .tabs-bfc{
  73. overflow: auto;
  74. }
  75. .tabs {
  76. background-color: #0A1A33;
  77. overflow: auto;
  78. white-space: nowrap;
  79. .tab {
  80. display: inline-flex;
  81. justify-content: center;
  82. align-items: center;
  83. text-align: center;
  84. width: auto;
  85. height: 37px;
  86. background: #5C6066;
  87. border-radius: 3px;
  88. margin: 3px;
  89. font-size: 11px;
  90. font-family: PingFang SC;
  91. font-weight: 500;
  92. color: #FFFFFF;
  93. letter-spacing: 0.2800000011920929px;
  94. padding: 0 30rpx;
  95. }
  96. .tab-active {
  97. background-color: #498EF5;
  98. position: relative;
  99. &::after{
  100. content: '';
  101. width: 5px;
  102. height: 5px;
  103. position: absolute;
  104. top: 0;
  105. left: 50%;
  106. transform: translate(-50%,-50%) rotate(45deg);
  107. background-color: #498EF5;
  108. z-index: 1;
  109. }
  110. }
  111. }
  112. .video-item {
  113. position: relative;
  114. background-color: #ffffff;
  115. display: flex;
  116. flex-direction: column;
  117. justify-content: center;
  118. text-align: center;
  119. .image-box {
  120. position: relative;
  121. .img-tip{
  122. position: absolute;
  123. right: 10rpx;
  124. top: 10rpx;
  125. width: 50rpx;
  126. height: 28rpx;
  127. }
  128. .img-box {
  129. width: 100%;
  130. padding-bottom: 64%;
  131. position: relative;
  132. .image {
  133. position: absolute;
  134. left: 0;
  135. top: 0;
  136. width: 100%;
  137. height: 100%;
  138. }
  139. }
  140. text {
  141. position: absolute;
  142. color: red;
  143. right: 8rpx;
  144. bottom: 8rpx;
  145. color: #8A9099;
  146. }
  147. .icon {
  148. width: 44rpx;
  149. position: absolute;
  150. left: 50%;
  151. top: 50%;
  152. transform: translate(-50%, -50%);
  153. }
  154. }
  155. text {
  156. font-size: 30rpx;
  157. font-weight: 400;
  158. line-height: 39rpx;
  159. color: #0F0404;
  160. white-space: nowrap;
  161. text-overflow: ellipsis;
  162. overflow: hidden;
  163. }
  164. }
  165. }
  166. </style>