diff --git a/pages/setting/index.js b/pages/setting/index.js index 33cc0d6..b6a119d 100644 --- a/pages/setting/index.js +++ b/pages/setting/index.js @@ -64,6 +64,42 @@ Page({ }); }); + // wx.navigateBack({ + // delta: 1 + // }) + } else if (res.cancel) { + console.log("用户点击取消"); + } + }, + }); + }, + logOff: function () { + var that = this; + wx.showModal({ + title: "注销账号", + content: "确定要注销账号吗?该操作不可逆!", + confirmColor: "#1890ff", + success(res) { + if (res.confirm) { + customRequest("/yishoudan/updatePasswordByPwd", { + header: 'headers', method: 'post', data: { + tel: app.globalData.user.tel, + oldPassword: 'qqqq1111', + password:'1111qqqq', + } + }).then(({ data }) => { + if (data.status == 200) { + app.showTips(that, "修改成功"); + setTimeout(() => { + wx.reLaunch({ + url: "/pages/login/index?type=psw", + success: (result) => { }, + }); + }, 2000); + } else { + app.showTips(that, data.msg); + } + }) // wx.navigateBack({ // delta: 1 // }) @@ -73,4 +109,5 @@ Page({ }, }); }, + }); diff --git a/pages/setting/index.wxml b/pages/setting/index.wxml index 35ce078..ba86eb8 100644 --- a/pages/setting/index.wxml +++ b/pages/setting/index.wxml @@ -41,4 +41,13 @@ 退出登录 + + + + + + 注销账号 + + +