puyao 2 týždňov pred
rodič
commit
6129bcbf67
5 zmenil súbory, kde vykonal 381 pridanie a 12 odobranie
  1. 5 0
      api/user.js
  2. 2 2
      common/request.js
  3. 9 1
      pages.json
  4. 25 9
      pages/user/customerDetail.vue
  5. 340 0
      pages/user/editUser.vue

+ 5 - 0
api/user.js

@@ -29,4 +29,9 @@ let request = new Request().http
  //获取客户详情
  export function getdetails(data){
  	return request('/app/qw/statistics/course/watch',data,  'POST', 'application/json;charset=UTF-8');
+ }
+ 
+ //修改客户信息
+ export function updataUser(data){
+ 	return request('/app/qw/user/updateQwUserInfo',data,  'POST', 'application/json;charset=UTF-8');
  }

+ 2 - 2
common/request.js

@@ -2,8 +2,8 @@
 export default class Request {
 	http(router, data = {}, method,contentType) {
 		let that = this;
-		// let path = 'http://192.168.10.122:8007';
-		let path = 'https://qwtool.ylrzcloud.com';
+		let path = 'http://192.168.10.122:7771';
+		// let path = 'https://qwtool.ylrzcloud.com';
 		//let path = 'http://scrm.myks8.com/apis';
 		//let path = 'http://scrm.baohetangjinyue.cn/apis';
 		//let path='http://tool.jiuzhouzaixian.com/apis';

+ 9 - 1
pages.json

@@ -87,7 +87,15 @@
         		"navigationBarTitleText" : "催课详情",
 				"navigationBarBackgroundColor": "#fff"
         	}
-        }
+        },
+		{
+			"path" : "pages/user/editUser",
+			"style" : 
+			{
+				"navigationBarTitleText" : "修改用户信息",
+				"navigationBarBackgroundColor": "#fff"
+			}
+		}
 		 
     ],
 	"globalStyle": {

+ 25 - 9
pages/user/customerDetail.vue

@@ -10,7 +10,11 @@
 			</view>
 		</view>
 		<view class="bgf p20">
-			<view>会员资料</view>
+			<view class="justify-between align-center"> 
+				<view>会员资料</view>
+				<view class="fs24 u-border plr20 ptb6 radius40 base-color-6"
+				@click="changeuser()">修改用户信息</view>
+			</view>
 			<view class="justify-between">
 				<view class="justify-start align-center fs24 mt20 widthpath" >
 					<view class="base-color-6 mr40">性别</view>
@@ -30,8 +34,8 @@
 				<view>{{moreInfo.illnessTime?moreInfo.illnessTime:'无'}}</view>
 			</view>
 			<view class="justify-start align-center fs24 mt20" >
-				<view class="base-color-6 mr40">身体状态</view>
-				<view>{{moreInfo.body?moreInfo.mebodydicine:'无'}}</view>
+				<view class="base-color-6 mr40">疾病</view>
+				<view>{{moreInfo.disease?moreInfo.disease:'无'}}</view>
 			</view>
 			<view class="justify-start align-center fs24 mt20" >
 				<view class="base-color-6 mr40">家人的疾病</view>
@@ -174,10 +178,27 @@
 		},
 		onLoad(option) {
 			// this.id=option.id
+			this.url=window.location.href;
+			this.code=options.code;
 			this.corpId=options.corpId;
-			// uni.setStorageSync("corpId",this.corpId);
+			uni.setStorageSync("corpId",this.corpId);
+			this.externalUserId=uni.getStorageSync("externalUserId");
+			var userId=uni.getStorageSync("qwUserId");
+			if(userId!=null&&userId!=undefined&&userId!=""){
+				this.userId=userId;
+			}
+			this.getConfigSignature()
+			if(this.externalUserId!=null&&this.externalUserId!=undefined&&this.userId!=null&&this.userId!=undefined){
+				console.log("获取外部联系人")
+				this.getQwExternalContactDetails()
+			}
 		},
 		methods: {
+			changeuser(){
+				uni.navigateTo({
+					url:'/pages/user/editUser?externalUserId='+this.externalUserId
+				})
+			},
 			getQwExternalContactDetails(){
 				var that=this
 				var data = {
@@ -326,15 +347,12 @@
 									fail: (res) => {
 										console.error('agentConfig fail:', res);
 									},
-									
-									
 								});
 							});
 							jWeixin.error((res) => {
 								
 								console.error('wx.error:', res);
 							});
-							
 						}
 						else{
 							// uni.setStorageSync("qwUserId",null);
@@ -342,9 +360,7 @@
 							// setTimeout(function(){
 							// 	window.location.reload();
 							// },5000);
-							
 						}
-						
 					},
 					rej => {
 						setTimeout(function(){

+ 340 - 0
pages/user/editUser.vue

@@ -0,0 +1,340 @@
+<template>
+	<view>
+		<view class="content pb180">
+			<view class="info-item">
+				<view class="label">姓名</view>
+				<view class="right">
+					<text class="text">{{name}}</text>
+				</view>
+			</view>
+			<view class="info-item">
+				<view class="label">性别</view>
+				<view class="right">
+					<view class="fs28" :class="sex?'base-color-0':'base-color-6'"
+					@click="show=!show">{{sex?sex:'请输入性别'}}</view>
+					<u-picker :show="show" :columns="columns" @confirm='confirm'
+					@cancel='show=!show'></u-picker>
+				</view>
+			</view>
+			<view class="info-item">
+				<view class="label">年龄</view>
+				<view class="right">
+					<input type="text" v-model="age" placeholder="请输入年龄" class="input"></text>
+				</view>
+			</view>
+			<view class="info-item">
+				<view class="label">行为习惯</view>
+				<view class="right">
+					<input type="text" v-model="habits" placeholder="请输入行为习惯" class="input"></text>
+				</view>
+			</view>
+			<view class="info-item">
+				<view class="label">患病时间</view>
+				<view class="right">
+					<input type="text" v-model="illnessTime" placeholder="请输入患病时间" class="input"></text>
+				</view>
+			</view>
+			<view class="info-item">
+				<view class="label">疾病</view>
+				<view class="right">
+					<input type="text" v-model="disease" placeholder="请输入疾病" class="input"></text>
+				</view>
+			</view>
+			 <view class="info-item">
+			 	<view class="label">家人的疾病</view>
+			 	<view class="right">
+					<input type="text" v-model="familyDisease" placeholder="请输入家人的疾病" class="input"></text>
+			 	</view>
+			 </view>
+			<view class="info-item">
+				<view class="label">是否线下就诊</view>
+				<view class="right">
+					<input type="text" v-model="isLine" placeholder="请输入是否线下就诊" class="input"></text>
+				</view>
+			</view>
+			<view class="info-item">
+				<view class="label">体质</view>
+				<view class="right">
+					<input type="text" v-model="constitution" placeholder="请输入体质" class="input"></text>
+				</view>
+			</view>
+			<view class="info-item">
+				<view class="label">使用药品</view>
+				<view class="right">
+					<input type="text" v-model="medicine" placeholder="请输入使用药品" class="input"></text>
+				</view>
+			</view>
+			<view class="info-item">
+				<view class="label">咨询产品</view>
+				<view class="right">
+					<input type="text" v-model="consultProduct" placeholder="请输入咨询产品" class="input"></text>
+				</view>
+			</view>
+			<view class="info-item">
+				<view class="label">是否已经购买产品</view>
+				<view class="right">
+					<input type="text" v-model="isBuy" placeholder="请输入是否已经购买产品" class="input"></text>
+				</view>
+			</view>
+		</view>
+		<view class="btn-box">
+			<view class="sub-btn" @click="submit()">保存修改</view>
+		</view>
+	</view>
+	
+
+</template>
+
+<script>
+	import { getcustomer,updataUser } from "@/api/user.js";
+	export default {
+		data() {
+			return {
+				name:"",
+				deptName:"",
+				postNames:"",
+				sexPicker: ['男', '女','未知'],
+				sex: 0, // 性别
+				age:"",
+				habits:"",//行为习惯
+				illnessTime:"",//患病时间
+				disease:"",//疾病
+				familyDisease:"",//家人疾病
+				isLine:"",//是否线下就诊
+				constitution:"",//体质
+				medicine:"",//使用药品
+				consultProduct:"",//咨询产品
+				isBuy:"",//是否已经购买产品
+				externalUserId:50,
+				show: false,
+				columns: [
+					['男', '女', '未知']
+				],
+			}
+		},
+		onLoad(options) {
+			// this.externalUserId=options.externalUserId
+			this.getuser()
+		},
+		methods: {
+			confirm(e) {
+				console.log('confirm', e)
+				this.sex=e.value[0]
+				this.show = false
+			},
+			bindUser(data){
+				var that=this;
+				that.sex=data.sex;
+				that.age=data.age;
+				that.habits=data.habits;
+				that.illnessTime=data.illnessTime;
+				that.disease=data.disease;
+				that.familyDisease=data.familyDisease;
+				that.isLine=data.isLine;
+				that.constitution=data.constitution;
+				that.medicine=data.medicine;
+				that.consultProduct=data.consultProduct;
+				that.isBuy=data.isBuy;
+			},
+			getuser(){
+				const data={
+					qwExternalContactId:this.externalUserId
+				}
+				getcustomer(data).then(res=>{
+					if (res.code == 200) {
+						this.detailUser=res.data
+						// this.moreInfo=res.moreInfo
+						this.name=res.data.name;
+						this.bindUser(res.moreInfo);
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.msg
+						})
+					}
+				})
+			},
+			// 性别选择
+			pickerSex(e) {
+				console.log(e)
+				this.sex = e.detail.value
+			},
+			submit(){
+				if (this.utils.isEmpty(this.sex)) {
+					uni.showToast({
+						title: "请输入性别",
+						icon: 'none',
+					});
+					return
+				}
+				if (this.utils.isEmpty(this.age)) {
+					uni.showToast({
+						title: "请输入年龄",
+						icon: 'none',
+					});
+					return
+				}
+				uni.showLoading({
+					title: '加载中'
+				});
+				var data = {
+					externalContactId:this.externalUserId,
+					name:this.phonenumber,
+					age:this.age,
+					sex:this.sex.toString(),
+					habits:this.habits,
+					illnessTime:this.illnessTime,
+					disease:this.disease,
+					familyDisease:this.familyDisease,
+					isLine:this.isLine,
+					constitution:this.constitution,
+					medicine:this.medicine,
+					consultProduct:this.consultProduct,
+					isBuy:this.isBuy
+					};
+				console.log(data);
+				updataUser(data).then(
+					res => {
+						uni.hideLoading();
+						if(res.code==200){
+							uni.showToast({
+								title: '修改成功',
+								duration: 2000
+							});
+							// setTimeout(function() {
+							// 	uni.navigateBack({
+							// 	  success: () => {
+							// 	  }
+							// 	})
+							// }, 500);
+							this.getuser()
+						}
+						else{
+							uni.showToast({
+								title: res.msg,
+								icon: 'none',
+							});
+						}
+						
+					},
+					rej => {}
+				);
+				
+			}
+			
+		}
+	}
+</script>
+
+
+<style scoped lang="scss">
+	.base-color-0{
+		color: #000;
+	}
+	.content{
+		padding-top: 20rpx;
+		border-top: 1px solid #F5F6FA;
+	}
+	.info-item{
+		height: 104upx;
+		background: #FFFFFF;
+		padding: 0 30upx;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		border-bottom: 1px solid #F5F6FA;
+		&:last-child{
+			border-bottom: none;
+		}
+		.label{
+			
+			font-size: 30upx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #0F1826;
+		}
+		.right{
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			.text{
+				font-size: 30upx;
+				font-family: PingFang SC;
+				font-weight: 400;
+				color: #0F1826;
+			}
+			.image{
+				margin-left: 10upx;
+				width: 30upx;
+				height: 30upx;
+			}
+			.input{
+				text-align: right;
+				font-size: 30upx;
+				font-family: PingFang SC;
+				font-weight: 400;
+				color: #0F1826;
+			}
+		}
+		.head{
+			border-radius: 50%;
+			width: 80upx;
+			height: 80upx;
+		}
+		.arrow{
+			width: 30upx;
+			height: 30upx;
+		}
+		.text{
+			font-size: 30upx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #0F1826;
+		}
+		.input{
+			text-align: right;
+			font-size: 30upx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #0F1826;
+		}
+		&.password{
+			margin-top: 20upx;
+			.right{
+				display: flex;
+				align-items: center;
+				.text{
+					font-size: 30upx;
+					font-family: PingFang SC;
+					font-weight: 400;
+					color: #0F1826;
+					margin-right: 15upx;
+				}
+			}
+		}
+	}
+	.btn-box{
+		margin-top: 15rpx;
+		padding: 0 30upx;
+		position: fixed;
+		bottom: 0;
+		background-color: #FFFFFF;
+		padding-top: 30rpx;
+		padding-bottom: 30rpx;
+		width: 100%;
+		align-items: center;
+		justify-content: center;
+		.sub-btn{
+			width: 100%;
+			height: 88upx;
+			line-height: 88upx;
+			text-align: center;
+			font-size: 30upx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #FFFFFF;
+			background: #078df3;
+			border-radius: 44upx;
+		}
+	}
+</style>