index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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-left: 20upx;
  113. margin-top: 10upx;
  114. }
  115. }
  116. .top {
  117. position: relative;
  118. .top-img {
  119. width: 100%;
  120. height: 250rpx;
  121. }
  122. .top-wrapper {
  123. display: flex;
  124. flex-direction: column;
  125. position: absolute;
  126. color: #FDF6EC;
  127. margin-left: 25rpx;
  128. bottom: 20px;
  129. .top-title {
  130. font-size: 36px;
  131. font-weight: bolder;
  132. margin-bottom: 35rpx;
  133. font-family: Georgia, 'Times New Roman', Times, serif;
  134. }
  135. .top-content {
  136. font-size: 16px;
  137. font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  138. }
  139. }
  140. }
  141. .integral-mall-goods {
  142. width: 100%;
  143. height: 280rpx;
  144. object-fit: contain;
  145. background: #F2F2F2;
  146. border-radius: 16upx;
  147. }
  148. .user-not-vip {
  149. width: 100%;
  150. height: 80rpx;
  151. background: #FDF6EC;
  152. border-radius: 40rpx;
  153. border: 2rpx solid #EFC381;
  154. text-align: center;
  155. line-height: 76rpx;
  156. font-size: 24rpx;
  157. color: #000000;
  158. font-weight: bold;
  159. }
  160. .tuan-product-l {
  161. width: 320rpx;
  162. height: 240rpx;
  163. border-radius: 16rpx;
  164. background: #F2F2F2;
  165. }
  166. .tuan-product-r {
  167. width: calc(100% - 320rpx);
  168. }
  169. .search-result {
  170. padding-top: 10px;
  171. padding-bottom: 20px;
  172. text-align: center;
  173. }
  174. .search-result-text {
  175. text-align: center;
  176. font-size: 14px;
  177. color: #666;
  178. }
  179. .example-body {
  180. /* #ifndef APP-NVUE */
  181. display: block;
  182. /* #endif */
  183. padding: 0px;
  184. }
  185. .uni-mt-10 {
  186. margin-top: 10px;
  187. }
  188. </style>