瀏覽代碼

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

zhengkaixin 3 年之前
父節點
當前提交
059b4a49de
共有 6 個文件被更改,包括 201 次插入74 次删除
  1. 3 3
      apis/login.js
  2. 112 10
      pages/user/edit.vue
  3. 2 2
      pages/user/index.vue
  4. 56 49
      pagesB/pages/login/step1.vue
  5. 14 4
      pagesB/pages/login/step2.vue
  6. 14 6
      utils/request.js

+ 3 - 3
apis/login.js

@@ -6,11 +6,11 @@ import requestSon from '../utils/requestSon.js';
 export function changePublicNot(data){
 export function changePublicNot(data){
 	var url = '/mobile/member/changePublicnot';
 	var url = '/mobile/member/changePublicnot';
 		
 		
-		return requestSon({
+		return request({
 			method: 'post', 	
 			method: 'post', 	
-			 header:{'Content-Type': 'application/json',
+/*			 header:{'Content-Type': 'application/json',
 			 //		'X-Requested-With': 'XMLHttpRequest',
 			 //		'X-Requested-With': 'XMLHttpRequest',
-				},
+				},*/
 			data:data,
 			data:data,
 			url: url
 			url: url
 		})
 		})

+ 112 - 10
pages/user/edit.vue

@@ -364,8 +364,13 @@
 			//console.log('personalInfoPlus'+JSON.stringify(personalInfoPlus))
 			//console.log('personalInfoPlus'+JSON.stringify(personalInfoPlus))
 			this.personal_info = this.carhelp.getPersonInfo();	
 			this.personal_info = this.carhelp.getPersonInfo();	
 //			console.log('个人信息'+JSON.stringify(this.personal_info))
 //			console.log('个人信息'+JSON.stringify(this.personal_info))
-			let subject = {subject:''}		
+			let subject = {subject:''}	
+			uni.showLoading({
+				title: "加载中",
+				mask: true,
+			})
 			loginApi.getBaseDictionary(subject).then(function(data){
 			loginApi.getBaseDictionary(subject).then(function(data){
+				uni.hideLoading();
 				//console.log('基础字典'+JSON.stringify(data));
 				//console.log('基础字典'+JSON.stringify(data));
 				let personal_info = _self.carhelp.getPersonInfo();
 				let personal_info = _self.carhelp.getPersonInfo();
 				if(data.data)
 				if(data.data)
@@ -377,10 +382,20 @@
 						{
 						{
 							_self.base_dictionary.zfqkList[i].label = _self.base_dictionary.zfqkList[i].name;
 							_self.base_dictionary.zfqkList[i].label = _self.base_dictionary.zfqkList[i].name;
 						}
 						}
+						if(_self.personal_info.housingSituation!=null)
+						{						 
+							let index = _self.base_dictionary.zfqkList.findIndex(item => item.value === personal_info.housingSituation);
+							if(index>=0){
+								  _self.defaultData.house_status = [index]
+								 _self.personal_info.housingSituationN = _self.base_dictionary.zfqkList[index].name;
+								 _self.personal_info.housingSituation = _self.base_dictionary.zfqkList[index].value;
+							}
+						}
+						/*
 						if(_self.personal_info.housingSituation!=null && _self.personal_info.housingSituation<= _self.base_dictionary.zfqkList.length)
 						if(_self.personal_info.housingSituation!=null && _self.personal_info.housingSituation<= _self.base_dictionary.zfqkList.length)
 						{
 						{
 							_self.personal_info.housingSituationN =_self.base_dictionary.zfqkList[_self.personal_info.housingSituation-1].label						
 							_self.personal_info.housingSituationN =_self.base_dictionary.zfqkList[_self.personal_info.housingSituation-1].label						
-						}
+						}*/
 					}
 					}
 					
 					
 					//console.log('住房情况'+JSON.stringify(_self.base_dictionary.zfqkList));
 					//console.log('住房情况'+JSON.stringify(_self.base_dictionary.zfqkList));
@@ -390,6 +405,25 @@
 						{
 						{
 							_self.base_dictionary.yxList[i].label = _self.base_dictionary.yxList[i].name;
 							_self.base_dictionary.yxList[i].label = _self.base_dictionary.yxList[i].name;
 						}
 						}
+						if(_self.personal_info.salaryRange!=null)
+						{						 
+							let index = _self.base_dictionary.yxList.findIndex(item => item.value === personal_info.salaryRange);
+							if(index>=0){
+								  _self.defaultData.salary_range = [index]
+								 _self.personal_info.salaryRangeN = _self.base_dictionary.yxList[index].name;
+								 _self.personal_info.salaryRange = _self.base_dictionary.yxList[index].value;
+							}
+						}
+						if(_self.personal_info.taIncomeRange!=null)
+						{						 
+							let index = _self.base_dictionary.yxList.findIndex(item => item.value === personal_info.taIncomeRange);
+							if(index>=0){
+								  _self.defaultData.ta_salary_range = [index]
+								 _self.personal_info.taIncomeRangeN = _self.base_dictionary.yxList[index].name;
+								 _self.personal_info.taIncomeRange = _self.base_dictionary.yxList[index].value;
+							}
+						}
+						/*
 						if(_self.personal_info.salaryRange!=null && _self.personal_info.salaryRange<= _self.base_dictionary.yxList.length)
 						if(_self.personal_info.salaryRange!=null && _self.personal_info.salaryRange<= _self.base_dictionary.yxList.length)
 						{
 						{
 							_self.personal_info.salaryRangeN =_self.base_dictionary.yxList[_self.personal_info.salaryRange-1].label						
 							_self.personal_info.salaryRangeN =_self.base_dictionary.yxList[_self.personal_info.salaryRange-1].label						
@@ -397,7 +431,7 @@
 						if(_self.personal_info.taIncomeRange!=null && _self.personal_info.taIncomeRange<= _self.base_dictionary.yxList.length)
 						if(_self.personal_info.taIncomeRange!=null && _self.personal_info.taIncomeRange<= _self.base_dictionary.yxList.length)
 						{
 						{
 							_self.personal_info.taIncomeRangeN =_self.base_dictionary.yxList[_self.personal_info.taIncomeRange-1].label						
 							_self.personal_info.taIncomeRangeN =_self.base_dictionary.yxList[_self.personal_info.taIncomeRange-1].label						
-						}
+						}*/
 					}
 					}
 					
 					
 					//console.log('月薪情况'+JSON.stringify(_self.base_dictionary.yxList));
 					//console.log('月薪情况'+JSON.stringify(_self.base_dictionary.yxList));
@@ -407,10 +441,20 @@
 						{
 						{
 							_self.base_dictionary.znqkList[i].label = _self.base_dictionary.znqkList[i].name;
 							_self.base_dictionary.znqkList[i].label = _self.base_dictionary.znqkList[i].name;
 						}
 						}
+						if(_self.personal_info.childStatus!=null)
+						{						 
+							let index = _self.base_dictionary.znqkList.findIndex(item => item.value === personal_info.childStatus);
+							if(index>=0){
+								  _self.defaultData.children_status = [index]
+								 _self.personal_info.childStatusN = _self.base_dictionary.znqkList[index].name;
+								 _self.personal_info.childStatus = _self.base_dictionary.znqkList[index].value;
+							}
+						}
+						/*
 						if(_self.personal_info.childStatus!=null && _self.personal_info.childStatus<= _self.base_dictionary.znqkList.length)
 						if(_self.personal_info.childStatus!=null && _self.personal_info.childStatus<= _self.base_dictionary.znqkList.length)
 						{
 						{
 							_self.personal_info.childStatusN =_self.base_dictionary.znqkList[_self.personal_info.childStatus-1].label						
 							_self.personal_info.childStatusN =_self.base_dictionary.znqkList[_self.personal_info.childStatus-1].label						
-						}
+						}*/
 					} 
 					} 
 					//console.log('子女情况'+JSON.stringify(_self.base_dictionary.znqkList));
 					//console.log('子女情况'+JSON.stringify(_self.base_dictionary.znqkList));
 					/*
 					/*
@@ -429,18 +473,36 @@
 						{
 						{
 							_self.base_dictionary.xlList[i].label = _self.base_dictionary.xlList[i].name;
 							_self.base_dictionary.xlList[i].label = _self.base_dictionary.xlList[i].name;
 							
 							
+						} 
+						if(_self.personal_info.education!=null)
+						{						 
+							let index = _self.base_dictionary.xlList.findIndex(item => item.value === personal_info.education);
+							if(index>=0){
+								  _self.defaultData.education = [index]
+								 _self.personal_info.educationN = _self.base_dictionary.xlList[index].name;
+								 _self.personal_info.education = _self.base_dictionary.xlList[index].value;
+							}
+						}
+						if(_self.personal_info.taEdu!=null)
+						{
+							let index = _self.base_dictionary.xlList.findIndex(item => item.value === personal_info.taEdu);
+							if(index>=0){
+								  _self.defaultData.ta_education = [index]
+								 _self.personal_info.taEduN = _self.base_dictionary.xlList[index].name;
+								 _self.personal_info.taEdu = _self.base_dictionary.xlList[index].value;
+							}
 						}
 						}
-						
 						//console.log('学历'+JSON.stringify(_self.base_dictionary.xlList.length))
 						//console.log('学历'+JSON.stringify(_self.base_dictionary.xlList.length))
-						if(_self.personal_info.education!=null && _self.personal_info.education <= _self.base_dictionary.xlList.length)
+/*						if(_self.personal_info.education!=null && _self.personal_info.education <= _self.base_dictionary.xlList.length)
 						{
 						{
 							//console.log('学历'+JSON.stringify(_self.personal_info.education))
 							//console.log('学历'+JSON.stringify(_self.personal_info.education))
 							_self.personal_info.educationN =_self.base_dictionary.xlList[Number(_self.personal_info.education)-1].label						
 							_self.personal_info.educationN =_self.base_dictionary.xlList[Number(_self.personal_info.education)-1].label						
+							_self.defaultData.education = [Number(_self.personal_info.education)-1]
 						}
 						}
 						if(_self.personal_info.taEdu!=null && _self.personal_info.taEdu<= _self.base_dictionary.xlList.length)
 						if(_self.personal_info.taEdu!=null && _self.personal_info.taEdu<= _self.base_dictionary.xlList.length)
 						{
 						{
 							_self.personal_info.taEduN =_self.base_dictionary.xlList[_self.personal_info.taEdu-1].label						
 							_self.personal_info.taEduN =_self.base_dictionary.xlList[_self.personal_info.taEdu-1].label						
-						}
+						}*/
 					}
 					}
 					//console.log('学历情况'+JSON.stringify(_self.base_dictionary.xlList));
 					//console.log('学历情况'+JSON.stringify(_self.base_dictionary.xlList));
 					
 					
@@ -450,10 +512,20 @@
 						{
 						{
 							_self.base_dictionary.hyList[i].label = _self.base_dictionary.hyList[i].name;
 							_self.base_dictionary.hyList[i].label = _self.base_dictionary.hyList[i].name;
 						}
 						}
+						if(_self.personal_info.industry!=null)
+						{
+							let index = _self.base_dictionary.hyList.findIndex(item => item.value === personal_info.industry);
+							if(index>=0){
+								  _self.defaultData.profession = [index]
+								 _self.personal_info.industryN = _self.base_dictionary.hyList[index].name;
+								 _self.personal_info.industry = _self.base_dictionary.hyList[index].value;
+							}
+						}
+						/*
 						if(_self.personal_info.industry!=null && _self.personal_info.industry<= _self.base_dictionary.hyList.length)
 						if(_self.personal_info.industry!=null && _self.personal_info.industry<= _self.base_dictionary.hyList.length)
 						{
 						{
 							_self.personal_info.industryN =_self.base_dictionary.hyList[_self.personal_info.industry-1].label						
 							_self.personal_info.industryN =_self.base_dictionary.hyList[_self.personal_info.industry-1].label						
-						}
+						}*/
  					
  					
 					}
 					}
 //					console.log('行业情况'+JSON.stringify(_self.base_dictionary.hyList));
 //					console.log('行业情况'+JSON.stringify(_self.base_dictionary.hyList));
@@ -463,10 +535,20 @@
 						{
 						{
 							_self.base_dictionary.nlfwList[i].label = _self.base_dictionary.nlfwList[i].name;
 							_self.base_dictionary.nlfwList[i].label = _self.base_dictionary.nlfwList[i].name;
 						}
 						}
+						if(_self.personal_info.taAgeRange!=null)
+						{
+							let index = _self.base_dictionary.nlfwList.findIndex(item => item.value === personal_info.taAgeRange);
+							if(index>=0){
+								  _self.defaultData.ta_age_range = [index]
+								 _self.personal_info.taAgeRangeN = _self.base_dictionary.nlfwList[index].name;
+								 _self.personal_info.taAgeRange = _self.base_dictionary.nlfwList[index].value;
+							}
+						}
+						/*
 						if(_self.personal_info.taAgeRange!=null && _self.personal_info.taAgeRange<= _self.base_dictionary.nlfwList.length)
 						if(_self.personal_info.taAgeRange!=null && _self.personal_info.taAgeRange<= _self.base_dictionary.nlfwList.length)
 						{
 						{
 							_self.personal_info.taAgeRangeN =_self.base_dictionary.nlfwList[_self.personal_info.taAgeRange-1].label						
 							_self.personal_info.taAgeRangeN =_self.base_dictionary.nlfwList[_self.personal_info.taAgeRange-1].label						
-						}
+						}*/
 					}
 					}
 					//console.log('年龄范围'+JSON.stringify(_self.base_dictionary.nlfwList));
 					//console.log('年龄范围'+JSON.stringify(_self.base_dictionary.nlfwList));
 					if(_self.base_dictionary.hyqkList){ 
 					if(_self.base_dictionary.hyqkList){ 
@@ -475,10 +557,20 @@
 						{
 						{
 							_self.base_dictionary.hyqkList[i].label = _self.base_dictionary.hyqkList[i].name;
 							_self.base_dictionary.hyqkList[i].label = _self.base_dictionary.hyqkList[i].name;
 						}
 						}
+						if(_self.personal_info.maritalStatus!=null)
+						{
+							let index = _self.base_dictionary.hyqkList.findIndex(item => item.value === personal_info.maritalStatus);
+							if(index>=0){
+								  _self.defaultData.ta_age_range = [index]
+								 _self.personal_info.maritalStatusN = _self.base_dictionary.hyqkList[index].name;
+								 _self.personal_info.maritalStatus = _self.base_dictionary.hyqkList[index].value;
+							}
+						}
+						/*
 						if(_self.personal_info.maritalStatus!=null && _self.personal_info.maritalStatus<= _self.base_dictionary.hyqkList.length)
 						if(_self.personal_info.maritalStatus!=null && _self.personal_info.maritalStatus<= _self.base_dictionary.hyqkList.length)
 						{
 						{
 							_self.personal_info.maritalStatusN =_self.base_dictionary.hyqkList[_self.personal_info.maritalStatus-1].label						
 							_self.personal_info.maritalStatusN =_self.base_dictionary.hyqkList[_self.personal_info.maritalStatus-1].label						
-						}
+						}*/
 					}
 					}
 					//console.log('婚姻情况'+JSON.stringify(_self.base_dictionary.hyqkList));
 					//console.log('婚姻情况'+JSON.stringify(_self.base_dictionary.hyqkList));
 					if(_self.base_dictionary.hobbyInfoList){ 
 					if(_self.base_dictionary.hobbyInfoList){ 
@@ -516,6 +608,7 @@
 				} 
 				} 
 			},function(err){
 			},function(err){
 				console.log('获取基础字典错误'+JSON.stringify(err))
 				console.log('获取基础字典错误'+JSON.stringify(err))
+				uni.hideLoading();
 			}) 
 			}) 
 						
 						
 			for(let i = 130;i<=220;i++)
 			for(let i = 130;i<=220;i++)
@@ -535,17 +628,25 @@
 				if(this.personal_info.height)
 				if(this.personal_info.height)
 				{
 				{
 					this.form.height = this.personal_info.height+'cm'
 					this.form.height = this.personal_info.height+'cm'
+					_self.defaultData.height = [_self.height_ranges.findIndex(item => item.value === _self.personal_info.height)]
+					
 					
 					
 				}
 				}
 				if(this.personal_info.weight)
 				if(this.personal_info.weight)
 				{
 				{
 					this.form.weight = this.personal_info.weight+'kg'
 					this.form.weight = this.personal_info.weight+'kg'
+					_self.defaultData.weight = [_self.weight_ranges.findIndex(item => item.value === _self.personal_info.weight)]
 					
 					
 				}
 				}
 			}
 			}
 			
 			
 			if(provinceData.length<=0){
 			if(provinceData.length<=0){
+				  uni.showLoading({
+				  	title: "加载中",
+				  	mask: true,
+				  })	
 				  loginApi.getCityList().then(function(data){
 				  loginApi.getCityList().then(function(data){
+					uni.hideLoading();
 //					console.log('获取城市成功'+JSON.stringify(data));
 //					console.log('获取城市成功'+JSON.stringify(data));
 					if(data.result &&  data.data){
 					if(data.result &&  data.data){
 						setCityData(data.data);
 						setCityData(data.data);
@@ -578,6 +679,7 @@
 					
 					
 				  },function(err){
 				  },function(err){
 					console.log('获取城市列表错误'+JSON.stringify(err))
 					console.log('获取城市列表错误'+JSON.stringify(err))
+					uni.hideLoading();
 				  })		
 				  })		
 			}else{
 			}else{
 				_self.init_city_data();
 				_self.init_city_data();

+ 2 - 2
pages/user/index.vue

@@ -92,7 +92,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 			<view>
 			<view>
-				<u-modal v-model="show" @confirm="confirm" show-cancel-button=true ref="uModal" :asyncClose="true" :content="content"></u-modal>
+				<u-modal v-model="show" @confirm="confirm" show-cancel-button='true' ref="uModal" :asyncClose="true" :content="content"></u-modal>
 			</view>
 			</view>
 			<view class="user-cell-item" @click="logout">
 			<view class="user-cell-item" @click="logout">
 				<view class="user-cell-l">
 				<view class="user-cell-l">
@@ -144,7 +144,7 @@
 				let personal_info = {};
 				let personal_info = {};
 				//personal_info.type = 1;
 				//personal_info.type = 1;
 				personal_info.subject = '';
 				personal_info.subject = '';
-				personal_info.status = _self.personalInfo.publicNot;
+				personal_info.status = _self.personalInfo.publicNot?1:0;
 				console.log('publicNotx2 '+_self.personalInfo.publicNot)
 				console.log('publicNotx2 '+_self.personalInfo.publicNot)
 				
 				
 				//let personalInfo = this.carhelp.getPersonInfo();
 				//let personalInfo = this.carhelp.getPersonInfo();

+ 56 - 49
pagesB/pages/login/step1.vue

@@ -186,53 +186,60 @@
 //				this.weight_ranges.push(i.toString());
 //				this.weight_ranges.push(i.toString());
 				let weight_range = {value:i, label:i.toString()+"kg"};
 				let weight_range = {value:i, label:i.toString()+"kg"};
 				_self.weight_ranges_by_names.push(weight_range);
 				_self.weight_ranges_by_names.push(weight_range);
-			}
-			loginApi.getCityList().then(function(data){
-				//console.log('获取城市成功'+JSON.stringify(data));
-				if(data.result &&  data.data){
-					setCityData(data.data);
-					//_self.$refs.mpvuebirtydayCityPicker.setCityData(data.data);		
-					//console.log('province data '+JSON.stringify(provinceData))
-				}
-				let personal_info = _self.carhelp.getPersonInfo();
-				if(personal_info)
-				{
-//					console.log('个人信息'+JSON.stringify(personal_info))
-					if(personal_info.gender!=null){
-						if(personal_info.gender)
-							_self.form.sex = "female";
-						else
-							_self.form.sex = "male";
-					}
-					if(personal_info.idCard!=null){
-						 let idCard = personal_info.idCard;
-						 let birthday = idCard.substr(6,8);
-						_self.form.birthday = birthday.substr(0,4)+'-'+birthday.substr(4,2)+'-'+birthday.substr(6,2)
+			}
+			if(provinceData.length<=0){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				loginApi.getCityList().then(function(data){
+					//console.log('获取城市成功'+JSON.stringify(data));
+					if(data.result &&  data.data){
+						setCityData(data.data);
+						//_self.$refs.mpvuebirtydayCityPicker.setCityData(data.data);		
+						//console.log('province data '+JSON.stringify(provinceData))
+					}				
+					uni.hideLoading();
+				},function(err){
+					console.log('获取城市列表错误'+JSON.stringify(err))
+					uni.hideLoading();
+				})	
+			}					 
+			let personal_info = _self.carhelp.getPersonInfo();
+			if(personal_info)
+			{
+//					console.log('个人信息'+JSON.stringify(personal_info))
+				if(personal_info.gender!=null){
+					if(personal_info.gender)
+						_self.form.sex = "female";
+					else
+						_self.form.sex = "male";
+				}
+				if(personal_info.idCard!=null){
+					 let idCard = personal_info.idCard;
+					 let birthday = idCard.substr(6,8);
+					_self.form.birthday = birthday.substr(0,4)+'-'+birthday.substr(4,2)+'-'+birthday.substr(6,2)
 //personal_info.birthday;
 //personal_info.birthday;
-					 }
-					 /*
-					 if(personal_info.birthday!=null){
-						 let idCard = personal_info.idCard;
-						 let birthday = idCard.substr(6,8);
-					 	_self.form.birthday = birthday.substr(0,4)+'-'+birthday.substr(4,2)+'-'+birthday.substr(6,2)
-//personal_info.birthday;
-					 }*/
-					 if(personal_info.height!=null){
-					 	_self.form.height_val = personal_info.height;
-						_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)]
-					 } 
-				}
-				
- 			},function(err){
-				console.log('获取城市列表错误'+JSON.stringify(err))
-			})			 
+				 }
+				 /*
+				 if(personal_info.birthday!=null){
+					 let idCard = personal_info.idCard;
+					 let birthday = idCard.substr(6,8);
+					_self.form.birthday = birthday.substr(0,4)+'-'+birthday.substr(4,2)+'-'+birthday.substr(6,2)
+//personal_info.birthday;
+				 }*/
+				 if(personal_info.height!=null){
+					_self.form.height_val = personal_info.height;
+					_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)]
+				 } 
+			}
 			//#ifdef H5
 			//#ifdef H5
 			//_self.form.height = 150;
 			//_self.form.height = 150;
 			//_self.form.weight = 66;
 			//_self.form.weight = 66;
@@ -280,8 +287,8 @@
 				e.map((val, index) => {
 				e.map((val, index) => {
 					// this.result += this.result == '' ? val.label : '-' + val.label;
 					// this.result += this.result == '' ? val.label : '-' + val.label;
 					let result = val.label
 					let result = val.label
-					_self.height_val = val.value
-					this.form.height  += result;
+					_self.form.height_val = val.value
+ 					this.form.height  += result;
 				}) 
 				}) 
 			},
 			},
 			weightConfirm(e){
 			weightConfirm(e){
@@ -291,7 +298,7 @@
 				e.map((val, index) => {
 				e.map((val, index) => {
 					// this.result += this.result == '' ? val.label : '-' + val.label;
 					// this.result += this.result == '' ? val.label : '-' + val.label;
 					let result = val.label
 					let result = val.label
-					_self.weight_val = val.value;
+					_self.form.weight_val = val.value;
 					this.form.weight  += result;
 					this.form.weight  += result;
 				}) 
 				}) 
 			},
 			},

+ 14 - 4
pagesB/pages/login/step2.vue

@@ -190,8 +190,12 @@
 			_self = this;
 			_self = this;
 			let subject = {subject:''}		
 			let subject = {subject:''}		
 			 
 			 
-			
-			loginApi.getBaseDictionary(subject).then(function(data){
+			uni.showLoading({
+				title: "加载中",
+				mask: true,
+			})
+			loginApi.getBaseDictionary(subject).then(function(data){
+				uni.hideLoading();
 				//console.log('基础字典'+JSON.stringify(data));
 				//console.log('基础字典'+JSON.stringify(data));
 				let personal_info = _self.carhelp.getPersonInfo();
 				let personal_info = _self.carhelp.getPersonInfo();
 				if(data.data)
 				if(data.data)
@@ -304,6 +308,10 @@
 					{
 					{
 						//console.log('个人信息'+JSON.stringify(personal_info))
 						//console.log('个人信息'+JSON.stringify(personal_info))
 						 if(provinceData.length<=0){
 						 if(provinceData.length<=0){
+							 uni.showLoading({
+							 	title: "加载中",
+							 	mask: true,
+							 })
 							  loginApi.getCityList().then(function(data){
 							  loginApi.getCityList().then(function(data){
 				 //					console.log('获取城市成功'+JSON.stringify(data));
 				 //					console.log('获取城市成功'+JSON.stringify(data));
 								if(data.result &&  data.data){
 								if(data.result &&  data.data){
@@ -332,9 +340,10 @@
 																 
 																 
 									 }  
 									 }  
 								} 
 								} 
-								
+								uni.hideLoading();
 							  },function(err){
 							  },function(err){
 								console.log('获取城市列表错误'+JSON.stringify(err))
 								console.log('获取城市列表错误'+JSON.stringify(err))
+								uni.hideLoading();
 							  })		
 							  })		
 						}else{
 						}else{
 							_self.init_city_data();
 							_self.init_city_data();
@@ -494,7 +503,8 @@
 					}
 					}
 				} 
 				} 
 			},function(err){
 			},function(err){
-				console.log('获取基础字典错误'+JSON.stringify(err))
+				console.log('获取基础字典错误'+JSON.stringify(err))
+				uni.hideLoading();
 			}) 
 			}) 
 			_self.get_options();
 			_self.get_options();
 		},
 		},

+ 14 - 6
utils/request.js

@@ -32,8 +32,8 @@ const request = (options) => {
 		 
 		 
 		 
 		 
 		uni.request({
 		uni.request({
-			method:'get',
-			url: process.car.BASE_URL + "/mobile/regUser/findByOpenId",
+			method:options.method?options.method:'get',
+			url: options.url? options.url : process.car.BASE_URL + "/mobile/regUser/findByOpenId",
 			data: {
 			data: {
 				openId:openId,
 				openId:openId,
 			
 			
@@ -46,7 +46,7 @@ const request = (options) => {
 			}
 			}
 		}).then((response) => {
 		}).then((response) => {
  			let [error, res] = response;
  			let [error, res] = response;
- 		  
+ 		    console.log('response'+JSON.stringify(response))
 			if (res.data.code == 200&&res.data.result) {
 			if (res.data.code == 200&&res.data.result) {
 				
 				
 				var token = res ? res.data.data.token : '';
 				var token = res ? res.data.data.token : '';
@@ -58,15 +58,23 @@ const request = (options) => {
 				
 				
 				options.token=token
 				options.token=token
 				 
 				 
-			} else{
-				console.log("游客访问")
+			} else  if(res.data.code == 415||(res.data.code == 200&&!res.data.result)||res.data.code == 400){
+				
+				var url="var windowlocationhref".split("#")[1]
+				var windowlocationhref="#/pages/login/index?message=请登录&back="+ url+"&phone="+options.data.phone
+				
+			 
+				
+			}else{
+				console.log('response'+JSON.stringify(response))
+				reject(res.data.message)
 			}
 			}
 			var isson= requestSon(options)
 			var isson= requestSon(options)
 			//requestNum(options);
 			//requestNum(options);
 			resolve(isson);
 			resolve(isson);
 			
 			
 		}).catch(error => {
 		}).catch(error => {
-			
+			console.log('response'+JSON.stringify(error))
 			let [err, res] = error;
 			let [err, res] = error;
 			reject(err)
 			reject(err)
 		})
 		})