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; }