Kaynağa Gözat

Merge branch 'v1.4' into dev

ansoni 2 ay önce
ebeveyn
işleme
f1733dfc93

+ 1 - 1
messages/br.json

@@ -191,7 +191,7 @@
         "bouns6002": "No Bouns está aberto, não é possível receber"
     },
     "DepositPage": {
-        "Montante": "Montante",
+        "Montante": "Alcance de recarga",
         "Oferecer": "Oferecer",
         "DepositarAgora": "Depositar Agora",
         "depositTips": "O CPF a que pertence a conta de pagamento deve \nser omesmo que preencheu ao levantar o dinheiro,\ncaso contrário o levantamento não será bem-sucedido.",

+ 1 - 1
messages/en.json

@@ -179,7 +179,7 @@
         "carteira": "TRANSFERIR PARA A CARTEIRA"
     },
     "DepositPage": {
-        "Montante": "Montante",
+        "Montante": "Alcance de recarga",
         "Oferecer": "Oferecer",
         "DepositarAgora": "Depositar Agora",
         "RechargeSuc": "The recharge is successful",

+ 5 - 2
src/app/[locale]/(TabBar)/[[...share]]/@swiperWidget/page.tsx

@@ -1,21 +1,24 @@
 import { BannerRep } from "@/api/home";
 import { server } from "@/utils/server";
+import React from "react";
 import HomeSwiper from "../_home/HomeSwiper";
-const getBanners = async () => {
+const getBanners = React.cache(async () => {
     return server
         .request<BannerRep[]>({
             url: "/v1/api/front/banner_list",
             method: "POST",
+            next: { revalidate: 30 },
             body: JSON.stringify({}),
         })
         .then((res) => {
             if (res.code === 200) return res.data;
             return [];
         });
-};
+});
 const Page = async () => {
     const banners = await getBanners();
 
+    console.log(`🚀🚀🚀🚀🚀-> in page.tsx on 19 组件加载中。。。。`);
     if (!banners.length) return null;
 
     return <HomeSwiper banners={banners}></HomeSwiper>;

+ 14 - 7
src/app/[locale]/(TabBar)/[[...share]]/_home/HomeSwiper.tsx

@@ -1,19 +1,26 @@
 "use client";
-import { FC } from "react";
+import { FC, memo } from "react";
 
 import { BannerRep } from "@/api/home";
 import Box from "@/components/Box";
+import { Image } from "antd-mobile";
 import { Autoplay, Pagination } from "swiper/modules";
 import { Swiper, SwiperSlide } from "swiper/react";
-import { Image } from "antd-mobile";
 interface Props {
     banners: BannerRep[];
 }
+
 const HomeSwiper: FC<Props> = (props) => {
     const { banners = [] } = props;
 
+    console.log(`🚀🚀🚀🚀🚀-> in HomeSwiper.tsx on 17`);
     return (
-        <div style={{ height: "1.86rem" }} className={"home-banner rounded-[0.1rem] border-[0.01rem] border-[#47aaae] overflow-hidden"}>
+        <div
+            style={{ height: "1.86rem" }}
+            className={
+                "home-banner overflow-hidden rounded-[0.1rem] border-[0.01rem] border-[#47aaae]"
+            }
+        >
             <Swiper
                 autoplay={{ delay: 2500 }}
                 pagination={{ clickable: true }}
@@ -27,9 +34,9 @@ const HomeSwiper: FC<Props> = (props) => {
                     <SwiperSlide key={index}>
                         <Box none action={banner.action_type} actionData={banner.action_params}>
                             <Image
-                              lazy={true}
-                              width={"100%"}
-                              height={ "1.86rem"}
+                                width={"100%"}
+                                height={"1.86rem"}
+                                lazy
                                 // className="rounded-[0.1rem] border-[0.01rem] border-[#47aaae]"9
                                 src={banner.content}
                                 // style={{ height: "1.86rem", width: "100%" }}
@@ -43,4 +50,4 @@ const HomeSwiper: FC<Props> = (props) => {
     );
 };
 
-export default HomeSwiper;
+export default memo(HomeSwiper);

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

@@ -51,6 +51,7 @@ 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,

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

@@ -2,12 +2,12 @@
 import { GroupType, PrizeTypes } from "@/api/home";
 import { server } from "@/utils/server";
 import dynamic from "next/dynamic";
-import { sleep } from "@/utils/methods";
+import React from "react";
 
 const HomeTabs = dynamic(() => import("./_home/HomeTabs"));
 
 const TIME = 30;
-const getGames = async () => {
+const getGames = React.cache(async () => {
     return server
         .request<GroupType[]>({
             url: "/v1/api/front/game_list",
@@ -18,7 +18,7 @@ const getGames = async () => {
             if (res.code === 200) return res.data;
             return [];
         });
-};
+});
 
 const getPrizeApi = () => {
     return server.request<PrizeTypes[]>({
@@ -29,6 +29,7 @@ const getPrizeApi = () => {
 
 export default async function Page(props: any) {
     const group = await getGames();
+
     // const result = await getPrizeApi();
     return (
         <HomeTabs

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

@@ -265,7 +265,7 @@ const DepositData: FC<Props> = (props) => {
                         rules={[{ required: true, type: "number", validator: amountValidator }]}
                     >
                         <Input
-                            placeholder={`${t("DepositPage.Montante")}(BRL): Mín. ${activeType?.min_amount}`}
+                            placeholder={`${t("DepositPage.Montante")}: (${activeType?.min_amount}-${activeType?.max_amount})`}
                             type={"number"}
                             maxLength={activeType?.max_amount}
                         />

+ 35 - 0
src/app/[locale]/(TabBar)/template.tsx

@@ -0,0 +1,35 @@
+"use client";
+
+import { usePathname } from "@/i18n/routing";
+import { AnimatePresence, motion } from "framer-motion";
+import { ReactNode, useEffect } from "react";
+const routerStack = new Map();
+const Template = ({ children }: { children: ReactNode }) => {
+    const key = usePathname();
+
+    useEffect(() => {
+        if (routerStack.has(key)) {
+            routerStack.delete(key);
+        } else {
+            routerStack.set(key, key);
+        }
+    }, [key]);
+
+    return (
+        <AnimatePresence mode="popLayout">
+            <motion.div
+                layout
+                key={key}
+                initial={{ x: routerStack.has(key) ? 750 : -750, opacity: 0 }}
+                animate={{ x: 0, opacity: 1 }}
+                exit={{ x: routerStack.has(key) ? -750 : 750, opacity: 0 }}
+                transition={{ duration: 0.3 }}
+                className={"h-[100%]"}
+            >
+                {children}
+            </motion.div>
+        </AnimatePresence>
+    );
+};
+
+export default Template;

+ 3 - 4
src/app/[locale]/(doings)/cashWheel/page.tsx

@@ -1,5 +1,4 @@
 import { WheelsType } from "@/api/cashWheel";
-import { redirect } from "@/i18n/routing";
 import { server } from "@/utils/server";
 import CashWheelClient from "./CashWheelClient";
 
@@ -27,9 +26,9 @@ const getWheelApi = async () => {
             if (Array.isArray(res.data.not_receive) && res.data.not_receive.length > 0) {
                 return;
             }
-            if (!Array.isArray(res.data) && res.data.activate.end_time === 0) {
-                redirect({ href: "/", locale: "br" });
-            }
+            // if (!Array.isArray(res.data) && res.data.activate.end_time === 0) {
+            //     redirect({ href: "/", locale: "br" });
+            // }
         });
 };
 const CashWheel = async () => {

+ 0 - 13
src/app/[locale]/loading.tsx

@@ -1,13 +0,0 @@
-import Loading from "@/components/Loading";
-import { FC } from "react";
-interface Props {}
-
-const LoadingPage: FC<Props> = (props) => {
-    return (
-        <div className={"flex h-[100dvh] items-center justify-center"}>
-            <Loading />
-        </div>
-    );
-};
-
-export default LoadingPage;

+ 2 - 2
src/app/[locale]/providers.tsx

@@ -22,7 +22,6 @@ import { motion } from "framer-motion";
 
 import Image from "next/image";
 import styles from "./style.module.scss";
-import PageTransitionEffect from "@/components/PageTransitionEffect";
 
 export interface ProvidersProps {
     children: ReactNode;
@@ -195,7 +194,7 @@ const GlobalNotify = () => {
                             alt={""}
                             width={750}
                             className={
-                                "animate-slow-bounce absolute -top-[0.5rem] left-0 h-[3.2rem]"
+                                "absolute -top-[0.5rem] left-0 h-[3.2rem] animate-slow-bounce"
                             }
                             height={512}
                         />
@@ -235,6 +234,7 @@ const GlobalNotify = () => {
 
 const Layout = ({ children, themeProps }: ProvidersProps) => {
     const pathname = usePathname();
+    const key = usePathname();
 
     const { isCollapse, setCollapse } = useSystemStore((state) => ({
         isCollapse: state.isCollapse,

+ 5 - 7
src/components/Card/Card.tsx

@@ -6,12 +6,11 @@ import useGame from "@/hooks/useGame";
 import { useRouter } from "@/i18n/routing";
 import { useWalletStore } from "@/stores/useWalletStore";
 import { getToken } from "@/utils/Cookies";
-import { Button, Popup, Toast } from "antd-mobile";
+import { Button, Image, Popup, Toast } from "antd-mobile";
 import { useTranslations } from "next-intl";
 import { FC, PropsWithChildren, ReactNode, useEffect, useRef, useState } from "react";
 import TipsModal, { ModalProps } from "../TipsModal";
 import styles from "./style.module.scss";
-import { Image } from 'antd-mobile'
 export interface CardProps {
     item?: GameListRep;
     render?: (value: GameListRep) => ReactNode;
@@ -136,12 +135,12 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
                 render(item!)
             ) : (
                 <div className={styles.cardWrap} onClick={() => handler(item!)}>
-                  <Image
+                    <Image
                         lazy={true}
                         src={item?.game_icon}
                         alt={item?.game_name_cn}
-                        width={'100%'}
-                        height={'1.54rem'}
+                        width={"100%"}
+                        height={"1.54rem"}
                         className={"h-[100%] w-[100%]"}
                     />
                 </div>
@@ -168,11 +167,10 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
                 <Box className={"w-1/1 flex w-[4.02rem] flex-1"}>
                     <div className={styles.cardWrap} style={{ width: "1.1rem" }}>
                         <Image
-                            lazy={true}
-                            loading={'lazy'}
                             src={item?.game_icon}
                             alt={item?.game_name + "-" + item?.category_name}
                             className={"h-[100%] w-[100%]"}
+                            height={"1.54rem"}
                         />
                     </div>
                     <div className={styles.cardWrapGmeInfo}>

+ 13 - 8
src/components/Header/HeaderRight.tsx

@@ -1,3 +1,4 @@
+"use client";
 import { Link } from "@/i18n/routing";
 import { useWalletStore } from "@/stores/useWalletStore";
 import { getToken } from "@/utils/Cookies";
@@ -15,21 +16,25 @@ const HeaderRight = () => {
             <div className={styles.right}>
                 {token ? (
                     <>
-                        <Link href={"/profile"}  >
-                            <div className={"flex items-center text-[0.12rem]"}>
-                                <i className={"iconfont icon-yonghu mr-[0.03rem]"}></i>
-                                <span>{score}</span>
-                            </div>
+                        <Link
+                            href={"/profile"}
+                            className={"flex items-center text-[0.12rem]"}
+                            prefetch
+                        >
+                            <i className={"iconfont icon-yonghu mr-[0.03rem]"}></i>
+                            <span>{score}</span>
                         </Link>
 
-                        <Link href={"/deposit"}   className={styles.rightActive}>
+                        <Link href={"/deposit"} prefetch className={styles.rightActive}>
                             {t("deposit")}
                         </Link>
                     </>
                 ) : (
                     <>
-                        <Link href={"/login?redirect=/"} prefetch  className={styles.leftActive}>{t("login")}</Link>
-                        <Link href={"/register?redirect=/"} prefetch  className={styles.rightActive}>
+                        <Link href={"/login?redirect=/"} prefetch className={styles.leftActive}>
+                            {t("login")}
+                        </Link>
+                        <Link href={"/register?redirect=/"} prefetch className={styles.rightActive}>
                             {t("register")}
                         </Link>
                     </>

+ 6 - 3
src/components/Header/index.tsx

@@ -1,13 +1,16 @@
 "use client";
-import HeaderRight from "@/components/Header/HeaderRight";
 import { useSystemStore } from "@/stores/useSystemStore";
 import { FC, memo, ReactNode } from "react";
 import { useSwiper } from "swiper/react";
 import HeaderTitle from "./HerderTitle";
 import styles from "./style.module.scss";
+// import HeaderRight from "@/components/Header/HeaderRight";
+import dynamic from "next/dynamic";
+
+const HeaderRight = dynamic(() => import("@/components/Header/HeaderRight"));
 /**
  * @description HeaderProps
- * @param {boolean} headerPlaceholder 是否展示展位元素
+ * @param {boolean} headerPlaceholder 是否展示展位元素00
  * @param {() => ReactNode} headerRender 自定义渲染
  */
 export interface HeaderProps {
@@ -33,7 +36,7 @@ const Header: FC<HeaderProps> = (props) => {
         <header className={styles.headerWrap}>
             <div className={styles.headerMain}>
                 <div className={styles.headerLeft} onClick={menuHandler}>
-                    <i className="iconfont icon-caidan1 text-[#87ccd9] text-8"></i>
+                    <i className="iconfont icon-caidan1 text-8 text-[#87ccd9]"></i>
                     {/* <div>
                         <div className={styles.bar}></div>
                         <div className={styles.bar} style={{ width: "0.1389rem" }}></div>

+ 2 - 2
src/components/ModalPopup/WheelModal/index.tsx

@@ -516,10 +516,10 @@ const WheelModal = forwardRef<WheelModalProps, { onDestory?: Function }>(
 
                 <Mask visible={visible} destroyOnClose={true} getContainer={null} opacity="thick">
                     <div
-                        className={"absolute right-[0.2083rem] top-[18%] z-50"}
+                        className={"absolute right-[0.2083rem] top-[12%] z-50"}
                         onClick={customClose}
                     >
-                        <span className={"iconfont icon-guanbi"}></span>
+                        <span className={"iconfont icon-guanbi font-bold"}></span>
                     </div>
                     <div className={"absolute top-[5%] w-[100%]"}>
                         <WheelClient isRotate={true} onRotateEnd={onRotateEnd} />

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

@@ -1,8 +1,8 @@
 "use client";
 import { AnimatePresence, motion } from "framer-motion";
+import { LayoutRouterContext } from "next/dist/shared/lib/app-router-context.shared-runtime";
 import { usePathname } from "next/navigation";
 import { ReactNode, useContext, useRef } from "react";
-import { LayoutRouterContext } from "next/dist/shared/lib/app-router-context.shared-runtime";
 
 // FrozenRouter 组件,保持页面切换过程中上下文的持久化
 function FrozenRouter(props: { children: ReactNode }) {
@@ -26,9 +26,9 @@ const PageTransitionEffect = ({ children }: { children: ReactNode }) => {
                 animate={{ opacity: 1, x: 0 }}
                 exit={{ opacity: 0, x: 0 }}
                 transition={{ type: "linear", duration: 0.5 }}
-                className={'h-[100%]'}
+                className={"h-[100%]"}
             >
-                <FrozenRouter>{children}</FrozenRouter>
+                {children}
             </motion.div>
         </AnimatePresence>
     );