From d3457a430b8fb3afa2f4d6badf002491a9841a4b Mon Sep 17 00:00:00 2001
From: Apple <>
Date: Tue, 1 Nov 2022 16:42:06 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E3=80=90C=E7=AB=AF?=
=?UTF-8?q?=E3=80=91=E5=BE=AE=E4=BF=A1=E6=B5=8F=E8=A7=88=E5=99=A8=E6=97=A0?=
=?UTF-8?q?=E6=B3=95=E9=A2=86=E5=8F=96=E6=94=AF=E4=BB=98=E5=AE=9D=E7=AB=8B?=
=?UTF-8?q?=E5=87=8F=E9=87=91=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
coupon/details.html | 2 +-
paysuccess.html | 69 ++++++++++++++++++++++++++++-----------------
2 files changed, 44 insertions(+), 27 deletions(-)
diff --git a/coupon/details.html b/coupon/details.html
index 07fde40..32169c8 100644
--- a/coupon/details.html
+++ b/coupon/details.html
@@ -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,
diff --git a/paysuccess.html b/paysuccess.html
index dcc40c0..d90c85f 100644
--- a/paysuccess.html
+++ b/paysuccess.html
@@ -1,15 +1,11 @@
-
-
+
支付成功
-
-
+
+
@@ -39,7 +35,7 @@
-
@@ -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() {
+ toLinkAlipay () {
//支付宝H5跳转
let self = this;
let banklink = encodeURIComponent(
- window.location.origin +
- "/alipay.html?orderNumber=" + this.orderNumber
+ window.location.origin +
+ "/alipay.html?orderNumber=" + this.orderId
);
let link = "http://openapi.1688sup.com/alipay/oauth?jump=" + banklink;
let ua = navigator.userAgent.toLowerCase(); //判断用户打开链接环境
- window.location.replace(link);
+ 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,18 +186,8 @@
}
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);
- }
}
}
},