Преглед на файлове

feat: 新增下载app页面

Before преди 6 месеца
родител
ревизия
ea9a75ff5e

+ 9 - 0
src/app/[locale]/(TabBar)/[[...share]]/@prizeWidget/page.tsx

@@ -1,6 +1,15 @@
+import { server } from "@/utils/server";
 import HomePrize from "../_home/HomePrize";
 
+const getPrizeApi = () => {
+    return server.request({
+        url: "/v1/api/front/games_notice_win",
+        method: "post",
+    });
+};
 const Page = async () => {
+    const result = await getPrizeApi();
+    console.log(`🚀🚀🚀🚀🚀-> in page.tsx on 12`, result);
     return <HomePrize></HomePrize>;
 };
 export default Page;

+ 4 - 3
src/app/[locale]/(TabBar)/[[...share]]/_home/HomePrize.tsx

@@ -27,6 +27,7 @@ const HomePrize: FC<Props> = () => {
         staleTime: 5000,
         onError: (error) => {},
         onSuccess: (res) => {
+            console.log(`🚀🚀🚀🚀🚀-> in HomePrize.tsx on 30`, res);
             setWinImg(res.data || []);
         },
     });
@@ -35,8 +36,8 @@ const HomePrize: FC<Props> = () => {
     const [gameInfo, setGameInfo] = useState<any>({});
     const handler = (game: GameListRep) => {
         setVisible(true);
+        console.log(`🚀🚀🚀🚀🚀-> in HomePrize.tsx on 39`, game);
         setGameInfo(game);
-        console.log(game);
     };
 
     const router = useRouter();
@@ -119,12 +120,12 @@ const HomePrize: FC<Props> = () => {
                     <div className={styles.cardWrap} style={{ width: "1.1rem" }}>
                         <img
                             src={gameInfo?.game_icon}
-                            alt={gameInfo?.game_name_cn}
+                            alt={gameInfo?.game_name}
                             className={"h-[100%] w-[100%]"}
                         />
                     </div>
                     <div className={styles.cardWrapGmeInfo}>
-                        <p className={"h-[0.6rem]"}>{gameInfo?.game_name_cn}</p>
+                        <p className={"h-[0.6rem]"}>{gameInfo?.game_name}</p>
 
                         <div className={"flex w-[2.2rem] justify-around"}>
                             {/*<Button*/}

+ 23 - 0
src/app/[locale]/(navbar)/download/layout.tsx

@@ -0,0 +1,23 @@
+import HeaderBack from "@/components/HeaderBack";
+import { getTranslations } from "next-intl/server";
+import { ReactNode } from "react";
+export const generateMetadata = async () => {
+    const t = await getTranslations("titles");
+    return {
+        title: t("message"),
+    };
+};
+export default async function Layout({
+    children,
+    params: { locale },
+}: {
+    children: ReactNode;
+    params: { locale: string };
+}) {
+    return (
+        <>
+            <HeaderBack showBack={true} />
+            <main className={"main-header bg-[#282828]"}>{children}</main>
+        </>
+    );
+}

+ 40 - 0
src/app/[locale]/(navbar)/download/page.tsx

@@ -0,0 +1,40 @@
+const Page = () => {
+    return (
+        <div
+            className={"h-[100%] p-[20px]"}
+            style={{
+                background:
+                    "repeating-linear-gradient(-45deg, #2a2a2a, #2a2a2a .02rem, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) .08rem)",
+            }}
+        >
+            <p>
+                Este jogo é destinado a adultos maiores de 18 anos e é destinado apenas para fins de
+                entretenimento. Não há nenhuma conexão necessária entre os resultados no jogo social
+                e os resultados na vida real.
+            </p>
+            <p>Você pode se divertir jogando de graça, com compras opcionais incluídas no jogo.</p>
+
+            <div className={"mt-[0.1rem] text-center text-[0.18rem] text-[#ff6a01]"}>
+                <p>Baixe o APP e jogue agora! </p>
+            </div>
+
+            <div className={"mt-[0.0694rem]"}>
+                <a
+                    href={"#"}
+                    className={
+                        "flex h-[0.4rem] w-[100%] items-center justify-center " +
+                        " rounded-[0.2778rem] bg-gradient-to-b from-[#ff9323] to-[#ff6a01] font-bold"
+                    }
+                    download={"#"}
+                >
+                    BAIXAR AGORA (3.7MB)
+                </a>
+            </div>
+            <div className={"text-center text-[0.12rem] text-[#919191]"}>
+                Requer Android 4.4 ou acimat
+            </div>
+        </div>
+    );
+};
+
+export default Page;

+ 0 - 8
src/utils/server/index.ts

@@ -52,13 +52,6 @@ class Server {
         options = requestInterceptor(options);
         const { method = "GET", url, headers = {}, data = {}, body, ...other } = options;
         const params = JSON.stringify(data);
-        console.log(`🚀🚀🚀🚀🚀-> in index.ts on 55`, {
-            Token: cookies().get("Token")?.value || "",
-            "Content-Type": "application/json",
-            language: cookies().get("language")?.value || defaultLocale,
-            url: url,
-            ...headers,
-        });
         try {
             const response = await fetch(`${this.BASE_URL}${url}`, {
                 method: method,
@@ -76,7 +69,6 @@ class Server {
                     console.log(`🚀🚀🚀🚀🚀-> in index.ts on 68`, error);
                     return {};
                 });
-                console.log(`🚀🚀🚀🚀🚀-> in index.ts on 79`, response);
             return responseInterceptor<T, R>(response, options, this.BASE_URL);
         } catch (error) {
             console.log(