Skip to content

Commit 47c238b

Browse files
committed
feat(PC): 全局评论二次确认
1 parent baf1f5a commit 47c238b

File tree

1 file changed

+15
-10
lines changed
  • packages/zhiyicx-plus-pc/resources/assets/web/js

1 file changed

+15
-10
lines changed

packages/zhiyicx-plus-pc/resources/assets/web/js/common.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -964,16 +964,21 @@ var comment = {
964964
break;
965965
}
966966
_this.lockStatus = 1;
967-
axios.delete(url)
968-
.then(function (response) {
969-
$('#comment' + id).fadeOut();
970-
$('.cs' + source_id).text(parseInt($('.cs' + source_id).text())-1);
971-
_this.lockStatus = 0;
972-
})
973-
.catch(function (error) {
974-
showError(error.response.data);
975-
_this.lockStatus = 0;
976-
});
967+
layer.confirm(confirmTxt + '确定删除这条评论?', {}, function() {
968+
axios.delete(url)
969+
.then(function (response) {
970+
$('#comment' + id).fadeOut();
971+
$('.cs' + source_id).text(parseInt($('.cs' + source_id).text())-1);
972+
_this.lockStatus = 0;
973+
layer.closeAll();
974+
noticebox('删除成功')
975+
})
976+
.catch(function (error) {
977+
showError(error.response.data);
978+
_this.lockStatus = 0;
979+
});
980+
});
981+
977982
},
978983
pinneds: function (type, source_id, id){
979984
var url = '';

0 commit comments

Comments
 (0)