| | |
| | | }, 1000) |
| | | }) |
| | | }, |
| | | onShow(){ |
| | | wx.hideHomeButton() |
| | | }, |
| | | handleJudge(e) { |
| | | const flag = e.currentTarget.dataset.flag |
| | | console.log(e); |
| | |
| | | }else{ |
| | | wx.showToast({ |
| | | title: '你还不是该系统用户,请联系相关管理员注册', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | }) |
| | |
| | | that.setData({openid:res.data.openid}) |
| | | if (res && res.data !=null && res.data.token!=null) { |
| | | console.log(res) |
| | | wx.hideLoading() |
| | | wx.setStorageSync('member', res.data.users || '') |
| | | wx.setStorageSync('token', res.data.token || '') |
| | | wx.switchTab({ |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | wx.navigateTo({ |
| | | wx.reLaunch({ |
| | | url: '/pages/login/index', |
| | | }) |
| | | wx.hideLoading() |
| | | console.log('登录失败!' + res) |
| | | } |
| | | }, |
| | | fail(err) { |
| | | wx.hideLoading() |
| | | console.log(err) |
| | | } |
| | | }) |
| | |
| | | getWxMiniPhone({ |
| | | encryptedData: data.encryptedData, |
| | | iv: data.iv, |
| | | openid:this.data.openid, |
| | | sessionKey: wx.getStorageSync('sessionKey'), |
| | | }).then(res => { |
| | | if (res.data && res.data.token) { |
| | | wx.login({ |
| | | timeout: 5000, |
| | | success: (loginRes) => { |
| | | if (loginRes.code) { |
| | | this.bindingOpenid(loginRes.code, res.data.token) |
| | | } |
| | | } |
| | | }) |
| | | if (res.data && res.data.token) { |
| | | if(res.data.phone){ |
| | | res.data.users.phone = res.data.phone || res.data.users.phone |
| | | } |
| | |
| | | }else{ |
| | | wx.showToast({ |
| | | title: '你还不是该系统用户,请联系相关管理员注册', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | |
| | |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | }, |
| | | |