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