// pages/login/login.js Page({ /** * 页面的初始数据 */ data: { isChecked: false, hintText: "获取电话号码", code: '', msg: '', errno: '' }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { }, //用户服务协议 showServiceDeal() { wx.navigateTo({ url: '/pages/treaty/service/service', }) }, //隐私条款 showPrivacyDeal() { wx.navigateTo({ url: '/pages/treaty/privacy/privacy', }) }, onChange(e) { console.log(e) this.setData({ isChecked: e.detail.value === '1' }); }, doGetPhoneNumber(e) { wx.switchTab({ url: '/pages/index/index' }); // wx.navigateBack({ // delta: 1, // success: function () { // wx.switchTab({ // url: '/pages/index/index' // }); // }, // error: (res) => { // console.log(res) // } // }); // if (e.detail.errMsg === 'getPhoneNumber:ok') { // // 用户同意授权 // const { // encryptedData, // iv // } = e.detail; // console.log('encryptedData:', encryptedData); // console.log('iv:', iv); // //通过后台获取手机号 // //弹窗获取授权用户昵称 // } else { // // 用户拒绝授权 // console.log('用户拒绝授权'); // } }, doGetUserInfo() { wx.getUserProfile({ desc: '获取昵称用于展示', success: (res) => { } }) }, onUnload() { console.log('login卸载') } })