|
|
|
@ -2,6 +2,7 @@ const app = getApp<IAppOption>();
@@ -2,6 +2,7 @@ const app = getApp<IAppOption>();
|
|
|
|
|
|
|
|
|
|
Page({ |
|
|
|
|
data: { |
|
|
|
|
username: '', |
|
|
|
|
userInfo: {} as any, |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
@ -17,11 +18,17 @@ Page({
@@ -17,11 +18,17 @@ Page({
|
|
|
|
|
this.updateUserInfo(); |
|
|
|
|
}, |
|
|
|
|
handleInputBlur(e) { |
|
|
|
|
const { key } = e.currentTarget.dataset; |
|
|
|
|
this.setData({ |
|
|
|
|
[`userInfo.${key}`]: e.detail.value, |
|
|
|
|
username: e.detail.value, |
|
|
|
|
}); |
|
|
|
|
this.updateUserInfo(); |
|
|
|
|
}, |
|
|
|
|
handleInputBlurPass(e) { |
|
|
|
|
if (e.detail.pass) { |
|
|
|
|
this.setData({ |
|
|
|
|
[`userInfo.username`]: this.data.username, |
|
|
|
|
}); |
|
|
|
|
this.updateUserInfo(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
updateUserInfo() { |
|
|
|
|
const { avatar, username } = this.data.userInfo; |
|
|
|
|