♻️ refactor: 重构单个卡密兑换逻辑
This commit is contained in:
parent
bce181d2b3
commit
71999bcc52
|
@ -243,15 +243,7 @@
|
||||||
|
|
||||||
//刷新页面
|
//刷新页面
|
||||||
successchangeBtnFn () {
|
successchangeBtnFn () {
|
||||||
/* 只有卡密商品时 直接跳转查看卡密页面 */
|
window.location.replace(document.referrer);
|
||||||
if (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2 && !this.backAble) {
|
|
||||||
this.popboxshow = false;
|
|
||||||
this.maskshow = false;
|
|
||||||
localStorage.setItem('orderNumber', this.order_number);
|
|
||||||
window.location.href = './coupon/lookCard.html';
|
|
||||||
} else {
|
|
||||||
window.location.replace(document.referrer);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//兑换商品
|
//兑换商品
|
||||||
|
@ -260,11 +252,13 @@
|
||||||
return this.openErrorDialog(product_status(goodsDetail.available, goodsDetail));
|
return this.openErrorDialog(product_status(goodsDetail.available, goodsDetail));
|
||||||
}
|
}
|
||||||
/* 卡密商品直接兑换 */
|
/* 卡密商品直接兑换 */
|
||||||
if (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) {
|
if (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2 && this.backAble) {
|
||||||
this.maskshow = true;
|
this.maskshow = true;
|
||||||
this.popboxshow = true;
|
this.popboxshow = true;
|
||||||
this.popboxtype = '兑换';
|
this.popboxtype = '兑换';
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
return this.surexchangeBtn();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!this.account) {
|
if (!this.account) {
|
||||||
|
@ -351,10 +345,9 @@
|
||||||
if (this.goodInfo.card_show == 2) {
|
if (this.goodInfo.card_show == 2) {
|
||||||
if (!this.backAble) { /* 当只有一个卡密商品时 */
|
if (!this.backAble) { /* 当只有一个卡密商品时 */
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.order_number = res.data.order_number;
|
|
||||||
this.successTip = '兑换成功!';
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.popboxshow = true;
|
localStorage.setItem('orderNumber', res.data.order_number);
|
||||||
|
window.location.href = './coupon/lookCard.html';
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}, 3000);
|
}, 3000);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue