Files
AGuestSaas/pages/user/setting/aboutMine/aboutMine.js
2020-12-30 17:34:35 +08:00

93 lines
2.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Page({
/**
* 页面的初始数据
*/
data: {
userId: "", //用户id
phone: "", //用户信息
nickname: "", //用户昵称
cover: "", //用户头像
columns: ["未知", "男", "女"],
gender: 0 || wx.getStorageSync("gender") * 1,
date: '2016-09-01',
region: ['广东省', '广州市', '海珠区'],
},
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
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
wx.$api.user.userInfoEdit().then(res => {
this.setData({
phone: res.username,
nickname: res.nickname,
cover: res.avatar
})
})
},
// 跳转到修改页面
goUrl() {
wx.navigateTo({
url: "../editUserInfo/editUserInfo?nickname=" + this.data.nickname
})
},
// 更新头像
upload() {
wx.chooseImage({
count: 1, // 默认9
success: res => {
const src = res.tempFilePaths[0]
wx.navigateTo({
url: '../tailoring/tailoring?src=' + src
})
}
})
},
logOut() {
wx.showModal({
title: "退出提示",
content: "是否现在就退出",
showCancel: true,
confirmColor: "#0b0041",
confirmText: "确定",
success: (res) => {
if (res.confirm) {
wx.clearStorage({
success: () => {
wx.navigateBack()
}
})
}
}
})
}
})