lihongxiao 1 рік тому
батько
коміт
bdd572311f
3 змінених файлів з 68 додано та 45 видалено
  1. 8 8
      pages/my/my.vue
  2. 41 18
      pages/realname/realname.vue
  3. 19 19
      pages/user/userInfo.vue

+ 8 - 8
pages/my/my.vue

@@ -12,7 +12,7 @@
 			<view class="icon iconfont icon-cuo d-flex a-center j-center" @tap="controlProdetIntro"></view>
 		</view>
 		<view class="home-info d-flex">
-			<view class="mystatus d-flex a-center j-center">{{mystatusText}}</view>
+			<view class="mystatus d-flex a-center j-center">{{userInfo.sysUser.status=='1'?'已认证':'未认证'}}</view>
 			<image :src="avatar" mode="aspectFill" @tap="popupShow = true"></image>
 			<view class="person-info" @tap="openDetail">
 				<h3>{{userInfo.sysUser.name}}</h3>
@@ -249,13 +249,13 @@
 		},
 		
 		async onload() {
-			if(this.userStatus == '1'){
-				this.mystatusText="未认证";
-			}else if(this.userStatus == '5'){
-				this.mystatusText="已认证";
-			}else{
-				this.mystatusText="认证中";
-			}
+			// if(this.userInfo.sysUser.status == '2'){
+			// 	this.mystatusText="未认证";
+			// }else if(this.userInfo.sysUser.status == '1'){
+			// 	this.mystatusText="已认证";
+			// }else{
+			// 	this.mystatusText="认证中";
+			// }
 			
 			await this.getAdvanceMoney();//预收金额
 			await this.getPayAccount();//可提现余额

+ 41 - 18
pages/realname/realname.vue

@@ -3,7 +3,7 @@
 		<!-- 公共组件-每个页面必须引入 -->
 		<public-module></public-module>
 		<u-form  :model="form" ref="uForm" class="addStaffManage" >
-			<u-form-item label="姓名" prop="name"><u-input v-model="form.name" /></u-form-item>
+			<u-form-item label="姓名" prop="param1"><u-input v-model="form.param1" /></u-form-item>
 			<!-- <u-form-item label="性别">
 				<u-input type="select" :select-open="showSex" v-model="form.sex"
 						placeholder="请选择性别" @click="showSex = true"
@@ -12,7 +12,7 @@
 				 @confirm="sexSelect"></u-select>
 					
 			</u-form-item> -->
-			<u-form-item label="身份证号" prop="identity"><u-input v-model="form.identity"  /></u-form-item>
+			<u-form-item label="身份证号" prop="param2"><u-input v-model="form.param2"  /></u-form-item>
 			 <u-button hover-class="none" :custom-style="submitBtnStyle" type="success" @click="submit">提交</u-button>
 		</u-form>
 		
@@ -21,6 +21,7 @@
 </template>
 
 <script>
+	import store from '@/store';
 	import {
 		mapState
 	} from "vuex"
@@ -117,8 +118,8 @@
 					backgroundColor: "#ea552d",
 				},
 				form: {
-					name: '',
-					identity: '',
+					param1: '',
+					param2: '',
 				},
 				actions: [{
 						value: '1',
@@ -134,14 +135,14 @@
 					}
 							],
 					rules: {
-						name: [
+						param1: [
 							{
 								required: true,
 								message: '请输入姓名',
 								trigger: ['blur', 'change']
 							}
 						],
-						identity: [
+						param2: [
 							// {
 							// 	required: true,
 							// 	message: '请输入身份证号',
@@ -161,24 +162,46 @@
 			sexSelect(e) {
 				this.form.sex = e[0].label
 			},
-			async submit(){
+			 submit(){
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
-						console.log('验证通过');
-						console.log(this.userInfo.sysUser,11111111)
+						this.$http.post('/user/realNameAuth' ,this.form).then(res=>{
+							if(res.code==200){
+								// 更新个人信息
+								this.$http.get('/user/loginUser').then(res=>{
+									store.commit('setUserModules', {
+										title: 'userInfo',
+										data: {
+											sysUser:{...res.data}
+										}
+									})
+									uni.showToast({
+										icon: "none",
+										title: '提交成功',
+										duration: 1500
+									})
+									uni.reLaunch({
+										url: "/pages/index/index"
+									})
+								})
+								
+							}
+							else{
+								uni.showToast({
+									icon: "none",
+									title: res.msg,
+									duration: 1500
+								})
+							}
+						})
+						// console.log('验证通过');
+						// console.log(this.userInfo.sysUser,11111111)
 					} else {
 						console.log('验证失败');
 					}
 				});
-				// let res = await this.$http.post('/user/updateUserInfo/' + this.userInfo.sysUser.id,
-				// {
-				// 	sysUser:{name:this.form.name,identity:this.form.identity,status:'1',
-				// 	mobile:this.userInfo.sysUser.mobile,deptId:this.userInfo.sysUser.deptId,
-				// 	deptName:this.userInfo.sysUser.deptName,
-				// 	},
-				// 	sysUserInfo:{},
-				// });
-				// console.log(res,11111111)
+			
+				
 			}
 		},
 		onReady() {

+ 19 - 19
pages/user/userInfo.vue

@@ -59,21 +59,21 @@
 			</view>
 		</view>
 		
-		<view style="padding-bottom: 30upx;" v-if="showRecommend">
+		<view style="padding-bottom: 30upx;" v-if="this.userInfo.sysUser.status=='1'">
 			<view class="infoTitle">业务信息</view>
 			<view class="user-set-userinfo-list d-flex a-center j-sb">
 				<view>推荐人</view>
-				<view class="d-flex a-center info">{{recommenderId}}({{recommenderName}})</view>
+				<view class="d-flex a-center info">{{this.userInfo.sysUser.referrerId}}({{this.userInfo.sysUser.referrerName}})</view>
 				<view></view>
 			</view>
 			<view class="user-set-userinfo-list d-flex a-center j-sb">
 				<view>所属机构</view>
-				<view class="d-flex a-center info">{{recommenderComname}}</view>
+				<view class="d-flex a-center info">{{this.userInfo.sysUser.deptName}}</view>
 				<view></view>
 			</view>
 			<view class="user-set-userinfo-list d-flex a-center j-sb">
 				<view>所属团队</view>
-				<view class="d-flex a-center info">{{recommenderTeam}}</view>
+				<view class="d-flex a-center info">{{this.userInfo.sysUser.roleName}}</view>
 				<view></view>
 			</view>
 		</view>
@@ -98,22 +98,22 @@
 			}
 		},
 		async onLoad() {
-			var sysUser={};
-			Object.assign(this.sysUser,this.userInfo.sysUser);
-			Object.assign(this.esmUserInternal,this.userInfo.esmUserInternal);
-			Object.assign(this.esmUserAgent,this.userInfo.esmUserAgent);
+			// var sysUser={};
+			// Object.assign(this.sysUser,this.userInfo.sysUser);
+			// Object.assign(this.esmUserInternal,this.userInfo.esmUserInternal);
+			// Object.assign(this.esmUserAgent,this.userInfo.esmUserAgent);
 
-			// 查询推荐人信息
-			if(!!this.userCheckInfo.esmUserAgent.recommenderid){
-				let res = await this.$http.get('/user/findById?id='+this.userCheckInfo.esmUserAgent.recommenderid);
-				if((res.code == '200') && (res.data!= null)){
-					this.showRecommend=true;
-					this.recommenderId = res.data.id;
-					this.recommenderName = res.data.name;
-					this.recommenderComname = res.data.comname;
-					this.recommenderTeam = res.data.deptname;
-				}
-			}
+			// // 查询推荐人信息
+			// if(!!this.userCheckInfo.esmUserAgent.recommenderid){
+			// 	let res = await this.$http.get('/user/findById?id='+this.userCheckInfo.esmUserAgent.recommenderid);
+			// 	if((res.code == '200') && (res.data!= null)){
+			// 		this.showRecommend=true;
+			// 		this.recommenderId = res.data.id;
+			// 		this.recommenderName = res.data.name;
+			// 		this.recommenderComname = res.data.comname;
+			// 		this.recommenderTeam = res.data.deptname;
+			// 	}
+			// }
 			
 		},
 		computed: {