From f899da66af4800bf4f0ea8cdff5b6f7937c09751 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Wed, 1 Mar 2023 18:07:04 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=84=20refactor(=E7=AB=8B=E5=87=8F?= =?UTF-8?q?=E9=87=91=E9=A2=86=E5=8F=96=E9=A1=B5):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alipay.html | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/alipay.html b/alipay.html index 8789e6a..1cd6221 100644 --- a/alipay.html +++ b/alipay.html @@ -117,13 +117,17 @@ return null; }, //获取订单详情 - getOrderDetail (id) { + getOrderDetail (id, isNext = false, message = '') { req.axiosGet('/voucher/info', { order_number: id }).then(res => { this.reduceInfo = res.data.rule; this.reduceInfo.status = res.data.status; this.couponInfo = res.data; + if (isNext) { + window.location.href = './advise.html'; + sessionStorage.setItem('messageTip', message); + } }).catch(); }, toReceive () { @@ -143,14 +147,8 @@ setTimeout(() => { this.disabledBtn = false; }, 2000); - if (res.code == 200) { - window.location.href = './advise.html'; - this.getOrderDetail(); - sessionStorage.setItem('messageTip', ''); - } else { - window.location.href = './advise.html'; - sessionStorage.setItem('messageTip', res.message); - } + const text = res.code == 200 ? '' : res.message; + this.getOrderDetail(this.orderNumber, true, text); }) .catch((err) => { }); }, @@ -173,13 +171,13 @@ return '立即领取'; break; case 1: - return '充值中'; + return '立即领取'; break; case 2: - return '已完成'; + return '已领取'; break; case 3: - return '充值失败'; + return '立即领取'; break; case 5: return '已过期';