promoter_rank.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view>
  3. <view class="CommissionRank">
  4. <view class="header">
  5. <view class="rank" v-if="position">您目前的排名第<text class="num">{{position }}</text>名</view>
  6. <view class="rank" v-else>您目前暂无排名</view>
  7. </view>
  8. <view class="wrapper">
  9. <view class="nav acea-row row-around">
  10. <view class="item" :class="active == index ? 'font-color' : ''" v-for="(item,index) in navList" :key="index" @click="switchTap(index)">
  11. {{ item }}
  12. </view>
  13. </view>
  14. <view class="list">
  15. <view class="item acea-row row-between-wrapper" v-for="(item,index) in rankList" :key="index">
  16. <view class="num" v-if="index <3">
  17. <image :src="'https://hy.liuniu946.com/app/img/'+(index+1)+'.png'"></image>
  18. </view>
  19. <view class="num" v-else>
  20. {{index+1}}
  21. </view>
  22. <view class="picTxt acea-row row-between-wrapper">
  23. <view class="pictrue"><image :src="item.avatar ? item.avatar : '/static/images/f.png'"></image></view>
  24. <view class="text line1">{{item.nickname}}</view>
  25. </view>
  26. <view class="people font-color">¥{{item.brokerage_price}}</view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- #ifdef MP -->
  32. <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
  33. <!-- #endif -->
  34. </view>
  35. </template>
  36. <script>
  37. import { getBrokerageRank } from '@/api/user.js';
  38. import {
  39. toLogin
  40. } from '@/libs/login.js';
  41. import {
  42. mapGetters
  43. } from "vuex";
  44. export default {
  45. components: {
  46. },
  47. data() {
  48. return {
  49. navList: ["周排行", "月排行"],
  50. active: 0,
  51. rankList:[],
  52. page:1,
  53. limit:20,
  54. loadend:false,
  55. loading:false,
  56. loadTitle:'加载更多',
  57. type:'week',
  58. position:0,
  59. };
  60. },
  61. onLoad(){
  62. this.getBrokerageRankList();
  63. },
  64. methods: {
  65. onLoadFun:function(){
  66. this.isShowAuth = false;
  67. this.getBrokerageRankList();
  68. },
  69. switchTap:function(index){
  70. this.active = index;
  71. this.type = index ? 'month': 'week';
  72. this.page = 1;
  73. this.loadend = false;
  74. this.$set(this,'rankList',[]);
  75. this.getBrokerageRankList();
  76. },
  77. getBrokerageRankList:function(){
  78. if(this.loadend) return;
  79. if(this.loading) return;
  80. this.loading = true;
  81. this.loadTitle = '';
  82. getBrokerageRank({
  83. page:this.page,
  84. limit:this.limit,
  85. type:this.type
  86. }).then(res=>{
  87. let list = res.data.rank;
  88. let loadend = list.length < this.limit;
  89. this.rankList.push.apply(this.rankList, list);
  90. this.loading = false;
  91. this.loadend = loadend;
  92. this.loadTitle = loadend ? '😕我也是有底线的':'加载更多';
  93. this.$set(this,'rankList',this.rankList);
  94. this.position = res.data.position;
  95. }).catch(err=>{
  96. this.loading = false;
  97. this.loadTitle = '加载更多';
  98. })
  99. }
  100. },
  101. onReachBottom: function () {
  102. this.page= this.page+1
  103. this.getBrokerageRankList();
  104. }
  105. }
  106. </script>
  107. <style scoped lang="scss">
  108. .rank{
  109. color: #e93323 !important;
  110. }
  111. .nav{
  112. display: flex;
  113. }
  114. .nav view{
  115. text-align: center;
  116. flex: 1;
  117. }
  118. .header{
  119. border-bottom-left-radius: 20rpx;
  120. border-bottom-right-radius: 20rpx;
  121. }
  122. .CommissionRank .header{
  123. background-image: url(https://hy.liuniu946.com/app/img/phb.jpg);
  124. background-repeat: no-repeat;
  125. width: 100%;height: 344rpx;background-size: 100% 100%;
  126. }
  127. .CommissionRank .header .rank {font-size: 33rpx;color: #fff;position: absolute;top: 160rpx;left: 48rpx;}
  128. .CommissionRank .header .rank .num {font-size: 51rpx;font-weight: bold;margin: 0 10rpx;}
  129. .CommissionRank .wrapper {width: 710rpx;background-color: #fff;border-radius: 20rpx;margin: -76rpx auto 0 auto;}
  130. .CommissionRank .wrapper .nav {height: 99rpx;border-bottom: 2.5rpx solid #f3f3f3;font-size: 30rpx;font-weight: bold;color: #999;line-height: 99rpx;}
  131. .CommissionRank .wrapper .nav .item.font-color {border-bottom: 4rpx solid #e93323;}
  132. .CommissionRank .wrapper .list {padding: 0 30rpx;}
  133. .CommissionRank .wrapper .list .item {border-bottom: 1px solid #f3f3f3;height: 101rpx;font-size: 28rpx;}
  134. .CommissionRank .wrapper .list .item .num {color: #666;width: 70rpx;}
  135. .CommissionRank .wrapper .list .item .num image {width: 34rpx;height: 40rpx;display: block;}
  136. .CommissionRank .wrapper .list .item .picTxt {width: 350rpx;}
  137. .CommissionRank .wrapper .list .item .picTxt .pictrue {width: 68rpx;height: 68rpx;}
  138. .CommissionRank .wrapper .list .item .picTxt .pictrue image {width: 100%;height: 100%;display: block;border-radius: 50%;}
  139. .CommissionRank .wrapper .list .item .picTxt .text {width: 262rpx;color: #333;}
  140. .CommissionRank .wrapper .list .item .people {width: 175rpx;text-align: right;}
  141. </style>