index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <view class="main">
  3. <view class="bg">
  4. <view class="search">
  5. <text>亚太视频</text>
  6. <u-search height="30" bgColor="#FFF" :showAction="false" placeholder="请输入剧名"
  7. searchIconColor="#000" v-model="keyword" @focus="toSearch"></u-search>
  8. </view>
  9. <view class="playlets">
  10. <view class="ranks">
  11. <u-tabs :list="tabs" @click="click" :activeStyle="{
  12. color: '#303133',
  13. fontWeight: 'bold',
  14. transform: 'scale(1.05)'
  15. }" :inactiveStyle="{
  16. color: '#606266',
  17. transform: 'scale(1)'
  18. }" itemStyle="padding-right: 15px; height: 34px;"></u-tabs>
  19. </view>
  20. <view class="rank_list">
  21. <view class="list-item" v-for="(item,index) in list" :key="index" @click="toPlay(item)">
  22. <view class="cover">
  23. <image class="cover_img" :src="item.thumbnail"></image>
  24. <view :class="`grade${index}`" class="grade">{{index+1}}</view>
  25. <!-- <view class="hot">
  26. <pv-icon name="icon-huomiao" color='#fff' :customStyle="{ fontSize: '24rpx'}"></pv-icon>
  27. <text>12.8W</text>
  28. </view> -->
  29. </view>
  30. <view class="names">
  31. <text>{{item.name}}</text>
  32. <text class="ellipsis-2">{{item.description}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="play_types">
  38. <view class="type_item" v-for="(item,index) in typeLists" :key="index">
  39. <view class="title">{{item.name}}</view>
  40. <view class="watches">
  41. <view class="watch-item" v-for="(wai,ind) in item.list" :key="ind">
  42. <view class="cover">
  43. <image class="cover_img" src=""></image>
  44. <view class="uphot">
  45. <text>更新至12集</text>
  46. <view class="hot">
  47. <pv-icon name="icon-huomiao" color='#fff'
  48. :customStyle="{ fontSize: '26rpx'}"></pv-icon>
  49. <text>12.8W</text>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="names">
  54. <text>小日子</text>
  55. <text>陈晓童瑶首搭守护小日子</text>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import {
  66. getServerShipCategoryList,getServerShipProgramPage,getServerShipVideoList
  67. } from '@/apis/index'
  68. export default {
  69. data() {
  70. return {
  71. keyword:'',
  72. tabs: [],
  73. list: [],
  74. typeLists: [
  75. // {
  76. // name: '都市逆袭',
  77. // list: [{
  78. // name: '小日子'
  79. // },
  80. // {
  81. // name: '永安梦'
  82. // },
  83. // {
  84. // name: '烈焰'
  85. // },
  86. // {
  87. // name: '目中无人'
  88. // },
  89. // ]
  90. // },
  91. // {
  92. // name: '现代言情',
  93. // list: [{
  94. // name: '小日子'
  95. // },
  96. // {
  97. // name: '永安梦'
  98. // },
  99. // {
  100. // name: '烈焰'
  101. // },
  102. // {
  103. // name: '目中无人'
  104. // },
  105. // ]
  106. // },
  107. ]
  108. }
  109. },
  110. onLoad() {
  111. },
  112. methods: {
  113. // 跳转视频页面
  114. toPlay(item){
  115. uni.navigateTo({
  116. url:'/pages/play/index?id='+ item.id+'&data='+JSON.stringify(item),
  117. })
  118. },
  119. // 获取视频分类列表
  120. async getVideoList() {
  121. const res = await getServerShipCategoryList()
  122. this.tabs = res
  123. this.getVideoPage(res[0].id)
  124. },
  125. // 获取视频节目分页
  126. async getVideoPage(id) {
  127. let params = {
  128. orderByColumn: "",
  129. orderByAsc: true,
  130. pageIndex: 1,
  131. pageSize: 10,
  132. keyword: this.keyword,
  133. shipCategoryId: id,
  134. }
  135. const res = await getServerShipProgramPage(params)
  136. this.list = res.list
  137. console.log(res);
  138. },
  139. // 跳转搜索页
  140. toSearch(){
  141. console.log(8899);
  142. uni.navigateTo({
  143. url:'/pages/search/index'
  144. })
  145. }
  146. // async getList(id){
  147. // const res = await getServerShipVideoList(id)
  148. // console.log(res);
  149. // }
  150. },
  151. mounted() {
  152. this.getVideoList()
  153. // this.getVideoPage()
  154. },
  155. }
  156. </script>
  157. <style lang="scss" scoped>
  158. .main {
  159. padding-bottom: var(--window-bottom);
  160. .bg{
  161. background: #3C7FFC;
  162. }
  163. .search {
  164. width: 100%;
  165. height: 88rpx;
  166. display: flex;
  167. align-items: center;
  168. padding: 0 24rpx;
  169. .search_accent{
  170. flex: 1;
  171. }
  172. text {
  173. color: #fff;
  174. font-weight: bold;
  175. margin-right: 44rpx;
  176. }
  177. }
  178. .playlets {
  179. background: linear-gradient(180deg, #FFF6DE 0%, #FFFFFF 100%);
  180. border-radius: 24rpx 24rpx 0 0;
  181. padding: 22rpx 36rpx;
  182. .ranks {
  183. margin-bottom: 20rpx;
  184. }
  185. .rank_list {
  186. display: flex;
  187. justify-content: space-between;
  188. .list-item {
  189. width: 216rpx;
  190. .cover {
  191. position: relative;
  192. .cover_img {
  193. width: 100%;
  194. height: 276rpx;
  195. border-radius: 16rpx;
  196. background: #3C7FFC;
  197. }
  198. .grade {
  199. text-align: center;
  200. line-height: 32rpx;
  201. width: 28rpx;
  202. height: 32rpx;
  203. border-radius: 8rpx;
  204. position: absolute;
  205. color: #713B03;
  206. font-size: 24rpx;
  207. font-weight: bold;
  208. top: 0;
  209. right: 0;
  210. }
  211. .grade0 {
  212. background: linear-gradient(90deg, #FFBB3E 0%, #FFCE1C 100%);
  213. }
  214. .grade1 {
  215. background: linear-gradient(90deg, #FFF2DA 0%, #FFDC5E 100%);
  216. }
  217. .grade2 {
  218. background: linear-gradient(90deg, #FFEBC6 0%, #FFF4CE 100%);
  219. }
  220. .hot {
  221. position: absolute;
  222. left: 12rpx;
  223. bottom: 8rpx;
  224. text {
  225. font-size: 24rpx;
  226. color: #fff;
  227. margin-left: 8rpx;
  228. }
  229. }
  230. }
  231. .names {
  232. margin-top: 35rpx;
  233. display: flex;
  234. flex-direction: column;
  235. text:nth-child(1) {
  236. color: #2A2D32;
  237. font-size: 28rpx;
  238. font-weight: 500;
  239. margin-bottom: 5rpx;
  240. }
  241. text:nth-child(2) {
  242. color: #636267;
  243. font-size: 24rpx;
  244. font-weight: 400;
  245. }
  246. }
  247. }
  248. }
  249. }
  250. .play_types {
  251. background: #fff;
  252. padding: 32rpx 36rpx 0;
  253. .type_item {
  254. .title {
  255. font-weight: bold;
  256. font-size: 36rpx;
  257. color: #2A2D32;
  258. margin-bottom: 28rpx;
  259. }
  260. .watches {
  261. display: flex;
  262. flex-wrap: wrap;
  263. justify-content: space-between;
  264. .watch-item {
  265. width: 336rpx;
  266. margin-bottom: 40rpx;
  267. .cover {
  268. position: relative;
  269. .cover_img {
  270. width: 100%;
  271. height: 216rpx;
  272. border-radius: 16rpx;
  273. background: #3C7FFC;
  274. }
  275. .uphot {
  276. padding: 12rpx;
  277. width: 100%;
  278. position: absolute;
  279. bottom: 0;
  280. left: 0;
  281. display: flex;
  282. justify-content: space-between;
  283. font-size: 24rpx;
  284. color: #FFFFFF;
  285. text {}
  286. .hot {}
  287. }
  288. }
  289. .names {
  290. margin-top: 20rpx;
  291. display: flex;
  292. flex-direction: column;
  293. text:nth-child(1) {
  294. color: #2A2D32;
  295. font-size: 28rpx;
  296. font-weight: 500;
  297. }
  298. text:nth-child(2) {
  299. color: #636267;
  300. font-size: 24rpx;
  301. font-weight: 400;
  302. }
  303. }
  304. }
  305. }
  306. }
  307. }
  308. }
  309. </style>