Browse Source

删除奖项

master
左文祺 8 years ago
parent
commit
cfa05bdf91
  1. 16
      src/static/manage.js

16
src/static/manage.js

@ -26,6 +26,11 @@ class BS { @@ -26,6 +26,11 @@ class BS {
award_name, award_capacity
});
}
static removeAwards(award_id) {
return this.fetch('/remove_award', {
award_id
});
}
static getAwards() {
return this.fetch('/awards');
@ -86,8 +91,15 @@ $(function () { @@ -86,8 +91,15 @@ $(function () {
})
}).on('click', '.js-remove', e => {
let aid = $(e.target).data('aid');
layer.confirm('确认要删除该项?',()=>{
layer.alert('暂不支持')
layer.confirm('确认要删除该项?',(index)=>{
BS.removeAwards(aid).then((resp)=>{
if(resp.status===200){
flushAwards()
layer.close(index)
}else {
layer.alert(resp.msg)
}
})
})
});
flushAwards()

Loading…
Cancel
Save