From 8b7088558b6749269e9cfad705e499dadf68e0d2 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Fri, 15 Sep 2023 17:42:25 +0800 Subject: [PATCH] 商品详情页面的优化 --- pages/goods/goodsInfo/goodsInfo.js | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 3c76155..ee03341 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -1818,93 +1818,93 @@ Page({ } th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 - } else if (o.prom_type == 7) { - - //判断进行中的活动,是不是要判断线下库存 - th.check_zh_acting(function (ee) { - newd.prom_id = 0; - newd.prom_type = 0; - if (ee && th.data.sele_g.act) { - newd.prom_id = th.data.sele_g.act.id; - newd.prom_type = 7; - if (o.store_count <= 0) { - wx.hideLoading(); - th.data.adding=0; - wx.showToast({ - title: '库存已为空!', - icon: 'none', - }); - return false; - }; - if (o.store_count < e.data.goodsInputNum) { - wx.hideLoading(); - th.data.adding=0; - wx.showToast({ - title: '库存不足!', - icon: 'none', - }); - return false; - //return s.my_warnning("库存不足!", 0, th); - }; - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 - return false; - } else { - //---如果是线下门店销售的时候--- - if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2) { - var pick = th.get_pick_from_list(th.data.sto_sele_id) - - th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { - if (CanOutQty) { - - if (CanOutQty < e.data.goodsInputNum) { - wx.hideLoading(); - th.data.adding=0; - wx.showToast({ - title: '库存不足!', - icon: 'none', - }); - return false; - } - - th.add_cart_next(e, t, a, o, newd, CanOutQty); - } else { - wx.hideLoading(); - th.data.adding=0; - wx.showToast({ - title: '库存不足!', - icon: 'none', - }); - return false; - } - }) - - } else { - if (o.store_count <= 0) { - wx.hideLoading(); - th.data.adding=0; - wx.showToast({ - title: '库存已为空!', - icon: 'none', - }); - return false; - //return s.my_warnning("库存已为空!", 0, th); - }; - if (o.store_count < e.data.goodsInputNum) { - wx.hideLoading(); - th.data.adding=0; - wx.showToast({ - title: '库存不足!', - icon: 'none', - }); - return false; - //return s.my_warnning("库存不足!", 0, th); - }; - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 - } - } - }) } - + // else if (o.prom_type == 7) { + // + // //判断进行中的活动,是不是要判断线下库存 + // th.check_zh_acting(function (ee) { + // newd.prom_id = 0; + // newd.prom_type = 0; + // if (ee && th.data.sele_g.act) { + // newd.prom_id = th.data.sele_g.act.id; + // newd.prom_type = 7; + // if (o.store_count <= 0) { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存已为空!', + // icon: 'none', + // }); + // return false; + // }; + // if (o.store_count < e.data.goodsInputNum) { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存不足!', + // icon: 'none', + // }); + // return false; + // //return s.my_warnning("库存不足!", 0, th); + // }; + // th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 + // return false; + // } else { + // //---如果是线下门店销售的时候--- + // if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2) { + // var pick = th.get_pick_from_list(th.data.sto_sele_id) + // + // th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { + // if (CanOutQty) { + // + // if (CanOutQty < e.data.goodsInputNum) { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存不足!', + // icon: 'none', + // }); + // return false; + // } + // + // th.add_cart_next(e, t, a, o, newd, CanOutQty); + // } else { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存不足!', + // icon: 'none', + // }); + // return false; + // } + // }) + // + // } else { + // if (o.store_count <= 0) { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存已为空!', + // icon: 'none', + // }); + // return false; + // //return s.my_warnning("库存已为空!", 0, th); + // }; + // if (o.store_count < e.data.goodsInputNum) { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存不足!', + // icon: 'none', + // }); + // return false; + // //return s.my_warnning("库存不足!", 0, th); + // }; + // th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 + // } + // } + // }) + // } //要包含积分购的普通购买0 3,5,7,10, is_integral_normal积分普通购买字段 else if ([0, 3, 5, 7, 10].indexOf(th.data.prom_type) > -1 || newd.is_integral_normal) { newd.prom_type = 0; -- libgit2 0.21.4