index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view>
  3. <view class="flex space" style="display:flex; flex-wrap:wrap; padding: 30upx 30upx 0px 30upx;">
  4. <block v-for="(value,key) in listData" :key="key">
  5. <view class="box pb10 mb15" style="width:31%; 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. .integral-mall-goods {
  94. width: 100%;
  95. height: 280rpx;
  96. background: #F2F2F2;
  97. border-radius: 16upx;
  98. }
  99. .user-not-vip {
  100. width: 100%;
  101. height: 80rpx;
  102. background: #FDF6EC;
  103. border-radius: 40rpx;
  104. border: 2rpx solid #EFC381;
  105. text-align: center;
  106. line-height: 76rpx;
  107. font-size: 24rpx;
  108. color: #000000;
  109. font-weight: bold;
  110. }
  111. .tuan-product-l {
  112. width: 320rpx;
  113. height: 240rpx;
  114. border-radius: 16rpx;
  115. background: #F2F2F2;
  116. }
  117. .tuan-product-r {
  118. width: calc(100% - 320rpx);
  119. }
  120. .search-result {
  121. padding-top: 10px;
  122. padding-bottom: 20px;
  123. text-align: center;
  124. }
  125. .search-result-text {
  126. text-align: center;
  127. font-size: 14px;
  128. color: #666;
  129. }
  130. .example-body {
  131. /* #ifndef APP-NVUE */
  132. display: block;
  133. /* #endif */
  134. padding: 0px;
  135. }
  136. .uni-mt-10 {
  137. margin-top: 10px;
  138. }
  139. </style>