Sfoglia il codice sorgente

fix: remove propsWhitChildren

Before 1 anno fa
parent
commit
c283dc097b

+ 0 - 1
next.config.mjs

@@ -6,7 +6,6 @@ const withNextIntl = createNextIntlPlugin();
 /** @type {import('next').NextConfig} */
 const nextConfig = {
   reactStrictMode: true,
-  output: 'export',
   transpilePackages: ['antd-mobile'],
   sassOptions: {
     prependData: `@import "./src/styles/variables.scss";`

+ 69 - 71
src/app/[locale]/(ordinary)/profile/page.tsx

@@ -1,119 +1,117 @@
 "use client";
-import { FC, PropsWithChildren, useEffect, useState } from "react";
+import { getUserInfoApi, getUserMoneyApi } from "@/api/user";
 import { useRouter } from "@/i18n";
+import { useGlobalStore } from "@/stores";
 import clsx from "clsx";
+import { useTranslations } from "next-intl";
+import { FC, useEffect, useState } from "react";
 import ItemCom from "./component/ItemCom";
-import ModalCom from "./component/ModalCom";
 import MaskCom from "./component/MaskCom";
-import './page.scss'
-import { useGlobalStore } from '@/stores';
-import { getUserInfoApi, getUserMoneyApi } from "@/api/user";
-import { useTranslations } from "next-intl";
+import ModalCom from "./component/ModalCom";
+import "./page.scss";
 
 interface Props {}
 
-const Profile: FC<PropsWithChildren<Props>> = () => {
+const Profile: FC<Props> = () => {
     const t = useTranslations("ProfilePage");
-    
+
     const { token, userInfo, setUserInfo } = useGlobalStore();
     const userInfoRequest = async () => {
-        getUserInfoApi().then(res => {
-            res.code == 200 && setUserInfo(res.data)
-        })
-    }
+        getUserInfoApi().then((res) => {
+            res.code == 200 && setUserInfo(res.data);
+        });
+    };
 
     let [money, setMoney] = useState({
         deposit: 0,
-        point: 0
-    })
+        point: 0,
+    });
     const userMoneyRequest = async () => {
-        getUserMoneyApi().then(res => {
-            res.code == 200 && setMoney({
-                deposit: res.data.deposit,
-                point: res.data.point
-            })
-        })
-    }
+        getUserMoneyApi().then((res) => {
+            res.code == 200 &&
+                setMoney({
+                    deposit: res.data.deposit,
+                    point: res.data.point,
+                });
+        });
+    };
     useEffect(() => {
         if (token) {
-            userInfoRequest()
-            userMoneyRequest()
+            userInfoRequest();
+            userMoneyRequest();
         }
         // eslint-disable-next-line react-hooks/exhaustive-deps
-    }, [])
-    
+    }, []);
 
     const router = useRouter();
-    const goPage = (path = '/') => {
-        router.push(path)
-    }
+    const goPage = (path = "/") => {
+        router.push(path);
+    };
 
     const [visible, setVisible] = useState(false);
     const callbackFun = () => {
-        setVisible(!visible)
-    }
+        setVisible(!visible);
+    };
 
-    const divClassName = clsx('bgImg', token && 'default');
+    const divClassName = clsx("bgImg", token && "default");
     return (
         <div className="profile-box">
             <div className="userContent">
                 <div className="userInfo">
                     <div>
                         <div className={divClassName}></div>
-                        {
-                            token && (
-                                <div>
-                                    <span>{t('Conta')}</span>
-                                    <span className="phone">{userInfo?.user_phone || ''}</span>
-                                </div>
-                            )
-                        }
-                    </div>
-                    {
-                        !token && (
-                            <div className="goto" onClick={() => goPage('/login')}>
-                                <span>{t('Login')}</span>
-                                <span className="iconfont icon-xiangzuo1"></span>
+                        {token && (
+                            <div>
+                                <span>{t("Conta")}</span>
+                                <span className="phone">{userInfo?.user_phone || ""}</span>
                             </div>
-                        )
-                    }
-                    
+                        )}
+                    </div>
+                    {!token && (
+                        <div className="goto" onClick={() => goPage("/login")}>
+                            <span>{t("Login")}</span>
+                            <span className="iconfont icon-xiangzuo1"></span>
+                        </div>
+                    )}
                 </div>
-                { 
-                    token && (
-                        <div className="coin">
+                {token && (
+                    <div className="coin">
+                        <div>
+                            <span className="iconfont icon-icon-wallet"></span>
                             <div>
-                                <span className="iconfont icon-icon-wallet"></span>
-                                <div>
-                                    <span>{t('Saldo')}</span>
-                                    <div className="num">
-                                        <span className="uppercase">brl </span>
-                                        <span>{ money.deposit || 0.00 }</span>
-                                    </div>
+                                <span>{t("Saldo")}</span>
+                                <div className="num">
+                                    <span className="uppercase">brl </span>
+                                    <span>{money.deposit || 0.0}</span>
                                 </div>
                             </div>
+                        </div>
+                        <div>
+                            <span className="iconfont icon-gift2"></span>
                             <div>
-                                <span className="iconfont icon-gift2"></span>
-                                <div>
-                                    <span onClick={() => setVisible(true)}> {t('Bônus')} <img className="a" src="/img/a.png" alt=""/></span>
-                                    <div className="num">
-                                        <span className="uppercase">brl </span>
-                                        <span>{ money.point || 0.00 }</span>
-                                    </div>
+                                <span onClick={() => setVisible(true)}>
+                                    {" "}
+                                    {t("Bônus")} <img className="a" src="/img/a.png" alt="" />
+                                </span>
+                                <div className="num">
+                                    <span className="uppercase">brl </span>
+                                    <span>{money.point || 0.0}</span>
                                 </div>
                             </div>
                         </div>
-                    ) 
-                }
+                    </div>
+                )}
             </div>
 
             <div className="link">
-                <span onClick={() => goPage('/deposit')}>{t('Depósito')}</span>
-                <span onClick={() => goPage(token ? '/withdraw' : `/login?redirect=withdraw`)}>{t('Sacar')}</span>
+                <span onClick={() => goPage("/deposit")}>{t("Depósito")}</span>
+                <span onClick={() => goPage(token ? "/withdraw" : `/login?redirect=withdraw`)}>
+                    {t("Sacar")}
+                </span>
             </div>
             <ItemCom />
-            <ModalCom  />
-            <MaskCom visible={visible} callbackFun={(callbackFun)}/>
+            <ModalCom />
+            <MaskCom visible={visible} callbackFun={callbackFun} />
         </div>
     );
 };

+ 2 - 2
src/app/[locale]/affiliate/faq/page.tsx

@@ -1,10 +1,10 @@
 "use client";
 import { useTranslations } from "next-intl";
-import { FC, PropsWithChildren, useRef, useState } from "react";
+import { FC, useRef, useState } from "react";
 import "./page.scss";
 
 interface Props {}
-const App: FC<PropsWithChildren<Props>> = (props) => {
+const App: FC<Props> = (props) => {
     const t = useTranslations("FaqPage");
 
     const sliderRef = useRef<HTMLDivElement>(null);

+ 9 - 12
src/app/[locale]/affiliate/payments/page.tsx

@@ -1,14 +1,11 @@
-'use client'
-import { FC, PropsWithChildren } from "react";
-import { useRouter } from "@/i18n";
+"use client";
 import { useTranslations } from "next-intl";
-import HeaderCom from "../component/HeaderCom"
-import TabsCom from "../component/TabsCom"
-import './page.scss'
+import { FC } from "react";
+import "./page.scss";
 
-interface Props { }
-const App: FC<PropsWithChildren<Props>> = (props) => {
-    const t = useTranslations("PaymentsPage")
+interface Props {}
+const App: FC<Props> = (props) => {
+    const t = useTranslations("PaymentsPage");
     return (
         <div className="content">
             <div className="referralPayment referral-router-view">
@@ -26,6 +23,6 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                 </div>
             </div>
         </div>
-    )
-}
-export default App
+    );
+};
+export default App;

+ 15 - 14
src/app/[locale]/affiliate/referrals/page.tsx

@@ -1,14 +1,11 @@
-'use client'
-import { FC, PropsWithChildren, useEffect } from "react";
-import { useRouter } from "@/i18n";
+"use client";
 import { useTranslations } from "next-intl";
-import './page.scss'
-
-
-interface Props { }
-const App: FC<PropsWithChildren<Props>> = (props) => {
-    const t = useTranslations("ReferralsPage")
+import { FC } from "react";
+import "./page.scss";
 
+interface Props {}
+const App: FC<Props> = (props) => {
+    const t = useTranslations("ReferralsPage");
 
     return (
         <div className="content">
@@ -26,8 +23,12 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                     <li>
                         <div>#</div>
                         <div>{t("Conta")}</div>
-                        <div>{t("Apostas")}({t("R$")})</div>
-                        <div>{t("ApostaEquipe")}({t("R$")})</div>
+                        <div>
+                            {t("Apostas")}({t("R$")})
+                        </div>
+                        <div>
+                            {t("ApostaEquipe")}({t("R$")})
+                        </div>
                         <div>{t("Comissão")}</div>
                     </li>
                 </ul>
@@ -48,6 +49,6 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                 {/* 日历 */}
             </div>
         </div>
-    )
-}
-export default App
+    );
+};
+export default App;

+ 15 - 12
src/app/[locale]/affiliate/report/page.tsx

@@ -1,12 +1,11 @@
-'use client'
-import { FC, PropsWithChildren } from "react";
-import { useRouter } from '@/i18n'
+"use client";
 import { useTranslations } from "next-intl";
-import './page.scss'
+import { FC } from "react";
+import "./page.scss";
 
-interface Props { }
-const App: FC<PropsWithChildren<Props>> = (props) => {
-    const t = useTranslations("ReportPage")
+interface Props {}
+const App: FC<Props> = (props) => {
+    const t = useTranslations("ReportPage");
     return (
         <div className="content">
             <div className="report referral-router-view">
@@ -14,8 +13,12 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                     <li>
                         <div>#</div>
                         <div>{t("Conta")}</div>
-                        <div>{t("Apostas")}({t("R$")})</div>
-                        <div>{t("ApostaEquipe")}({t("R$")})</div>
+                        <div>
+                            {t("Apostas")}({t("R$")})
+                        </div>
+                        <div>
+                            {t("ApostaEquipe")}({t("R$")})
+                        </div>
                         <div>{t("Comissão")}</div>
                     </li>
                 </ul>
@@ -25,6 +28,6 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                 </div>
             </div>
         </div>
-    )
-}
-export default App
+    );
+};
+export default App;

+ 59 - 52
src/app/[locale]/affiliate/summary/page.tsx

@@ -1,50 +1,46 @@
 "use client";
-import { useRouter } from "@/i18n";
+import { Toast } from "antd-mobile";
 import { useTranslations } from "next-intl";
-import { FC, PropsWithChildren, useRef, useState } from "react";
-import './page.scss'
-import { useRouter } from "@/i18n"
-import { useTranslations } from "next-intl";
-import { Toast } from 'antd-mobile'
-
+import { FC, useRef, useState } from "react";
+import "./page.scss";
 
 interface Props {}
 
-const App: FC<PropsWithChildren<Props>> = (props) => {
+const App: FC<Props> = (props) => {
     const t = useTranslations("SummaryPage");
 
-    const sliderRef = useRef<HTMLDivElement>(null)
-    const [num, setNum] = useState(100)
-    const [money, setMoney] = useState('5000')
+    const sliderRef = useRef<HTMLDivElement>(null);
+    const [num, setNum] = useState(100);
+    const [money, setMoney] = useState("5000");
     const handleSlide: any = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
         if (sliderRef.current) {
-            const startX = sliderRef.current.getBoundingClientRect().x
-            const x = e.clientX - startX
-            const xRem = x / (144 * 0.6)
-            const intNum = Math.round(10000 * xRem) - Math.round(10000 * xRem % 10)
-            setNum(intNum)
-            const m = intNum * 50
-            let r = ''
-            const arr = m.toString().split('')
+            const startX = sliderRef.current.getBoundingClientRect().x;
+            const x = e.clientX - startX;
+            const xRem = x / (144 * 0.6);
+            const intNum = Math.round(10000 * xRem) - Math.round((10000 * xRem) % 10);
+            setNum(intNum);
+            const m = intNum * 50;
+            let r = "";
+            const arr = m.toString().split("");
             arr.forEach((item, i) => {
-                if (i !== (arr.length - 1) && (arr.length - i - 1) % 3 === 0) {
-                    r += item + ','
+                if (i !== arr.length - 1 && (arr.length - i - 1) % 3 === 0) {
+                    r += item + ",";
                 } else {
-                    r += item
+                    r += item;
                 }
-            })
+            });
 
-            setMoney(r)
-            const scale = ((Math.round((xRem * 10000))) / 100.00).toFixed(2) + '%';
-            sliderRef.current.style.width = scale
+            setMoney(r);
+            const scale = (Math.round(xRem * 10000) / 100.0).toFixed(2) + "%";
+            sliderRef.current.style.width = scale;
         }
-    }
+    };
 
     const copy = (text: string) => {
         navigator.clipboard.writeText(text).then(() => {
-            Toast.show({ icon: 'success', content: t("copySuc"), maskClickable: false })
-        })
-    }
+            Toast.show({ icon: "success", content: t("copySuc"), maskClickable: false });
+        });
+    };
     return (
         <div className="content">
             <div className="summary referral-router-view">
@@ -94,11 +90,11 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                                 </li>
                                 <li>
                                     <span className="num">0</span>
-                                    <span>  {t("Jogadores")}  </span>
+                                    <span> {t("Jogadores")} </span>
                                 </li>
                                 <li>
                                     <span className="num">0</span>
-                                    <span>  {t("ApostaTotal")}  </span>
+                                    <span> {t("ApostaTotal")} </span>
                                 </li>
                                 <li>
                                     <span className="num">0</span>
@@ -140,7 +136,7 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                                         <span>{t("R$")}</span>
                                         <span className="cash">0.00</span>
                                     </span>
-                                    <span>  {t("Não")}  </span>
+                                    <span> {t("Não")} </span>
                                 </li>
                             </ul>
                             <div className="wallet">
@@ -193,7 +189,9 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                         <div className="tip">{t("content1")}</div>
                         <div className="copyUrl">
                             <span className="url omitWrap">{t("https")}</span>
-                            <span id="copy" onClick={() => copy(t("https"))}>{t("Cópia")}</span>
+                            <span id="copy" onClick={() => copy(t("https"))}>
+                                {t("Cópia")}
+                            </span>
                         </div>
                     </div>
                 </div>
@@ -206,14 +204,20 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                             <a href="" className="telicon">
                                 <img src="/img/telegram.webp" alt="" />
                             </a>
-                            <div className="hintTitle3">
-                                {t("content2-1")}
-                            </div>
+                            <div className="hintTitle3">{t("content2-1")}</div>
                         </div>
                         <div className="hintTitle2">
                             <i className="iconfont icon-tishi"></i>
                             {t("content2-2")}
-                            <a href="" style={{ borderBottom: "1px solid rgb(109, 155, 195)", color: "#0000EE" }}>{t("business")}</a>
+                            <a
+                                href=""
+                                style={{
+                                    borderBottom: "1px solid rgb(109, 155, 195)",
+                                    color: "#0000EE",
+                                }}
+                            >
+                                {t("business")}
+                            </a>
                         </div>
                     </div>
                 </div>
@@ -225,19 +229,26 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                         </div>
                     </div>
                     <div className="hint">
-                        <div className="hintTitle">
-                            {t("content3")}
-                        </div>
+                        <div className="hintTitle">{t("content3")}</div>
                         <div className="imgContent">
                             <img src="/img/cash.png" alt="" />
                             <div>
-                                {t("number")}{num}
+                                {t("number")}
+                                {num}
                                 <br />
-                                {t("Comissão")} > {t("R$")} {money} {t("money")}
+                                {t("Comissão")} &gt; {t("R$")} {money} {t("money")}
                             </div>
-                            <div className="slider van-slider" style={{ height: "0.02rem" }} onClick={handleSlide}>
-                                <div className="van-slider__bar" style={{ width: "0.900901%", background: "rgb(0, 157, 128)" }} ref={sliderRef}>
-                                    <div role="slider" className="van-slider__button-wrapper" >
+                            <div
+                                className="slider van-slider"
+                                style={{ height: "0.02rem" }}
+                                onClick={handleSlide}
+                            >
+                                <div
+                                    className="van-slider__bar"
+                                    style={{ width: "0.900901%", background: "rgb(0, 157, 128)" }}
+                                    ref={sliderRef}
+                                >
+                                    <div role="slider" className="van-slider__button-wrapper">
                                         <div className="img"></div>
                                     </div>
                                 </div>
@@ -249,12 +260,9 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                             <ul className="rules">
                                 <li>
                                     {t("content4-1")}
-                                    <span style={{ color: "red" }}>{t("red")}</span>
-                                    .
-                                </li>
-                                <li>
-                                    {t("content4-2")}
+                                    <span style={{ color: "red" }}>{t("red")}</span>.
                                 </li>
+                                <li>{t("content4-2")}</li>
                             </ul>
                         </div>
                     </div>
@@ -262,7 +270,6 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                 <div className="content"></div>
             </div>
         </div>
-
     );
 };