Переглянути джерело

fix: 移除antd-mobile 优化

ansoni 2 місяців тому
батько
коміт
885d348967

+ 1 - 0
messages/br.json

@@ -398,6 +398,7 @@
         "1019": "Valor mínimo não atingido",
         "1020": "Limite diário de saques excedido",
         "1021": "Conta de pagamento inválida",
+        "1022": "Restricção da Conta",
         "1200": "Estoque insuficiente",
         "1201": "",
         "1202": "",

+ 1 - 0
messages/en.json

@@ -387,6 +387,7 @@
         "1019": "The amount coding too small",
         "1020": "Too many withdrawals in the same day",
         "1021": "The payment account is invalid",
+        "1022": "Restricção da Conta",
         "1200": "Insufficient inventory",
         "1201": "",
         "1202": "",

+ 1 - 2
next.config.mjs

@@ -4,7 +4,7 @@ import createNextIntlPlugin from "next-intl/plugin";
 const withNextIntl = createNextIntlPlugin();
 /** @type {import('next').NextConfig} */
 const nextConfig = {
-    output: "standalone",
+    // output: "standalone",
     productionBrowserSourceMaps: true,
     reactStrictMode: false,
     env: {
@@ -28,7 +28,6 @@ const nextConfig = {
         },
         scrollRestoration: true,
         optimizePackageImports: [
-            "antd-mobile",
             "dayjs",
             "bignumber.js",
             "@lucky-canvas/react",

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

@@ -6,7 +6,6 @@ import { useSystemStore } from "@/stores/useSystemStore";
 import { Toast } from "antd-mobile";
 import clsx from "clsx";
 import { useTranslations } from "next-intl";
-import Image from "next/image";
 import { FC, useState } from "react";
 import { Swiper, SwiperSlide } from "swiper/react";
 import HomeGames from "./HomeGames";
@@ -109,13 +108,12 @@ const TabItem = ({
         "relative flex flex-1 cursor-pointer items-center flex-col",
         active ? "text-[#d0f5fb]" : "text-[#d0f5fb]"
     );
+
     return (
         <div className={rootCls} onClick={() => handler(item)}>
             <div className="flex h-[.55rem] items-end justify-center">
                 {!item.image && <span className={cls}></span>}
-                {item.image && (
-                    <img src={item.image} width={45} height={55} alt={item.url}></img>
-                )}
+                {item.image && <img src={item.image} width={45} height={55} alt={item.url}></img>}
             </div>
 
             <span className={"break-word truncate whitespace-normal text-center text-[0.13rem]"}>

+ 0 - 1
src/app/[locale]/(TabBar)/[[...share]]/layout.tsx

@@ -51,7 +51,6 @@ const Placeholder = () => {
     return <div className={"flex justify-center"}>{/*<Loading/>*/}</div>;
 };
 const Layout: FC<PropsWithChildren<Props>> = async (props) => {
-    console.log(`🚀🚀🚀🚀🚀-> in layout.tsx on 54 布局组件加载。。。`);
     const {
         children,
         swiperWidget,

+ 0 - 1
src/app/[locale]/(TabBar)/deposit/DepositData.tsx

@@ -117,7 +117,6 @@ const DepositData: FC<Props> = (props) => {
         getUserRechargeApi({ is_reset_rollover, ...params })
             .then(async (res) => {
                 formInstanceRef.current?.resetFields();
-                // Toast.show({ icon: "success", content: t("code.200"), maskClickable: false });
                 tipModelRef.current?.onClose();
                 setAmount(undefined);
                 // const url =

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

@@ -4,7 +4,8 @@ import { useSystemStore } from "@/stores/useSystemStore";
 import { ConfigProvider, Mask } from "antd-mobile";
 import ptBR from "antd-mobile/es/locales/pt-BR";
 import { ThemeProviderProps } from "next-themes/dist/types";
-import { ReactNode, useEffect, useMemo, useState } from "react";
+import { ReactNode, useEffect, useMemo, useRef, useState } from "react";
+import { Swiper } from "swiper/react";
 
 import { server } from "@/utils/client";
 import { useDebounceEffect, useRequest } from "ahooks";
@@ -19,6 +20,7 @@ import { Local } from "@/utils/storage";
 import { motion } from "framer-motion";
 
 import Image from "next/image";
+import { SwiperClass, SwiperSlide } from "swiper/react";
 import styles from "./style.module.scss";
 
 export interface ProvidersProps {
@@ -341,9 +343,9 @@ export default function SidebarLayout({ children, themeProps }: ProvidersProps)
                 <Sidebar />
             </motion.div>
 
-            {/* Main Content */}
+            {/* Main Content  transform: translate(0, 0);*/}
             <motion.div
-                className="relative z-10 h-[100%]"
+                className="relative z-10 h-[100%] translate-x-0 translate-y-0 transform"
                 animate={{ x: isCollapse ? "70%" : "0%" }}
                 transition={{ type: "tween", duration: 0.3 }}
             >
@@ -364,6 +366,78 @@ export default function SidebarLayout({ children, themeProps }: ProvidersProps)
         </div>
     );
 }
+const Layout = ({ children, themeProps }: ProvidersProps) => {
+    const pathname = usePathname();
+    const key = usePathname();
+
+    const { isCollapse, setCollapse } = useSystemStore((state) => ({
+        isCollapse: state.isCollapse,
+        setCollapse: state.setCollapse,
+    }));
+
+    const swiperRef = useRef<SwiperClass>();
+    const homeContainerRef = useRef<HTMLDivElement>(null);
+
+    const startHandler = () => {
+        homeContainerRef.current?.classList.add("containerMask");
+        setCollapse(true);
+    };
+    const endHandler = () => {
+        homeContainerRef.current?.classList.remove("containerMask");
+        setCollapse(false);
+    };
+
+    const isShowBg = useMemo(() => {
+        const local = pathname.split("/")[1];
+
+        if (`/${local}` === pathname) return true;
+        return [`/${local}/freeGames`, "/br/replayGames", "/br/promo", "/br/gameList"].includes(
+            pathname
+        );
+    }, [pathname]);
+    return (
+        <div id="app" className="bg-black">
+            <Swiper
+                resistanceRatio={10}
+                initialSlide={2}
+                slidesPerView={"auto"}
+                style={{ width: "100%", height: "100%" }}
+                onSlidePrevTransitionStart={startHandler}
+                onSlideNextTransitionEnd={endHandler}
+                slideToClickedSlide
+                onSwiper={(swiper) => {
+                    swiperRef.current = swiper;
+                }}
+                allowTouchMove={false}
+            >
+                <SwiperSlide style={{ width: "100%", height: "100%" }}>
+                    <section className="relative flex h-[100%] items-center justify-center">
+                        {/*<Loading />*/}
+                    </section>
+                </SwiperSlide>
+
+                <SwiperSlide style={{ width: "70%", height: "100%" }} className={""}>
+                    <section className="relative h-[100%]">
+                        <Sidebar></Sidebar>
+                    </section>
+                </SwiperSlide>
+
+                <SwiperSlide style={{ width: "100%", height: "100%" }}>
+                    {/*停服通知*/}
+                    <StopServiceClient />
+                    {/*充值成功通知*/}
+                    <GlobalNotify />
+                    <section
+                        className={clsx(isShowBg && styles.homePage, "relative h-[100%]")}
+                        ref={homeContainerRef}
+                    >
+                        {children}
+                    </section>
+                </SwiperSlide>
+            </Swiper>
+        </div>
+    );
+};
 
 export const Providers = ({ children, themeProps }: ProvidersProps) => {
     const setupConfig = useSystemStore((state) => state.setupConfig);

+ 0 - 2
src/hooks/useGame.tsx

@@ -39,8 +39,6 @@ const useGame = () => {
         const lang = getCookies("language") || defaultLocale;
         getGameDetailApi({ ...params, language: lang === "br" ? "pt" : lang })
             .then((res) => {
-                console.log("category_name", game);
-
                 Toast.clear();
                 if (res.data && res.data.game_url) {
                     eventStartTrial();