|
|
@@ -59,15 +59,32 @@ Page({ |
|
|
|
} |
|
|
|
}).then(res => { |
|
|
|
console.log(res, 'res') |
|
|
|
|
|
|
|
let avatarUrl = null |
|
|
|
if (res.data.avatarUrl) { |
|
|
|
avatarUrl = res.data.avatarUrl |
|
|
|
} else { |
|
|
|
avatarUrl = defaultAvatarUrl |
|
|
|
} |
|
|
|
|
|
|
|
let gender = null |
|
|
|
if (1 * res.data.sex) { |
|
|
|
gender = res.data.sex - 1 |
|
|
|
} else { |
|
|
|
gender = res.data.sex |
|
|
|
} |
|
|
|
|
|
|
|
let adress = null |
|
|
|
if (res.data.address) { |
|
|
|
adress = JSON.parse(res.data.address) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.setData({ |
|
|
|
avatarUrl: res.data.avatarUrl, |
|
|
|
avatarUrl: avatarUrl, |
|
|
|
nickName: res.data.nickName, |
|
|
|
username: res.data.name, |
|
|
|
gender: res.data.sex, |
|
|
|
gender: gender, |
|
|
|
sexFlag: 2, |
|
|
|
date: util.fmtDate(parseInt(res.data.birthdate)), |
|
|
|
dateFlag: res.data.birthdate ? 2 : 1, |
|
|
@@ -136,7 +153,7 @@ Page({ |
|
|
|
avatarUrl: that.data.avatarUrl, |
|
|
|
nickName: e.detail.value.nickname, |
|
|
|
name: e.detail.value.username, |
|
|
|
sex: that.data.gender, |
|
|
|
sex: 1 * that.data.gender + 1, |
|
|
|
birthdate: birthdate, |
|
|
|
height: e.detail.value.height ? e.detail.value.height : that.data.height, |
|
|
|
weight: e.detail.value.weight ? e.detail.value.weight : that.data.weight, |
|
|
@@ -162,14 +179,13 @@ Page({ |
|
|
|
}).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
wx.showToast({ |
|
|
|
title: "信息提交成功,将在3分钟内生效", |
|
|
|
icon: 'none', |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
title: "信息提交成功", |
|
|
|
icon: 'success', |
|
|
|
duration: 1500, |
|
|
|
}) |
|
|
|
setTimeout(() => { |
|
|
|
wx.navigateBack() |
|
|
|
}, 2000) |
|
|
|
}, 1500) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err); |
|
|
@@ -237,9 +253,9 @@ Page({ |
|
|
|
/** |
|
|
|
* 用户点击右上角分享 |
|
|
|
*/ |
|
|
|
onShareAppMessage() { |
|
|
|
// onShareAppMessage() { |
|
|
|
|
|
|
|
}, |
|
|
|
// }, |
|
|
|
|
|
|
|
onChooseAvatar(e) { |
|
|
|
const that = this |
|
|
@@ -255,6 +271,7 @@ Page({ |
|
|
|
that.setData({ |
|
|
|
avatarUrl: JSON.parse(res.data).data.url |
|
|
|
}) |
|
|
|
console.log(that.data.avatarUrl); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|