فهرست منبع

fix: 完成短信接口对接,忘记密码功能完善,完善游戏跳转方式,其他bug修改。

Before 8 ماه پیش
والد
کامیت
b257d95863
3فایلهای تغییر یافته به همراه21 افزوده شده و 18 حذف شده
  1. 2 2
      .env.test
  2. 1 1
      src/app/[locale]/verification/page.tsx
  3. 18 15
      src/components/Card/Card.tsx

+ 2 - 2
.env.test

@@ -1,7 +1,7 @@
 #baseurl
-NEXT_PUBLIC_BASE_URL=http://192.168.0.84:8800
+NEXT_PUBLIC_BASE_URL=http://192.168.0.231:31549
 #sharelink
-NEXT_PUBLIC_SHARE_URL=http://192.168.0.84:3000
+NEXT_PUBLIC_SHARE_URL=http://192.168.0.231:32568
 #firebase
 NEXT_PUBLIC_FIREBASE_APIKEY=AIzaSyDAWORGKhdyzb5KeqTi535VmD5gN2Cdle8
 NEXT_PUBLIC_FIREBASE_AUTHDOMAIN=bcwin-a99b1.firebaseapp.com

+ 1 - 1
src/app/[locale]/verification/page.tsx

@@ -17,7 +17,7 @@ const ResetPhone: FC<Props> = () => {
     const t = useTranslations("VerificationPage");
     const tCode = useTranslations();
     const router = useRouter();
-    const staticTime = Date.now() + 3 * 1000;
+    const staticTime = Date.now() + 60 * 1000;
     //  是否发送
     const [isSend, setIsSend] = useState(true);
     let [time, setTime] = useState<number>();

+ 18 - 15
src/components/Card/Card.tsx

@@ -18,7 +18,6 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
     const { render, item, groupType } = props;
 
     const t = useTranslations("Game");
-    const urlRef = useRef<string>("");
     const brandRef = useRef<string>("");
     const score = useWalletStore((state) => state.score);
 
@@ -30,15 +29,8 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
         setVisible(true);
         brandRef.current = brandList.find((item) => item.gid === game.game_id)?.brand ?? "";
         if (!token) return;
-        const params = {
-            id: game.id,
-            mode: groupType,
-        };
-        getGameDetailApi(params).then((res) => {
-            urlRef.current = res.data?.game_url;
-        });
     };
-    const playGameHandler = () => {
+    const playGameHandler = (game: GameListRep) => {
         if (!token) {
             router.push("/login?redirect=/");
             return;
@@ -47,11 +39,22 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
             router.push("/deposit");
             return;
         }
-        if (urlRef.current) {
-            window.open(`${urlRef.current}&brand=${brandRef.current}`);
-        } else {
-            Toast.show("数据错误");
-        }
+        Toast.show({
+            icon: "loading",
+            duration: 0,
+            maskStyle: { zIndex: 99999, background: "rgba(0,0,0,0.5)" },
+        });
+        const params = {
+            id: game.id,
+            mode: groupType,
+        };
+        getGameDetailApi(params).then((res) => {
+            if (res.data && res.data.game_url) {
+                window.open(`${res.data?.game_url}&brand=${brandRef.current}`);
+            } else {
+                Toast.show("数据错误");
+            }
+        });
     };
     return (
         <>
@@ -102,7 +105,7 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
                             {/*    {t("demo")}*/}
                             {/*</Button>*/}
                             <Button
-                                onClick={playGameHandler}
+                                onClick={() => playGameHandler(item!)}
                                 style={{
                                     "--background-color": "#009d80",
                                     "--border-color": "#009d80",