index.vue 3.1 KB

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