181 lines
3.8 KiB
Vue
181 lines
3.8 KiB
Vue
<template>
|
|
<view class="content">
|
|
<view class="header">
|
|
客户列表
|
|
<text>共{{count.one}}人</text>
|
|
</view>
|
|
<block v-if="users.length > 0">
|
|
<view class="team-item" v-for="(item, index) in users" :key="index">
|
|
<u-avatar :src="item.avatar" size="40"></u-avatar>
|
|
<view class="name">
|
|
<view class="nowrap">{{item.nickname}}</view>
|
|
<view>
|
|
<text class="identity certification-y" v-if="item.certification"><image src="@/static/icons/user_nav_03.png"></image>已实名</text>
|
|
<text class="identity identity-2" v-if="item.identity.order == 2">业务员</text>
|
|
<text class="identity identity-1" v-if="item.identity.order == 1">普通用户</text>
|
|
<text class="identity identity-3" v-if="item.identity.order == 3">顾问</text>
|
|
</view>
|
|
</view>
|
|
<view class="mobile">{{item.username}}</view>
|
|
</view>
|
|
<!-- 分页 -->
|
|
<u-loadmore v-if="pagesShow" :status="status" />
|
|
</block>
|
|
<block v-else>
|
|
<view class="list-null">
|
|
<u-empty
|
|
mode="data"
|
|
icon="http://cdn.uviewui.com/uview/empty/data.png"
|
|
text="暂无客户数据"
|
|
>
|
|
</u-empty>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { relations } from '@/apis/interfaces/user.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
users : [],
|
|
count : {
|
|
all: 0
|
|
},
|
|
// 分页
|
|
page : {
|
|
current : 1,
|
|
has_more: false,
|
|
},
|
|
pagesShow : false,
|
|
status : false,
|
|
};
|
|
},
|
|
created() {
|
|
this.getList()
|
|
},
|
|
methods: {
|
|
getList(){
|
|
uni.showLoading({
|
|
title: '加载中...',
|
|
mask : true
|
|
})
|
|
relations({
|
|
larer : 1,
|
|
page : this.page.current
|
|
}).then(res => {
|
|
let { users, count } = res;
|
|
this.count = count
|
|
let atList = users.page.current == 1 ? [] : this.users
|
|
this.users = atList.concat(users.data)
|
|
this.page = users.page
|
|
this.pagesShow = false
|
|
uni.hideLoading()
|
|
}).catch(err => {
|
|
uni.showToast({
|
|
title: err.message,
|
|
icon : 'none'
|
|
})
|
|
})
|
|
}
|
|
},
|
|
onReachBottom() {
|
|
this.pagesShow = true;
|
|
if(this.page.has_more){
|
|
this.status = 'loading';
|
|
this.page.current++
|
|
this.getList()
|
|
return
|
|
}
|
|
this.status = 'nomore';
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.content{
|
|
box-sizing: border-box;
|
|
}
|
|
// 统计数据
|
|
.header{
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 0 30rpx;
|
|
line-height: 100rpx;
|
|
font-weight: bold;
|
|
text{
|
|
font-size: 28rpx;
|
|
color: gray;
|
|
font-weight: normal;
|
|
}
|
|
}
|
|
// 团队列表
|
|
.team-item{
|
|
background: white;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 30rpx;
|
|
border-radius: 20rpx;
|
|
margin: 0 30rpx 30rpx 30rpx;
|
|
.name{
|
|
width: calc(100% - 200rpx - 40px);
|
|
padding: 0 20rpx;
|
|
box-sizing: border-box;
|
|
font-weight: bold;
|
|
font-size: 30rpx;
|
|
color: #333333;
|
|
.identity{
|
|
display: inline-block;
|
|
background: #F6F6F6;
|
|
color: #999999;
|
|
font-weight: normal;
|
|
margin-left: 20rpx;
|
|
border-radius: 20rpx;
|
|
height: 40rpx;
|
|
line-height: 36rpx;
|
|
padding: 0 15rpx;
|
|
font-size: 24rpx;
|
|
border:solid 1rpx #000;
|
|
box-sizing: border-box;
|
|
&:first-child{
|
|
margin-left: 0;
|
|
}
|
|
&.identity-2{
|
|
background: #ECF0FF;
|
|
border-color: #443DE2;
|
|
color: #443DE2;
|
|
}
|
|
&.identity-1{
|
|
background: #F6F6F6;
|
|
border-color: #999999;
|
|
color: #999999;
|
|
}
|
|
&.identity-3{
|
|
background: #FFF7EC;
|
|
border-color: #FEAD45;
|
|
color: #FEAD45;
|
|
}
|
|
&.certification-y{
|
|
background: #FFF7EC;
|
|
border-color: #FEAD45;
|
|
color: #FEAD45;
|
|
image{
|
|
width: 32rpx;
|
|
height: 32rpx;
|
|
vertical-align: middle;
|
|
margin-bottom: 5rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.mobile{
|
|
width: 200rpx;
|
|
color: #666666;
|
|
text-align: right;
|
|
font-size: 30rpx;
|
|
}
|
|
}
|
|
</style>
|