|
@@ -126,9 +126,9 @@
|
|
|
<td class="quanxuan">
|
|
|
<input type="checkbox" name="checkbox" class="all_check" /> 全选
|
|
|
</td>
|
|
|
- <td class="mui-text-center">合计:<span class="count_price_box">¥<span class="count_price">165.06</span></span>元</td>
|
|
|
+ <td class="mui-text-center">合计:<span class="count_price_box">¥<span class="count_price">0.0</span></span>元</td>
|
|
|
<td>
|
|
|
- <a id="go-clearing" class="mui-btn mui-pull-right add_gwc go-clearing">去结算(3)</a>
|
|
|
+ <a id="go-clearing" class="mui-btn mui-pull-right add_gwc1 go-clearing">去结算(0)</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
@@ -187,7 +187,7 @@
|
|
|
$("#go-clearing").removeClass("add_gwc1").addClass("add_gwc").text('去结算('+$(".shopping-cart-list input[type=checkbox]:not(:disabled):checked").length+')');//点亮结算按钮
|
|
|
}
|
|
|
mui(".mui-numbox").numbox(); //激活加减按钮组合
|
|
|
- $(".shopping-box,.buy-footer1").show();
|
|
|
+// $(".shopping-box,.buy-footer1").show();
|
|
|
$(".gwc_null").hide();
|
|
|
calculator();
|
|
|
}
|
|
@@ -339,8 +339,10 @@
|
|
|
if($(this).hasClass("all_check")) {
|
|
|
if($(this).prop("checked") == true) {
|
|
|
console.log("全选")
|
|
|
- $("input[type='checkbox']").prop('checked', true);
|
|
|
- $("#go-clearing").removeClass('add_gwc1').addClass('add_gwc').text("去结算(" + $(".shopping-cart-list input[type='checkbox']:checked").length + ")");
|
|
|
+ if($(".shopping-cart-list input[type='checkbox']:not(:disabled)").length>0){
|
|
|
+ $(".shopping-cart-list input[type='checkbox']:not(:disabled)").prop('checked', true);
|
|
|
+ $("#go-clearing").removeClass('add_gwc1').addClass('add_gwc').text("去结算(" + $(".shopping-cart-list input[type='checkbox']:checked").length + ")");
|
|
|
+ }
|
|
|
} else {
|
|
|
console.log("取消全选")
|
|
|
$("input[type='checkbox']").prop('checked', false);
|
|
@@ -348,7 +350,7 @@
|
|
|
}
|
|
|
} else {
|
|
|
$(".all_check").prop('checked', false);
|
|
|
- if($("input[type='checkbox']:checked").length > 0) {
|
|
|
+ if($(".shopping-cart-list input[type='checkbox']:checked").length > 0) {
|
|
|
$("#go-clearing").removeClass('add_gwc1').addClass('add_gwc').text("去结算(" + $(".shopping-cart-list input[type='checkbox']:checked").length + ")");
|
|
|
if(($("input[type='checkbox']:checked").length + 1) == $("input[type='checkbox']").length) {
|
|
|
$("input[type='checkbox']").prop('checked', true);
|
|
@@ -368,10 +370,10 @@
|
|
|
|
|
|
//结算事件
|
|
|
mui('body').on('tap', '.go-clearing', function() {
|
|
|
- if($("input[type='checkbox']:checked").length > 0) {
|
|
|
+ if($(".shopping-cart-list input[type='checkbox']:checked").length > 0) {
|
|
|
var cartidList = ''; //购物项id集合
|
|
|
- $.each($(".shopping-cart-list .mui-input-numbox"), function(index) {
|
|
|
- var th = $(this);
|
|
|
+ $.each($(".shopping-cart-list input[type='checkbox']:not(:disabled):checked"), function(index) {
|
|
|
+ var th = $(this).parent().find('.mui-input-numbox');
|
|
|
if(typeof(th.attr("cartid")) != "undefined") {
|
|
|
var a = '';
|
|
|
if(index != 0) {
|
|
@@ -409,13 +411,18 @@
|
|
|
var count = 0;
|
|
|
var num = 0;
|
|
|
$(".mui-table-view li").each(function() {
|
|
|
- if($(this).find("input[type='checkbox']").prop('checked') == true) {
|
|
|
+ if($(this).find("input[type='checkbox']:not(:disabled)").prop('checked') == true) {
|
|
|
num = parseFloat($(this).find(".price_sp").text().replace(/¥/g, "") * $(this).find(".mui-input-numbox").val()).toFixed(2);
|
|
|
count = accAdd(count, num);
|
|
|
}
|
|
|
});
|
|
|
$(".count_price").text(accAdd(count, 0).toFixed(2));
|
|
|
- $("#go-clearing").text('去结算('+$(".shopping-cart-list input[type=checkbox]:checked").length+')');
|
|
|
+ $("#go-clearing").text('去结算('+$(".shopping-cart-list input[type=checkbox]:not(:disabled):checked").length+')');
|
|
|
+ if($(".shopping-cart-list input[type='checkbox']:not(:disabled):checked").length<1){
|
|
|
+ $("#go-clearing").removeClass("add_gwc").addClass("add_gwc1");
|
|
|
+ }else{
|
|
|
+ $("#go-clearing").removeClass("add_gwc1").addClass("add_gwc");
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|