index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view class="search">
  3. <view class="input_box">
  4. <u-search height="30" bgColor="#FFF" :showAction="false" :focus="true" placeholder="请输入剧名"
  5. searchIconColor="#000" v-model="keyword" @search="search"></u-search>
  6. </view>
  7. <view v-if="list && list.length" class="video_lists">
  8. <view class="list_item" v-for="(item,index) in list" :key="index" @click="toPlay(item)">
  9. <image :src="item.thumbnail" mode="aspectFill" loading="lazy"></image>
  10. <view class="innews">
  11. <text>{{ item.name }}</text>
  12. <text class="ellipsis-2">{{ item.description }}</text>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import { getServerShipProgramPage } from '@/apis/index'
  20. export default {
  21. data(){
  22. return{
  23. keyword:'',
  24. list:[]
  25. }
  26. },
  27. methods: {
  28. // 获取视频节目分页
  29. async getVideoPage() {
  30. let params = {
  31. orderByColumn: "",
  32. orderByAsc: true,
  33. pageIndex: 1,
  34. pageSize: 10,
  35. keyword: this.keyword,
  36. shipCategoryId: '',
  37. }
  38. const res = await getServerShipProgramPage(params)
  39. this.list = res.list
  40. console.log(res);
  41. },
  42. search(){
  43. this.getVideoPage()
  44. },
  45. toPlay(item){
  46. uni.redirectTo({
  47. url:'/pages/play/index?id='+ item.id+'&data='+JSON.stringify(item),
  48. })
  49. },
  50. },
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .search{
  55. background: #fff;
  56. padding-bottom: var(--window-bottom);
  57. .input_box{
  58. padding: 20rpx;
  59. }
  60. .video_lists{
  61. padding: 20rpx;
  62. background: #fff;
  63. .list_item{
  64. display: flex;
  65. padding: 20rpx;
  66. border-bottom: 1rpx solid #e2e1d0;
  67. image{
  68. flex-shrink: 0;
  69. width: 160rpx;
  70. height: 220rpx;
  71. margin-right: 30rpx;
  72. }
  73. .innews{
  74. padding: 10rpx 0;
  75. display: flex;
  76. flex-direction: column;
  77. justify-content: space-around;
  78. // justify-content: space-around;
  79. }
  80. }
  81. .list_item:nth-last-child(1){
  82. border: 0;
  83. }
  84. }
  85. }
  86. </style>