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>
<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>
<div v-if="!suspension" class="content">
@ -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;
}