diff --git a/pages/index/index.js b/pages/index/index.js index 97c782b..9c5c478 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -140,6 +140,15 @@ Page({ console.log(options, 'check'); let that = this; + const isCancel = wx.getStorageSync('isCancel') + if (isCancel === '1') { + // 主页 + wx.switchTab({ + url: app.globalData.goHomeUrl + }) + wx.setStorageSync('isCancel', '0') + } + Http.get({ url: config.api.checkUserStatus, data: { diff --git a/pages/theme/index1/index.js b/pages/theme/index1/index.js index fbb4463..993cafd 100644 --- a/pages/theme/index1/index.js +++ b/pages/theme/index1/index.js @@ -764,7 +764,7 @@ Page({ marketName: app.globalData.marketName, activeColor: app.globalData.mouldType == 1 ? "#E9D0AA" : bgColor.colorFirst.main.activeColor }) - this.uesrInfo() + // this.uesrInfo() if (businessSwitch) { let openId = wx.getStorageSync("openId") let member_status = 0 diff --git a/pages3/setUserInfo/index.js b/pages3/setUserInfo/index.js index 15447f2..8df4667 100644 --- a/pages3/setUserInfo/index.js +++ b/pages3/setUserInfo/index.js @@ -212,12 +212,14 @@ Page({ }, goCanelAccount() { + const that = this wx.showModal({ title: '提示', - content: '是否要注销账号?', + content: '注销后请重新进入小程序', success(res) { if (res.confirm) { console.log('用户点击确定') + that.goCancelUser() } else if (res.cancel) { console.log('用户点击取消') } @@ -225,6 +227,30 @@ Page({ }) }, + goCancelUser() { + Http.get({ + url: "/user/cancelUser" + }).then(res => { + if (res.code == 200) { + wx.showToast({ + title: "注销成功", + icon: 'success', + duration: 1500, + }) + + wx.exitMiniProgram() + + } + }).catch(err => { + console.log(err); + wx.showToast({ + title: err.message || "注销失败", + icon: 'none', + duration: 1500, + }) + }) + }, + /** * 生命周期函数--监听页面加载 */