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.
44 lines
978 B
44 lines
978 B
5 years ago
|
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;
|
||
|
//console.log(course_id, course_member_id);
|
||
|
let students = [{course_member_id}];
|
||
|
app.api("courses.delete_from_course")({course_id,students})
|
||
|
.then(res=>{
|
||
|
this.triggerEvent("delete",{},{bubbles:true,composed:true});
|
||
|
//console.log(res);
|
||
|
//res.message='删除成功';
|
||
|
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();
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
|
||
|
}
|
||
|
}
|
||
|
})
|