const app = getApp(); Page({ data: { }, onLoad: function (options) { let {course_id} = options; this.setData({course_id}); this.refresh(); }, refresh(){ let {course_id} = this.data; app.api("courses.apply_teachers")({course_id}) .then(res=>{ console.log(res); this.setData(res); }).catch(e=>{ app.showError(e); }) }, onShow: function () { } })