1
This commit is contained in:
parent
3fc5449883
commit
6d7d4b099c
|
|
@ -246,6 +246,14 @@ export default {
|
||||||
}, 300);
|
}, 300);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查库存
|
||||||
|
const remainStock = (this.goodsInfo.stock || 0) - (this.goodsInfo.sale_stock || 0);
|
||||||
|
if (remainStock <= 0) {
|
||||||
|
this.$c.msg('库存不足,兑换失败');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 登录后如果还没加载支付信息,先加载
|
// 登录后如果还没加载支付信息,先加载
|
||||||
if (!this.orderData) {
|
if (!this.orderData) {
|
||||||
this.loadDetail().then(() => {
|
this.loadDetail().then(() => {
|
||||||
|
|
@ -301,6 +309,14 @@ export default {
|
||||||
this.$c.msg(this.$config.getAppSetting('currency2_name') + '不足');
|
this.$c.msg(this.$config.getAppSetting('currency2_name') + '不足');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 再次检查库存(防止并发购买)
|
||||||
|
const remainStock = (this.goodsInfo.stock || 0) - (this.goodsInfo.sale_stock || 0);
|
||||||
|
if (remainStock <= 0) {
|
||||||
|
this.$c.msg('库存不足,兑换失败');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const res = await createMallOrder({ goods_id: this.goodsId, prize_num: 1 });
|
const res = await createMallOrder({ goods_id: this.goodsId, prize_num: 1 });
|
||||||
if (res.status == 1) {
|
if (res.status == 1) {
|
||||||
this.$refs.orderPop.close();
|
this.$refs.orderPop.close();
|
||||||
|
|
|
||||||
|
|
@ -2415,7 +2415,7 @@ public class OrderService : IOrderService
|
||||||
|
|
||||||
if (prizeItem == null)
|
if (prizeItem == null)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("暂无奖品信息");
|
throw new InvalidOperationException("库存不足,兑换失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 12. 扣减奖品库存
|
// 12. 扣减奖品库存
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user