You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
const app = getApp();
|
|
|
|
Component({
|
|
|
|
properties: {
|
|
|
|
data:Object,
|
|
|
|
ext:Object
|
|
|
|
},
|
|
|
|
|
|
|
|
data: {
|
|
|
|
eduImgDir: global.config.eduImgDir,
|
|
|
|
buttons:[{text:"删除", type:"warn"}]
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
delete(e){
|
|
|
|
console.log(e,this.data);
|
|
|
|
let {course_id} = this.data.ext;
|
|
|
|
let {course_member_id} = this.data.data;
|
|
|
|
console.log(course_id, course_member_id);
|
|
|
|
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){
|
|
|
|
//console.log(e,this.data);
|
|
|
|
wx.showModal({
|
|
|
|
title:"提示",
|
|
|
|
content:"确认删除所选教师吗?",
|
|
|
|
success:res=>{
|
|
|
|
if(res.confirm){
|
|
|
|
this.delete();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|