$(document
).on('click', '[data-role="batchdelbtn"]', function() {
var checkbox
= [];
$("[name=selectbooks]:checkbox").each(function(i
) {
if ($(this).prop("checked") == true) {
checkbox
.push($(this).val());
}
})
if (checkbox
== '') {
layer
.msg('没有选择书籍~');
return;
}
batchDeletes(checkbox
);
})
function batchDeletes(bookids
) {
var para
= {
book_ids
: bookids
};
layer
.confirm('确认删除该书籍吗?', function() {
api_books
.batchDelete(para
).then(function(res
) {
if (res
.code
== 0) {
layer
.msg(common
.msg(res
.msg
), {
time
: 2000,
icon
: 6
}, function() {
layer
.closeAll();
bookslist(start
);
});
} else {
layer
.msg(common
.msg(res
.msg
), {
time
: 2000,
icon
: 5
});
}
})
})
}
转载请注明原文地址:https://tech.qufami.com/read-23343.html