This commit is contained in:
唐明明
2023-02-13 11:58:29 +08:00
parent da7b903547
commit 8d8c14ec66
33 changed files with 879 additions and 90 deletions

View File

@@ -7,14 +7,19 @@
<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 nowrap">
{{item.nickname}}
<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 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">
@@ -34,26 +39,56 @@
export default {
data() {
return {
users: [],
count: {
users : [],
count : {
all: 0
}
},
// 分页
page : {
current : 1,
has_more: false,
},
pagesShow : false,
status : false,
};
},
created() {
relations({
larer: 1
}).then(res => {
console.log(res)
let { users, count } = res;
this.users = users.data
this.count = count
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
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>
@@ -100,10 +135,13 @@
border-radius: 20rpx;
height: 40rpx;
line-height: 36rpx;
padding: 0 10rpx;
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;
@@ -119,6 +157,17 @@
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{