Преглед изворни кода

修改读取信息的位置

zhupeng пре 3 година
родитељ
комит
b20fb5b7f7
3 измењених фајлова са 139 додато и 51 уклоњено
  1. 31 24
      pagesB/pages/login/step1.vue
  2. 75 19
      pagesB/pages/login/step2.vue
  3. 33 8
      pagesB/pages/login/step3.vue

+ 31 - 24
pagesB/pages/login/step1.vue

@@ -15,13 +15,13 @@
 				</view>
 				<view class="jpLogin-sex">
 					<view class="jpLogin-sex-item">
-						<u-image class="newsList-img" v-show="form.sex=='male'"  src="/static/img/sexMan.png" height="200" width="200" border-radius="10" ></u-image>
-						 <u-image class="newsList-img" v-show="form.sex!='male'" src="/static/img/sexMan2.png" height="200" width="200" border-radius="10" @click="changeSex('male')" ></u-image> 
+						<u-image class="newsList-img"  :src="form.sex == 'male'? '/static/img/sexMan.png':'/static/img/sexMan2.png'" height="200" width="200" border-radius="10" @click="changeSex('male')"></u-image>
+<!--						 <u-image class="newsList-img" v-show="form.sex!='male'" src="" height="200" width="200" border-radius="10" @click="changeSex('male')" ></u-image> -->
 					</view>
 					<view class="jpLogin-sex-item">
 						<!-- <u-image class="newsList-img" src="/static/img/sexWoman.png" height="200" width="200" border-radius="10"></u-image> -->
-						<u-image class="newsList-img" v-show="form.sex=='female'" src="/static/img/sexWoman.png"  height="200" width="200" border-radius="10"></u-image>
-						<u-image class="newsList-img" v-show="form.sex!='female'"  src="/static/img/sexWoman2.png"  height="200" width="200" border-radius="10" @click="changeSex('female')"></u-image>
+						<u-image class="newsList-img"  :src="form.sex =='female' ? '/static/img/sexWoman.png':'/static/img/sexWoman2.png'"  height="200" width="200" border-radius="10" @click="changeSex('female')"></u-image>
+<!--						<u-image class="newsList-img" v-show="form.sex!='female'"  src="/static/img/sexWoman2.png"  height="200" width="200" border-radius="10" @click="changeSex('female')"></u-image> -->
 					
 					</view>
 				</view>
@@ -107,7 +107,7 @@
 				personal_info:{},
 				form: {
 //					name: '',			
-					sex:'male',		
+					sex:'',		
 					birthday:"",
 					height:'', 
 					height_val:180,
@@ -174,7 +174,19 @@
 		},
 		onLoad(){
 			
-			_self = this; 
+			_self = this; 
+			for(let i = 130;i<=220;i++)
+			{
+				let height_range = {value: i, label: i.toString()+"cm"};
+				_self.height_ranges_by_names.push(height_range);
+				//this.height_ranges.push(i.toString());
+			}
+			for(let i = 20;i<=120;i++)
+			{
+//				this.weight_ranges.push(i.toString());
+				let weight_range = {value:i, label:i.toString()+"kg"};
+				_self.weight_ranges_by_names.push(weight_range);
+			}
 			loginApi.getCityList().then(function(data){
 				//console.log('获取城市成功'+JSON.stringify(data));
 				if(data.result &&  data.data){
@@ -185,7 +197,7 @@
 				let personal_info = _self.carhelp.getPersonInfo();
 				if(personal_info)
 				{
-					console.log('个人信息'+JSON.stringify(personal_info))
+//					console.log('个人信息'+JSON.stringify(personal_info))
 					if(personal_info.gender!=null){
 						if(personal_info.gender)
 							_self.form.sex = "female";
@@ -207,11 +219,14 @@
 					 }*/
 					 if(personal_info.height!=null){
 					 	_self.form.height_val = personal_info.height;
-						_self.form.height = personal_info.height.toString()+"cm"
+						_self.form.height = personal_info.height.toString()+"cm"
+						_self.defaultData.height = [_self.height_ranges_by_names.findIndex(item => item.value === _self.form.height_val)]
+						
 					 } 
 					 if(personal_info.height!=null){
 					 	_self.form.weight_val = personal_info.weight;
 					 	_self.form.weight = personal_info.weight.toString()+"kg"
+						_self.defaultData.weight = [_self.weight_ranges_by_names.findIndex(item => item.value === _self.form.weight_val)]
 					 } 
 				}
 				
@@ -225,18 +240,7 @@
 			//_self.form.sex = 'male'
 			//#endif
 			
-			for(let i = 130;i<=220;i++)
-			{
-				let height_range = {value: i, label: i.toString()+"cm"};
-				_self.height_ranges_by_names.push(height_range);
-				//this.height_ranges.push(i.toString());
-			}
-			for(let i = 20;i<=120;i++)
-			{
-//				this.weight_ranges.push(i.toString());
-				let weight_range = {value:i, label:i.toString()+"kg"};
-				_self.weight_ranges_by_names.push(weight_range);
-			}
+			
 			
  			
 		},
@@ -247,12 +251,15 @@
 			async selectweight(status) {
 				this.show_weight = true;
 			},
-			changeSex(sex){
+			changeSex(sex){
+				if(this.form.sex.length>0)
+					return;
 				this.form.sex = sex;
-			},
-			birthdayChange(){
+			},
+			
+/*			birthdayChange(){
 				this.$refs.mpvueDatePicker.show()
-			},
+			},*/
 			onDateConfirm(e) {
 				_self.form.birthday = e.label;
 				console.log('地址选择'+_self.birthday)

+ 75 - 19
pagesB/pages/login/step2.vue

@@ -2,7 +2,7 @@
 	<view>
 		<view class="jpLogin">
 			<u-navbar :background="background" :border-bottom="false"></u-navbar>
-			
+			<u-toast ref="uToast"></u-toast>
 			<view class="jpLogin-title">
 				<h2>完善个人信息<span>2</span>/4</h2>
 				<p>完善资料,才能给您精准匹配对象哦~</p>
@@ -40,7 +40,7 @@
 					</view>
 					<view class="jpLogin-input">
 						<u-form-item :required="true"><u-input v-model="form.work_corporation" placeholder="我的工作单位"/></u-form-item>
-						<u-icon custom-prefix="custom-icon"  name="information-line" class="jpLogin-warn"></u-icon>
+						<u-icon custom-prefix="custom-icon"  name="information-line" class="jpLogin-warn" @click='tips'></u-icon>
 					</view>
 					<view class="jpLogin-input">
 						<u-form-item :required="true">
@@ -69,7 +69,7 @@
 					</view>
 					<view class="jpLogin-textarea">
 						<u-form-item> 
-							<u-input v-model="form.self_assess" type="textarea" placeholder="" />
+							<u-input v-model="form.self_assess" type="textarea" placeholder=" " />
  
 						</u-form-item>
 					</view>
@@ -353,16 +353,26 @@
 							} 
 						}
 						 
-						 if(personal_info.education!=null){
+						 if(personal_info.education!=null){
+							 
+							 let index = _self.education_ranges.findIndex(item => item.value === personal_info.education);							 
+							 if(index>=0){
+								  _self.defaultData.education = [index]
+								 _self.form.education = _self.education_ranges[index].name;
+								 _self.form.educationId = _self.education_ranges[index].value;
+							 }
+							 //console.log('default'+JSON.stringify(_self.defaultData.education));
+							 /*
 							 for(let i = 0;i< _self.education_ranges.length;i++)
 							 {
 								 if(personal_info.education.indexOf(_self.education_ranges[i].value)>=0)
 								 {
 									_self.form.education = _self.education_ranges[i].name; 
-									_self.form.educationId = _self.education_ranges[i].value; 
+									_self.form.educationId = _self.education_ranges[i].value;
+									 
 									 									 
 								 } 						
-							 }
+							 }*/
 						 }  
 						  
 						  if(personal_info.workUnit!=null){
@@ -373,8 +383,14 @@
 						  		_self.form.work_post = personal_info.post; 
 						  }  
 						    
-						 if(personal_info.industry!=null){ 
-								for(let i = 0;i< _self.profession_ragnes.length;i++)
+						 if(personal_info.industry!=null){ 
+							 let index = _self.profession_ragnes.findIndex(item => item.value === personal_info.industry);
+							 if(index>=0){
+								  _self.defaultData.profession = [index]
+								  _self.form.profession = _self.profession_ragnes[index].name; 
+								  _self.form.professionId = _self.profession_ragnes[index].value; 
+							 }
+/*								for(let i = 0;i< _self.profession_ragnes.length;i++)
 								{
 									 if(personal_info.industry.indexOf(_self.profession_ragnes[i].value)>=0)
 									 {
@@ -382,10 +398,17 @@
 										_self.form.professionId = _self.profession_ragnes[i].value; 
 																			 
 									 } 						
-								} 
+								} */
 						 }  
 						 				 
-						 if(personal_info.salaryRange!=null){
+						 if(personal_info.salaryRange!=null){
+							let index = _self.salary_ranges.findIndex(item => item.value === personal_info.salaryRange);
+							 if(index>=0){
+								  _self.defaultData.salary_range = [index]
+								  _self.form.salary_range = _self.salary_ranges[index].name; 
+								  _self.form.salary_rangeId = _self.salary_ranges[index].value; 
+							 }
+ /*
 							 for(let i = 0;i< _self.salary_ranges.length;i++)
 							 {
 								 if(personal_info.salaryRange.indexOf(_self.salary_ranges[i].value)>=0)
@@ -394,9 +417,16 @@
 									_self.form.salary_rangeId = _self.salary_ranges[i].value; 
 																		 
 								 } 						
-							 } 
+							 } */
 						 }  
-						 if(personal_info.housingSituation!=null){
+						 if(personal_info.housingSituation!=null){
+							let index = _self.house_statuses.findIndex(item => item.value === personal_info.housingSituation);
+							 if(index>=0){
+								  _self.defaultData.salary_range = [index]
+								  _self.form.house_status = _self.house_statuses[index].name; 
+								  _self.form.house_statusId = _self.house_statuses[index].value; 
+							 }
+							 /*
 							 for(let i = 0;i< _self.house_statuses.length;i++)
 							 {
 								 if(personal_info.housingSituation.indexOf(_self.house_statuses[i].value)>=0)
@@ -404,9 +434,16 @@
  									_self.form.house_status = _self.house_statuses[i].name; 
  									_self.form.house_statusId = _self.house_statuses[i].value; 									 									 
 								 } 	
- 							 } 
+ 							 } */
 						 }  
-						 if(personal_info.maritalStatus!=null){
+						 if(personal_info.maritalStatus!=null){
+							 let index = _self.marriage_statuses.findIndex(item => item.value === personal_info.maritalStatus);
+							  if(index>=0){
+							 	  _self.defaultData.salary_range = [index]
+							 	  _self.form.marriage_status = _self.marriage_statuses[index].name; 
+							 	  _self.form.marriage_statusId = _self.marriage_statuses[index].value; 
+							  }
+							 /*
 							 for(let i = 0;i< _self.marriage_statuses.length;i++)
 							 {
 								 if(personal_info.maritalStatus.indexOf(_self.marriage_statuses[i].value)>=0)
@@ -415,11 +452,17 @@
 									_self.form.marriage_statusId = _self.marriage_statuses[i].value; 
 																		 
 								 } 						
-							 }   
+							 }   */
 						 }  
 						   
-						 if(personal_info.childStatus!=null){ 
-								for(let i = 0;i< _self.children_statuses.length;i++)
+						 if(personal_info.childStatus!=null){ 
+							 let index = _self.children_statuses.findIndex(item => item.value === personal_info.childStatus);
+							  if(index>=0){
+							 	  _self.defaultData.children_status = [index]
+							 	  _self.form.children_status = _self.children_statuses[index].name; 
+							 	  _self.form.children_statusId = _self.children_statuses[index].value; 
+							  }
+/*								for(let i = 0;i< _self.children_statuses.length;i++)
 								{
 									 if(personal_info.childStatus.indexOf(_self.children_statuses[i].value)>=0)
 									 {
@@ -427,7 +470,7 @@
 										_self.form.children_statusId = _self.children_statuses[i].value; 
 																			 
 									 } 						
-								}  
+								}  */
 						 }  
 						 
 						 if(personal_info.selfEvaluation!=null){
@@ -455,6 +498,17 @@
 			_self.get_options();
 		},
 		methods:{
+			tips(){
+				let param = {
+						type: 'default',
+						title: '请填写真实单位,保密项',
+						message: "请填写真实单位,保密项",
+						url: '/pages/componentsB/tag/tag',
+						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/jump.png'
+					};
+					
+				this.$refs.uToast.show({...param})
+			},
 			init_city_data(){
 				for(let i = 0;i< provinceData.length;i++){
 					let province = provinceData[i];
@@ -498,7 +552,7 @@
 				console.log('item'+JSON.stringify(this.interests[index])) 
 			},
 			get_options(){
-				console.log('get options')
+//				console.log('get options')
 				// #ifdef APP-NVUE
 				 const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
 				 // #endif
@@ -738,6 +792,8 @@
 				if(_self.form.self_assess.length>0)
 				{
 					_self.personal_info.selfEvaluation = _self.form.self_assess;
+				}else{
+					_self.personal_info.selfEvaluation = '';
 				}
 				let interest = ''
 				//console.log('interest'+JSON.stringify(_self.interests))

+ 33 - 8
pagesB/pages/login/step3.vue

@@ -46,7 +46,7 @@
 					</view>
 					<view class="jpLogin-textarea">
 						<u-form-item> 
-							<u-input v-model="form.other" type="textarea" height="140" placeholder="" />
+							<u-input v-model="form.other" type="textarea" height="140" placeholder=" " />
  
 						</u-form-item>
 					</view>
@@ -197,10 +197,14 @@
 			   
 			   if(_self.form.profession.length>0)
 			   {
-			   	_self.personal_info.taOccupation = _self.form.profession;	
+			   	 _self.personal_info.taOccupation = _self.form.profession;	
+			   }else{
+				   _self.personal_info.taOccupation = '';
 			   }
 			   if(_self.form.other.length>0){
 					_self.personal_info.taOther = _self.form.other;
+			   }else{
+				   _self.personal_info.taOther = '';
 			   }
 			   console.log('步骤3'+JSON.stringify(_self.personal_info))
 				//_self.personal_info.step3= _self.form;
@@ -335,7 +339,14 @@
 					
 					
 					////
-					if(personal_info.taAgeRange!=null){
+					if(personal_info.taAgeRange!=null){
+						let index = _self.age_ranges.findIndex(item => item.value === personal_info.taAgeRange);
+						if(index>=0){
+							  _self.defaultData.ageRange = [index]
+							 _self.form.age_range = _self.age_ranges[index].name;
+							 _self.form.age_rangeId = _self.age_ranges[index].value;
+						}
+						/*
 						 for(let i = 0;i< _self.age_ranges.length;i++)
 						 {
 							 if(personal_info.taAgeRange.indexOf(_self.age_ranges[i].value)>=0)
@@ -344,9 +355,16 @@
 								_self.form.age_rangeId = _self.age_ranges[i].value; 
 																	 
 							 } 						
-						 }
+						 }*/
 					}   
-					if(personal_info.taEdu!=null){
+					if(personal_info.taEdu!=null){
+						let index = _self.education_ranges.findIndex(item => item.value === personal_info.taEdu);
+						if(index>=0){
+							  _self.defaultData.education = [index]
+							 _self.form.education = _self.education_ranges[index].name;
+							 _self.form.educationId = _self.education_ranges[index].value;
+						}
+						/*
 						 for(let i = 0;i< _self.education_ranges.length;i++)
 						 {
 							 if(personal_info.taEdu.indexOf(_self.education_ranges[i].value)>=0)
@@ -355,9 +373,16 @@
 								_self.form.educationId = _self.education_ranges[i].value; 
 																	 
 							 } 						
-						 }
+						 }*/
 					}   
-					if(personal_info.taIncomeRange!=null){
+					if(personal_info.taIncomeRange!=null){
+						let index = _self.salary_ranges.findIndex(item => item.value === personal_info.taIncomeRange);
+						if(index>=0){
+							  _self.defaultData.salary_range = [index]
+							 _self.form.salary_range = _self.salary_ranges[index].name;
+							 _self.form.salary_rangeId = _self.salary_ranges[index].value;
+						}
+						/*
 						 for(let i = 0;i< _self.salary_ranges.length;i++)
 						 {
 							 if(personal_info.taIncomeRange.indexOf(_self.salary_ranges[i].value)>=0)
@@ -366,7 +391,7 @@
 								_self.form.salary_rangeId = _self.salary_ranges[i].value; 
 																	 
 							 } 						
-						 }
+						 }*/
 					}