This commit is contained in:
zpc 2026-03-14 17:10:06 +08:00
parent fc7ad732bf
commit 4ae08406a0
2 changed files with 19 additions and 11 deletions

View File

@ -337,6 +337,13 @@ export default {
console.log(`[商城订单] payByWechat 响应: status=${res.status} msg=${res.msg} data.status=${res.data?.status}`);
if (res.status == 1) {
this.$refs.orderPop.close();
//
if (this.goodsInfo.goodslist_surplus_stock != null) {
this.goodsInfo.goodslist_surplus_stock = Math.max(0, this.goodsInfo.goodslist_surplus_stock - 1);
}
if (this.goodsInfo.sale_stock != null) {
this.goodsInfo.sale_stock = (this.goodsInfo.sale_stock || 0) + 1;
}
if (res.data.status == 1) {
const status = await this.$platform.pay({ data: res.data.res }, this);
console.log(`[商城订单] 微信支付结果: ${status}`);
@ -373,22 +380,23 @@ export default {
console.log(`[商城订单] createMallOrder 响应: status=${res.status} msg=${res.msg} data.status=${res.data?.status}`);
if (res.status == 1) {
this.$refs.orderPop.close();
//
if (this.goodsInfo.goodslist_surplus_stock != null) {
this.goodsInfo.goodslist_surplus_stock = Math.max(0, this.goodsInfo.goodslist_surplus_stock - 1);
}
if (this.goodsInfo.sale_stock != null) {
this.goodsInfo.sale_stock = (this.goodsInfo.sale_stock || 0) + 1;
}
if (res.data.status == 1) {
const status = await this.$platform.pay({ data: res.data.res }, this);
if (status == 'success') {
this.$c.msg('兑换成功');
// ""
setTimeout(() => {
this.silentLoadDetail();
}, 1600);
this.silentLoadDetail();
}
} else {
// /
this.$c.msg('兑换成功');
// ""
setTimeout(() => {
this.silentLoadDetail();
}, 1600);
this.silentLoadDetail();
}
}
}

View File

@ -163,6 +163,8 @@ export default {
selected: 2
});
}
//
this.getData();
this.$platform.getOrderNo(this).then(order_num => {
if (order_num != null && order_num != "") {
this.$c.msg("购买成功!");
@ -199,9 +201,7 @@ export default {
console.log(`[商城列表] id=${item.id} title=${item.title} stock=${item.stock} sale_stock=${item.sale_stock}`);
});
if (isWXPay) {
if (this.datas.length > 0) {
this.datas = this.datas.slice(0, this.datas.length);
}
this.datas = [];
for (let index = 0; index < res.data.data.length; index++) {
const element = res.data.data[index];
if (element.title.indexOf('京东卡') == -1) {