index.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 class="videoLists">
  8. <view class="list_item" v-for="(item,index) in list" :key="index">
  9. <image :src="item.thumbnail" mode="aspectFill" loading="lazy"></image>
  10. <view class="innews">
  11. <text>{{item.title}}</text>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import { getServerShipProgramPage } from '@/apis/index'
  19. export default {
  20. data(){
  21. return{
  22. keyword:'',
  23. list:[]
  24. }
  25. },
  26. methods: {
  27. // 获取视频节目分页
  28. async getVideoPage() {
  29. let params = {
  30. orderByColumn: "",
  31. orderByAsc: true,
  32. pageIndex: 1,
  33. pageSize: 10,
  34. keyword: this.keyword,
  35. shipCategoryId: '',
  36. }
  37. const res = await getServerShipProgramPage(params)
  38. this.list = res.list
  39. console.log(res);
  40. },
  41. search(){
  42. this.getVideoPage()
  43. }
  44. },
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. .search{
  49. padding-bottom: var(--window-bottom);
  50. .input_box{
  51. padding: 20rpx;
  52. }
  53. }
  54. </style>