browse.vue 4.2 KB

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