diff --git a/coupon/lookCard.html b/coupon/lookCard.html index adba319..87d3f7f 100644 --- a/coupon/lookCard.html +++ b/coupon/lookCard.html @@ -9,6 +9,9 @@ + +
@@ -35,7 +38,7 @@卡号:
-{{cardData.card_number}}
+{{cardData.card_number||'卡密正在生成中,请稍后刷新再查看'}}
@@ -44,7 +47,7 @@
密码:
-{{cardData.card_password}}
+{{cardData.card_password||'卡密正在生成中,请稍后刷新再查看'}}
@@ -55,7 +58,7 @@
卡密: {{cardData.card_password}} {{cardData.card_password||'卡密正在生成中,请稍后刷新再查看'}}
@@ -78,10 +81,14 @@
};
},
-
-
created () {
- this.cardData = JSON.parse(localStorage.getItem('cardProductDetail'));
+ const orderNumber = localStorage.getItem('orderNumber');
+ /* 获取卡密详情 */
+ req.axiosGet(`/key/order/detail/${orderNumber}`).then(res => {
+ if (res.code == 200) {
+ this.cardData = res.data;
+ }
+ });
},
methods: {
diff --git a/coupon/myOrder.html b/coupon/myOrder.html
index 3e00931..37a133f 100644
--- a/coupon/myOrder.html
+++ b/coupon/myOrder.html
@@ -181,7 +181,7 @@
/* 查看卡密 */
lookCard (item) {
- localStorage.setItem("cardProductDetail", JSON.stringify(item));
+ localStorage.setItem("orderNumber", item.order_number);
window.location.href = './lookCard.html';
},
diff --git a/exchange.html b/exchange.html
index c414f3f..52286c6 100644
--- a/exchange.html
+++ b/exchange.html
@@ -239,24 +239,13 @@
//刷新页面
successchangeBtnFn () {
if (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) {
- this.getCardDetails();
+ localStorage.setItem("orderNumber", this.order_number);
+ window.location.href = './coupon/lookCard.html';
} else {
window.location.replace(document.referrer);
}
},
- /* 获取卡密详情 */
- getCardDetails () {
- req.axiosGet(`/key/order/detail/${this.order_number}`).then(res => {
- if (res.code == 200) {
- localStorage.setItem('cardProductDetail', JSON.stringify(res.data));
- window.location.replace('./coupon/lookCard.html');
- } else {
- this.openErrorDialog(res.message);
- }
- });
- },
-
//兑换商品
exchangeGoodsFn () {
if (goodsDetail.available != 1) {
diff --git a/order.html b/order.html
index fa72463..304c0db 100644
--- a/order.html
+++ b/order.html
@@ -250,7 +250,7 @@
/* 查看卡密 */
lookCard (item) {
- localStorage.setItem("cardProductDetail", JSON.stringify(item));
+ localStorage.setItem("orderNumber", item.order_number);
window.location.href = './coupon/lookCard.html';
},