Commit 7204b4edd136c311fb20636dea2c6a7ffdae0f76
1 parent
80e4af63
不包邮的运算~~·
Showing
1 changed file
with
28 additions
and
17 deletions
pages/cart/cart2/cart2.js
| ... | ... | @@ -1118,6 +1118,7 @@ Page({ |
| 1118 | 1118 | } |
| 1119 | 1119 | //如果有设置不包邮区商品 |
| 1120 | 1120 | if(by_qc.goods_list!="" && by_qc.goods_list!=undefined && by_qc!=null && freight_free>0){ |
| 1121 | + freight_free=0; | |
| 1121 | 1122 | no_ex_good=by_qc.goods_list; |
| 1122 | 1123 | } |
| 1123 | 1124 | } |
| ... | ... | @@ -1210,24 +1211,34 @@ Page({ |
| 1210 | 1211 | continue; |
| 1211 | 1212 | } |
| 1212 | 1213 | |
| 1214 | + | |
| 1215 | + var no_ex_good_arr=null; | |
| 1216 | + if(no_ex_good) no_ex_good_arr=no_ex_good.split(','); | |
| 1217 | + | |
| 1213 | 1218 | //----------------如果是选择了物流--------------------- |
| 1214 | - if(cart_item.exp_type == 0 && item[j].is_free_shipping==0){ | |
| 1215 | - //如果地址不为空 | |
| 1216 | - if (th.data.user_addr!=null){ | |
| 1217 | - switch (item[j]['exp_sum_type']) { | |
| 1218 | - case 1: | |
| 1219 | - //统一运费 | |
| 1220 | - o_shipping_price += item[j]['uniform_exp_sum'];break; | |
| 1221 | - case 2: | |
| 1222 | - if (goods_weight < 0) goods_weight = 0; | |
| 1223 | - //累积商品重量 每种商品的重量 * 数量 | |
| 1224 | - goods_weight += item[j]['weight'] * item[j]['goods_num']; break; | |
| 1225 | - case 3: | |
| 1226 | - if (goods_piece < 0) goods_piece = 0; | |
| 1227 | - //累积商品数量 | |
| 1228 | - goods_piece += item[j]['goods_num'];break; | |
| 1229 | - } | |
| 1230 | - } | |
| 1219 | + if(cart_item.exp_type == 0 && item[j].is_free_shipping==0 && (!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id+'')>-1 )){ | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + //如果地址不为空 | |
| 1223 | + if (th.data.user_addr!=null){ | |
| 1224 | + switch (item[j]['exp_sum_type']) { | |
| 1225 | + case 1: | |
| 1226 | + //统一运费 | |
| 1227 | + o_shipping_price += item[j]['uniform_exp_sum'];break; | |
| 1228 | + case 2:+'' | |
| 1229 | + if (goods_weight < 0) goods_weight = 0; | |
| 1230 | + //累积商品重量 每种商品的重量 * 数量 | |
| 1231 | + goods_weight += item[j]['weight'] * item[j]['goods_num']; | |
| 1232 | + | |
| 1233 | + break; | |
| 1234 | + case 3: | |
| 1235 | + if (goods_piece < 0) goods_piece = 0; | |
| 1236 | + //累积商品数量 | |
| 1237 | + goods_piece += item[j]['goods_num']; | |
| 1238 | + break; | |
| 1239 | + } | |
| 1240 | + } | |
| 1241 | + | |
| 1231 | 1242 | } |
| 1232 | 1243 | } |
| 1233 | 1244 | ... | ... |