index.vue 4.0 KB

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