| | |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady: function () { |
| | | |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | }, |
| | | |
| | | loginWx() { |
| | | var that = this |
| | | if (!this.waitAgree()) return |
| | | |
| | | if (app.globalData.userProfile) { |
| | | this.loginPw(app.globalData.userProfile) |
| | | }else { |
| | | wx.requestSubscribeMessage({ |
| | | tmplIds: [ |
| | | '6JQFOJ12yBvKfRg_duSdwKiH5_J3LpICmz3Li-L1Cr8', |
| | | 'zPNMzF5WsshniJyl83DD-lDZtNvx7JyqLbKgqDl0qvU', |
| | | 'dqREi7vAd03OOirTgBGcm5aCihZJKBjVpiA8Kbu4B8w' |
| | | ], |
| | | success(res) { |
| | | console.log(res); |
| | | }, |
| | | fail(e) { |
| | | console.log(e); |
| | | }, |
| | | complete() { |
| | | that.loginPw(app.globalData.userProfile) |
| | | } |
| | | }) |
| | | } else { |
| | | wx.getUserProfile({ |
| | | lang: 'zh_CN', |
| | | desc: '用于显示,提示用户当前已登录', |
| | | success:(res)=> { |
| | | success: (res) => { |
| | | console.log(res); |
| | | wx.setStorage({ |
| | | data: res.userInfo, |
| | | key: 'userProfile', |
| | | }) |
| | | this.loginPw(res.userInfo) |
| | | }, |
| | | complete() { |
| | | wx.requestSubscribeMessage({ |
| | | tmplIds: [ |
| | | '6JQFOJ12yBvKfRg_duSdwKiH5_J3LpICmz3Li-L1Cr8', |
| | | 'zPNMzF5WsshniJyl83DD-lDZtNvx7JyqLbKgqDl0qvU', |
| | | 'dqREi7vAd03OOirTgBGcm5aCihZJKBjVpiA8Kbu4B8w' |
| | | ], |
| | | success(res) { |
| | | console.log(res); |
| | | }, |
| | | fail(e) { |
| | | console.log(e); |
| | | }, |
| | | complete() { |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | _onLoginFail(e) { |
| | |
| | | |
| | | gotoLogin(toast) { |
| | | if (!this.waitAgree()) return |
| | | wx.navigateTo({ |
| | | url: '/pages/m_user/userloginpw/userloginpw', |
| | | success: (result) => { |
| | | if (typeof toast === 'function') { |
| | | toast() |
| | | } |
| | | wx.requestSubscribeMessage({ |
| | | tmplIds: [ |
| | | '6JQFOJ12yBvKfRg_duSdwKiH5_J3LpICmz3Li-L1Cr8', |
| | | 'zPNMzF5WsshniJyl83DD-lDZtNvx7JyqLbKgqDl0qvU', |
| | | 'dqREi7vAd03OOirTgBGcm5aCihZJKBjVpiA8Kbu4B8w' |
| | | ], |
| | | success(res) { |
| | | console.log(res); |
| | | }, |
| | | fail: (res) => {}, |
| | | complete: (res) => {}, |
| | | fail(e) { |
| | | console.log(e); |
| | | }, |
| | | complete() { |
| | | wx.navigateTo({ |
| | | url: '/pages/m_user/userloginpw/userloginpw', |
| | | success: (result) => { |
| | | if (typeof toast === 'function') { |
| | | toast() |
| | | } |
| | | }, |
| | | fail: (res) => {}, |
| | | complete: (res) => {}, |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | |
| | | return true |
| | | } else { |
| | | wx.showToast({ |
| | | title: '请先同意说明', |
| | | title: '阅读并同意条款', |
| | | icon: 'none' |
| | | }) |
| | | return false |