Переглянути джерело

Merge branch 'develop/3.2.1' into pre

Damon 11 місяців тому
батько
коміт
4d4f14ea6f
3 змінених файлів з 2083 додано та 12 видалено
  1. 7 0
      src/pages.json
  2. 29 12
      src/pages/pay/index.vue
  3. 2047 0
      src/pages/weixin/index.vue

+ 7 - 0
src/pages.json

@@ -214,6 +214,13 @@
       "style": {
         "navigationStyle": "custom"
       }
+    },
+    {
+      // 微信浏览器检测
+      "path": "pages/weixin/index",
+      "style": {
+        "navigationStyle": "custom"
+      }
     }
   ]
 }

+ 29 - 12
src/pages/pay/index.vue

@@ -173,6 +173,7 @@ wechatPay,
 export default {
   data() {
     return {
+      isWeixin: false,
       type: "center",
       msgType: "success",
       messageText: "这是一条成功提示",
@@ -203,6 +204,14 @@ export default {
   },
 
   onLoad(e) {
+    // this.detectWeixin();
+    // if (!this.isWeixin){
+    //   // 跳转到微信页面
+    //   uni.navigateTo({
+    //     url: `/pages/weixin/index`,
+    //   });
+    // }
+
     this.state = e.state;
     this.getOpenId(e);
     this.getDetail();
@@ -211,6 +220,14 @@ export default {
     this.getNewAcitivityDetail();
   },
   methods: {
+    // detectWeixin() {
+    //   let userAgent = navigator.userAgent;
+    //   if (userAgent.includes("MicroMessenger")) {
+    //     this.isWeixin = true
+    //   } else {
+    //     this.isWeixin = false
+    //   }
+    // },
     // 联通流量详细信息
     getNewAcitivityDetail() {
       newAcitivityDetail({
@@ -229,20 +246,20 @@ export default {
             this.msgType = "success";
             this.$refs.alertDialog.open();
           } else {
-            uni.showToast({
-              title: res.data.msg,
-              icon: "none",
-              mask: true,
-              duration: 4000,
-            });
+            // uni.showToast({
+            //   title: res.data.msg,
+            //   icon: "none",
+            //   mask: true,
+            //   duration: 4000,
+            // });
           }
         } else {
-          uni.showToast({
-            title: res.message,
-            icon: "none",
-            mask: true,
-            duration: 4000,
-          });
+          // uni.showToast({
+          //   title: res.message,
+          //   icon: "none",
+          //   mask: true,
+          //   duration: 4000,
+          // });
         }
       });
     },

Різницю між файлами не показано, бо вона завелика
+ 2047 - 0
src/pages/weixin/index.vue