//index.js //获取应用实例 const app = getApp() Page({ data: { spinShow: false, groups: [], pushPaper: [], timeLimitPaper: [], taskList: [] }, onLoad: function() { this.setData({ spinShow: true }); app.checkLogin( this.indexLoad) }, onPullDownRefresh() { this.setData({ spinShow: true }); if (!this.loading) { this.indexLoad() } }, indexLoad: function() { let _this = this app.formPost('Exam.index', {}).then(res => { _this.setData({ spinShow: false }); wx.stopPullDownRefresh() if (res.code === 200) { console.log( res.data ) _this.setData({ groups: res.data.groups }); } }) } })