Commit 4006285e0f0e935f1c8412d03d4c2d0ce247ab8f
1 parent
2adcd0fa
fix:修改购物车检测库存
Showing
1 changed file
with
22 additions
and
29 deletions
pages/cart/cart/cart.js
@@ -2037,7 +2037,7 @@ Page({ | @@ -2037,7 +2037,7 @@ Page({ | ||
2037 | // 检测库存 | 2037 | // 检测库存 |
2038 | if(redis_num == 0) { | 2038 | if(redis_num == 0) { |
2039 | wx.showModal({ | 2039 | wx.showModal({ |
2040 | - title: '超出活动库存1', | 2040 | + title: '超出活动库存', |
2041 | }); | 2041 | }); |
2042 | th.setData({[txt]: redis_num}); | 2042 | th.setData({[txt]: redis_num}); |
2043 | return false; | 2043 | return false; |
@@ -2135,36 +2135,29 @@ Page({ | @@ -2135,36 +2135,29 @@ Page({ | ||
2135 | }; | 2135 | }; |
2136 | 2136 | ||
2137 | // 个人限购 | 2137 | // 个人限购 |
2138 | - //----获取用户活动购买数---- | ||
2139 | - await getApp().request.get("/api/weshop/rechargeServicelist/getUserBuyGoodsNum", { | ||
2140 | - data: { | ||
2141 | - store_id: t.store_id, | ||
2142 | - user_id: getApp().globalData.user_id, | ||
2143 | - card_id: t.goods_id, | ||
2144 | - prom_type: t.prom_type, | ||
2145 | - prom_id: t.prom_id | ||
2146 | - }, | ||
2147 | - //-----获取----- | ||
2148 | - success: function (tt) { | ||
2149 | - if (tt.data.code == 0) { | ||
2150 | - th.setData({ | ||
2151 | - promcardbuynum: tt.data.data.promcardbuynum, | ||
2152 | - cardbuynum: tt.data.data.cardbuynum, | ||
2153 | - }); | ||
2154 | - }; | ||
2155 | - }, | ||
2156 | - | ||
2157 | - }); | 2138 | + //----获取用户活动购买数---- |
2139 | + 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, { | ||
2140 | + }).then(tt => { | ||
2141 | + if (tt.data.code == 0) { | ||
2142 | + th.setData({ | ||
2143 | + promcardbuynum: tt.data.data.promcardbuynum, | ||
2144 | + cardbuynum: tt.data.data.cardbuynum, | ||
2145 | + }); | ||
2146 | + }; | ||
2147 | + }); | ||
2148 | + | ||
2149 | + | ||
2158 | 2150 | ||
2159 | var buylimit = 0 | 2151 | var buylimit = 0 |
2160 | - await getApp().request.get("/api/ms/flash_sale/getNew/" + t.store_id + "/" + getApp().globalData.user_id + "/" + t.prom_id, { | ||
2161 | - success: function (res) { | ||
2162 | - if(res.data.code == 0) { | ||
2163 | - th.data.sele_g = res.data.data; | ||
2164 | - th.data.sele_g.viplimited = res.data.data.buy_limit; | ||
2165 | - buylimit = res.data.data.buy_limit; | ||
2166 | - }; | ||
2167 | - }, | 2152 | + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + t.store_id + "/" + getApp().globalData.user_id + "/" + t.prom_id, { |
2153 | + | ||
2154 | + }).then(res => { | ||
2155 | + if(res.data.code == 0) { | ||
2156 | + | ||
2157 | + th.data.sele_g = res.data.data; | ||
2158 | + th.data.sele_g.viplimited = res.data.data.buy_limit; | ||
2159 | + buylimit = res.data.data.buy_limit; | ||
2160 | + }; | ||
2168 | }); | 2161 | }); |
2169 | 2162 | ||
2170 | 2163 |