diff --git a/index/user.js b/index/user.js index 180a9ea..85dfd96 100644 --- a/index/user.js +++ b/index/user.js @@ -107,11 +107,39 @@ Page({ url: config.api.checkPhoneStatus, data: {} }).then(res => { + console.log(res, 'res'); that.setData({ ifSetUserInfo: true }) + // 手机号未授权 + const ifSetUserInfo = wx.getStorageSync('ifSetUserInfo') + if (ifSetUserInfo == 1) { + if (!that.data.ifSetUserInfo) return + wx.showModal({ + title: '完善个人信息', + content: '请继续完成个人信息哦', + showCancel: true, + cancelText: "以后再说", + cancelColor: '', + confirmText: "去完善", + confirmColor: '#FD832D', + complete: (res) => { + if (res.cancel) { + console.log('cancel'); + } + if (res.confirm) { + wx.navigateTo({ + url: '/pages3/setUserInfo/index', + }) + } + // 已完成手机号授权 + wx.setStorageSync('ifSetUserInfo', 2) + } + }) + } return }).catch(err => { + console.log(err, 'err'); that.setData({ ifSetUserInfo: false }) @@ -452,31 +480,7 @@ Page({ */ onShow: function () { this.ifPhoneInfo() - const ifSetUserInfo = wx.getStorageSync('ifSetUserInfo') || 2 - // 手机号未授权 - if (ifSetUserInfo == 1) { - if (!this.data.ifSetUserInfo) return - wx.showModal({ - title: '完善个人信息', - content: '请继续完成个人信息哦', - showCancel: true, - cancelText: "以后再说", - cancelColor: '', - confirmText: "去完善", - confirmColor: '#FD832D', - complete: (res) => { - if (res.cancel) { - console.log('cancel'); - } - if (res.confirm) { - wx.navigateTo({ - url: '/pages3/setUserInfo/index', - }) - } - wx.setStorageSync('ifSetUserInfo', 2) // 已完成手机号授权 - } - }) - } + if (businessSwitch) { let openId = wx.getStorageSync("openId") this.setData({ diff --git a/pages/getphoneInfo/index.js b/pages/getphoneInfo/index.js index d286adf..0fa6373 100755 --- a/pages/getphoneInfo/index.js +++ b/pages/getphoneInfo/index.js @@ -227,7 +227,6 @@ Page({ url: `/pages/radetail/joinActivity/edit?activityId=${that.data.signActivity}` }) } else if (that.data.mineFlag == 'mine') { - wx.switchTab({ url: '/index/user' });