|
|
@@ -2,7 +2,7 @@
|
|
|
<view class="default_page adffc" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
|
|
|
<cus-header title='团队成员'></cus-header>
|
|
|
<view class="add" @click="handleAdd">+ 添加</view>
|
|
|
- <view class="list">
|
|
|
+ <view class="list" v-if="list.length">
|
|
|
<u-swipe-action>
|
|
|
<u-swipe-action-item v-for="(item, index) in list" :key="index"
|
|
|
:options="options" @click="e=>deleteUser(item,e)" :ref="'swipeAction' + index" :threshold="5"
|
|
|
@@ -16,10 +16,12 @@
|
|
|
</template>
|
|
|
<view class="lbox-info">
|
|
|
<view class="lbox-info-top adfac">
|
|
|
- <text>{{'吴一可'}}</text>
|
|
|
- <view class="type">{{'赞助人Sponsor'}}</view>
|
|
|
+ <text>{{item.realName}}</text>
|
|
|
+ <template v-if="type">
|
|
|
+ <view class="type">{{'赞助人Sponsor'}}</view>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
- <view class="lbox-info-email">{{'123456789@qq.com'}}</view>
|
|
|
+ <view class="lbox-info-email">{{item.email}}</view>
|
|
|
</view>
|
|
|
<view class="lbox-edit" @click="handleEdit(item)">
|
|
|
<u-icon name="edit-pen" size="42rpx" color="#B9B9B9"></u-icon>
|
|
|
@@ -30,16 +32,27 @@
|
|
|
</u-swipe-action-item>
|
|
|
</u-swipe-action>
|
|
|
</view>
|
|
|
+ <view v-else class="adffcacjc" style="flex: 1;">
|
|
|
+ <empty text='暂无团队人员,请添加'></empty>
|
|
|
+ </view>
|
|
|
<view class="btn" v-if="type">确定</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import empty from '@/components/pageEmpty/index.vue'
|
|
|
export default {
|
|
|
+ components:{ empty },
|
|
|
data(){
|
|
|
return {
|
|
|
type:'',
|
|
|
- list:[1,1,1,1],
|
|
|
+ query:{
|
|
|
+ page:1,
|
|
|
+ limit:10,
|
|
|
+ coachId:''
|
|
|
+ },
|
|
|
+ isOver:false,
|
|
|
+ list:[],
|
|
|
options: [
|
|
|
{
|
|
|
text: '删除',
|
|
|
@@ -53,15 +66,41 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- this.type = options.type
|
|
|
+ this.type = options.type;
|
|
|
+ this.query.coachId = uni.getStorageSync('userInfo')&&JSON.parse(uni.getStorageSync('userInfo')).id||''
|
|
|
+ this.getList()
|
|
|
},
|
|
|
methods:{
|
|
|
scrolltolower(){
|
|
|
-
|
|
|
+ if(this.isOver) return
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ getList(){
|
|
|
+ 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.query.page++
|
|
|
+ if(this.length>=res.data.total) this.isOver = true
|
|
|
+ })
|
|
|
},
|
|
|
deleteUser(item,index){
|
|
|
- this.list.forEach((d, i) => {
|
|
|
- this.$refs['swipeAction' + i][0].closeHandler();
|
|
|
+ uni.showModal({
|
|
|
+ title:'温馨提示',
|
|
|
+ content:`是否确认删除团队成员【${item.realName}】?`,
|
|
|
+ success: (res) => {
|
|
|
+ if(res.confirm){
|
|
|
+ this.$api.del('/core/member',[item.id]).then(({data:res})=>{
|
|
|
+ if(res.code!==0) return this.$showToast(res.msg)
|
|
|
+ this.query.page = 1;
|
|
|
+ this.list = [];
|
|
|
+ this.isOver = false;
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ this.list.forEach((d, i) => {
|
|
|
+ this.$refs['swipeAction' + i][0].closeHandler();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
handleAdd(){
|
|
|
@@ -71,7 +110,7 @@
|
|
|
},
|
|
|
handleEdit(item){
|
|
|
uni.navigateTo({
|
|
|
- url:'/pagesMy/teamUserDetail?user='+encodeURIComponent(JSON.stringify(item))
|
|
|
+ url:'/pagesMy/teamUserDetail?id='+item.id
|
|
|
})
|
|
|
},
|
|
|
}
|
|
|
@@ -130,13 +169,13 @@
|
|
|
line-height: 32rpx;
|
|
|
}
|
|
|
.type{
|
|
|
- background: rgba(173,120,166,0.1);
|
|
|
+ background: #FFF7DC;
|
|
|
border-radius: 21rpx;
|
|
|
padding: 6rpx 16rpx;
|
|
|
font-family: PingFangSC, PingFang SC;
|
|
|
font-weight: 400;
|
|
|
font-size: 22rpx;
|
|
|
- color: #AD78A6;
|
|
|
+ color: #BA9B31;
|
|
|
line-height: 30rpx;
|
|
|
margin-left: 20rpx;
|
|
|
}
|