From d849fa5514bb0c75d32e81d97047fb95ec93a900 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Mon, 8 Jan 2024 16:08:53 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E5=8D=A1=E5=AF=86=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=9B=B4=E6=8E=A5=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coupon/lookCard.html | 65 ++++++++++++++++++++++++++++++-------------- coupon/myOrder.html | 2 +- exchange.html | 29 ++++++++++++++++---- order.html | 2 +- 4 files changed, 70 insertions(+), 28 deletions(-) diff --git a/coupon/lookCard.html b/coupon/lookCard.html index adba319..b553557 100644 --- a/coupon/lookCard.html +++ b/coupon/lookCard.html @@ -9,11 +9,13 @@ + +
-
{{this.toastTip}} @@ -35,32 +37,41 @@
@@ -72,7 +83,13 @@ el: "#app", data () { return { - cardData: {}, + cardData: { + goods: {}, + card_password: null, + card_number: null, + product_name: null, + show_url: null, + }, toastShow: false, toastTip: '' }; @@ -81,7 +98,13 @@ 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 0d3c553..688794d 100644 --- a/exchange.html +++ b/exchange.html @@ -30,6 +30,8 @@ + + @@ -83,6 +85,9 @@ @click="exchangeGoodsFn">立即兑换
+
+ +
{{this.promttip}} @@ -157,6 +162,8 @@ goodsDetail: {},//商品详情 backAble: true, bindClick: false,//控制遮罩显示 + order_number: 0, + loading: false, goodsShow: [ 'https://lsxd-yunshanfu.oss-cn-hangzhou.aliyuncs.com/common_image/20220120/9bedd7af6a8a570be8f2858564f9ec6d.png' ] @@ -233,9 +240,15 @@ this.promttip = ''; }, 3000); }, + //刷新页面 successchangeBtnFn () { - window.location.replace(document.referrer); + if (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) { + localStorage.setItem('orderNumber', this.order_number); + window.location.replace('./coupon/lookCard.html'); + } else { + window.location.replace(document.referrer); + } }, //兑换商品 @@ -325,19 +338,25 @@ self.popboxshow = false; req.axiosPost('/key/usage', data).then(res => { if (res.code == 200) { + this.popboxtype = '成功'; sessionStorage.setItem('lastid', self.goodInfo.product_id); - // 查询订单接口 if (this.goodInfo.product_type === 2) { if (this.goodInfo.card_show == 2) { - this.successTip = '兑换成功,请到页面左下角"订单"(订单列表处)查看卡密信息!'; + this.loading = true; + this.order_number = res.data.order_number; + this.successTip = '兑换成功!'; + setTimeout(() => { + this.popboxshow = true; + this.loading = false; + }, 3000); } else { this.successTip = '兑换成功,请到注意查收手机短信!'; + this.popboxshow = true; } } else { this.successTip = '兑换成功,到账信息请关注官方APP!'; + this.popboxshow = true; } - this.popboxtype = '成功'; - this.popboxshow = true; } else { this.openErrorDialog(res.message); diff --git a/order.html b/order.html index 2425c2b..c8ed545 100644 --- a/order.html +++ b/order.html @@ -322,7 +322,7 @@ /* 查看卡密 */ lookCard (item) { - localStorage.setItem("cardProductDetail", JSON.stringify(item)); + localStorage.setItem("orderNumber", item.order_number); window.location.href = "./coupon/lookCard.html"; },