diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index ff80bfd..2c88752 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -316,6 +316,27 @@ Page({ //--------立即支付---------- async jumpToCart4(e) { + + // 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id} + if (parseInt(this.data.order.order_goods['0']['prom_type']) == 9) { + var aid = this.data.order.order_goods['0']['prom_id']; + var knum = 0; + await r.promiseGet('/api/weshop/activitylist/getActLen/' + os.stoid + '/9/' + aid, { + }).then(res => { + if (res.data.code == 0) { + knum = res.data.data; + } + + }); + + if (knum <= 0) { + getApp().confirmBox("库存为0,支付失败"); + return false; + } + + } + + var th=this; if(this.data.optionIsGoup) wx.navigateTo({ diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index d78921a..1c1a63d 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -484,6 +484,7 @@ Page({ }, /*----------跳转支付-----------*/ async jumpToCart4(t) { + var o_index = t.currentTarget.dataset.idx; var e = this.data.orderList[o_index]; var th = this; @@ -491,6 +492,26 @@ Page({ var order_goods = e.order_goods; var user_id=getApp().globalData.userInfo.user_id; + // 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id} + if (parseInt(order_goods['0']['prom_type']) == 9) { + var aid = order_goods['0']['prom_id']; + var knum = 0; + await r.promiseGet('/api/weshop/activitylist/getActLen/' + os.stoid + '/9/' + aid, { + }).then(res => { + if (res.data.code == 0) { + knum = res.data.data; + } + + }); + + if (knum <= 0) { + getApp().confirmBox("库存为0,支付失败"); + return false; + } + + } + + var wlist = ""; for (var i in order_goods) { var good = order_goods[i];