Ver código fonte

Merge branch 'master' of http://47.92.161.104:10080/zkx/jp-xqjy

wkyy 3 anos atrás
pai
commit
6096deaec4

+ 1 - 1
apis/city.js

@@ -192,7 +192,7 @@ export function getCityData(id){
 	if(province == null)
 		return ''
  	let name =  province.name +'-'+city.name +'-'+area.name;
-	console.log('name '+name);
+//	console.log('name '+name);
 	return name;
 	
 }

+ 1 - 8
pages.json

@@ -12,14 +12,7 @@
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
-		{
-			"name":"欢迎页",
-			"path": "pages/user/test",
-			"style": {
-			
-				//"navigationStyle": "custom" // 隐藏系统导航栏
-			}
-		},
+		 
 		{
 			"name":"首页",
 			"path": "pages/index/index",

+ 2 - 2
pages/friend/personal.vue

@@ -108,7 +108,7 @@
 								<span v-for="(item,index) in hobbyList"
 								:key="index"
 								>{{item.hobbyName}}</span>
-						
+								<view v-if="islogin&&hobbyList.length==0">暂未填写</view>
 							</view>
 						</view>
 					</view>
@@ -120,7 +120,7 @@
 					</view>
 					<view class="personal-con">
 						<view class="personal-text">
-							{{detail.selfEvaluation}}
+							{{detail.selfEvaluation?detail.selfEvaluation:'暂未填写'}}
  						</view>
 					</view>
 				</view>

+ 1 - 1
pages/index/index.vue

@@ -30,7 +30,7 @@
 			v-for="(item ,index) in list" :key="item.id" >
 				<view class="homeUser-add">
 					<u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
-					<span>{{item.workplaceN}}</span>
+					<span>{{item.orgAreaName}}</span>
 				</view>
 				<view class="homeUser-text">
 					<view class="homeUser-name">

+ 1 - 0
pages/user/edit.vue

@@ -428,6 +428,7 @@
 						for(let i = 0;i< _self.base_dictionary.xlList.length;i++)
 						{
 							_self.base_dictionary.xlList[i].label = _self.base_dictionary.xlList[i].name;
+							
 						}
 						
 						//console.log('学历'+JSON.stringify(_self.base_dictionary.xlList.length))

+ 33 - 5
pages/user/index.vue

@@ -9,7 +9,7 @@
 				<view class="userHead-name">
 					<h2>{{personalInfo.realName}}</h2>
 					<!-- <h2>注册/登录</h2> -->
-					<view class="userHead-icon" v-show="personalInfo.status == 1">
+					<view class="userHead-icon" v-show="Number(personalInfo.status) == 1">
 						<u-icon custom-prefix="custom-icon" name="shield-user-fill" color="#fff"></u-icon>
 						<span >认证会员</span>
 					</view>
@@ -47,7 +47,7 @@
 					<h4>公开我的资料</h4>
 				</view>
 				<view class="user-cell-r">
-					<u-switch v-if='logined' v-model="personalInfo.publicNot"></u-switch>
+					<u-switch v-if='logined' v-model="personalInfo.publicNot" @input='updatePublicNot' ></u-switch>
 					<u-switch v-else  ></u-switch>
 				</view>
 			</view>
@@ -117,6 +117,7 @@
 			return {
 				phone:'13623239823',
 				checked: false,
+				publicNot:false,
 				personalInfo:{
 					realName:'',
 					publicNot:true,
@@ -130,7 +131,30 @@
 			}
 
 		},
+		 
 		methods:{
+			change(status) {
+				console.log(status);
+			},
+			updatePublicNot(e){
+				console.log('updatePublicNot'+JSON.stringify(_self.personalInfo))
+				_self.personalInfo.publicNot = !_self.publicNot;
+				let personal_info = {};
+				personal_info.type = 1;
+				personal_info.publicNot = _self.personalInfo.publicNot;
+				
+				//let personalInfo = this.carhelp.getPersonInfo();
+				personal_info.id = _self.personalInfo.id;
+				console.log('提交结果'+JSON.stringify(personal_info))
+				loginApi.save_personal_info(personal_info).then(function(data){
+					console.log('保存成功'+JSON.stringify(data));
+						
+					
+				},function(err){
+					_self.personalInfo.publicNot = !_self.personalInfo.publicNot;
+					console.log('保存失败'+JSON.stringify(err));
+				});
+			},
 			changePhone(){
 				if(!_self.logined)
 					return;
@@ -191,12 +215,13 @@
 			improvePersonalInfo(){
 				if(!_self.logined)
 					return;
-				console.log('完善个人资料')
+//				console.log('完善个人资料')
 				uni.navigateTo({
 					url: '../../pagesB/pages/login/step1'
 				})
 			},
 			findByOpenId(){
+				console.log('findByOpenId')
 				var openId=this.carhelp.getOpenId()
 				if(openId==""){
 					console.log("------------------")
@@ -218,7 +243,7 @@
 				}).then((response) => {
 					console.log('findByOpenId')
 					let [error, res] = response;
-					console.log('res'+JSON.stringify(res))
+//					console.log('res'+JSON.stringify(res))
 					if (res.data.code == 200 && res.data.result) {									 
 						var token = res ? res.data.data.token : '';			
 						
@@ -238,6 +263,9 @@
 				let personalInfo = this.carhelp.getPersonInfo();
 				console.log('个人信息'+JSON.stringify(personalInfo));
 				this.personalInfo = personalInfo;
+				/*if(this.personalInfo.publicNot!=null){
+					this.checked = this.personalInfo.publicNot;
+				}*/
 				if(this.personalInfo.phone != null)
 				{
 					let phone = this.personalInfo.phone;
@@ -403,7 +431,7 @@
 		}, 
 		onLoad(){
 			 _self = this;
-			
+			 console.log('mylogined onLoad')
 		},
 		onShow(){
 			console.log('mylogined onShow');

+ 5 - 2
pages/user/message.vue

@@ -2,11 +2,13 @@
   <view>
 	<u-navbar title="留言"></u-navbar>	
 	<view class="message">
+		<u-notice-bar style="position: sticky;top:40px" mode="horizontal" :list="noticebar"></u-notice-bar>
+		
 		 <scroll-view id="scrollview" class="chat-window" scroll-y="true" :style="{height: style.contentViewHeight + 'px'}" :scroll-with-animation="true" :scroll-top="scrollTop">
 			<view class="cu-chat">
 				<view class="messageRecord">
-					<u-divider  style="background-color: #ffffff;" >最多显示40条信息,可尝试索要微信聊天噢</u-divider>
-					
+				<u-divider  style="background-color: #ffffff;"  v-if="list.length ==40" >最多显示40条信息</u-divider>
+				
 					
 					<template v-for="(item ,index) in list"  > 
 						
@@ -55,6 +57,7 @@
 	export default {
 		data() {
 			return {
+				noticebar:["请勿随意泄露个人信息谨防诈骗,如合适请添加对方微信。"],
 				beMemberId:"",
 				src1: '/static/img/sexMan.png',
 				src2:'/static/img/sexWoman.png',

+ 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; 
 																	 
 							 } 						
-						 }
+						 }*/
 					}