洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.6 KiB

  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="安全驾驶"></topNavbar>
  4. <view class="pad">
  5. <view class="searcBox">
  6. <searchRow placeholder="搜索视频名称" @searchFn="searchFn"/>
  7. </view>
  8. <view class="ul">
  9. <view class="li" v-for="(item,index) in listData" :key="index" @click="$goPage('/pages/indexEntry/publicVideo/videoDetail/videoDetail?id='+ item.id)">
  10. <videoItem :item="item"></videoItem>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import videoItem from './comp/videoItem'
  18. import { publicVideoPage } from '@/config/api.js'
  19. export default {
  20. components: { videoItem },
  21. data() {
  22. return {
  23. params: {
  24. pageNo: 1,
  25. pageSize: 20,
  26. title: ''
  27. },
  28. listData: [],
  29. total: 20,
  30. }
  31. },
  32. onLoad() {
  33. this.publicVideoPageFn()
  34. },
  35. methods: {
  36. initList() {
  37. this.params.pageNo = 1
  38. this.listData = []
  39. this.publicVideoPageFn()
  40. },
  41. async publicVideoPageFn() {
  42. const {data: res} = await publicVideoPage(this.params)
  43. this.listData.push(...res.list)
  44. this.total = res.total
  45. },
  46. searchFn(val) {
  47. this.params.title = val
  48. this.initList()
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .ul {
  55. width: 100%;
  56. display: flex;
  57. justify-content: space-between;
  58. flex-wrap: wrap;
  59. .li {
  60. width: 100%;
  61. width: 48%;
  62. height: 260rpx;
  63. background: #FFFFFF;
  64. box-shadow: 0px 8rpx 20rpx 0px rgba(0,0,0,0.04), 2rpx 2rpx 8rpx 0px rgba(0,0,0,0.06);
  65. border-radius: 16rpx;
  66. margin-bottom: 24rpx;
  67. padding: 16rpx;
  68. }
  69. }
  70. .searcBox {
  71. padding: 0rpx 0 32rpx 0;
  72. }
  73. </style>