|
@@ -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>
|
|
|
);
|