Browse Source

feat(小程序/跳转): 新增跳转文章

qq12rrr 3 days ago
parent
commit
214ebb99eb
1 changed files with 18 additions and 3 deletions
  1. 18 3
      src/app.tsx

+ 18 - 3
src/app.tsx

@@ -34,10 +34,25 @@ const App = (props: PropsWithChildren<IAppProps>) => {
   useRequest(() => {
     return UserHelper.cacheTabMenu();
   });
-  useDidShow((options) => {
+  useDidShow((options: any) => {
     if (options.query.source === "app") {
+      let jumpUrls = "";
+
+      switch (options.query) {
+        case "cyr":
+          jumpUrls = "https://mp.weixin.qq.com/s/TBP2VhzYRaMWf_CWbo5mBA";
+          break;
+        case "hrqb":
+          jumpUrls = "https://mp.weixin.qq.com/s/JJrWlgaA1lvIBAp7eNZjxg";
+          break;
+        default:
+          // 默认惠融钱包的文章
+          jumpUrls = "https://mp.weixin.qq.com/s/JJrWlgaA1lvIBAp7eNZjxg";
+          break;
+      }
+
       RouteUtil.toWebViewPage({
-        url: "https://mp.weixin.qq.com/s/4umQqPbPGfCgXqCizeXqKA",
+        url: jumpUrls,
       });
     }
   });
@@ -59,7 +74,7 @@ const App = (props: PropsWithChildren<IAppProps>) => {
         },
       }}
     >
-      <WebView src='https://mp.weixin.qq.com/s/4umQqPbPGfCgXqCizeXqKA'></WebView>
+      <WebView src="https://mp.weixin.qq.com/s/4umQqPbPGfCgXqCizeXqKA"></WebView>
       <ReduxProvider store={ReduxUtil.store}>{props.children}</ReduxProvider>
     </AppContext.Provider>
   );