2020-08-13 08:12:57 +00:00
|
|
|
<template>
|
|
|
|
<view>
|
|
|
|
<view class="promoter-list">
|
|
|
|
<view class='promoterHeader bg-color'>
|
2021-06-11 09:41:16 +00:00
|
|
|
<view class='headerCon acea-row row-between'>
|
2020-08-13 08:12:57 +00:00
|
|
|
<view>
|
|
|
|
<view class='name'>推广人数</view>
|
2021-06-11 09:41:16 +00:00
|
|
|
<view><text class='num'>{{peopleData.count}}</text>人</view>
|
2020-08-13 08:12:57 +00:00
|
|
|
</view>
|
|
|
|
<view class='iconfont icon-tuandui'></view>
|
|
|
|
</view>
|
|
|
|
</view>
|
2021-06-11 09:41:16 +00:00
|
|
|
<view class="pad30">
|
|
|
|
<view class='nav acea-row row-around'>
|
|
|
|
<view :class="grade == 0 ? 'item on' : 'item'" @click='setType(0)'>一级({{peopleData.total}})</view>
|
|
|
|
<view :class="grade == 1 ? 'item on' : 'item'" @click='setType(1)'>二级({{peopleData.totalLevel}})
|
2020-08-13 08:12:57 +00:00
|
|
|
</view>
|
|
|
|
</view>
|
2021-06-11 09:41:16 +00:00
|
|
|
<view class='search acea-row row-between-wrapper'>
|
|
|
|
<view class='input'><input placeholder='点击搜索会员名称' placeholder-class='placeholder' v-model="keyword"
|
|
|
|
@confirm="submitForm" confirm-type='search' name="search"></input></view>
|
|
|
|
<button class='iconfont icon-sousuo2' @click="submitForm"></button>
|
|
|
|
</view>
|
|
|
|
<view class='list'>
|
|
|
|
<view class="sortNav acea-row row-middle">
|
|
|
|
<view class="sortItem" @click='setSort("childCount","ASC")' v-if="sort == 'childCountDESC'">团队排序
|
|
|
|
<image src='/static/images/sort1.png'></image>
|
|
|
|
</view>
|
|
|
|
<view class="sortItem" @click='setSort("childCount")' v-else-if="sort == 'childCountASC'">团队排序
|
|
|
|
<image src='/static/images/sort3.png'></image>
|
|
|
|
</view>
|
|
|
|
<view class="sortItem" @click='setSort("childCount","DESC")' v-else>团队排序
|
|
|
|
<image src='/static/images/sort2.png'></image>
|
|
|
|
</view>
|
|
|
|
<view class="sortItem" @click='setSort("numberCount","ASC")' v-if="sort == 'numberCountDESC'">
|
|
|
|
金额排序
|
|
|
|
<image src='/static/images/sort1.png'></image>
|
2020-08-13 08:12:57 +00:00
|
|
|
</view>
|
2021-06-11 09:41:16 +00:00
|
|
|
<view class="sortItem" @click='setSort("numberCount")' v-else-if="sort == 'numberCountASC'">金额排序
|
|
|
|
<image src='/static/images/sort3.png'></image>
|
|
|
|
</view>
|
|
|
|
<view class="sortItem" @click='setSort("numberCount","DESC")' v-else>金额排序
|
|
|
|
<image src='/static/images/sort2.png'></image>
|
|
|
|
</view>
|
|
|
|
<view class="sortItem" @click='setSort("orderCount","ASC")' v-if="sort == 'orderCountDESC'">订单排序
|
|
|
|
<image src='/static/images/sort1.png'></image>
|
|
|
|
</view>
|
|
|
|
<view class="sortItem" @click='setSort("orderCount")' v-else-if="sort == 'orderCountASC'">订单排序
|
|
|
|
<image src='/static/images/sort3.png'></image>
|
|
|
|
</view>
|
|
|
|
<view class="sortItem" @click='setSort("orderCount","DESC")' v-else>订单排序
|
|
|
|
<image src='/static/images/sort2.png'></image>
|
2020-08-13 08:12:57 +00:00
|
|
|
</view>
|
|
|
|
</view>
|
2021-06-11 09:41:16 +00:00
|
|
|
<block v-for="(item,index) in recordList" :key="index">
|
|
|
|
<view class='item acea-row row-between-wrapper'>
|
|
|
|
<view class="picTxt acea-row row-between-wrapper">
|
|
|
|
<view class='pictrue'>
|
|
|
|
<image :src='item.avatar'></image>
|
|
|
|
</view>
|
|
|
|
<view class='text'>
|
|
|
|
<view class='name line1'>{{item.nickname}}</view>
|
|
|
|
<view>加入时间: {{item.time.split(' ')[0]}}</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="right">
|
|
|
|
<view><text class='num font-color'>{{item.childCount ? item.childCount : 0}}</text>人
|
|
|
|
</view>
|
|
|
|
<view><text class="num">{{item.orderCount ? item.orderCount : 0}}</text>单</view>
|
|
|
|
<view><text class="num">{{item.numberCount ? item.numberCount : 0}}</text>元</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</block>
|
|
|
|
<Loading :loaded="status" :loading="loadingList"></Loading>
|
|
|
|
<block v-if="recordList.length == 0 && isShow">
|
|
|
|
<emptyPage title="暂无推广人数~"></emptyPage>
|
|
|
|
</block>
|
|
|
|
</view>
|
2020-08-13 08:12:57 +00:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- #ifdef MP -->
|
2021-06-11 09:41:16 +00:00
|
|
|
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
2020-08-13 08:12:57 +00:00
|
|
|
<!-- #endif -->
|
|
|
|
<home></home>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {
|
2021-06-11 09:41:16 +00:00
|
|
|
spreadPeople,
|
|
|
|
spreadPeoCount
|
2020-08-13 08:12:57 +00:00
|
|
|
} from '@/api/user.js';
|
|
|
|
import {
|
|
|
|
toLogin
|
|
|
|
} from '@/libs/login.js';
|
|
|
|
import {
|
|
|
|
mapGetters
|
|
|
|
} from "vuex";
|
2021-06-11 09:41:16 +00:00
|
|
|
import emptyPage from '@/components/emptyPage.vue'
|
|
|
|
import Loading from "@/components/Loading";
|
2020-08-13 08:12:57 +00:00
|
|
|
// #ifdef MP
|
|
|
|
import authorize from '@/components/Authorize';
|
|
|
|
// #endif
|
|
|
|
import home from '@/components/home';
|
|
|
|
export default {
|
|
|
|
components: {
|
2021-06-11 09:41:16 +00:00
|
|
|
Loading,
|
|
|
|
emptyPage,
|
2020-08-13 08:12:57 +00:00
|
|
|
// #ifdef MP
|
|
|
|
authorize,
|
|
|
|
// #endif
|
|
|
|
home
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
page: 1,
|
|
|
|
limit: 20,
|
|
|
|
keyword: '',
|
|
|
|
sort: '',
|
|
|
|
isAsc: '',
|
|
|
|
sortKey: '',
|
|
|
|
grade: 0,
|
|
|
|
status: false,
|
2021-06-11 09:41:16 +00:00
|
|
|
loadingList: false,
|
2020-08-13 08:12:57 +00:00
|
|
|
recordList: [],
|
2021-06-11 09:41:16 +00:00
|
|
|
peopleData: {},
|
|
|
|
isShow: false,
|
2020-08-13 08:12:57 +00:00
|
|
|
isAuto: false, //没有授权的不会自动授权
|
|
|
|
isShowAuth: false //是否隐藏授权
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: mapGetters(['isLogin']),
|
|
|
|
onLoad() {
|
|
|
|
if (this.isLogin) {
|
|
|
|
this.userSpreadNewList();
|
2021-06-11 09:41:16 +00:00
|
|
|
this.spreadPeoCount();
|
2020-08-13 08:12:57 +00:00
|
|
|
} else {
|
|
|
|
toLogin();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onShow: function() {
|
|
|
|
if (this.is_show) this.userSpreadNewList();
|
|
|
|
},
|
|
|
|
onHide: function() {
|
|
|
|
this.is_show = true;
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onLoadFun: function(e) {
|
|
|
|
this.userSpreadNewList();
|
|
|
|
},
|
|
|
|
// 授权关闭
|
|
|
|
authColse: function(e) {
|
|
|
|
this.isShowAuth = e
|
|
|
|
},
|
2021-06-11 09:41:16 +00:00
|
|
|
setSort: function(sortKey, isAsc) {
|
2020-08-13 08:12:57 +00:00
|
|
|
let that = this;
|
|
|
|
that.isAsc = isAsc;
|
2021-06-11 09:41:16 +00:00
|
|
|
that.sort = sortKey + isAsc;
|
2020-08-13 08:12:57 +00:00
|
|
|
that.sortKey = sortKey;
|
|
|
|
that.page = 1;
|
|
|
|
that.limit = 20;
|
|
|
|
that.status = false;
|
|
|
|
that.$set(that, 'recordList', []);
|
|
|
|
that.userSpreadNewList();
|
|
|
|
},
|
|
|
|
submitForm: function() {
|
|
|
|
this.page = 1;
|
|
|
|
this.limit = 20;
|
|
|
|
this.status = false;
|
|
|
|
this.$set(this, 'recordList', []);
|
|
|
|
this.userSpreadNewList();
|
|
|
|
},
|
2021-06-11 09:41:16 +00:00
|
|
|
|
2020-08-13 08:12:57 +00:00
|
|
|
setType: function(grade) {
|
|
|
|
if (this.grade != grade) {
|
|
|
|
this.grade = grade;
|
|
|
|
this.page = 1;
|
|
|
|
this.limit = 20;
|
|
|
|
this.keyword = '';
|
|
|
|
this.sort = '';
|
|
|
|
this.isAsc = '';
|
|
|
|
this.status = false;
|
2021-06-11 09:41:16 +00:00
|
|
|
this.loadingList = false;
|
2020-08-13 08:12:57 +00:00
|
|
|
this.$set(this, 'recordList', []);
|
|
|
|
this.userSpreadNewList();
|
|
|
|
}
|
|
|
|
},
|
2021-06-11 09:41:16 +00:00
|
|
|
spreadPeoCount() {
|
|
|
|
spreadPeoCount().then(res => {
|
|
|
|
this.peopleData = res.data;
|
|
|
|
});
|
|
|
|
},
|
2020-08-13 08:12:57 +00:00
|
|
|
userSpreadNewList: function() {
|
|
|
|
let that = this;
|
|
|
|
let page = that.page;
|
|
|
|
let limit = that.limit;
|
|
|
|
let status = that.status;
|
|
|
|
let keyword = that.keyword;
|
|
|
|
let isAsc = that.isAsc;
|
|
|
|
let sortKey = that.sortKey;
|
|
|
|
let grade = that.grade;
|
|
|
|
let recordList = that.recordList;
|
|
|
|
let recordListNew = [];
|
2021-06-11 09:41:16 +00:00
|
|
|
if (that.loadingList) return;
|
2020-08-13 08:12:57 +00:00
|
|
|
if (status == true) return;
|
|
|
|
spreadPeople({
|
|
|
|
page: page,
|
|
|
|
limit: limit,
|
|
|
|
keyword: keyword,
|
|
|
|
grade: grade,
|
|
|
|
sortKey: sortKey,
|
|
|
|
isAsc: isAsc
|
|
|
|
}).then(res => {
|
2021-06-11 09:41:16 +00:00
|
|
|
let recordListData = res.data.list ? res.data.list : [];
|
2020-08-13 08:12:57 +00:00
|
|
|
let len = recordListData.length;
|
|
|
|
recordListNew = recordList.concat(recordListData);
|
|
|
|
that.status = limit > len;
|
|
|
|
that.page = page + 1;
|
2020-11-05 08:21:06 +00:00
|
|
|
that.$set(that, 'recordList', recordListNew || []);
|
2021-06-11 09:41:16 +00:00
|
|
|
that.loadingList = false;
|
|
|
|
if(that.recordList.length===0) that.isShow = true;
|
2020-08-13 08:12:57 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onReachBottom: function() {
|
|
|
|
this.userSpreadNewList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.promoter-list .nav {
|
|
|
|
background-color: #fff;
|
|
|
|
height: 86rpx;
|
|
|
|
line-height: 86rpx;
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #282828;
|
|
|
|
border-bottom: 1rpx solid #eee;
|
2021-06-11 09:41:16 +00:00
|
|
|
border-top-left-radius: 14rpx;
|
|
|
|
border-top-right-radius: 14rpx;
|
|
|
|
margin-top: -30rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .nav .item.on {
|
2021-06-11 09:41:16 +00:00
|
|
|
border-bottom: 5rpx solid $theme-color;
|
|
|
|
color: $theme-color;
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .search {
|
|
|
|
width: 100%;
|
|
|
|
background-color: #fff;
|
2021-06-11 09:41:16 +00:00
|
|
|
height: 100rpx;
|
|
|
|
padding: 0 24rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
box-sizing: border-box;
|
2021-06-11 09:41:16 +00:00
|
|
|
border-bottom-left-radius: 14rpx;
|
|
|
|
border-bottom-right-radius: 14rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .search .input {
|
2021-06-11 09:41:16 +00:00
|
|
|
width: 592rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
height: 60rpx;
|
|
|
|
border-radius: 50rpx;
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
text-align: center;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .search .input input {
|
|
|
|
height: 100%;
|
|
|
|
font-size: 26rpx;
|
|
|
|
width: 610rpx;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .search .input .placeholder {
|
|
|
|
color: #bbb;
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .search .input .iconfont {
|
|
|
|
position: absolute;
|
|
|
|
right: 28rpx;
|
|
|
|
color: #999;
|
|
|
|
font-size: 28rpx;
|
|
|
|
top: 50%;
|
|
|
|
transform: translateY(-50%);
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .search .iconfont {
|
2021-06-11 09:41:16 +00:00
|
|
|
font-size: 32rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
color: #515151;
|
|
|
|
height: 60rpx;
|
|
|
|
line-height: 60rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .list {
|
2021-06-11 09:41:16 +00:00
|
|
|
margin-top: 20rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .list .sortNav {
|
|
|
|
background-color: #fff;
|
|
|
|
height: 76rpx;
|
|
|
|
border-bottom: 1rpx solid #eee;
|
|
|
|
color: #333;
|
|
|
|
font-size: 28rpx;
|
2021-06-11 09:41:16 +00:00
|
|
|
border-top-left-radius: 14rpx;
|
|
|
|
border-top-right-radius: 14rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .list .sortNav .sortItem {
|
|
|
|
text-align: center;
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .list .sortNav .sortItem image {
|
|
|
|
width: 24rpx;
|
|
|
|
height: 24rpx;
|
|
|
|
margin-left: 6rpx;
|
|
|
|
vertical-align: -3rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .list .item {
|
|
|
|
background-color: #fff;
|
|
|
|
border-bottom: 1rpx solid #eee;
|
|
|
|
height: 152rpx;
|
2021-06-11 09:41:16 +00:00
|
|
|
padding: 0 24rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
font-size: 24rpx;
|
|
|
|
color: #666;
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .list .item .picTxt .pictrue {
|
|
|
|
width: 106rpx;
|
|
|
|
height: 106rpx;
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .list .item .picTxt .pictrue image {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
border-radius: 50%;
|
|
|
|
border: 3rpx solid #fff;
|
|
|
|
box-shadow: 0 0 10rpx #aaa;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .list .item .picTxt .text {
|
2021-06-11 09:41:16 +00:00
|
|
|
// width: 304rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
font-size: 24rpx;
|
|
|
|
color: #666;
|
2021-06-11 09:41:16 +00:00
|
|
|
margin-left: 14rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .list .item .picTxt .text .name {
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #333;
|
|
|
|
margin-bottom: 13rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.promoter-list .list .item .right {
|
|
|
|
text-align: right;
|
|
|
|
font-size: 22rpx;
|
|
|
|
color: #333;
|
|
|
|
}
|
2021-06-11 09:41:16 +00:00
|
|
|
|
|
|
|
.promoter-list .list .item .right .num {
|
2020-08-13 08:12:57 +00:00
|
|
|
margin-right: 7rpx;
|
|
|
|
}
|
|
|
|
</style>
|