From 8b324fc7527762eb7c7590751757b87834cfca00 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期四, 21 三月 2024 09:23:49 +0800 Subject: [PATCH] ... --- pages/personalCenter/index.js | 40 ++++++++++++++++++++++++++++++++++------ 1 files changed, 34 insertions(+), 6 deletions(-) diff --git a/pages/personalCenter/index.js b/pages/personalCenter/index.js index 1ecdbf5..f4dfc6b 100644 --- a/pages/personalCenter/index.js +++ b/pages/personalCenter/index.js @@ -167,7 +167,9 @@ let userTypeData = res.infoList.find((item) => item.type == 'userType') let type = ""; if (userTypeData) { - this.data.userTypeActive = JSON.parse(userTypeData.data).userType; + this.setData({ + userTypeActive: JSON.parse(userTypeData.data).userType, + }); type = userTypeList.find((item) => item.value === this.data.userTypeActive)?.lable; } else { type = '-' @@ -250,7 +252,6 @@ }, //淇敼鐢ㄦ埛绫诲瀷 editUserType() { - console.log(44) if (!this.data.visible) { this.setData({ visible: true, @@ -261,6 +262,37 @@ this.setData({ visible: e.detail.visible, }); + }, + tabUserTypeClick(e) { + console.log(e) + let { info } = e.currentTarget.dataset; + this.setData({ + userTypeActive: info.value, + }); + }, + submit() { + let userTypeInfo = { + requests: [ + { + data: JSON.stringify({ userType: this.data.userTypeActive }), + name: '鐢ㄦ埛绫诲瀷', + type: 'userType' + } + ] + } + app.MG.identity.setAppUserInfo(userTypeInfo).then((res) => { + if (res) { + wx.showToast({ + title: "淇敼鎴愬姛", + icon: 'success', + duration: 1000, + }) + this.getUserInfo() + this.setData({ + visible: false, + }); + } + }) }, //璁剧疆 gotoUserEditPage() { @@ -292,8 +324,4 @@ onShareAppMessage() { }, - //璺宠浆鍏充簬鎴戜滑鍜岃仈绯绘垜浠� - onAboutUS() { - console.log(111); - } }) \ No newline at end of file -- Gitblit v1.9.1