From 11e970255325346c90a2659c224f4006d7f4512a Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 3 Apr 2024 17:51:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reduce.html | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/reduce.html b/reduce.html index b5eb857..f9a866e 100644 --- a/reduce.html +++ b/reduce.html @@ -234,26 +234,21 @@ if (res.code == 200) { sessionStorage.setItem("lastid", self.goodInfo.product_id); this.orderId = res.data.order_number; - let ua = navigator.userAgent.toLowerCase(); //判断用户打开链接环境 - if (self.plaflam == 1) { - //支付宝-微信环境中不能唤起支付宝 - self.toLinkAlipay(); - } - if (self.plaflam == 2) { - //微信 - // if (ua.indexOf("dingtalk") > -1) { - // //在钉钉内置环境打开,不能唤起微信小程序 - // self.openErrorDialog("请在其他浏览器打开!"); - // } else { - if (this.goodInfo.entity.is_webview == 1) { - this.publicCollection(res.data.order_number); - } else { - //唤起微信福利官小程序 - window.location.replace(res.data.redirect_url); - } - // } + let ua = navigator.userAgent.toLowerCase(); //判断用户打开链接环境 + // 第一步:如果是微信 + if (ua.match(/MicroMessenger/i) == "micromessenger") { + this.publicCollection(res.data.order_number); + return } + + // 如果是支付宝 + if (ua.match(/Alipay/i) == "alipay") { + self.toLinkAlipay(); + return; + } + // 其它方式 唤起微信福利官小程序 + window.location.replace(res.data.redirect_url); } else { self.openErrorDialog(res.message); if (res.code == 403) {