index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view>
  3. <view class="wrapper" style="" v-if="listData.length>0">
  4. <block v-for="(value,key) in listData" :key="key">
  5. <view class="box pb10 mb15" style="width:30%; border-radius:20rpx;" @click="detail(value)">
  6. <image class="integral-mall-goods" mode="aspectFill" :src="value.cover_image"></image>
  7. <view class="mt8 plr10 ft14 ftw400 text-center text-over cl-main">{{value.name}}</view>
  8. </view>
  9. </block>
  10. </view>
  11. <view class="empty-box" v-else>
  12. <image src="/static/img/orders/emty.png" mode=""></image>
  13. <p class="ft14 line-1-txt">暂无数据</p>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  19. import {
  20. getMiniprogramRecentvideo
  21. } from '@/common/apis/index.js'
  22. import cellGroup from '../../../uni_modules/uview-ui/libs/config/props/cellGroup';
  23. export default {
  24. components: {
  25. uniLoadMore
  26. },
  27. data() {
  28. return {
  29. banners: [],
  30. searchValue: '',
  31. total: 0,
  32. selectIndex: 0,
  33. scrollTop: 0,
  34. keytext: '',
  35. listData: [],
  36. last_id: 0,
  37. reload: true,
  38. status: 'more',
  39. contentText: {
  40. contentdown: '上拉加载更多',
  41. contentrefresh: '加载中',
  42. contentnomore: '没有数据了'
  43. }
  44. }
  45. },
  46. onLoad(e) {
  47. if (e.selectIndex) {
  48. this.selectIndex = e.selectIndex * 1
  49. }
  50. this.status = 'more';
  51. this.getList();
  52. this.banners = uni.getStorageSync("config").banner
  53. },
  54. onPageScroll(e) {
  55. this.scrollTop = e.scrollTop;
  56. },
  57. onReachBottom() {
  58. this.status = 'more';
  59. // this.getList();
  60. },
  61. methods: {
  62. detail(value) {
  63. uni.navigateTo({
  64. url: '/pages/video/index?video_id=' + value.id
  65. })
  66. },
  67. getList() {
  68. getMiniprogramRecentvideo().then(res => {
  69. console.log(res, 'getMiniprogramRecentvideogetMiniprogramRecentvideogetMiniprogramRecentvideo')
  70. this.listData = res.data;
  71. })
  72. },
  73. getdata() {
  74. this.last_id = 0
  75. this.reload = true
  76. this.getList()
  77. },
  78. search(res) {
  79. this.listData = [];
  80. this.last_id = 0;
  81. this.keytext = res.value;
  82. this.type = '';
  83. this.getList(0)
  84. },
  85. cancel(res) {
  86. this.keytext = '';
  87. this.type = '';
  88. this.getList(0)
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .empty-box {
  95. padding: 20px;
  96. justify-content: center;
  97. text-align: center;
  98. }
  99. .wrapper {
  100. display: flex;
  101. flex-wrap: wrap;
  102. .box {
  103. margin-left: 20upx;
  104. margin-top: 10upx;
  105. }
  106. }
  107. .integral-mall-goods {
  108. width: 100%;
  109. height: 280rpx;
  110. background: #F2F2F2;
  111. border-radius: 16upx;
  112. }
  113. .user-not-vip {
  114. width: 100%;
  115. height: 80rpx;
  116. background: #FDF6EC;
  117. border-radius: 40rpx;
  118. border: 2rpx solid #EFC381;
  119. text-align: center;
  120. line-height: 76rpx;
  121. font-size: 24rpx;
  122. color: #000000;
  123. font-weight: bold;
  124. }
  125. .tuan-product-l {
  126. width: 320rpx;
  127. height: 240rpx;
  128. border-radius: 16rpx;
  129. background: #F2F2F2;
  130. }
  131. .tuan-product-r {
  132. width: calc(100% - 320rpx);
  133. }
  134. .search-result {
  135. padding-top: 10px;
  136. padding-bottom: 20px;
  137. text-align: center;
  138. }
  139. .search-result-text {
  140. text-align: center;
  141. font-size: 14px;
  142. color: #666;
  143. }
  144. .example-body {
  145. /* #ifndef APP-NVUE */
  146. display: block;
  147. /* #endif */
  148. padding: 0px;
  149. }
  150. .uni-mt-10 {
  151. margin-top: 10px;
  152. }
  153. </style>