Forráskód Böngészése

feat: 543 【bcwin网站】增加apk下载功能

Before 6 hónapja
szülő
commit
7189ec2795

BIN
public/download/bg.png


BIN
public/download/button.png


+ 10 - 10
src/app/[locale]/(enter)/components/GoogleCom/index.tsx

@@ -21,16 +21,16 @@ const GoogleCom: FC<GoogleComProps> = ({ title = "", text = "", callbackFun }) =
             <div className="title">
                 <h2>{title || t("Googletitle")}</h2>
             </div>
-            <div className="otherAccount">
-                <div className="ggAfb" onClick={callbackFun}>
-                    <span className="gg">
-                        <i></i> {text || t("Googletext")}
-                    </span>
-                </div>
-                <div className="or">
-                    <span>OU</span>
-                </div>
-            </div>
+            {/*<div className="otherAccount">*/}
+            {/*    <div className="ggAfb" onClick={callbackFun}>*/}
+            {/*        <span className="gg">*/}
+            {/*            <i></i> {text || t("Googletext")}*/}
+            {/*        </span>*/}
+            {/*    </div>*/}
+            {/*    <div className="or">*/}
+            {/*        <span>OU</span>*/}
+            {/*    </div>*/}
+            {/*</div>*/}
         </div>
     );
 };

+ 4 - 3
src/app/[locale]/(enter)/components/GoogleCom/style.scss

@@ -1,8 +1,9 @@
 .GoogleCom {
   width: 100%;
   height: auto;
-  background-color: #1f1f1f;
+  //background-color: #1f1f1f;
   padding: .72rem .18rem 0;
+  margin-bottom: .2rem;
 
   .title {
     font-size: .16rem;
@@ -16,7 +17,7 @@
 
   .otherAccount {
     margin: .2rem 0 .1rem;
-    
+
     .ggAfb {
       display: flex;
       -webkit-box-pack: center;
@@ -82,4 +83,4 @@
       }
     }
   }
-}
+}

+ 88 - 19
src/app/[locale]/(navbar)/download/page.tsx

@@ -1,4 +1,68 @@
-const Page = () => {
+import { server } from "@/utils/server";
+import Image from "next/image";
+
+/**
+ * @description
+ * 获取下载应用信息
+ *   POST /v1/api/front/app/info
+ *   接口ID:254339242
+ *   接口地址:https://app.apifox.com/link/project/4790544/apis/api-254339242
+ */
+interface AppInfoTypes {
+    /**
+     * 创建时间
+     */
+    created_at: number;
+    /**
+     * ID 编号
+     */
+    id: number;
+    /**
+     * 名称
+     */
+    name: string;
+    /**
+     * 文件大小
+     */
+    size: number;
+    /**
+     * 更新时间
+     */
+    updated_at: number;
+    /**
+     * 下载地址
+     */
+    url: string;
+    /**
+     * 版本号
+     */
+    version: string;
+}
+const getAppInfoApi = async () => {
+    return server.request<AppInfoTypes>({
+        url: "/v1/api/front/app/info",
+        method: "POST",
+    });
+};
+/**
+ * @description  大小转kb - mb -gb
+ * @date: 2025/1/15
+ */
+const filterSize = (size: number) => {
+    if (!size) return "";
+    // if (size < pow1024(1)) return size + " B";
+    // if (size < pow1024(2)) return (size / pow1024(1)).toFixed(2) + " KB";
+    if (size < pow1024(3)) return (size / pow1024(2)).toFixed(2) + " MB";
+    if (size < pow1024(4)) return (size / pow1024(3)).toFixed(2) + " GB";
+    return (size / pow1024(4)).toFixed(2) + " TB";
+};
+
+// 求次幂
+function pow1024(num: number) {
+    return Math.pow(1024, num);
+}
+const Page = async () => {
+    const { data } = await getAppInfoApi();
     return (
         <div
             className={"h-[100%] p-[20px]"}
@@ -7,33 +71,38 @@ const Page = () => {
                     "repeating-linear-gradient(-45deg, #2a2a2a, #2a2a2a .02rem, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) .08rem)",
             }}
         >
-            <p>
+            <p className={"text-center"}>
                 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.
+                entretenimento.
+            </p>
+            <p className={"mt-[0.0694rem] text-center"}>
+                Não há nenhuma conexão necessária entre os resultados no jogo social e os resultados
+                na vida real.Você pode se divertir jogando de graça, com compras opcionais incluídas
+                no jogo.
             </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]"}>
+            <div className={"mt-[0.1rem] text-center text-[0.18rem] text-[#edc610]"}>
                 <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 text-[#fff]"
-                    }
-                    download={"#"}
-                >
-                    BAIXAR AGORA (3.7MB)
+            <div
+                className={
+                    "relative h-[80px] bg-[url(/download/button.png)]" +
+                    " mt-[0.0694rem] flex bg-contain bg-center bg-no-repeat" +
+                    " items-center justify-center"
+                }
+            >
+                <a href={data.url} className={"font-bold text-[#fff]"} download={data.name}>
+                    BAIXAR AGORA ({filterSize(data.size)})
                 </a>
             </div>
-            <div className={"text-center text-[0.12rem] text-[#919191]"}>
-                Requer Android 4.4 ou acimat
+
+            <div className={"mt-[10px] text-center text-[#b1b1b1]"}>
+                <p className={"text-[0.12rem]"}>Requer Android 4.4 ou acimat</p>
+                <p className={"iconfont icon-Upxiangshang30 text-[0.3472rem]"}></p>
             </div>
+
+            <Image src={"/download/bg.png"} alt={"1"} width={600} height={400} />
         </div>
     );
 };