var myCheckBoxUtils = {
checkAll: function(parentCheckBox_class, childCheckBox_name) {
if ($('.' + parentCheckBox_class).prop("checked")) {
$('input[name="' + childCheckBox_name + '"]:visible:not(:disabled)').prop("checked", true);
} else {
$('input[name="' + childCheckBox_name + '"]:visible').prop("checked", false);
}
},
reverseCheck: function(parentCheckBox_class, childCheckBox_name) {
var childCheckBox_length = $('input[name="' + childCheckBox_name + '"]:not(:disabled)').length;
if (childCheckBox_length == 0) {
return;
}
var $childCheckBox_notChecked = $('input[name="' + childCheckBox_name + '"]:visible[checked!=checked]:not(:disabled)');
if ($childCheckBox_notChecked.length ==0) {
$('.' + parentCheckBox_class).prop("checked", true);
} else {
$('.' + parentCheckBox_class).prop("checked", false);
}
}
$.post('<{:U("Cart/changeCartAllChecked")}>',{cart_id:cart_id,checked:checked},function (data){
layer.close(load);
if(data.status==1){
myCheckBoxUtils.checkAll(parentCheckBox_class, childCheckBox_name);
carFns.total();
}else{
layer.msg('未知错误',{icon:5});return;
}
})
};