|
|
@@ -4,12 +4,12 @@
|
|
|
<view class="add" @click="handleAdd">+ 添加</view>
|
|
|
<view class="list" v-if="list.length">
|
|
|
<u-swipe-action>
|
|
|
- <u-swipe-action-item v-for="(item, index) in list" :key="index"
|
|
|
+ <u-swipe-action-item v-for="(item, index) in list" :key="index"
|
|
|
:options="options" @click="e=>deleteUser(item,e)" :ref="'swipeAction' + index" :threshold="5"
|
|
|
>
|
|
|
<view class="swipe-action u-border-top u-border-bottom">
|
|
|
<view class="swipe-action__content">
|
|
|
- <view class="lbox adfac">
|
|
|
+ <view class="lbox adfac" @click.prevent="selectUser(item,index)">
|
|
|
<template v-if="type">
|
|
|
<image class="lbox-select" v-if="item.select" :src="imgBase+'selected.png'"></image>
|
|
|
<image class="lbox-select" v-else :src="imgBase+'not_select.png'"></image>
|
|
|
@@ -18,12 +18,15 @@
|
|
|
<view class="lbox-info-top adfac">
|
|
|
<text>{{item.realName}}</text>
|
|
|
<template v-if="type">
|
|
|
- <view class="type">{{'赞助人Sponsor'}}</view>
|
|
|
+ <view class="type adfac" @click.stop="selectUserCategory(item,index)">
|
|
|
+ {{item.categoryName||'选择身份类型'}}
|
|
|
+ <image :src="imgBase+'icon_user_down.png'"></image>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
</view>
|
|
|
<view class="lbox-info-email">{{item.email}}</view>
|
|
|
</view>
|
|
|
- <view class="lbox-edit" @click="handleEdit(item)">
|
|
|
+ <view class="lbox-edit" @click.stop="handleEdit(item)">
|
|
|
<u-icon name="edit-pen" size="42rpx" color="#B9B9B9"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -35,14 +38,16 @@
|
|
|
<view v-else class="adffcacjc" style="flex: 1;">
|
|
|
<empty text='暂无团队人员,请添加'></empty>
|
|
|
</view>
|
|
|
- <view class="btn" v-if="type">确定</view>
|
|
|
+ <view class="btn" v-if="type" @click="handleConfirmAdd">确定</view>
|
|
|
+ <cus-select :show="show" title="选择身份类型" :list="categoryData" @close="show=false" @confirmTeam="selectConfirm"></cus-select>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import empty from '@/components/pageEmpty/index.vue'
|
|
|
+ import CusSelect from '@/components/CusSelect/index.vue'
|
|
|
export default {
|
|
|
- components:{ empty },
|
|
|
+ components:{ empty, CusSelect },
|
|
|
data(){
|
|
|
return {
|
|
|
type:'',
|
|
|
@@ -63,6 +68,10 @@
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
+ show:false,
|
|
|
+ categoryData:[],
|
|
|
+ currentUser:null,
|
|
|
+ currentIndex:'',
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
@@ -79,10 +88,30 @@
|
|
|
this.$api.get('/core/member/page',this.query).then(({data:res})=>{
|
|
|
if(res.code!==0) return this.$showToast(res.msg)
|
|
|
this.list = [...this.list,...res.data.list]
|
|
|
+ this.list.forEach((l,i)=>{
|
|
|
+ this.$set(this.list[i],'category','');
|
|
|
+ this.$set(this.list[i],'categoryName','');
|
|
|
+ this.$set(this.list[i],'select',false);
|
|
|
+ })
|
|
|
this.query.page++
|
|
|
if(this.length>=res.data.total) this.isOver = true
|
|
|
})
|
|
|
},
|
|
|
+ getCategoryData(){
|
|
|
+ this.$api.get('/getListByType/UserCategory').then(({data:res})=>{
|
|
|
+ if(res.code!==0) return this.$showToast(res.msg)
|
|
|
+ this.categoryData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
|
|
|
+ this.show = true;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectUser(item,index){
|
|
|
+ this.$set(this.list[index],'select',!this.list[index].select);
|
|
|
+ },
|
|
|
+ selectUserCategory(item,index){
|
|
|
+ this.currentUser = item;
|
|
|
+ this.currentIndex = index;
|
|
|
+ this.getCategoryData()
|
|
|
+ },
|
|
|
deleteUser(item,index){
|
|
|
uni.showModal({
|
|
|
title:'温馨提示',
|
|
|
@@ -113,6 +142,21 @@
|
|
|
url:'/pagesMy/teamUserDetail?id='+item.id
|
|
|
})
|
|
|
},
|
|
|
+ selectConfirm(e){
|
|
|
+ this.$set(this.list[this.currentIndex],'category',e.id);
|
|
|
+ this.$set(this.list[this.currentIndex],'categoryName',e.name);
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
+ handleConfirmAdd(){
|
|
|
+ let selectList = this.list.filter(l=>l.select);
|
|
|
+ if(selectList.length===0) return this.$showToast('请至少选择一位团队成员')
|
|
|
+ let sendList = selectList.map(l=>({realName:l.realName,id:l.id,category:l.category,categoryName:l.categoryName,email:l.email}))
|
|
|
+ let tempuser = selectList.find(s=>!s.category);
|
|
|
+ if(tempuser) return this.$showToast(`请为团队人员【${tempuser.realName}】选择身份类型`)
|
|
|
+
|
|
|
+ this.getOpenerEventChannel().emit('selectUserConfirm',sendList)
|
|
|
+ uni.navigateBack()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -178,6 +222,11 @@
|
|
|
color: #BA9B31;
|
|
|
line-height: 30rpx;
|
|
|
margin-left: 20rpx;
|
|
|
+ image{
|
|
|
+ width: 24rpx;
|
|
|
+ height: 24rpx;
|
|
|
+ margin-left: 12rpx;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
&-email{
|