|
@ -14,12 +14,98 @@ Page({ |
|
|
phone: String, |
|
|
phone: String, |
|
|
company: String, |
|
|
company: String, |
|
|
position: String, |
|
|
position: String, |
|
|
|
|
|
street:String, |
|
|
|
|
|
age:String, |
|
|
|
|
|
gender:['','男','女'], |
|
|
|
|
|
genderIndex:Number, |
|
|
|
|
|
educationIndex:Number, |
|
|
|
|
|
education:['','高中','专科','本科','硕士','博士'], |
|
|
|
|
|
professionalTitle:String, |
|
|
|
|
|
talentTitle:String, |
|
|
|
|
|
prize:String, |
|
|
|
|
|
show: false, |
|
|
|
|
|
tempData:String, |
|
|
|
|
|
realData:String, |
|
|
|
|
|
type:String, |
|
|
|
|
|
value:String, |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getUserInfo(event) { |
|
|
|
|
|
console.log(event.detail); |
|
|
|
|
|
}, |
|
|
|
|
|
onClose() { |
|
|
|
|
|
this.setData({ close: false }); |
|
|
|
|
|
}, |
|
|
|
|
|
vantConfirm(){ |
|
|
|
|
|
console.log("vant confirm"); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
realData:this.data.tempData |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(this.data.realData); |
|
|
|
|
|
if(this.data.type === 'userName'){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
nickName:this.data.realData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if(this.data.type === 'userPhone'){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
phone:this.data.realData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if(this.data.type === 'userStreet'){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
street:this.data.realData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if(this.data.type === 'userAge'){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
age:this.data.realData |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
if(this.data.type === 'workUnit'){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
workUnit:this.data.realData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if(this.data.type === 'position'){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
position:this.data.realData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if(this.data.type === 'workUnit'){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
company:this.data.realData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if(this.data.type === 'userProfessionalTitle'){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
professionalTitle:this.data.realData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if(this.data.type === 'userTalentTitle'){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
talentTitle:this.data.realData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if(this.data.type === 'userPrize'){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
prize:this.data.realData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
value:'' |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
tempData: function(e){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
tempData:e.detail.value |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
|
|
*/ |
|
|
|
|
|
onLoad: function (options) { |
|
|
onLoad: function (options) { |
|
|
|
|
|
console.log("index.js"); |
|
|
console.log(options) |
|
|
console.log(options) |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
avatarUrl: options.userIcon, |
|
|
avatarUrl: options.userIcon, |
|
@ -27,18 +113,34 @@ Page({ |
|
|
phone: options.userPhone || '', |
|
|
phone: options.userPhone || '', |
|
|
company: options.company || '', |
|
|
company: options.company || '', |
|
|
position: options.position || '', |
|
|
position: options.position || '', |
|
|
|
|
|
street:options.street || '', |
|
|
|
|
|
age:options.age || '', |
|
|
|
|
|
genderIndex:options.genderIndex || '', |
|
|
|
|
|
educationIndex:options.education || '', |
|
|
|
|
|
professionalTitle:options.professionalTitle || '', |
|
|
|
|
|
talentTitle:options.talentTitle || '', |
|
|
|
|
|
prize:options.prize || '', |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
//性别和学历有专门的bind方法。此方法修改年龄,工作单位,职务,职称等
|
|
|
onTapItem(e) { |
|
|
onTapItem(e) { |
|
|
const { type } = e.currentTarget.dataset |
|
|
const { type } = e.currentTarget.dataset |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
type:type |
|
|
|
|
|
}) |
|
|
console.log(type) |
|
|
console.log(type) |
|
|
|
|
|
//如果等于userIcon调用upload方法更新头像
|
|
|
if(type === 'userIcon'){ |
|
|
if(type === 'userIcon'){ |
|
|
this.upload() |
|
|
this.upload() |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
show:true |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
upload(){ |
|
|
upload(){ |
|
|
let that = this |
|
|
let that = this |
|
|
|
|
|
|
|
|
wx.chooseImage({ |
|
|
wx.chooseImage({ |
|
|
success(res) { |
|
|
success(res) { |
|
|
wx.showLoading() |
|
|
wx.showLoading() |
|
@ -89,13 +191,38 @@ Page({ |
|
|
// position: e.detail.value
|
|
|
// position: e.detail.value
|
|
|
// })
|
|
|
// })
|
|
|
// },
|
|
|
// },
|
|
|
|
|
|
bindGenderChange: function(e) { |
|
|
|
|
|
console.log("bindGenderChange"); |
|
|
|
|
|
console.log(e); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
genderIndex:e.detail.value |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(this.data.genderIndex); |
|
|
|
|
|
}, |
|
|
|
|
|
bindEducationChange:function(e){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
educationIndex:e.detail.value |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(this.data.educationIndex); |
|
|
|
|
|
}, |
|
|
submit(){ |
|
|
submit(){ |
|
|
|
|
|
console.log("submit"); |
|
|
|
|
|
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.street, |
|
|
|
|
|
age:this.data.age, |
|
|
|
|
|
gender:this.data.genderIndex,//
|
|
|
|
|
|
company:this.data.company, |
|
|
|
|
|
position:this.data.position, |
|
|
|
|
|
education:this.data.educationIndex,//
|
|
|
|
|
|
title:this.data.professionalTitle, |
|
|
|
|
|
designation:this.data.talentTitle, |
|
|
|
|
|
honor:this.data.prize |
|
|
}) |
|
|
}) |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: '修改成功', |
|
|
title: '修改成功', |
|
|