|
@ -19,6 +19,7 @@ Page({ |
|
|
position: String, |
|
|
position: String, |
|
|
streets:[], |
|
|
streets:[], |
|
|
streetsIndex:Number, |
|
|
streetsIndex:Number, |
|
|
|
|
|
streetsID:String, |
|
|
age:String, |
|
|
age:String, |
|
|
gender:['','男','女'], |
|
|
gender:['','男','女'], |
|
|
genderIndex:Number, |
|
|
genderIndex:Number, |
|
@ -41,7 +42,6 @@ Page({ |
|
|
this.setData({ close: false }); |
|
|
this.setData({ close: false }); |
|
|
}, |
|
|
}, |
|
|
vantConfirm(){ |
|
|
vantConfirm(){ |
|
|
|
|
|
|
|
|
this.setData({ |
|
|
this.setData({ |
|
|
realData:this.data.tempData |
|
|
realData:this.data.tempData |
|
|
}) |
|
|
}) |
|
@ -104,7 +104,7 @@ Page({ |
|
|
phone: options.userPhone || '', |
|
|
phone: options.userPhone || '', |
|
|
company: options.company || '', |
|
|
company: options.company || '', |
|
|
position: options.position || '', |
|
|
position: options.position || '', |
|
|
streetsIndex:options.street || '', |
|
|
streetsID:options.street || '',//得到streetsID的值
|
|
|
age:options.age || '', |
|
|
age:options.age || '', |
|
|
genderIndex:options.genderIndex || '', |
|
|
genderIndex:options.genderIndex || '', |
|
|
educationIndex:options.education || '', |
|
|
educationIndex:options.education || '', |
|
@ -119,12 +119,14 @@ Page({ |
|
|
streett[index] = value.departName |
|
|
streett[index] = value.departName |
|
|
}) |
|
|
}) |
|
|
streett.unshift('') |
|
|
streett.unshift('') |
|
|
// console.log(streett)
|
|
|
|
|
|
this.setData({ |
|
|
this.setData({ |
|
|
streets: streett |
|
|
streets: streett//得到street列表
|
|
|
|
|
|
}) |
|
|
|
|
|
resultss.forEach((value,index)=>{ |
|
|
|
|
|
if(value.id == this.data.streetsID){ |
|
|
|
|
|
return this.setData({streetsIndex: index+1}) |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
// console.log("查看data里streets的值");
|
|
|
|
|
|
// console.log(this.data.streetsIndex);
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -175,11 +177,11 @@ Page({ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
bindNickNameInput(e){ |
|
|
// bindNickNameInput(e){
|
|
|
this.setData({ |
|
|
// this.setData({
|
|
|
nickName:e.detail.value |
|
|
// nickName:e.detail.value
|
|
|
}) |
|
|
// })
|
|
|
}, |
|
|
// },
|
|
|
// bindPhoneInput(e) {
|
|
|
// bindPhoneInput(e) {
|
|
|
// this.setData({
|
|
|
// this.setData({
|
|
|
// phone: e.detail.value
|
|
|
// phone: e.detail.value
|
|
@ -206,8 +208,14 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
bindstreetChange:function(e){ |
|
|
bindstreetChange:function(e){ |
|
|
|
|
|
// console.log("bindstreetChange");
|
|
|
|
|
|
// console.log(e.detail.value);
|
|
|
|
|
|
var i = e.detail.value-1 |
|
|
|
|
|
topicModel.getStreetList(res=>{ |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
streetsIndex:e.detail.value |
|
|
streetsIndex:e.detail.value, |
|
|
|
|
|
streetsID:res.result[i].id |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
onTapPhone:function(){ |
|
|
onTapPhone:function(){ |
|
@ -216,15 +224,15 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
submit(){ |
|
|
submit(){ |
|
|
console.log("submit"); |
|
|
// console.log("submit");
|
|
|
console.log(this.data); |
|
|
// console.log(this.data);
|
|
|
userModel.updateUserInfo(this.data, res => { |
|
|
userModel.updateUserInfo(this.data, res => { |
|
|
if(res.code === 200){ |
|
|
if(res.code === 200){ |
|
|
store.saveUserInfo({ |
|
|
store.saveUserInfo({ |
|
|
nickName: this.data.nickName, |
|
|
nickName: this.data.nickName, |
|
|
avatarUrl: this.data.avatarUrl, |
|
|
avatarUrl: this.data.avatarUrl, |
|
|
phone: this.data.phone || '', |
|
|
phone: this.data.phone || '', |
|
|
departId:this.data.streetsIndex, |
|
|
departId:this.data.streetsID, |
|
|
age:this.data.age, |
|
|
age:this.data.age, |
|
|
gender:this.data.genderIndex, |
|
|
gender:this.data.genderIndex, |
|
|
company:this.data.company, |
|
|
company:this.data.company, |
|
|