Selaa lähdekoodia

Merge branch 'refs/heads/feature-Before' into dev

# Conflicts:
#	src/app/[locale]/affiliate/summary/page.tsx
Before 1 vuosi sitten
vanhempi
commit
5a18298b6d
1 muutettua tiedostoa jossa 59 lisäystä ja 50 poistoa
  1. 59 50
      src/app/[locale]/affiliate/summary/page.tsx

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

@@ -1,48 +1,46 @@
 "use client";
-import { FC, PropsWithChildren, useRef, useState } from "react";
-import './page.scss'
-import { useRouter } from "@/i18n"
+import { Toast } from "antd-mobile";
 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">
@@ -92,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>
@@ -138,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">
@@ -191,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>
@@ -204,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>
@@ -223,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>
@@ -247,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>
@@ -260,7 +270,6 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                 <div className="content"></div>
             </div>
         </div>
-
     );
 };