const app = getApp(); Component({ properties: { data:Object, course_id:Number }, data: { eduImgDir: global.config.eduImgDir }, methods: { review_application({approval}){ let {application_id, user_id} = this.data.data; let {course_id} = this.data; app.api("courses.teacher_application_review")({course_id, approval, application_id, user_id}) .then(res=>{ this.triggerEvent("review",{},{bubbles:true}); ; res.message = approval==1?'已同意':approval==2?'已拒绝':res.message; app.showMsg(res); }).catch(e=>{ app.showError(e); }) }, approval(e){ ; this.review_application({approval:1}); }, deny(e){ ; this.review_application({approval:2}); } } })