Browse Source

个人中心中的团队成员接口联调完成

htc 2 days ago
parent
commit
d78c91a46a

+ 5 - 1
components/pageEmpty/index.vue

@@ -1,12 +1,16 @@
 <template>
 	<view class="page-empty adffcacjc" :style="{'margin-top':marginTop}">
-		<u-empty text="暂无数据" textSize="32rpx" text-color="#999999" width="332rpx" height="332rpx" mode="order" :icon="imgBase+'recharge_empty.png'"></u-empty>
+		<u-empty :text="text" textSize="32rpx" text-color="#999999" width="332rpx" height="332rpx" mode="order" :icon="imgBase+'recharge_empty.png'"></u-empty>
 	</view>
 </template>
 
 <script>
 	export default {
 		props:{
+			text:{
+				typeof:String,
+				default:'暂无数据'
+			},
 			marginTop:{
 				typeof: String,
 				default: '0px'

+ 12 - 12
pagesHome/components/receiveList.vue

@@ -115,17 +115,17 @@
 					}
 				],
 				teamInfo:null,
-				noticeContent:`Transcend International PERILL Assessment is designed to provide insight into the key factors that underpin high value-creating team. It consists of six elements, focusing on Purpose & Motivation, External Systems and Processes, Relationships, Internal Systems and Processes, Learning Processes, Leadership Qualities and Behaviours.
-创衡国际PERILL团队发展动态评估旨在深入了解支撑高价值团队的关键因素。这些关键因素涵盖六个维度:宗旨和动机、外部流程/系统和结构、人际关系、外部流程/系统和结构、学习、领导力。
-<br/>
-All information will be kept confidential.
-您所填写的所有信息将被保密的。
-<br/>
-The following statements in the assessment describe the ideal state of a team. Please score the actual performance of the team being tested on each statement from two perspectives:
-以下问卷中的各条陈述是对团队理想状态的描述,请您对受测团队当下在每项描述上所呈现的实际表现从两个角度进行打分:
-<br/>
-1. Agreement: There are 5 levels ranging from 1 to 5. Score of 5 if you completely agree that the team has reached the statement. Score of 1 if you completely disagree.
-1、同意度:1-5分共5个等级,假如您完全同意该团队当下达到了所描述的状态为5分,假如您完全不同意该团队当下达到了所描述的状态为1分
+				noticeContent:`Transcend International PERILL Assessment is designed to provide insight into the key factors that underpin high value-creating team. It consists of six elements, focusing on Purpose & Motivation, External Systems and Processes, Relationships, Internal Systems and Processes, Learning Processes, Leadership Qualities and Behaviours.
+创衡国际PERILL团队发展动态评估旨在深入了解支撑高价值团队的关键因素。这些关键因素涵盖六个维度:宗旨和动机、外部流程/系统和结构、人际关系、外部流程/系统和结构、学习、领导力。
+<br/>
+All information will be kept confidential.
+您所填写的所有信息将被保密的。
+<br/>
+The following statements in the assessment describe the ideal state of a team. Please score the actual performance of the team being tested on each statement from two perspectives:
+以下问卷中的各条陈述是对团队理想状态的描述,请您对受测团队当下在每项描述上所呈现的实际表现从两个角度进行打分:
+<br/>
+1. Agreement: There are 5 levels ranging from 1 to 5. Score of 5 if you completely agree that the team has reached the statement. Score of 1 if you completely disagree.
+1、同意度:1-5分共5个等级,假如您完全同意该团队当下达到了所描述的状态为5分,假如您完全不同意该团队当下达到了所描述的状态为1分
 `
 			}
 		},
@@ -298,7 +298,7 @@ The following statements in the assessment describe the ideal state of a team. P
 					padding: 11rpx 15rpx;
 					box-sizing: border-box;
 					&.dwc{
-						background: #AD78A6;	
+						background: #BA9B31;	
 					}
 					&.ywc{
 						background: #64BBBB;	

+ 51 - 12
pagesMy/teamUser.vue

@@ -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;
 						}

+ 33 - 11
pagesMy/teamUserDetail.vue

@@ -5,13 +5,13 @@
 			<view class="form-item adfacjb">
 				<view class="form-item-left">姓名</view>
 				<view class="form-item-right">
-					<u-input v-model="userInfo.name" placeholder="请输入被教练团队人员姓名" border="none" style="font-size: 28rpx;color: #B3BFC8;line-height: 28rpx;" inputAlign="right"></u-input>
+					<u-input v-model="userInfo.realName" placeholder="请输入团队人员姓名" border="none" style="font-size: 28rpx;color: #B3BFC8;line-height: 28rpx;" inputAlign="right"></u-input>
 				</view>
 			</view>
 			<view class="form-item adfacjb">
 				<view class="form-item-left">手机号码</view>
 				<view class="form-item-right">
-					<u-input v-model="userInfo.phone" placeholder="请输入手机号码" border="none" style="font-size: 28rpx;color: #B3BFC8;line-height: 28rpx;" inputAlign="right"></u-input>
+					<u-input v-model="userInfo.mobile" placeholder="请输入手机号码" border="none" style="font-size: 28rpx;color: #B3BFC8;line-height: 28rpx;" inputAlign="right"></u-input>
 				</view>
 			</view>
 			<view class="form-item adfacjb">
@@ -21,14 +21,14 @@
 				</view>
 			</view>
 		</view>
-		<view class="type adfacjb" @click="typeShow=true">
+		<!-- <view class="type adfacjb" @click="typeShow=true">
 			<view class="type-left">团队人员身份类型</view>
 			<view class="type-right adfac">
 				<text>{{typeText}}</text>
 				<image :src="imgBase+'my_arrow_right.png'"></image>
 			</view>
-		</view>
-		<view class="zt_btn">确定</view>
+		</view> -->
+		<view class="zt_btn" @click="handleConfirm">确定</view>
 		<u-picker :itemHeight="88" :immediateChange="true" :show="typeShow" :columns="typeData" title="成员身份类型"
 			@cancel="typeShow=false" @confirm="typeConfirm" keyName="name" ></u-picker>
 	</view>
@@ -40,10 +40,11 @@
 			return {
 				title:'团队成员',
 				userInfo:{
-					name:'',
-					phone:'',
+					id:'',
+					coachId:JSON.parse(uni.getStorageSync('userInfo')).id,
+					realName:'',
+					mobile:'',
 					email:'',
-					type:''
 				},
 				typeText:'请选择',
 				typeShow:false,
@@ -56,14 +57,35 @@
 			}
 		},
 		onLoad(options) {
-			if(options.user){
-				this.userInfo = JSON.parse(decodeURIComponent(options.user))
-				this.title = '编辑成员'
+			if(options.id){
+				this.title = '编辑成员';
+				this.getDetail(options.id)
 			} 
 		},
 		methods:{
+			getDetail(id){
+				this.$api.get(`/core/member/${id}`).then(({data:res})=>{
+					if(res.code!==0) return this.$showToast(res.msg)
+					this.userInfo = {...this.userInfo,...res.data}
+				})
+			},
 			typeConfirm(e){
 				this.typeShow = false;
+			},
+			handleConfirm(){
+				if(!this.userInfo.realName) return this.$showToast('请输入姓名')
+				if(!this.$reg.mobile(this.userInfo.mobile)) return this.$showToast('请输入正确的手机号')
+				if(!this.$reg.email(this.userInfo.email)) return this.$showToast('请输入正确的邮箱')
+				
+				this.$api[this.userInfo.id?'put':'post']('/core/member',this.userInfo).then(({data:res})=>{
+					if(res.code!==0) return this.$showToast(res.msg)
+					this.$showToast(`${this.userInfo.id?'编辑':'添加'}成功`);
+					setTimeout(()=>{
+						uni.redirectTo({
+							url:'/pagesMy/teamUser'
+						})
+					},1000)
+				})
 			}
 		}
 	}

+ 1 - 1
pagesPublish/questionnaireFill.vue

@@ -176,7 +176,7 @@
 				font-family: PingFangSC, PingFang SC;
 				font-weight: 400;
 				font-size: 24rpx;
-				color: #AD78A6;
+				color: #BA9B31;
 				line-height: 30rpx;
 			}
 			image{