//index.js const util = require("../../../utils/util") //获取应用实例 const app = getApp() Page({ data: { info:{}, groups: [], isOpen: false, userInfo:{} }, onShow: function(){ app.checkLogin( userInfo =>{ this.setData({userInfo}) // 已经实名认证 this.indexLoad() }) }, onPullDownRefresh() { if (!this.loading) { this.indexLoad( this.stopPullDownRefresh ) } }, stopPullDownRefresh(){ wx.stopPullDownRefresh() }, indexLoad: function( cb ) { let _this = this app.formPost('Exam.getUserLimitPaperList', {}).then(res => { if (res.code === 200) { let groups = res.data.groups||[]; _this.setData({ groups: groups, isOpen: groups.length>0 }); cb&&cb() } }) } })