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) {