rankings.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <!-- 分销排行 -->
  2. <template>
  3. <view>
  4. <view style="color: #000000;">
  5. <tn-nav-bar backgroundColor="#ffffff" :bottomShadow="false">分销排行榜</tn-nav-bar>
  6. <!-- <view :style="{height: tobheight+'px'}"></view> -->
  7. </view>
  8. <z-paging ref="paging" refresher-complete-delay="200" v-model="rankingsList" @query="queryList"
  9. :loading-more-enabled="false">
  10. <view slot="top" class="z_tabs" :style="{ marginTop: tobheight + 'px' }"></view>
  11. <view style="background: #F6F7FB;">
  12. <view class="rankings-wrap" style="padding-left: 30rpx;padding-right: 30rpx;">
  13. <!-- 标题栏 -->
  14. <!-- <shopro-navbar back-icon-color="#fff" :background="{}" :backTextStyle="{ color: '#fff', fontSize: '40rpx', fontWeight: '500' }" backText="分销排行榜"></shopro-navbar> -->
  15. <!-- 排行榜 -->
  16. <view class="rankings-list-box">
  17. <!-- <scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-box"> -->
  18. <view class="ranking-list u-flex u-row-between" v-for="(item, index) in rankingsList"
  19. :key="index">
  20. <view class="list-left u-flex">
  21. <view class="tag-box u-flex u-row-center u-col-center">
  22. <text class="tag-text" v-if="index >= 3">{{ index + 1 }}</text>
  23. <image v-else class="tag-icon" :src="rankingsIcon[index]" mode=""></image>
  24. </view>
  25. <image class="user-avatar" :src="item.avatar?item.avatar:'/static/images/head.jpg'"
  26. mode=""></image>
  27. <view class="user-info">
  28. <view class="name u-m-b-10">{{ item.nickname?item.nickname : '默认用户' }}</view>
  29. <view class="date">{{ item.create_time }}</view>
  30. </view>
  31. </view>
  32. <view class="list-right y-end">
  33. <view class="num u-m-b-10">{{ item.income_sum?item.income_sum:'0.00' }}</view>
  34. <view class="des">累计收益</view>
  35. </view>
  36. </view>
  37. <!-- 更多 -->
  38. <!-- <u-loadmore v-if="rankingsList.length" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
  39. <!-- </scroll-view> -->
  40. </view>
  41. </view>
  42. </view>
  43. </z-paging>
  44. <wike-loading-page :isLoading="isLoading"></wike-loading-page>
  45. </view>
  46. </template>
  47. <script>
  48. import {
  49. mapMutations,
  50. mapActions,
  51. mapState,
  52. mapGetters
  53. } from 'vuex';
  54. export default {
  55. data() {
  56. return {
  57. isLoading: true,
  58. tobheight: 45,
  59. platform: this.$platform.get(),
  60. rankingsIcon: {
  61. 0: 'https://file.shopro.top/imgs/commission/01.png',
  62. 1: 'https://file.shopro.top/imgs/commission/02.png',
  63. 2: 'https://file.shopro.top/imgs/commission/03.png'
  64. },
  65. rankingsList: [], //排行榜
  66. loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
  67. currentPage: 1,
  68. lastPage: 1
  69. };
  70. },
  71. computed: {
  72. ...mapGetters(['appInfo', 'isLogin', 'userInfo'])
  73. },
  74. onLoad() {
  75. const that = this;
  76. if (this.platform == 'wxMiniProgram') {
  77. var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight
  78. var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop
  79. this.tobheight = (menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height)
  80. }
  81. // this.getRankings();
  82. },
  83. methods: {
  84. queryList(pageNo, pageSize) {
  85. //这里的pageNo和pageSize会自动计算好,直接传给服务器即可
  86. const params = {
  87. page: pageNo,
  88. limit: pageSize
  89. };
  90. this.$http('commission.ranking', params).then(res => {
  91. if (res.code == 0) {
  92. this.$refs.paging.complete(res.data.data);
  93. uni.setNavigationBarTitle({
  94. title: this.appInfo.site_name
  95. });
  96. this.isLoading = false;
  97. }
  98. });
  99. },
  100. // getRankings() {
  101. // let that = this;
  102. // that.loadStatus = 'loading';
  103. // that.$http('commission.ranking', {
  104. // }).then(res => {
  105. // if (res.code === 0) {
  106. // uni.setNavigationBarTitle({
  107. // title: this.appInfo.site_name
  108. // });
  109. // that.rankingsList = [...that.rankingsList, ...res.data.data];
  110. // that.lastPage = res.data.last_page;
  111. // that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
  112. // that.isLoading = false
  113. // }
  114. // });
  115. // },
  116. // 加载更多
  117. // loadMore() {
  118. // if (this.currentPage < this.lastPage) {
  119. // this.currentPage += 1;
  120. // this.getRankings();
  121. // }
  122. // }
  123. }
  124. };
  125. </script>
  126. <style lang="scss">
  127. .rankings-wrap {
  128. background: url('http://file.shopro.top/imgs/commission/rankings_bg.png') no-repeat;
  129. background-size: 100% auto;
  130. // height: 100%;
  131. overflow: hidden;
  132. }
  133. // 排行榜列表
  134. .rankings-list-box {
  135. background-color: #fff;
  136. border-radius: 20rpx 20rpx 0px 0px;
  137. // width: 690rpx;
  138. height: 100%;
  139. margin: 60rpx auto 0;
  140. .scroll-box {
  141. height: 100%;
  142. }
  143. .ranking-list {
  144. height: 140rpx;
  145. padding: 0 30rpx;
  146. border-bottom: 1rpx solid #e5e5e5;
  147. .list-left {
  148. .tag-box {
  149. width: 50rpx;
  150. font-size: 36rpx;
  151. font-weight: 500;
  152. color: #beb4b3;
  153. margin-right: 20rpx;
  154. .tag-icon {
  155. width: 40rpx;
  156. height: 60rpx;
  157. }
  158. }
  159. .user-avatar {
  160. width: 66rpx;
  161. height: 66rpx;
  162. border-radius: 50%;
  163. margin-right: 30rpx;
  164. }
  165. .user-info {
  166. .name {
  167. font-size: 28rpx;
  168. font-weight: bold;
  169. color: #333333;
  170. }
  171. .date {
  172. font-size: 24rpx;
  173. font-weight: 400;
  174. color: #999999;
  175. }
  176. }
  177. }
  178. .list-right {
  179. .num {
  180. font-size: 30rpx;
  181. font-weight: 500;
  182. color: #5e4ddf;
  183. }
  184. .des {
  185. font-size: 24rpx;
  186. font-weight: 500;
  187. color: #a09a98;
  188. }
  189. }
  190. }
  191. }
  192. </style>