rankings.vue 5.3 KB

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