Commit 5eb83af277a8aeb130f62ebefd0a249f10b8e479
1 parent
3f05ca84
商品在计算普通购买的时候,切换规格的优化
Showing
1 changed file
with
13 additions
and
6 deletions
pages/goods/goodsInfo/goodsInfo.js
| @@ -3426,10 +3426,12 @@ Page({ | @@ -3426,10 +3426,12 @@ Page({ | ||
| 3426 | }); | 3426 | }); |
| 3427 | 3427 | ||
| 3428 | 3428 | ||
| 3429 | + | ||
| 3429 | if (nor) that.get_sto(1); | 3430 | if (nor) that.get_sto(1); |
| 3430 | else that.get_sto(); | 3431 | else that.get_sto(); |
| 3431 | 3432 | ||
| 3432 | - if (!item.whsle_id && [1,2,4,6].indexOf(item.prom_type)==-1) that.check_is_youhui(gid, that.data.is_normal); | 3433 | + if (!item.whsle_id && ([1,2,4,6].indexOf(item.prom_type)==-1 || this.data.is_normal==1)) |
| 3434 | + that.check_is_youhui(gid, that.data.is_normal); | ||
| 3433 | 3435 | ||
| 3434 | //默认门店要拿下门店库存 | 3436 | //默认门店要拿下门店库存 |
| 3435 | if (that.data.sales_rules >= 2 && that.data.def_pick_store && !that.data.sele_g.whsle_id && [1,2,4,6].indexOf(item.prom_type)==-1) { | 3437 | if (that.data.sales_rules >= 2 && that.data.def_pick_store && !that.data.sele_g.whsle_id && [1,2,4,6].indexOf(item.prom_type)==-1) { |
| @@ -5165,9 +5167,10 @@ Page({ | @@ -5165,9 +5167,10 @@ Page({ | ||
| 5165 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | 5167 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { |
| 5166 | if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | 5168 | if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { |
| 5167 | wx.showToast({ | 5169 | wx.showToast({ |
| 5168 | - title: '超出商品限购', | ||
| 5169 | - icon: 'none', | 5170 | + title: '超出商品限购', |
| 5171 | + icon: 'none', | ||
| 5170 | }); | 5172 | }); |
| 5173 | + | ||
| 5171 | // s.my_warnning('超出商品限购', 0, th); | 5174 | // s.my_warnning('超出商品限购', 0, th); |
| 5172 | var num = th.data.prom_buy_limit - th.data.prom_buy_num; | 5175 | var num = th.data.prom_buy_limit - th.data.prom_buy_num; |
| 5173 | if (num < 0) num = 0; | 5176 | if (num < 0) num = 0; |
| @@ -5246,9 +5249,10 @@ Page({ | @@ -5246,9 +5249,10 @@ Page({ | ||
| 5246 | // return s.my_warnning("商品数量不能为0", 0, th); | 5249 | // return s.my_warnning("商品数量不能为0", 0, th); |
| 5247 | }; | 5250 | }; |
| 5248 | if (th.data.goodsInputNum > o.store_count) { | 5251 | if (th.data.goodsInputNum > o.store_count) { |
| 5249 | - th.setData({ | ||
| 5250 | - goodsInputNum: o.store_count | ||
| 5251 | - }) | 5252 | + |
| 5253 | + // th.setData({ | ||
| 5254 | + // goodsInputNum: o.store_count | ||
| 5255 | + // }) | ||
| 5252 | wx.showToast({ | 5256 | wx.showToast({ |
| 5253 | title: '超出商品库存', | 5257 | title: '超出商品库存', |
| 5254 | icon: 'none', | 5258 | icon: 'none', |
| @@ -7595,6 +7599,9 @@ Page({ | @@ -7595,6 +7599,9 @@ Page({ | ||
| 7595 | this.data.is_act=1; | 7599 | this.data.is_act=1; |
| 7596 | } | 7600 | } |
| 7597 | 7601 | ||
| 7602 | + console.log("11111111-gd"); | ||
| 7603 | + console.log(th.data.sele_g); | ||
| 7604 | + | ||
| 7598 | //-- 更新默认购买的数量 --- | 7605 | //-- 更新默认购买的数量 --- |
| 7599 | var mo_num=getApp().get_limit_qty(th.data.sele_g,this.data.is_act); | 7606 | var mo_num=getApp().get_limit_qty(th.data.sele_g,this.data.is_act); |
| 7600 | this.setData({goodsInputNum:mo_num}) | 7607 | this.setData({goodsInputNum:mo_num}) |