| @@ -140,6 +140,15 @@ Page({ | |||||
| console.log(options, 'check'); | console.log(options, 'check'); | ||||
| let that = this; | let that = this; | ||||
| const isCancel = wx.getStorageSync('isCancel') | |||||
| if (isCancel === '1') { | |||||
| // 主页 | |||||
| wx.switchTab({ | |||||
| url: app.globalData.goHomeUrl | |||||
| }) | |||||
| wx.setStorageSync('isCancel', '0') | |||||
| } | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.checkUserStatus, | url: config.api.checkUserStatus, | ||||
| data: { | data: { | ||||
| @@ -764,7 +764,7 @@ Page({ | |||||
| marketName: app.globalData.marketName, | marketName: app.globalData.marketName, | ||||
| activeColor: app.globalData.mouldType == 1 ? "#E9D0AA" : bgColor.colorFirst.main.activeColor | activeColor: app.globalData.mouldType == 1 ? "#E9D0AA" : bgColor.colorFirst.main.activeColor | ||||
| }) | }) | ||||
| this.uesrInfo() | |||||
| // this.uesrInfo() | |||||
| if (businessSwitch) { | if (businessSwitch) { | ||||
| let openId = wx.getStorageSync("openId") | let openId = wx.getStorageSync("openId") | ||||
| let member_status = 0 | let member_status = 0 | ||||
| @@ -212,12 +212,14 @@ Page({ | |||||
| }, | }, | ||||
| goCanelAccount() { | goCanelAccount() { | ||||
| const that = this | |||||
| wx.showModal({ | wx.showModal({ | ||||
| title: '提示', | title: '提示', | ||||
| content: '是否要注销账号?', | |||||
| content: '注销后请重新进入小程序', | |||||
| success(res) { | success(res) { | ||||
| if (res.confirm) { | if (res.confirm) { | ||||
| console.log('用户点击确定') | console.log('用户点击确定') | ||||
| that.goCancelUser() | |||||
| } else if (res.cancel) { | } else if (res.cancel) { | ||||
| console.log('用户点击取消') | 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, | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| /** | /** | ||||
| * 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
| */ | */ | ||||