import initCalendar from '../../template/calendar/index'; let chooseYear = null; let chooseMonth = null; const app = getApp(); const conf = { onLoad () { const that = this, userInfo = wx.getStorageSync('userInfo') || null, noticeLists = wx.getStorageSync('noticeLists'), token = wx.getStorageSync('token'); let info = wx.getStorageSync('latest_info'); if (info && userInfo && noticeLists) { app.globalData.userInfo = userInfo; app.globalData.noticeLists = noticeLists; app.globalData.token = token; info = JSON.parse(info); // console.log('test'); that.setData({info: info, notice: app.globalData.noticeLists[1]}); }else{ wx.redirectTo({url: '/pages/firstSetting/firstSetting'}) } }, onHide () { this.setData({'calendar.hiddenLoading': false}) }, onShow: function() { initCalendar(); let info = wx.getStorageSync('latest_info'); if (!info) { wx.redirectTo({url: '/pages/firstSetting/firstSetting'}) } }, onShareAppMessage: function () { return { title: app.globalData.title, imageUrl: app.globalData.img, path: '/pages/index/index', success: function(res) { app.confirmModal('分享成功', false) }, fail: function(res) { app.confirmModal('您取消了分享', false) } } } }; Page(conf);