fix:修复商品详情检测支付环境提示

This commit is contained in:
wangsongsole 2022-10-11 17:19:55 +08:00
parent 851bdde61d
commit 1b8c953fb1
1 changed files with 17 additions and 9 deletions

View File

@ -22,7 +22,7 @@
<body> <body>
<div id="exchangePage"> <div id="exchangePage">
<!-- 时提框 --> <!-- 时提框 -->
<model-pop :show.sync="popShow" :title="popTitle" :status="popStatus" :text="popText" <model-pop :show.sync="popShow" :title="popTitle" :status="popStatus" :text="popText" :bottom_text="bottomText"
@backFunction="backFunctionPop"></model-pop> @backFunction="backFunctionPop"></model-pop>
<div v-if="!suspension" class="content"> <div v-if="!suspension" class="content">
@ -219,7 +219,8 @@
popTitle: '', popTitle: '',
popText: '', popText: '',
popStatus: 1, /*1 成功 2提示 3失败 */ popStatus: 1, /*1 成功 2提示 3失败 */
bottomText: '', /* 复制按钮 */
href: '',/* 支付地址 */
receive_time: {} receive_time: {}
} }
}, },
@ -305,11 +306,12 @@
window.location.replace('./myOrder.html'); window.location.replace('./myOrder.html');
}, },
openErrorDialog (tip) { openErrorDialog (tip, bottomText) {
this.popTitle = '温馨提示' this.popTitle = '温馨提示'
this.popText = tip this.popText = tip
this.popStatus = 2 this.popStatus = 2
this.popShow = true this.popShow = true
this.bottomText = bottomText
}, },
backHandler () { backHandler () {
@ -331,12 +333,19 @@
}, },
/* 弹窗回调 */ /* 弹窗回调 */
backFunctionPop () { backFunctionPop (type) {
if (this.popStatus === 2) { if (this.bottomText === '点击复制' && type) {
window.location.replace(document.referrer) 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 () { exchangeGoodsFn () {
if (this.goodsDetail.type === 1) { /* 兑换码 */ if (this.goodsDetail.type === 1) { /* 兑换码 */
@ -436,8 +445,6 @@
createdPay (orderNumber) { createdPay (orderNumber) {
req.axiosGet('/key/coupon/createPay/' + orderNumber).then(res => { req.axiosGet('/key/coupon/createPay/' + orderNumber).then(res => {
if (res.code == 200) { if (res.code == 200) {
//判断打开链接的环境
console.log(382, res.data);
this.payWayRun(res.data); this.payWayRun(res.data);
} else { } else {
this.openErrorDialog(res.message); this.openErrorDialog(res.message);
@ -456,7 +463,8 @@
} }
if (this.payType == 2) {// 1微信支付 2 支付宝支付 if (this.payType == 2) {// 1微信支付 2 支付宝支付
if (isWx()) { if (isWx()) {
this.openErrorDialog(`请在其他浏览器打开链接`, '点击复制')
this.href = result;
} else { } else {
window.location.href = result; window.location.href = result;
} }