index.vue 3.9 KB

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