正在显示
1 个修改的文件
包含
9 行增加
和
6 行删除
@@ -754,6 +754,7 @@ | @@ -754,6 +754,7 @@ | ||
754 | } | 754 | } |
755 | }*/ | 755 | }*/ |
756 | for(var i1=0;i1<$('.shopBox').length;i1++){ | 756 | for(var i1=0;i1<$('.shopBox').length;i1++){ |
757 | + var goods_price = 0; | ||
757 | var freight = parseFloat($($('.shopBox')[i1]).attr('data-freight'));//运费 | 758 | var freight = parseFloat($($('.shopBox')[i1]).attr('data-freight'));//运费 |
758 | var free_freight = parseFloat($($('.shopBox')[i1]).attr('data-free_freight'));//满免运费 | 759 | var free_freight = parseFloat($($('.shopBox')[i1]).attr('data-free_freight'));//满免运费 |
759 | for(var i2=0;i2<$('.shopBox').eq(i1).find('ul li').length;i2++){ | 760 | for(var i2=0;i2<$('.shopBox').eq(i1).find('ul li').length;i2++){ |
@@ -763,14 +764,16 @@ | @@ -763,14 +764,16 @@ | ||
763 | 764 | ||
764 | var subtotal = parseFloat($('.shopBox').eq(i1).find('ul li').eq(i2).find('.subtotalBox').html().split('¥')[1]); | 765 | var subtotal = parseFloat($('.shopBox').eq(i1).find('ul li').eq(i2).find('.subtotalBox').html().split('¥')[1]); |
765 | totalPrice += subtotal; | 766 | totalPrice += subtotal; |
767 | + goods_price += subtotal; | ||
768 | + }else{ | ||
769 | + totalPrice -= freight; | ||
766 | } | 770 | } |
767 | } | 771 | } |
768 | - if (totalPrice < free_freight) { | ||
769 | - totalFreight += freight; | ||
770 | - totalPrice += totalFreight; | ||
771 | - } | ||
772 | - if($("input[class='commodityCheck']:checked").length == 0){ | ||
773 | - totalPrice -= totalFreight; | 772 | + console.log(goods_price); |
773 | + console.log(free_freight); | ||
774 | + console.log(totalPrice); | ||
775 | + if (goods_price < free_freight) { | ||
776 | + totalPrice += freight; | ||
774 | } | 777 | } |
775 | } | 778 | } |
776 | $('#totalCount').html(totalCount.toFixed(0)); | 779 | $('#totalCount').html(totalCount.toFixed(0)); |
-
请 注册 或 登录 后发表评论