123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <template>
- <view class="content">
- <view class="top-fan">
- <image src="../../static/img/top-bg.png" mode=""></image>
- </view>
- <view class="fans-base flex">
- <view class="base-item">
- <view class="base-item-val">
- {{fans.count || 0}}
- </view>
- <view class="base-item-name">
- 我的粉丝
- </view>
- </view>
- <view class="jg"></view>
- <view class="base-item">
- <view class="base-item-val">
- {{fans.active || 0}}
- </view>
- <view class="base-item-name">
- 活跃粉丝
- </view>
- </view>
- <view class="jg"></view>
- <view class="base-item">
- <view class="base-item-val">
- {{fans.money || 0}}
- </view>
- <view class="base-item-name">
- 总成交额
- </view>
- </view>
- </view>
- <view class="fans-tit">
- 我的粉丝列表
- </view>
- <view class="fans-list-tit flex">
- <view class="list-item">
- 姓名
- </view>
- <view class="list-item">
- ID
- </view>
- <view class="list-item">
- 当日业绩
- </view>
- <view class="list-item">
- 粉丝数
- </view>
- </view>
- <scroll-view scroll-y="true" class="swiper-box" :style="{'height':height}" @scrolltolower="getMyfans()">
- <view class="fans-list-val flex" v-for="(item,index) in list"
- :style="{'background':index%2 ==0 ? '#F9F9F9':'#fff'}">
- <view class="list-item clamp">
- {{item.real_name||item.nickname}}
- </view>
- <view class="list-item">
- {{item.uid}}
- </view>
- <view class="list-item">
- {{item.money}}
- </view>
- <view class="list-item">
- {{item.count}}
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </scroll-view>
- </view>
- </template>
- <script>
- import {
- getMyfans
- } from '@/api/user.js'
- export default {
- data() {
- return {
- height: '',
- list: [],
- page: 1,
- limit: 10,
- fans: {},
- loadingType: 'more'
- }
- },
- onLoad() {
- this.getMyfans()
- },
- onReady(res) {
- var _this = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.swiper-box').boundingClientRect();
- query.exec(function(res) {
- // console.log(res, 'ddddddddddddd');
- _this.height = resu.windowHeight - res[0].top + 'px';
- // console.log('打印页面的剩余高度', _this.height);
- });
- },
- fail: res => {}
- });
- },
- methods: {
- getMyfans() {
- let obj = this
- if (obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
- return
- }
- obj.loadingType = 'loading'
- getMyfans({
- page: obj.page,
- limit: obj.limit
- }).then(res => {
- console.log(res)
- obj.fans = res.data;
- let ar = res.data.user.map((item)=>{
- if(item.real_name.length>2){
- let str =item.real_name.slice(1,item.real_name.length-1);
- let str2 = str.replace(/.*/g,'*');
- item.real_name =item.real_name.slice(0,1)+str2+item.real_name.slice(item.real_name.length-1);
- }else if(item.real_name.length==2){
- item.real_name =item.real_name.slice(0,1)+"*";
- }
- return item
- })
- obj.list = obj.list.concat(res.data.user)
- obj.page++
- if (res.data.user.length == obj.limit) {
- obj.loadingType = 'more'
- } else {
- obj.loadingType = 'noMore'
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- background-color: #f3f5f4;
- height: 100%;
- }
- .content {
- background-color: #f3f5f4;
- }
- .top-fan {
- position: relative;
- width: 750rpx;
- height: 336rpx;
- image {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- width: 100%;
- height: 100%;
- }
- }
- .fans-base {
- position: relative;
- z-index: 2;
- width: 702rpx;
- height: 210rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
- border-radius: 20rpx;
- margin: -147rpx auto 0;
- text-align: center;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- .jg {
- width: 2rpx;
- height: 96rpx;
- background: #DCDCDC;
- }
- .base-item {
- flex-grow: 1;
- .base-item-val {
- font-size: 50rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #0C1732;
- }
- }
- }
- .fans-tit {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #0C1732;
- padding: 45rpx 0 29rpx 40rpx;
- }
- .fans-list-tit {
- width: 710rpx;
- height: 100rpx;
- background: #FFE1E2;
- border-radius: 20rpx 20rpx 0px 0px;
- margin: auto;
- text-align: center;
- ;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #DC262B;
- .list-item {
- width: 25%;
- flex-shrink: 0;
- }
- }
- .fans-list-val {
- width: 710rpx;
- height: 100rpx;
- margin: auto;
- text-align: center;
- ;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #0C1732;
- .list-item {
- // flex-grow: 1;
- width: 25%;
- flex-shrink: 0;
- }
- }
- </style>
|