Tang 4 anni fa
parent
commit
9480198aa7
5 ha cambiato i file con 45 aggiunte e 41 eliminazioni
  1. 2 0
      common/methodTool.js
  2. 3 3
      common/request.js
  3. 3 2
      pages2/wd/edu_info.vue
  4. 34 32
      pages2/wd/info.vue
  5. 3 4
      store/index.js

+ 2 - 0
common/methodTool.js

@@ -1,4 +1,6 @@
 const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'
+// const BASE_IMG_URL = 'http://192.168.1.222:8088'
+// const BASE_IMG_URL = 'http://192.168.1.20:8088'
 import store from '@/store/index.js'
 export default {
 	isLogin() {

+ 3 - 3
common/request.js

@@ -1,7 +1,7 @@
 
-//const BASE_URL = 'http://192.168.1.222:8088'
-// const BASE_URL = 'http://127.0.0.1:8088' 
-const BASE_URL = 'https://api.xyyxt.net' 
+// const BASE_URL = 'http://192.168.1.222:8088'
+const BASE_URL = 'http://192.168.1.20:8088' 
+// const BASE_URL = 'https://api.xyyxt.net' 
 import store from '@/store/index.js'
 import api from './api.js'
 var num = 1

+ 3 - 2
pages2/wd/edu_info.vue

@@ -73,8 +73,8 @@
 					<u-upload @on-list-change="changePhotoListHeader" :auto-upload="false" custom-btn="true" :action="action" :file-list="fileList" width="120" height ="120" size-type="['compressed']" max-count="1">
 						<template v-slot:addBtn >
 							<image :src="schoolInfo.studentStatusImg ? $method.splitImgHost(schoolInfo.studentStatusImg) : '/static/info_4.png'" style="width: 120rpx; height: 120rpx;"></image>
-						</template>
-					</u-upload>
+						</template>  
+					</u-upload> 
 				</u-form-item>
 				
 			</u-form>
@@ -262,6 +262,7 @@
 				this.$api.getSchoolInfo().then(res => {
 					if (res.data.code === 200) {
 						that.schoolInfo = res.data.data
+						console.log(that.schoolInfo)
 						if(this.schoolInfo.fullTimeSchool)
 							this.index_full = this.dictObj['full_time_school'].indexOf((this.schoolInfo.fullTimeSchool))
 						if(this.schoolInfo.admissionTime)

+ 34 - 32
pages2/wd/info.vue

@@ -15,7 +15,7 @@
 		</view>
 		<view class="form">
 			<u-form :model="form" ref="uForm">
-				<u-form-item label="姓名" prop="realname"><u-input :disabled="form.certified === 1" v-model="userInfo.realname" /></u-form-item>
+				<u-form-item label="姓名" prop="realname"><u-input :disabled="form.certified === 1" v-model="form.realname" /></u-form-item>
 				<u-form-item label="手机号码" prop="telphone" :label-width="auto"><u-input :disabled="form.certified === 1" v-model="form.telphone" /></u-form-item>
 				<u-form-item label="身份证号" prop="idCard" :label-width="auto"><u-input :disabled="form.certified === 1" v-model="form.idCard" /></u-form-item>
 				<u-form-item label="性别" prop="sex">
@@ -36,8 +36,8 @@
 					</pick-regions>
 				</u-form-item>
 				<u-form-item label="婚姻状况" prop="marry" :label-width="auto">
-					<picker @change="bindPickerChangeMarry" :value="form.marry" :range="array_marry">
-						<view class="picker">{{ array_marry[form.marry] }}</view>
+					<picker @change="bindPickerChangeMarry" :value="index_marry" :range="array_marry">
+						<view class="picker">{{ array_marry[index_marry] }}</view>
 					</picker>
 				</u-form-item>
 				<u-form-item label="所在城市" :label-width="auto">
@@ -46,13 +46,14 @@
 					</pick-regions>
 				</u-form-item>
 				<u-form-item label="政治面貌" :label-width="auto" prop="politic">
-					<picker @change="bindPickerChangePolitic" :value="form.politic" :range="array_politic">
-						<view class="picker">{{ array_politic[form.politic] }}</view>
+					<picker @change="bindPickerChangePolitic" :value="index_politic" :range="array_politic">
+						<view class="picker">{{ array_politic[index_politic] }}</view>
 					</picker>
 				</u-form-item>
 				<u-form-item label="一寸头像" prop="fileList" :label-width="auto" label-position="top">
 					<u-upload
 						:auto-upload="false"
+						:show-progress="false"
 						custom-btn="true"
 						:action="action"
 						:file-list="fileList"
@@ -108,7 +109,6 @@
 </template>
 
 <script>
-import {mapGetters} from 'vuex';
 export default {
 	data() {
 		return {
@@ -118,13 +118,7 @@ export default {
 			fileList: [],
 			defaultRegionCode: '440112',
 			form: {
-				realname: '',
-				telphone: '',
-				idCard: '',
-				email: '',
 				sex: 0,
-				marry: 0,
-				politic: 0,
 				userBirth: '1990-01-01',
 				houseProvince: '', //户籍省
 				houseCity: '', //户籍市
@@ -132,20 +126,19 @@ export default {
 				province: '', //城市省
 				city: '', //市
 				district: '', //区
-				// region1: ['广东省', '广州市', '天河区'],
-				// region2: ['广东省', '广州市', '天河区'],
 				oneInchPhotos: ''
 			},
-			// index_sex: 0,
 			array_sex: ['男', '女'],
-			array_marry: ['未婚', '已婚'],
-			array_politic: ['群众', '团员', '党员'],
+			index_marry: 0,
+			array_marry: [],
+			index_politic: 0,
+			array_politic: [],
 			rules: {
 				realname: [
 					{
 						required: true,
 						message: '请输入姓名',
-						trigger: ['blur', 'change']
+						trigger: 'blur'
 					}
 				],
 				telphone: [
@@ -189,17 +182,30 @@ export default {
 		if(this.form.district === ''){
 			this.form.district = '天河区'
 		}
+		if(this.form.marry !== null && this.form.marry != 'undefined' && this.form.marry !== ''){
+			this.index_marry = this.array_marry.indexOf(this.form.marry)
+		}
+		if(this.form.politic !== null && this.form.politic != 'undefined' && this.form.politic !== ''){
+			this.index_politic = this.array_politic.indexOf(this.form.politic)
+		}
 	},
 	onLoad(option) {
+		this.getUserInfos()
 		const Verify = require('@/wxcomponents/verify_mpsdk/main.js');
 		Verify.init();
+		this.array_marry = this.$store.state.dictObj['marry_status']
+		this.array_politic = this.$store.state.dictObj['politic_status']
 	},
 	methods: {
-		// getUserInfos() {
-		// 	this.$api.getInfo().then(res => {
-		// 		this.form = res.data.data;
-		// 	});
-		// },
+		getUserInfos(){
+			var self = this
+			this.$api.getInfo().then(res => {
+				this.form = res.data.data
+				if (this.form.HeadImageUrl !== null) {
+					self.fileList = [{ url: self.$method.splitImgHost(self.form.oneInchPhotos) }];
+				}
+			})
+		},
 		changePhotoListHeader(lists, name) {
 			this.fileList = lists;
 		},
@@ -225,7 +231,7 @@ export default {
 					setTimeout(() => {
 						self.$api.facecertification(self.BizToken).then(faceRec => {
 							//刷新用户信息
-							self.$api.refreshUserInfo() 
+							self.getUserInfos() 
 						});
 					}, 500);
 				},
@@ -287,8 +293,8 @@ export default {
 				sex: this.form.sex, //性别
 				telphone: this.form.telphone, //手机号
 				userBirth: this.form.userBirth, //出生日期
-				marry: this.form.marry, //结婚状态
-				politic: this.form.politic, //政治面貌
+				marry: this.array_marry[this.form.marry], //结婚状态
+				politic: this.array_politic[this.form.politic], //政治面貌
 				oneInchPhotos: this.form.oneInchPhotos //一寸照
 			};
 			this.$api.appuserInfo(data).then(res => {
@@ -356,6 +362,7 @@ export default {
 			this.form.politic = e.detail.value;
 		},
 		bindPickerChangeMarry(e) {
+			console.log(e)
 			this.form.marry = e.detail.value;
 		},
 		//城市
@@ -378,17 +385,12 @@ export default {
 			// var month = this.userBirth.substr(5, 2);
 			// var day = this.userBirth.substr(8, 2);
 		},
+		
 		actionSheetCallback(index) {
 			uni.hideKeyboard();
 			this.form.sex_text = this.actionSheetList[index].text;
 		}
 	},
-	computed: {...mapGetters(['userInfo'])},
-	watch:{
-		userInfo(val, oldVal){
-			this.form = val
-		}
-	}
 };
 </script>
 

+ 3 - 4
store/index.js

@@ -24,11 +24,10 @@ const store = new Vuex.Store({
 			return state.dictObj
 		},
 	},
-    mutations: {  
-        updateUserInfo(state, provider) {  
+    mutations: { 
+        updateUserInfo(state, provider) {
             state.userInfo = provider.userInfo;  
-        },  
-        
+        },
     }  
 })  
 async function getUserInfo(state){