From 1b8c953fb1ddf59f0c905fdc99d061d53d22a7fa Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Tue, 11 Oct 2022 17:19:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=A3=80=E6=B5=8B=E6=94=AF=E4=BB=98=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coupon/exchange.html | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/coupon/exchange.html b/coupon/exchange.html index 91609e8..1c9c2a7 100644 --- a/coupon/exchange.html +++ b/coupon/exchange.html @@ -22,7 +22,7 @@
-
@@ -219,7 +219,8 @@ popTitle: '', popText: '', popStatus: 1, /*1 成功 2提示 3失败 */ - + bottomText: '', /* 复制按钮 */ + href: '',/* 支付地址 */ receive_time: {} } }, @@ -305,11 +306,12 @@ window.location.replace('./myOrder.html'); }, - openErrorDialog (tip) { + openErrorDialog (tip, bottomText) { this.popTitle = '温馨提示' this.popText = tip this.popStatus = 2 this.popShow = true + this.bottomText = bottomText }, backHandler () { @@ -331,12 +333,19 @@ }, /* 弹窗回调 */ - backFunctionPop () { - if (this.popStatus === 2) { - window.location.replace(document.referrer) + backFunctionPop (type) { + if (this.bottomText === '点击复制' && type) { + var aux = document.createElement("input"); + aux.setAttribute("value", this.href); + document.body.appendChild(aux); + aux.select(); + document.execCommand("copy"); + document.body.removeChild(aux); + this.openDialog('复制成功') } }, + //兑换商品 exchangeGoodsFn () { if (this.goodsDetail.type === 1) { /* 兑换码 */ @@ -436,8 +445,6 @@ createdPay (orderNumber) { req.axiosGet('/key/coupon/createPay/' + orderNumber).then(res => { if (res.code == 200) { - //判断打开链接的环境 - console.log(382, res.data); this.payWayRun(res.data); } else { this.openErrorDialog(res.message); @@ -456,7 +463,8 @@ } if (this.payType == 2) {// 1微信支付 2 支付宝支付 if (isWx()) { - + this.openErrorDialog(`请在其他浏览器打开链接`, '点击复制') + this.href = result; } else { window.location.href = result; }