diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index ffdaf10..f9e5bc6 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -1914,10 +1914,19 @@ Page({ //-------如果购物车中有相关的数据--------- if (re.data.data.total > 0) { for (var j=0; j th.data.prom_buy_limit && (th.data.prom_type==1 || th.data.prom_type==2)) { + wx.showToast({ + title: '此商品已在购物车,去购物车结算!', + icon: 'none', + }); + return false; + //return s.my_warnning("库存不足!", 0, th); + } } var updata = { @@ -2188,13 +2206,16 @@ Page({ }, //因为在购物车 普通商品和 优惠促销,搭配购,组合购 阶梯购是一样的 - check_is_like(e,newd){ + check_is_like(e,newd,idx){ if(e.prom_type ==newd.prom_type) return true; - if(e.prom_type==0){ - if([3,5,7,10].indexOf(newd.prom_type)>-1) return true; - } - if(newd.prom_type==0){ - if([3,5,7,10].indexOf(e.prom_type)>-1) return true; + + if(!idx) { + if (e.prom_type == 0) { + if ([3, 5, 7, 10].indexOf(newd.prom_type) > -1) return true; + } + if (newd.prom_type == 0) { + if ([3, 5, 7, 10].indexOf(e.prom_type) > -1) return true; + } } return false; }, @@ -4629,7 +4650,6 @@ Page({ }, 1000); }, - //-------------获取购买数量的总函数---------------- get_buy_num: function (gd, func) { var map = this.data.g_buy_num, @@ -4731,7 +4751,6 @@ Page({ //--点击弹起拼单-- openSpecModel_pt: function (e) { - this.setData({ open_ind_store: 4, goodsInputNum: 1