import { urlPrefix } from '../../config/index' Page({ /** * 页面的初始数据 */ data: { id: 0, jd_count: 0, pay_status: 0 }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { }, onShow() { this.loadData(); this.getSystemInfo(); this.getTabBar().init(); }, loadData() { let that = this; let _id = wx.getStorageSync('id'); wx.request({ url: urlPrefix + '/QingLong/HuiYa/wxGetUserJinDou', method: 'POST', header: { 'content-type': 'application/x-www-form-urlencoded' }, data: { token: wx.getStorageSync('token'), }, success(res) { if (res.data.success) { if (res.data.token) { wx.setStorageSync('token', res.data.token); } that.setData({ id: _id, jd_count: res.data.jd_count }) } else { console.log('获取token失败!' + res.errMsg) } } }); }, getSystemInfo() { let that = this; wx.getSystemInfo({ success(res) { let platform = res.platform; if (platform == 'android' || platform == 'windows' || platform == 'devtools') { that.setData({ pay_status: 1 }); } } }) }, topupHandle(e) { wx.navigateTo({ url: '/pages/topup/index', }); }, clickHandAITxt(e){ wx.navigateTo({ url: '/pages/text/index', }); }, clickHandAIVid(e){ wx.navigateTo({ url: '/pages/video/index', }); }, clickHandAIMuc(e){ wx.navigateTo({ url: '/pages/music/index', }); }, clickHandle(e) { wx.navigateTo({ url: '/pages/agree_privacy/index', }); }, clickHandlezf(e) { wx.navigateTo({ url: '/pages/agree/index', }); }, clickHandjl(e) { wx.navigateTo({ url: '/pages/records/index', }); }, exitHandle(e) { wx.showModal({ title: '提示', content: '您确定要退出吗?', success(res) { if (res.confirm) { wx.exitMiniProgram({ success: (res) => { } }); } } }); } })