Browse Source

fix: 增加停服通知

ansoni 5 tháng trước cách đây
mục cha
commit
dcfae5d53c

+ 1 - 0
messages/br.json

@@ -465,6 +465,7 @@
     "start": "Início",
     "deposit": "Depósito",
     "affiliated": "Afiliado",
+    "promocoes": "Promoções",
     "exports":"Esportes",
     "profile": "Perfil"
   },

+ 68 - 3
src/app/[locale]/providers.tsx

@@ -8,12 +8,14 @@ import { ThemeProviderProps } from "next-themes/dist/types";
 import { ReactNode, useEffect, useRef, useState } from "react";
 import { Swiper, SwiperClass, SwiperSlide } from "swiper/react";
 
-import { setupFontSize } from "@/utils";
-import { useDebounceEffect } from "ahooks";
+import { server } from "@/utils/client";
+import { useDebounceEffect, useRequest } from "ahooks";
 import { initializeApp } from "firebase/app";
 import { getMessaging, getToken, onMessage } from "firebase/messaging";
 import { useSearchParams } from "next/navigation";
 import Script from "next/script";
+
+import { motion } from "framer-motion";
 export interface ProvidersProps {
     children: ReactNode;
     themeProps?: Omit<ThemeProviderProps, "children">;
@@ -65,7 +67,68 @@ const initFirebase = () => {
         });
     });
 };
+/**
+ * 获取停服公告信息
+ *   POST /v1/api/front/suspension
+ *   接口ID:263127760
+ *   接口地址:https://app.apifox.com/link/project/4790544/apis/api-263127760
+ */
+interface SuspensionType {
+    able: boolean;
+}
+const getStopServiceApi = () => {
+    return server
+        .post<SuspensionType>({
+            url: "/v1/api/front/suspension",
+            data: { renter_id: "10000" },
+        })
+        .then((res) => {
+            return res.data.able ?? false;
+        });
+};
+
+const StopServiceClient = () => {
+    const { data: isSuspension } = useRequest(getStopServiceApi, {
+        pollingInterval: 10000,
+        pollingErrorRetryCount: 3,
+        pollingWhenHidden: false,
+    });
 
+    return (
+        <>
+            {isSuspension && (
+                <div
+                    className={
+                        "absolute left-0 right-0 top-[60px] z-10 bg-[#fff] p-[20px]" +
+                        " text-[14px] text-[#000]"
+                    }
+                >
+                    <div className={"flex items-center"}>
+                        <div>
+                            <motion.div
+                                animate={{ opacity: [0, 100, 0] }}
+                                transition={{ repeat: Infinity, repeatDelay: 1 }}
+                            >
+                                <span
+                                    className={
+                                        "iconfont icon-gantanhao mr-[10px] text-primary-color" +
+                                        " text-[0.2rem]"
+                                    }
+                                ></span>
+                            </motion.div>
+                        </div>
+
+                        <span>
+                            O site está prestes a parar de ser atualizado, a fim de proteger a
+                            segurança de seus fundos, temporariamente impossibilitado de fazer
+                            apostas
+                        </span>
+                    </div>
+                </div>
+            )}
+        </>
+    );
+};
 const Layout = ({ children, themeProps }: ProvidersProps) => {
     const { isCollapse, setCollapse } = useSystemStore((state) => ({
         isCollapse: state.isCollapse,
@@ -111,6 +174,7 @@ const Layout = ({ children, themeProps }: ProvidersProps) => {
                 </SwiperSlide>
 
                 <SwiperSlide style={{ width: "100%", height: "100%" }}>
+                    <StopServiceClient />
                     <section className="relative h-[100%]" ref={homeContainerRef}>
                         {children}
                     </section>
@@ -223,12 +287,13 @@ export const Providers = ({ children, themeProps }: ProvidersProps) => {
         // 初始化配置
         setupConfig();
         // 初始化字体
-        setupFontSize();
+        // setupFontSize();
     }, []);
 
     return (
         <ConfigProvider locale={ptBR}>
             <InitAdvertise />
+
             <Layout>{children}</Layout>
         </ConfigProvider>
     );

+ 3 - 1
src/app/globals.scss

@@ -58,7 +58,7 @@ html, body {
 }
 
 html {
-  font-size: 104px;
+  font-size: 144px;
 }
 body{
   position: relative;
@@ -162,6 +162,8 @@ input[type=number] {
 @media (min-width: 360px){html{font-size: 96px;} }
 @media (min-width: 375px){html{font-size: 100px;} }
 @media (min-width: 384px){html{font-size: 102.4px;} }
+
+
 @media (min-width: 414px){html{font-size: 110.4px;} }
 @media (min-width: 448px){html{font-size: 119.466px;} }
 @media (min-width: 480px){html{font-size: 128px;} }

+ 1 - 4
src/components/Card/GroupCard.tsx

@@ -12,10 +12,7 @@ export interface GroupProps extends CardProps {
 
 const GroupCard: FC<GroupProps> = (props) => {
     const { col = 3, row = 1, gapX = 8, data, ...other } = props;
-    const cls = clsx(
-        "grid",
-        `grid-cols-${col} grid-rows-${row} gap-y-4  gap-x-[0.2rem]  justify-between`
-    );
+    const cls = clsx("grid", `grid-cols-${col} grid-rows-${row} gap-[14px] justify-between`);
     return (
         // <div className={"flex flex-wrap justify-between gap-y-4"}>
         <div className={cls}>

+ 3 - 3
src/components/Footer/index.tsx

@@ -40,9 +40,9 @@ const tabList = [
         path: "/affiliate/summary",
     },
     {
-        iconSpanName: "icon-tiyu",
-        label: "exports",
-        path: "/sports",
+        iconSpanName: "icon-liwulipinjiangpin",
+        label: "promocoes",
+        path: "/promo",
     },
     {
         iconSpanName: "icon-yonghu",

+ 17 - 17
src/components/Layout/Sidebar.tsx

@@ -13,7 +13,7 @@ interface Props {}
 
 const tabs = [
     { name: "casino", id: 1, icon: "pro-niuyouguo" },
-    { name: "esportes", id: 2, icon: "pro-zuqiu" },
+    { name: "promocoes", id: 2, icon: "pro-shengriliwu" },
 ];
 
 enum PageEnum {
@@ -50,7 +50,7 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
                     router.push("/");
                     break;
                 case 1:
-                    router.push("/sports");
+                    router.push("/promo");
                     break;
                 case 2:
                     router.push("/help");
@@ -178,21 +178,21 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
                 </div>
 
                 {/*  gift */}
-                <section
-                    onClick={() => tabHandler(PageEnum.promo)}
-                    className={"my-[0.11rem] flex items-center text-[0.15rem]" + " text-[#fff]"}
-                >
-                    <div className={"flex-1"}>
-                        <span
-                            className={
-                                "iconfont icon-liwulipinjiangpin mr-[0.0694rem]" +
-                                " text-[0.16rem] text-[#999]"
-                            }
-                        ></span>
-                        <span> {t("promocoes")} </span>
-                    </div>
-                    {/*<span className={"iconfont icon-xiangyou1"}></span>*/}
-                </section>
+                {/*<section*/}
+                {/*    onClick={() => tabHandler(PageEnum.promo)}*/}
+                {/*    className={"my-[0.11rem] flex items-center text-[0.15rem]" + " text-[#fff]"}*/}
+                {/*>*/}
+                {/*    <div className={"flex-1"}>*/}
+                {/*        <span*/}
+                {/*            className={*/}
+                {/*                "iconfont icon-liwulipinjiangpin mr-[0.0694rem]" +*/}
+                {/*                " text-[0.16rem] text-[#999]"*/}
+                {/*            }*/}
+                {/*        ></span>*/}
+                {/*        <span> {t("promocoes")} </span>*/}
+                {/*    </div>*/}
+                {/*    /!*<span className={"iconfont icon-xiangyou1"}></span>*!/*/}
+                {/*</section>*/}
 
                 <section
                     onClick={() => tabHandler(PageEnum.deposit)}

+ 9 - 9
tailwind.config.ts

@@ -18,15 +18,15 @@ const config: Config = {
         "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
     ],
     theme: {
-        space: size,
-        padding: size,
-        height: size,
-        minWidth: size,
-        lineHeight: size,
-        width: size,
-        gap: size,
-        minHeight: size,
-        fontSize: size,
+        // space: size,
+        // padding: size,
+        // height: size,
+        // minWidth: size,
+        // lineHeight: size,
+        // width: size,
+        // gap: size,
+        // minHeight: size,
+        // fontSize: size,
         extend: {
             backgroundImage: {
                 "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",