From a38fab6d6104496b0e1182f923b14206023bae42 Mon Sep 17 00:00:00 2001 From: banche Date: Mon, 21 Mar 2022 15:32:18 +0800 Subject: [PATCH] fix:购物车先判断库存 --- pages/cart/cart/cart.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index 8cfc5ec..b10c29b 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -2048,6 +2048,15 @@ Page({ return false; }; + if(t.goods_num > redis_num) { + wx.showToast({ + title: '超出活动库存', + icon: 'none', + }); + th.setData({[txt]: redis_num}); + return false; + }; + // 个人限购 //----获取用户活动购买数---- await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum?store_id="+t.store_id+"&user_id="+getApp().globalData.user_id+"&card_id="+t.goods_id+"&prom_type="+t.prom_type+"&prom_id="+t.prom_id, { @@ -2090,16 +2099,6 @@ Page({ }; } - - if(t.goods_num > redis_num) { - wx.showToast({ - title: '超出活动库存', - icon: 'none', - }); - th.setData({[txt]: redis_num}); - return false; - }; - } -- libgit2 0.21.4