diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 4e12a82..d7accad 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -1609,11 +1609,15 @@ Page({ //累积商品重量 每种商品的重量 * 数量 goods_weight += item[jo]['weight'] * item[jo]['goods_num']; by_g_weight+=item[jo]['weight'] * item[jo]['goods_num']; - if (weight_free > 0) { - out_of_weight = (weight_free * 1000) - by_g_weight; - }else{ - out_of_weight= -by_g_weight; + + if(free1>0){ + if (weight_free > 0) { + out_of_weight = (weight_free * 1000) - by_g_weight; + }else{ + out_of_weight= -by_g_weight; + } } + } } //这个是在不包邮列表礼包 @@ -1629,11 +1633,13 @@ Page({ } } - //当商品没有超出的时候 - if(out_of_weight>=0){ - out_of_weight= -by_g_weight; - }else{ - out_of_weight= -weight_free * 1000; + if(free1>0) { + //当商品没有超出的时候 + if (out_of_weight >= 0) { + out_of_weight = -by_g_weight; + } else { + if (weight_free > 0) out_of_weight = -weight_free * 1000; + } } //所有的商品都不在不包邮商品列表,freight_free为0的时候,以及不是区域包邮