-
mentioned in commit aa3adeb500956f70f247f9928debec0aa880a175
-
Status changed to merged
Showing
2 changed files
pages/cart/cart/cart.js
... | ... | @@ -3069,20 +3069,21 @@ Page({ |
3069 | 3069 | |
3070 | 3070 | for (var i in alllist) { |
3071 | 3071 | var list_item = alllist[i]; |
3072 | + if(list_item.pid==list.pid) continue; | |
3072 | 3073 | for (var j in list_item.goods) { |
3073 | 3074 | //如果赠品的ID一样,要进行统计数量 |
3074 | 3075 | if (list_item.goods[j].is_gift == 1 && list_item.goods[j].gift_id == newd.gift_id) { |
3075 | 3076 | all_num += list_item.goods[j].goods_num; |
3076 | 3077 | } |
3077 | 3078 | if (list_item.goods[j].is_gift == 1 && list_item.goods[j].gift_id == newd.gift_id && list_item.goods[j].prom_id == p_item[0]) { |
3078 | - all_limit_num += list_item.goods[j].limit_num; | |
3079 | + all_limit_num += list_item.goods[j].goods_num; | |
3079 | 3080 | } |
3080 | 3081 | |
3081 | 3082 | } |
3082 | 3083 | } |
3083 | 3084 | |
3084 | 3085 | //-- 赠品的数量超出库存数量和会员的限制,这里是保证所有的赠品部会超出 -- |
3085 | - if (discount.gift_storecount < all_num || discount.limit_num < all_limit_num) { | |
3086 | + if (discount.gift_storecount < all_num+newd.goods_num || discount.limit_num <all_limit_num+newd.goods_num ) { | |
3086 | 3087 | no_gift_arr.push(discount.gift_id); |
3087 | 3088 | //--进入下一个循环 -- |
3088 | 3089 | continue; | ... | ... |
pages/cart/cart2/cart2.js
... | ... | @@ -2913,6 +2913,7 @@ Page({ |
2913 | 2913 | if (pdata.length == 0) return; |
2914 | 2914 | var str = JSON.stringify(pdata); |
2915 | 2915 | |
2916 | + | |
2916 | 2917 | wx.showLoading({ title: "加载中" }); |
2917 | 2918 | wx.request({ |
2918 | 2919 | url: oo.url + '/api/weshop/order/createWxdOrder', |
... | ... | @@ -4397,7 +4398,7 @@ Page({ |
4397 | 4398 | var arr = []; |
4398 | 4399 | //判断是不是有goods_id重复 |
4399 | 4400 | for (var i = 0; i < goods.length; i++) { |
4400 | - if (goods[i].prom_type != 7 && goods[i].erpwareid == you_item.WareId) { | |
4401 | + if (goods[i].erpwareid == you_item.WareId) { | |
4401 | 4402 | var gg_ite = { |
4402 | 4403 | goods_id: goods[i].goods_id, |
4403 | 4404 | goods_num: goods[i].goods_num, | ... | ... |