Commit 9f27780687ea729cb37f513c5c298ae4bb5b78a2

Authored by yvan.ni
1 parent 8ce5ee6d

商品的库存不足报错~~~

pages/goods/goodsInfo/goodsInfo.js
... ... @@ -1587,11 +1587,10 @@ Page({
1587 1587 th.setData({goodsInputNum:redis_num})
1588 1588 return false;
1589 1589 }
1590   -
1591 1590 }
1592   -
1593 1591 var e = th.data.sele_g.store_count;
1594   - if(th.data.sales_rules==2){
  1592 + var p_type=th.data.prom_type; //&& p_type!=1 && p_type!=4
  1593 + if(th.data.sales_rules==2 && (p_type!=1 && p_type!=4 && p_type!=6 || th.data.openSpecModal_inte_normal==1 || th.data.is_normal== 1) ){
1595 1594 if(!th.data.def_pick_store){
1596 1595 wx.showModal({ title: '请选择门店', });
1597 1596 return false;
... ... @@ -1599,7 +1598,7 @@ Page({
1599 1598 e=th.data.def_pick_store.CanOutQty;
1600 1599 }
1601 1600 }
1602   -
  1601 + if(!e) e=0;
1603 1602 //库存不足,不增加
1604 1603 if(e<t){ wx.showModal({ title: '库存不足', });
1605 1604 if(e<0) e=0;
... ... @@ -1669,7 +1668,8 @@ Page({
1669 1668 }
1670 1669  
1671 1670 var e = th.data.sele_g.store_count;
1672   - if(th.data.sales_rules==2){
  1671 + var p_type=th.data.prom_type; //&& p_type!=1 && p_type!=4
  1672 + if(th.data.sales_rules==2 && (p_type!=1 && p_type!=4 && p_type!=6 || th.data.openSpecModal_inte_normal==1 || th.data.is_normal== 1) ){
1673 1673 if(!th.data.def_pick_store){
1674 1674 wx.showModal({ title: '请选择门店', });
1675 1675 return false;
... ... @@ -1677,7 +1677,7 @@ Page({
1677 1677 e=th.data.def_pick_store.CanOutQty;
1678 1678 }
1679 1679 }
1680   -
  1680 + if(!e) e=0;
1681 1681 //库存不足,不增加
1682 1682 if(e<t){ wx.showModal({ title: '库存不足', });
1683 1683 if(e<0) e=0;
... ... @@ -3228,7 +3228,7 @@ Page({
3228 3228 openSpecModel_pt: function(e) {
3229 3229  
3230 3230  
3231   - this.setData({ open_ind_store: 4});//拼团直接给4
  3231 + this.setData({ open_ind_store: 4,goodsInputNum:1});//拼团直接给4
3232 3232  
3233 3233  
3234 3234 //--先判断会员状态--
... ... @@ -5137,7 +5137,7 @@ Page({
5137 5137 //-- 积分购 --
5138 5138 go_pay_integral:function(){
5139 5139 this.get_sto(0)
5140   - this.setData({openSpecModal_inte:1});
  5140 + this.setData({openSpecModal_inte:1,goodsInputNum:1});
5141 5141 },
5142 5142 //-- 积分购普通购买 --
5143 5143 go_pay_integral_normal:function(){
... ...