个人中心修改资料完善
This commit is contained in:
@@ -8,46 +8,28 @@ Page({
|
||||
phone: "", //用户信息
|
||||
nickname: "", //用户昵称
|
||||
cover: "", //用户头像
|
||||
columns: ["未知", "男", "女"],
|
||||
gender: 0 || wx.getStorageSync("gender") * 1,
|
||||
date: '2016-09-01',
|
||||
region: ['广东省', '广州市', '海珠区'],
|
||||
sex:'',
|
||||
},
|
||||
besure(){
|
||||
|
||||
besure() {
|
||||
wx.navigateBack({
|
||||
delta: 0,
|
||||
})
|
||||
},
|
||||
// 选择性别
|
||||
pickSex: function (e) {
|
||||
this.setData({
|
||||
gender: e.detail.value
|
||||
});
|
||||
// console.log("当前选择性别-sex", e.detail.value);
|
||||
},
|
||||
// 选择出生年月日
|
||||
bindTimeChange: function (e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.setData({
|
||||
time: e.detail.value
|
||||
})
|
||||
},
|
||||
// 选择所在区域
|
||||
bindRegionChange: function (e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.setData({
|
||||
region: e.detail.value
|
||||
delta: 0,
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
wx.$api.user.userInfoEdit().then(res => {
|
||||
this.getUserInfo();
|
||||
},
|
||||
// 获取用户的基本信息
|
||||
getUserInfo() {
|
||||
wx.$api.user.getUserInfo().then(res => {
|
||||
this.setData({
|
||||
phone: res.username,
|
||||
nickname: res.nickname,
|
||||
cover: res.avatar
|
||||
cover: res.avatar,
|
||||
sex:res.sex
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -83,7 +65,9 @@ Page({
|
||||
if (res.confirm) {
|
||||
wx.clearStorage({
|
||||
success: () => {
|
||||
wx.navigateBack()
|
||||
wx.navigateTo({
|
||||
url: '/pages/welcome/index',
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user