Leon vor 1 Jahr
Ursprung
Commit
46292c840a
2 geänderte Dateien mit 7 neuen und 12 gelöschten Zeilen
  1. 7 0
      src/features/trackTimeDuration/hooks/Common.tsx
  2. 0 12
      src/pages/clock/Clock.tsx

+ 7 - 0
src/features/trackTimeDuration/hooks/Common.tsx

@@ -1,6 +1,9 @@
+import showAlert from "@/components/basic/Alert";
 import { ColorType } from "@/context/themes/color"
 import Taro from "@tarojs/taro"
 
+let lastJumpTime = 0;
+
 export const getThemeColor = (time: any) => {
     if (time.scenario == 'FAST') {
         return global.fastColor ? global.fastColor : ColorType.fast
@@ -17,6 +20,9 @@ export const getThemeColor = (time: any) => {
 }
 
 export const jumpPage = (url?: string, pageName?: string, navigation?: any, params?: any) => {
+    if (new Date().getTime() - lastJumpTime < 600) {
+        return
+    }
     if (process.env.TARO_ENV == 'rn') {
         navigation.push(pageName,params);
     }
@@ -25,4 +31,5 @@ export const jumpPage = (url?: string, pageName?: string, navigation?: any, para
             url: url ?? ''
         })
     }
+    lastJumpTime = new Date().getTime();
 }

+ 0 - 12
src/pages/clock/Clock.tsx

@@ -890,20 +890,8 @@ export default function Page() {
     }
 
     function tapLogin() {
-        // if (process.env.TARO_ENV=='rn'){
-        //     Taro.getLocation({
-        //         success(result) {
-        //             console.log(result)
-        //         },
-        //         fail(res) {
-        //             console.log(res)
-        //         },
-        //     })
-        //     return
-        // }
         if (!user.isLogin) {
             jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
-            return
         }
     }