Browse Source

feat(跳转): 新增当query里有参数openUrl时,自动跳转到对应的地址

qq12rrr 4 weeks ago
parent
commit
a28516ec72
1 changed files with 9 additions and 7 deletions
  1. 9 7
      src/app.tsx

+ 9 - 7
src/app.tsx

@@ -36,10 +36,9 @@ const App = (props: PropsWithChildren<IAppProps>) => {
     return UserHelper.cacheTabMenu();
   });
   useDidShow((options: any) => {
+    console.log("This is Options", options);
 
-    console.log('This is Options', options)
-    
-    let jumpUrls = ""
+    let jumpUrls = "";
     if (options.query?.source) {
       switch (options.query?.source) {
         case "app": {
@@ -57,20 +56,24 @@ const App = (props: PropsWithChildren<IAppProps>) => {
                 break;
             }
           }
-          break
+          break;
         }
         case "gxh": {
-          jumpUrls = 'https://mp.weixin.qq.com/s/RvsITI6t7_T-2UFC2pJvww'
+          jumpUrls = "https://mp.weixin.qq.com/s/RvsITI6t7_T-2UFC2pJvww";
           break;
         }
         case "wallet": {
-          jumpUrls = 'https://mp.weixin.qq.com/s/M-lkx1MTMRv2p7v-6ZFykg'
+          jumpUrls = "https://mp.weixin.qq.com/s/M-lkx1MTMRv2p7v-6ZFykg";
           break;
         }
       }
       RouteUtil.toWebViewPage({
         url: jumpUrls,
       });
+    } else if (options.query?.openUrl) {
+      RouteUtil.toWebViewPage({
+        url: options.query?.openUrl,
+      });
     }
     // if (options.query?.source === "app" && options.query?.platform) {
     //   let jumpUrls = "";
@@ -88,7 +91,6 @@ const App = (props: PropsWithChildren<IAppProps>) => {
     //       break;
     //   }
 
-
     // }
 
     if (StorageUtil.get(EStorage.channelCode)) {