index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view>
  3. <view class="wrapper" style="" v-if="listData.length>0">
  4. <view v-for="(value,key) in listData" :key="key" class="wrapper-inner" @click="detail(value)">
  5. <view class="box flex" style="width:30%; border-radius:20rpx;">
  6. <image class="integral-mall-goods" mode="aspectFill" :src="value.cover_image"></image>
  7. </view>
  8. <view class="text-wrapper">
  9. <view class="text-name plr10 ft16 ftw600 text-over cl-main">{{value.name}}</view>
  10. <view class="text-dec plr10 ft14 ftw400 text-over4 cl-main">
  11. {{value.note}}
  12. </view>
  13. <view>
  14. <text
  15. class="text-status mt8 plr10 ft12 ftw400 text-over cl-main">总集数:{{value.total_episode_num}}</text>
  16. <text
  17. class="text-status mt8 plr10 ft12 ftw400 text-over cl-main">{{value.update_type|getStatus}}</text>
  18. </view>
  19. </view>
  20. <!-- <view class="icon">
  21. <u-icon name="arrow-right" size="45rpx" color="#f00"></u-icon>
  22. </view> -->
  23. </view>
  24. </view>
  25. <view class="empty-box" v-else>
  26. <image src="/static/img/orders/emty.png" mode=""></image>
  27. <p class="ft14 line-1-txt">暂无数据</p>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  33. import {
  34. getMiniprogramRecentvideo
  35. } from '@/common/apis/index.js'
  36. import cellGroup from '../../../uni_modules/uview-ui/libs/config/props/cellGroup';
  37. export default {
  38. components: {
  39. uniLoadMore
  40. },
  41. filters: {
  42. getStatus: (value) => {
  43. let arrayData = {
  44. 1: '连载中',
  45. 2: '已完结',
  46. }
  47. return arrayData[value]
  48. }
  49. },
  50. data() {
  51. return {
  52. banners: [],
  53. searchValue: '',
  54. total: 0,
  55. selectIndex: 0,
  56. scrollTop: 0,
  57. keytext: '',
  58. listData: [],
  59. last_id: 0,
  60. reload: true,
  61. status: 'more',
  62. contentText: {
  63. contentdown: '上拉加载更多',
  64. contentrefresh: '加载中',
  65. contentnomore: '没有数据了'
  66. }
  67. }
  68. },
  69. onLoad(e) {
  70. if (e.selectIndex) {
  71. this.selectIndex = e.selectIndex * 1
  72. }
  73. this.status = 'more';
  74. this.getList();
  75. this.banners = uni.getStorageSync("config").banner
  76. },
  77. onPageScroll(e) {
  78. this.scrollTop = e.scrollTop;
  79. },
  80. onReachBottom() {
  81. this.status = 'more';
  82. // this.getList();
  83. },
  84. methods: {
  85. detail(value) {
  86. uni.navigateTo({
  87. url: '/pages/video/index?video_id=' + value.video_id
  88. })
  89. },
  90. getList() {
  91. getMiniprogramRecentvideo().then(res => {
  92. console.log(res, 'getMiniprogramRecentvideogetMiniprogramRecentvideogetMiniprogramRecentvideo')
  93. this.listData = res.data;
  94. })
  95. },
  96. getdata() {
  97. this.last_id = 0
  98. this.reload = true
  99. this.getList()
  100. },
  101. search(res) {
  102. this.listData = [];
  103. this.last_id = 0;
  104. this.keytext = res.value;
  105. this.type = '';
  106. this.getList(0)
  107. },
  108. cancel(res) {
  109. this.keytext = '';
  110. this.type = '';
  111. this.getList(0)
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. @import "./style/index.scss"
  118. </style>