let app = getApp() Page({ data: { groupId: 0, tableData: [], }, onLoad: function(options) { let groupId = +options.groupId||1; this.setData({ groupId }); }, onShow: function () { app.checkLogin( userInfo =>{ this.setData({userInfo, from:0}) this.loadData() }) }, gotoAnswer(e){ let item = e.currentTarget.dataset.item; let groupId = this.data.groupId console.log( item ) wx.navigateTo({ url: `/pages/exam/answer/answer?groupId=${groupId}&type=${item.type}&count=${item.count}` }) }, loadData: function(){ let param= {groupId: this.data.groupId} app.formPost('Exam.InitGroupAnswer', param ).then(res => { if( res.code == 200){ this.setData({tableData: res.data}) } }) } })