| | |
| | | privacyHtml: '', |
| | | activeHtml: '' |
| | | }, |
| | | initData(){ |
| | | initData() { |
| | | var app = getApp().globalData |
| | | this.setData({ |
| | | bottomLift: app.bottomLift |
| | |
| | | handleJudge(e) { |
| | | const flag = e.currentTarget.dataset.flag |
| | | console.log(e); |
| | | this.setData({ agreementFalg: flag, showModal: false }) |
| | | this.setData({ |
| | | agreementFalg: flag, |
| | | showModal: false |
| | | }) |
| | | }, |
| | | loginIn() { |
| | | const { agreementFalg } = this.data |
| | | if(!agreementFalg) return wx.showToast({ |
| | | const { |
| | | agreementFalg |
| | | } = this.data |
| | | if (!agreementFalg) return wx.showToast({ |
| | | title: '请先阅读并同意相关协议', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }) |
| | | }, |
| | | getPhoneNumber (e) { |
| | | getPhoneNumber(e) { |
| | | console.log(e.detail) |
| | | console.log(e.detail.iv) |
| | | console.log(e.detail.encryptedData) |
| | | const data = { ...e.detail } |
| | | getWxMiniPhone({ |
| | | encryptedData: data.encryptedData, |
| | | iv: data.iv, |
| | | sessionKey: wx.getStorageSync('sessionKey') || data.iv, |
| | | }).then(res => { |
| | | binDingPhone({ |
| | | phone: res.data |
| | | }).then((res) => { |
| | | if(res.code == 200){ |
| | | wx.setStorageSync('member', res.data) |
| | | wx.navigateBack() |
| | | } |
| | | const data = { |
| | | ...e.detail |
| | | } |
| | | if (e.detail && e.detail.iv) { |
| | | getWxMiniPhone({ |
| | | encryptedData: data.encryptedData, |
| | | iv: data.iv, |
| | | sessionKey: wx.getStorageSync('sessionKey') || data.iv, |
| | | }).then(res => { |
| | | binDingPhone({ |
| | | phone: res.data |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | const tempPath = wx.getStorageSync('tempPath') || '' |
| | | wx.setStorageSync('member', res.data) |
| | | if (tempPath) { |
| | | wx.redirectTo({ |
| | | url: tempPath, |
| | | }) |
| | | } else { |
| | | wx.navigateBack() |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | onOpen(e){ |
| | | onOpen(e) { |
| | | console.log('e', e); |
| | | const { serviceHtml, privacyHtml } = this.data |
| | | const { index } = e.target.dataset |
| | | const { |
| | | serviceHtml, |
| | | privacyHtml |
| | | } = this.data |
| | | const { |
| | | index |
| | | } = e.target.dataset |
| | | let activeHtml = index == '0' ? serviceHtml : privacyHtml |
| | | this.setData({ |
| | | activeHtml, |
| | | showModal: true |
| | | }) |
| | | }, |
| | | onClose(){ |
| | | this.setData({showModal: false}) |
| | | onClose() { |
| | | this.setData({ |
| | | showModal: false |
| | | }) |
| | | }, |
| | | agreementChange(e) { |
| | | this.setData({ |