// pages/permisission/permission.js Page({ /** * 页面的初始数据 */ data: { phoneLoading: false, showCreateForm: true, createForm: null, date: '', sexList: [ { id: 1, title: '男' }, { id: 0, title: '女' } ], sexActive: 0 }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { console.log('permission load'); }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 获取用户手机号权限 */ getPhoneNumber (e) { var that = this console.log(e.detail.code) setTimeout(() => { that.getUser() }, 1000); }, getUser () { console.log('get user'); wx.getUserProfile({ desc: '获取您的微信头像和昵称用于登录', success: (res) => { console.log(res); } }) }, fillInfo () { console.log('filinfo'); wx.reLaunch({ url: "/pages/createInfo/createInfo" }) }, bindDateChange (e) { console.log(e); this.setData({ date: e.detail.value }) }, handleSex (e) { this.setData({ sexActive: e.currentTarget.dataset.index }) }, handleConfirmBind () { wx.showLoading({ title: '绑定中...', mask: true }) setTimeout(() => { wx.hideLoading({ success: (res) => { wx.reLaunch({ url: '/pages/index/index', }) } }) }, 1000); } })