|
@@ -1,87 +1,98 @@
|
|
|
-'use client'
|
|
|
-import { FC, PropsWithChildren ,useRef, useState } from "react";
|
|
|
+"use client";
|
|
|
import { useRouter } from "@/i18n";
|
|
|
import { useTranslations } from "next-intl";
|
|
|
-import './page.scss'
|
|
|
+import { FC, useRef, useState } from "react";
|
|
|
+import "./page.scss";
|
|
|
|
|
|
-interface Props { }
|
|
|
-const App: FC<PropsWithChildren<Props>> = (props) =>{
|
|
|
- const t = useTranslations("FaqPage")
|
|
|
- const router:any = useRouter()
|
|
|
- const goPage = (path = '')=>{
|
|
|
- if(path){
|
|
|
- if(path === 'home'){
|
|
|
- router.replace('/')
|
|
|
- return
|
|
|
+interface Props {}
|
|
|
+const App: FC<Props> = (props) => {
|
|
|
+ const t = useTranslations("FaqPage");
|
|
|
+ const router: any = useRouter();
|
|
|
+ const goPage = (path = "") => {
|
|
|
+ if (path) {
|
|
|
+ if (path === "home") {
|
|
|
+ router.replace("/");
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
console.log(router);
|
|
|
-
|
|
|
- router.replace(`/affiliate/${path}`)
|
|
|
- return
|
|
|
+
|
|
|
+ router.replace(`/affiliate/${path}`);
|
|
|
+ return;
|
|
|
}
|
|
|
- router.back()
|
|
|
- }
|
|
|
- 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('')
|
|
|
- arr.forEach((item,i)=>{
|
|
|
- if(i!==(arr.length-1)&&(arr.length-i-1)%3===0){
|
|
|
- r += item + ','
|
|
|
- }else{
|
|
|
- r += item
|
|
|
+ router.back();
|
|
|
+ };
|
|
|
+ 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("");
|
|
|
+ arr.forEach((item, i) => {
|
|
|
+ if (i !== arr.length - 1 && (arr.length - i - 1) % 3 === 0) {
|
|
|
+ r += item + ",";
|
|
|
+ } else {
|
|
|
+ r += item;
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
- setMoney(r)
|
|
|
+ });
|
|
|
+
|
|
|
+ setMoney(r);
|
|
|
|
|
|
- const scale = ((Math.round((xRem * 10000)))/100.00).toFixed(2) + '%';
|
|
|
- sliderRef.current.style.width = scale
|
|
|
+ const scale = (Math.round(xRem * 10000) / 100.0).toFixed(2) + "%";
|
|
|
+ sliderRef.current.style.width = scale;
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
return (
|
|
|
<div className="vux-drawer-faq">
|
|
|
- <div className="vux-drawer-body" style={{transform: "translate3d(0px, 0px, 0px)"}}>
|
|
|
- <div className="referral router-view" id="id-router-view" style={{backgroundColor: "rgb(237, 237, 237)"}}>
|
|
|
+ <div className="vux-drawer-body" style={{ transform: "translate3d(0px, 0px, 0px)" }}>
|
|
|
+ <div
|
|
|
+ className="referral router-view"
|
|
|
+ id="id-router-view"
|
|
|
+ style={{ backgroundColor: "rgb(237, 237, 237)" }}
|
|
|
+ >
|
|
|
<div className="headerBack">
|
|
|
- <div className="left" onClick={()=>goPage()}>
|
|
|
+ <div className="left" onClick={() => goPage()}>
|
|
|
<span className="iconfont icon-xiangzuo1"></span>
|
|
|
</div>
|
|
|
<span className="title">
|
|
|
- {t("Afiliado")}
|
|
|
- <span style={{fontSize: "0.14rem"}}> - {t("title")}</span>
|
|
|
+ {t("Afiliado")}
|
|
|
+ <span style={{ fontSize: "0.14rem" }}> - {t("title")}</span>
|
|
|
</span>
|
|
|
- <span className="right" onClick={()=>goPage('home')}>
|
|
|
+ <span className="right" onClick={() => goPage("home")}>
|
|
|
<span className="iconfont icon-home_line router-link-active"></span>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div className="tabs alginLeft van-tabs van-tabs--line">
|
|
|
<div className="van-tabs__wrap van-tabs__wrap--scrollable">
|
|
|
- <div role="tablist" className="van-tabs__nav van-tabs__nav--line van-tabs__nav--complete">
|
|
|
- <div className="van-tab" onClick={()=>goPage('summary')}>
|
|
|
+ <div
|
|
|
+ role="tablist"
|
|
|
+ className="van-tabs__nav van-tabs__nav--line van-tabs__nav--complete"
|
|
|
+ >
|
|
|
+ <div className="van-tab" onClick={() => goPage("summary")}>
|
|
|
<span className="van-tab__text">{t("PAINEL")}</span>
|
|
|
</div>
|
|
|
- <div className="van-tab" onClick={()=>goPage('referrals')}>
|
|
|
+ <div className="van-tab" onClick={() => goPage("referrals")}>
|
|
|
<span className="van-tab__text">{t("REFERÊNCIAS")}</span>
|
|
|
</div>
|
|
|
- <div className="van-tab" onClick={()=>goPage('report')}>
|
|
|
+ <div className="van-tab" onClick={() => goPage("report")}>
|
|
|
<span className="van-tab__text">{t("RELATÓRIO")}</span>
|
|
|
</div>
|
|
|
- <div className="van-tab" onClick={()=>goPage('payments')}>
|
|
|
+ <div className="van-tab" onClick={() => goPage("payments")}>
|
|
|
<span className="van-tab__text">{t("PAGAMENTOS")}</span>
|
|
|
</div>
|
|
|
- <div className="van-tab van-tab--active" aria-selected="true" onClick={()=>goPage('faq')}>
|
|
|
- <span className="van-tab__text">{t("FAQ")}</span>
|
|
|
+ <div
|
|
|
+ className="van-tab van-tab--active"
|
|
|
+ aria-selected="true"
|
|
|
+ onClick={() => goPage("faq")}
|
|
|
+ >
|
|
|
+ <span className="van-tab__text">{t("FAQ")}</span>
|
|
|
</div>
|
|
|
<div className="van-tab">
|
|
|
<span className="van-tab__text">{t("TUTORIAL")}</span>
|
|
@@ -94,9 +105,7 @@ const App: FC<PropsWithChildren<Props>> = (props) =>{
|
|
|
<div className="referralFaq referralFaq referral-router-view">
|
|
|
<div className="content">
|
|
|
<h2>{t("title1")}</h2>
|
|
|
- <div>
|
|
|
- {t("content1")}
|
|
|
- </div>
|
|
|
+ <div>{t("content1")}</div>
|
|
|
</div>
|
|
|
<div className="content">
|
|
|
<h2>{t("title2")}</h2>
|
|
@@ -104,9 +113,7 @@ const App: FC<PropsWithChildren<Props>> = (props) =>{
|
|
|
</div>
|
|
|
<div className="content">
|
|
|
<h2>{t("title3")}</h2>
|
|
|
- <div>
|
|
|
- {t("content3")}
|
|
|
- </div>
|
|
|
+ <div>{t("content3")}</div>
|
|
|
</div>
|
|
|
<div className="content">
|
|
|
<h2>{t("title4")} </h2>
|
|
@@ -119,12 +126,23 @@ const App: FC<PropsWithChildren<Props>> = (props) =>{
|
|
|
<div className="imgContent rowReverse">
|
|
|
<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")} > {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
|
|
|
+ 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>
|
|
@@ -133,15 +151,13 @@ const App: FC<PropsWithChildren<Props>> = (props) =>{
|
|
|
</div>
|
|
|
<div className="relationSchema">
|
|
|
<div className="groupTitle">{t("title5")}</div>
|
|
|
- <img src="/img/group_br.webp" alt="" className="groupImg"/>
|
|
|
+ <img src="/img/group_br.webp" alt="" className="groupImg" />
|
|
|
<ul className="rules">
|
|
|
<li>
|
|
|
- {t("content5-1")}
|
|
|
- <span style={{color:"red"}}>{t("red1")}</span>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- {t("content5-2")}
|
|
|
+ {t("content5-1")}
|
|
|
+ <span style={{ color: "red" }}>{t("red1")}</span>
|
|
|
</li>
|
|
|
+ <li>{t("content5-2")}</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div className="content">
|
|
@@ -149,9 +165,7 @@ const App: FC<PropsWithChildren<Props>> = (props) =>{
|
|
|
<div>
|
|
|
<p>{t("content6-1")}</p>
|
|
|
<p>{t("content6-2")}</p>
|
|
|
- <p>
|
|
|
- {t("content6-3")}
|
|
|
- </p>
|
|
|
+ <p>{t("content6-3")}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -160,6 +174,6 @@ const App: FC<PropsWithChildren<Props>> = (props) =>{
|
|
|
<div className="drawer-mask"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- )
|
|
|
-}
|
|
|
-export default App
|
|
|
+ );
|
|
|
+};
|
|
|
+export default App;
|