|
|
@ -2,6 +2,9 @@ |
|
|
|
import { store } from '../../../utils/store.js' |
|
|
|
import { config } from '../../../config.js' |
|
|
|
import { UserModel } from '../../../models/user.js' |
|
|
|
import { TopicModel } from '../../../models/topic.js' |
|
|
|
|
|
|
|
let topicModel = new TopicModel() |
|
|
|
let userModel = new UserModel() |
|
|
|
Page({ |
|
|
|
|
|
|
@ -14,7 +17,8 @@ Page({ |
|
|
|
phone: String, |
|
|
|
company: String, |
|
|
|
position: String, |
|
|
|
street:String, |
|
|
|
streets:[], |
|
|
|
streetsIndex:Number, |
|
|
|
age:String, |
|
|
|
gender:['','男','女'], |
|
|
|
genderIndex:Number, |
|
|
@ -31,37 +35,26 @@ Page({ |
|
|
|
}, |
|
|
|
|
|
|
|
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({ |
|
|
@ -105,15 +98,13 @@ Page({ |
|
|
|
}, |
|
|
|
|
|
|
|
onLoad: function (options) { |
|
|
|
console.log("index.js"); |
|
|
|
console.log(options) |
|
|
|
this.setData({ |
|
|
|
avatarUrl: options.userIcon, |
|
|
|
nickName: options.userName, |
|
|
|
phone: options.userPhone || '', |
|
|
|
company: options.company || '', |
|
|
|
position: options.position || '', |
|
|
|
street:options.street || '', |
|
|
|
streetsIndex:options.street || '', |
|
|
|
age:options.age || '', |
|
|
|
genderIndex:options.genderIndex || '', |
|
|
|
educationIndex:options.education || '', |
|
|
@ -121,15 +112,28 @@ Page({ |
|
|
|
talentTitle:options.talentTitle || '', |
|
|
|
prize:options.prize || '', |
|
|
|
}) |
|
|
|
topicModel.getStreetList(res=>{ |
|
|
|
var resultss = res.result |
|
|
|
var streett = [] |
|
|
|
resultss.forEach((value,index)=>{ |
|
|
|
streett[index] = value.departName |
|
|
|
}) |
|
|
|
streett.unshift('') |
|
|
|
// console.log(streett)
|
|
|
|
this.setData({ |
|
|
|
streets: streett |
|
|
|
}) |
|
|
|
// console.log("查看data里streets的值");
|
|
|
|
// console.log(this.data.streetsIndex);
|
|
|
|
}) |
|
|
|
}, |
|
|
|
//性别和学历有专门的bind方法。此方法修改年龄,工作单位,职务,职称等
|
|
|
|
|
|
|
|
onTapItem(e) { |
|
|
|
const { type } = e.currentTarget.dataset |
|
|
|
this.setData({ |
|
|
|
type:type |
|
|
|
}) |
|
|
|
console.log(type) |
|
|
|
//如果等于userIcon调用upload方法更新头像
|
|
|
|
|
|
|
|
if(type === 'userIcon'){ |
|
|
|
this.upload() |
|
|
|
}else{ |
|
|
@ -145,7 +149,7 @@ Page({ |
|
|
|
success(res) { |
|
|
|
wx.showLoading() |
|
|
|
const tempFilePaths = res.tempFilePaths |
|
|
|
console.log(res) |
|
|
|
// console.log(res)
|
|
|
|
const token = store.readToken() |
|
|
|
wx.uploadFile({ |
|
|
|
url: config.api_url + "/api/common/upload", |
|
|
@ -156,7 +160,7 @@ Page({ |
|
|
|
}, |
|
|
|
name: 'files', |
|
|
|
success(res) { |
|
|
|
console.log(res); |
|
|
|
// console.log(res);
|
|
|
|
const data = JSON.parse(res.data) |
|
|
|
const image = { |
|
|
|
url: config.api_url + '/' + data.result.imgUrl, |
|
|
@ -192,18 +196,24 @@ Page({ |
|
|
|
// })
|
|
|
|
// },
|
|
|
|
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); |
|
|
|
}, |
|
|
|
bindstreetChange:function(e){ |
|
|
|
this.setData({ |
|
|
|
streetsIndex:e.detail.value |
|
|
|
}) |
|
|
|
}, |
|
|
|
onTapPhone:function(){ |
|
|
|
wx.navigateTo({ |
|
|
|
url:'../myInfo/register/index' |
|
|
|
}) |
|
|
|
}, |
|
|
|
submit(){ |
|
|
|
console.log("submit"); |
|
|
@ -214,12 +224,12 @@ Page({ |
|
|
|
nickName: this.data.nickName, |
|
|
|
avatarUrl: this.data.avatarUrl, |
|
|
|
phone: this.data.phone || '', |
|
|
|
departId:this.data.street, |
|
|
|
departId:this.data.streetsIndex, |
|
|
|
age:this.data.age, |
|
|
|
gender:this.data.genderIndex,//
|
|
|
|
gender:this.data.genderIndex, |
|
|
|
company:this.data.company, |
|
|
|
position:this.data.position, |
|
|
|
education:this.data.educationIndex,//
|
|
|
|
education:this.data.educationIndex, |
|
|
|
title:this.data.professionalTitle, |
|
|
|
designation:this.data.talentTitle, |
|
|
|
honor:this.data.prize |
|
|
|