const app = getApp(); Component({ properties: { data:Object, ext:Object }, data: { eduImgDir: global.config.eduImgDir, buttons:[{text:"删除", type:"warn"}] }, methods: { delete(){ let {course_id} = this.data.ext; let {course_member_id} = this.data.data; ; let students = [{course_member_id}]; app.api("courses.delete_from_course")({course_id,students}) .then(res=>{ this.triggerEvent("delete",{},{bubbles:true,composed:true}); ; //res.message='删除成功'; app.showMsg(res); }).catch(e=>{ app.showError(e); }) }, onButtonTap(e){ ; wx.showModal({ title:"提示", content:"确认删除所选学生吗?", success:res=>{ if(res.confirm){ this.delete(); } } }) } } })