fix:修复【C端】微信浏览器无法领取支付宝立减金。

This commit is contained in:
Apple 2022-11-01 16:42:06 +08:00
parent 4632930025
commit d3457a430b
2 changed files with 44 additions and 27 deletions

View File

@ -554,7 +554,7 @@
let data = {
"token": localStorage.getItem('token'),
"key": localStorage.getItem('key'),
"code_batch_id": this.goodsDetail.coupon.code_batch_id || this.goodsDetail.code_batch_id,
"code_batch_id": this.goodsDetail.coupon&&this.goodsDetail.coupon.code_batch_id||this.goodsDetail.code_batch_id,
"goods_id": this.goodInfo.goods_id,
"account": this.account || '888888', /* 卡密时默认账号 */
"pay_type": payType == 2 ? 1 : 5,

View File

@ -1,15 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport"
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,viewport-fit=cover" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,viewport-fit=cover" />
<title>支付成功</title>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript"
charset="utf-8"></script>
<script type="text/javascript"
src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144322"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144322"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/modelPop.js?v=3"></script>
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/loading.css">
@ -39,7 +35,7 @@
</div>
</div>
<!-- 弹出提示 -->
<model-pop :show="popAttr.show" :title="popAttr.title" :status="popAttr.status" :text="popAttr.text"
<model-pop :show.sync="popAttr.show" :title="popAttr.title" :status="popAttr.status" :text="popAttr.text" :bottom_text="popAttr.bottomText"
@backFunction="backFunctionPop"></model-pop>
</div>
@ -55,10 +51,12 @@
show: false,
title: '温馨提示',
status: 3,/*1 成功 2提示 3失败 */
text: '错误信息'
text: '错误信息',
bottomText:''
},
plaflam: 1,
payResult:false,
copyLink:'',
redirect_url: '' //微信小程序链接
};
},
@ -126,20 +124,49 @@
openTipDialog(popUpAttr) {
this.popAttr = popUpAttr;
},
/* 弹框回调,点击按钮触发 */
backFunctionPop() {
this.popAttr.show=false;
/* 弹窗回调 */
backFunctionPop (type) {
if (this.popAttr.bottomText === '点击复制' && type) {
var aux = document.createElement("input");
aux.setAttribute("value", this.copyLink);
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
this.openTipDialog({
show: true,
title: '温馨提示',
status: 1,/*1 成功 2提示 3失败 */
text: '复制成功'
});
}
if (this.isLogin) {
this.delayedOut()
}
},
toLinkAlipay () {
//支付宝H5跳转
let self = this;
let banklink = encodeURIComponent(
window.location.origin +
"/alipay.html?orderNumber=" + this.orderNumber
"/alipay.html?orderNumber=" + this.orderId
);
let link = "http://openapi.1688sup.com/alipay/oauth?jump=" + banklink;
let ua = navigator.userAgent.toLowerCase(); //判断用户打开链接环境
if (ua.match(/MicroMessenger/i) == "micromessenger") {
//复制链接地址,提醒去浏览器打开
this.copyLink = link;
this.openErrorDialog(`请复制链接,在其他浏览器打开`, '点击复制')
} else {
//唤起支付宝
window.location.replace(link);
}
},
openErrorDialog (tip, bottomText) {
this.popAttr.text = tip
this.popAttr.show = true
this.popAttr.bottomText = bottomText
},
//领取立减金
receiveFn() {
@ -159,20 +186,10 @@
}
if (this.plaflam == 2) {
//微信
if (ua.indexOf("dingtalk") > -1) {
//在钉钉内置环境打开,不能唤起微信小程序
this.openTipDialog({
show: true,
title: '温馨提示',
status: 2,/*1 成功 2提示 3失败 */
text: '请在其他浏览器打开'
});
} else {
//唤起微信福利官小程序
window.location.replace(this.redirect_url);
}
}
}
},
});
</script>