Skip to content

Commit

Permalink
feat(PC): 全局评论二次确认
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Nov 28, 2018
1 parent baf1f5a commit 47c238b
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions packages/zhiyicx-plus-pc/resources/assets/web/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -964,16 +964,21 @@ var comment = {
break;
}
_this.lockStatus = 1;
axios.delete(url)
.then(function (response) {
$('#comment' + id).fadeOut();
$('.cs' + source_id).text(parseInt($('.cs' + source_id).text())-1);
_this.lockStatus = 0;
})
.catch(function (error) {
showError(error.response.data);
_this.lockStatus = 0;
});
layer.confirm(confirmTxt + '确定删除这条评论?', {}, function() {
axios.delete(url)
.then(function (response) {
$('#comment' + id).fadeOut();
$('.cs' + source_id).text(parseInt($('.cs' + source_id).text())-1);
_this.lockStatus = 0;
layer.closeAll();
noticebox('删除成功')
})
.catch(function (error) {
showError(error.response.data);
_this.lockStatus = 0;
});
});

},
pinneds: function (type, source_id, id){
var url = '';
Expand Down

0 comments on commit 47c238b

Please sign in to comment.