|
|
|
<template>
|
|
|
|
<view>
|
|
|
|
<uni-card :is-shadow="false" :border="false" is-full spacing="0" margin="20">
|
|
|
|
<uni-search-bar class="search" radius="30" placeholder="请输入成员名称" clearButton="auto" cancelButton="none" v-model="keyword" />
|
|
|
|
</uni-card>
|
|
|
|
|
|
|
|
<template v-if="list.length">
|
|
|
|
<ul class="list">
|
|
|
|
<li v-for="item in list">
|
|
|
|
<image v-if="item.userAvatars" class="avatar" :src="item.userAvatars" mode=""></image>
|
|
|
|
<image v-else class="avatar" src="http://124.71.79.122/images/miniProgram/avatar.png" mode=""></image>
|
|
|
|
<view class="info">
|
|
|
|
<view class="c-name">{{ item.userName }}</view>
|
|
|
|
<view class="line">
|
|
|
|
<text class="name">手机号码:</text>
|
|
|
|
<text class="val">{{ item.phone }}</text>
|
|
|
|
</view>
|
|
|
|
<view v-if="item.lastLoginTime" class="line">
|
|
|
|
<text class="name">加入时间:</text>
|
|
|
|
<text class="val">{{ item.lastLoginTime.split(' ')[0] }}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view v-if="item.isTeam == 1" class="tag">团队负责人</view>
|
|
|
|
<view v-if="item.isTeam != 1" class="btn" @click.stop="transfer(item)">转让超管</view>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<uni-load-more :status="status" />
|
|
|
|
</template>
|
|
|
|
<empty v-else></empty>
|
|
|
|
|
|
|
|
<!-- 队长 -->
|
|
|
|
<uni-icons v-if="team.isTeam == 1" class="plus" type="plus-filled" size="60" color="#007eff" @click="$util.to('../addStaff/addStaff')"></uni-icons>
|
|
|
|
<view v-if="!per" class="per-mask">功能升级中,敬请期待...</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { platformTeamAccountList, transferTeam } from '@/apis/modules/parner.js'
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
team: uni.getStorageSync('team'),
|
|
|
|
platformId: uni.getStorageSync('platformId'),
|
|
|
|
per: true, // 是否有权限
|
|
|
|
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据
|
|
|
|
status: 'more', // 上拉加载状态 more|loading|noMore
|
|
|
|
searchTimer: null,
|
|
|
|
keyword: '',
|
|
|
|
list: [],
|
|
|
|
page: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
submiting: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
keyword () {
|
|
|
|
clearTimeout(this.searchTimer)
|
|
|
|
this.searchTimer = setTimeout(() => {
|
|
|
|
this.initList()
|
|
|
|
}, 500)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 下拉刷新
|
|
|
|
onPullDownRefresh() {
|
|
|
|
this.initList()
|
|
|
|
setTimeout(() => {
|
|
|
|
uni.stopPullDownRefresh()
|
|
|
|
}, 1500)
|
|
|
|
},
|
|
|
|
// 上拉加载
|
|
|
|
onReachBottom() {
|
|
|
|
if (this.reachBottom >= 0) {
|
|
|
|
this.reachBottom = 1
|
|
|
|
this.status = 'loading'
|
|
|
|
this.getList()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.per = true
|
|
|
|
this.initList()
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// 获取列表
|
|
|
|
getList() {
|
|
|
|
uni.showLoading({
|
|
|
|
title: '加载中'
|
|
|
|
})
|
|
|
|
platformTeamAccountList({
|
|
|
|
type: 1,
|
|
|
|
pageNum: this.page,
|
|
|
|
pageSize: this.pageSize,
|
|
|
|
keyWord: this.keyword,
|
|
|
|
platformId: this.platformId,
|
|
|
|
classificationId: this.team.isTeam ? this.team.teamId : this.team.parentId
|
|
|
|
}).then(({ pageList }) => {
|
|
|
|
uni.hideLoading()
|
|
|
|
const { records } = pageList
|
|
|
|
// 未加载完所有数据,并且不是筛选,则拼接list,否则直接赋值
|
|
|
|
this.list = this.reachBottom > 0 ? [...this.list, ...records] : records
|
|
|
|
this.page++ // 每次获取了数据后page+1
|
|
|
|
const noMore = this.list.length === pageList.total // 是否加载完所有数据
|
|
|
|
this.status = noMore ? 'noMore' : 'more' // 加载完了则设置为noMore
|
|
|
|
this.reachBottom = noMore ? -1 : 0 // 加载完了则设置为-1
|
|
|
|
}).catch(e => {
|
|
|
|
uni.hideLoading()
|
|
|
|
})
|
|
|
|
},
|
|
|
|
initList() {
|
|
|
|
this.page = 1
|
|
|
|
this.reachBottom = 0
|
|
|
|
this.getList()
|
|
|
|
},
|
|
|
|
// 转让超管
|
|
|
|
transfer(row) {
|
|
|
|
if (this.submiting) return false
|
|
|
|
this.submiting = true
|
|
|
|
const caption = this.list.find(e => e.isTeam === '1')
|
|
|
|
const that = this
|
|
|
|
uni.showModal({
|
|
|
|
title: '提示',
|
|
|
|
content: '确定要把管理员的角色转让为该成员吗?',
|
|
|
|
success(res) {
|
|
|
|
if (res.confirm) {
|
|
|
|
transferTeam({
|
|
|
|
adminManageId: caption.manageId,
|
|
|
|
adminTeamId: caption.classificationId,
|
|
|
|
memberManageId: row.manageId,
|
|
|
|
memberName: row.userName,
|
|
|
|
memberTeamId: row.classificationId
|
|
|
|
}).then(res => {
|
|
|
|
that.$util.sucMsg('转让成功')
|
|
|
|
that.initList()
|
|
|
|
that.submiting = false
|
|
|
|
}).catch(res => {})
|
|
|
|
} else {
|
|
|
|
that.submiting = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.list {
|
|
|
|
margin-top: 20rpx;
|
|
|
|
background-color: #fff;
|
|
|
|
li {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 20rpx 40rpx;
|
|
|
|
border-bottom: 1px solid #f7f7f7;
|
|
|
|
&:last-child {
|
|
|
|
border-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.avatar {
|
|
|
|
width: 100rpx;
|
|
|
|
height: 100rpx;
|
|
|
|
margin-right: 30rpx;
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
|
|
|
.c-name {
|
|
|
|
margin-bottom: 6rpx;
|
|
|
|
font-size: 30rpx;
|
|
|
|
color: #333;
|
|
|
|
}
|
|
|
|
.line {
|
|
|
|
display: flex;
|
|
|
|
padding: 2rpx 0;
|
|
|
|
}
|
|
|
|
.name {
|
|
|
|
margin-right: 10rpx;
|
|
|
|
white-space: nowrap;
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #999;
|
|
|
|
}
|
|
|
|
.val {
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #333;
|
|
|
|
}
|
|
|
|
.tag {
|
|
|
|
position: absolute;
|
|
|
|
top: 20rpx;
|
|
|
|
right: 40rpx;
|
|
|
|
padding: 8rpx 16rpx;
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: #fff;
|
|
|
|
background-color: #1fbd02;
|
|
|
|
border-radius: 20px;
|
|
|
|
}
|
|
|
|
.btn {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 20rpx;
|
|
|
|
right: 40rpx;
|
|
|
|
padding: 8rpx 28rpx;
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #fff;
|
|
|
|
background-color: $uni-primary;
|
|
|
|
border-radius: 4px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.plus {
|
|
|
|
position: fixed;
|
|
|
|
bottom: 40rpx;
|
|
|
|
right: 40rpx;
|
|
|
|
}
|
|
|
|
</style>
|