ソースを参照

Merge remote-tracking branch 'refs/remotes/origin/dev' into feature-Before

Before 1 年間 前
コミット
62abb93246

ファイルの差分が大きいため隠しています
+ 2969 - 108
pnpm-lock.yaml


+ 7 - 1
src/app/[locale]/(ordinary)/profile/page.scss

@@ -13,7 +13,7 @@
       background: -webkit-linear-gradient(top, #ffaa30, #ffe6be);
       background: -o-linear-gradient(top, #ffaa30 0, #ffe6be 100%);
       background: linear-gradient(180deg, #ffaa30, #ffe6be);
-      min-height: .93rem;
+      height: auto;
     }
 
     .userInfo {
@@ -28,6 +28,12 @@
       padding: .11rem .18rem;
       -webkit-box-sizing: border-box;
       box-sizing: border-box;
+      margin-bottom: .23rem;
+
+      &.active {
+        margin-bottom: 0;
+      }
+
       & > div {
         display: flex;
         -webkit-box-pack: justify;

+ 18 - 10
src/app/[locale]/(ordinary)/profile/page.tsx

@@ -54,10 +54,12 @@ const Profile: FC<Props> = () => {
     };
 
     const divClassName = clsx("bgImg", token && "default");
+    const divClassName2 = clsx("userContent", token && "active");
+    const divClassName3 = clsx("userInfo", token && "active");
     return (
         <div className="profile-box">
-            <div className="userContent">
-                <div className="userInfo">
+            <div className={divClassName2}>
+                <div className={divClassName3}>
                     <div>
                         <div className={divClassName}></div>
                         {token && (
@@ -67,12 +69,19 @@ const Profile: FC<Props> = () => {
                             </div>
                         )}
                     </div>
-                    {!token && (
-                        <div className="goto" onClick={() => goPage("/login")}>
-                            <span>{t("Login")}</span>
-                            <span className="iconfont icon-xiangzuo1"></span>
-                        </div>
-                    )}
+                    {
+                        token ?
+                        (
+                            <div className="goto" onClick={() => goPage(`/confirmPassword?userPhone=${userInfo.user_phone}&code=123456&alter=true`)}>
+                                <span className="iconfont icon-xiangzuo1"></span>
+                            </div>
+                        ) : (
+                            <div className="goto" onClick={() => goPage("/login")}>
+                                <span>{t("Login")}</span>
+                                <span className="iconfont icon-xiangzuo1"></span>
+                            </div>
+                        )
+                    }
                 </div>
                 {token && (
                     <div className="coin">
@@ -90,7 +99,6 @@ const Profile: FC<Props> = () => {
                             <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">
@@ -105,7 +113,7 @@ const Profile: FC<Props> = () => {
 
             <div className="link">
                 <span onClick={() => goPage("/deposit")}>{t("Depósito")}</span>
-                <span onClick={() => goPage(token ? "/withdraw" : `/login?redirect=withdraw`)}>
+                <span onClick={() => goPage(token ? "/withdraw" : `/login?redirect=/withdraw`)}>
                     {t("Sacar")}
                 </span>
             </div>

+ 25 - 5
src/app/[locale]/confirmPassword/page.tsx

@@ -6,8 +6,10 @@ import HeaderBack from "@/components/HeaderBack";
 import { useRouter } from "@/i18n";
 import { Toast } from "antd-mobile";
 import { useSearchParams } from "next/navigation";
-import { FC, useMemo, useState } from "react";
+import { FC, useEffect, useMemo, useState } from "react";
+import { getSendCodeApi } from "@/api/user";
 import "./page.scss";
+import { useGlobalStore } from "@/stores";
 
 interface Props {}
 
@@ -23,6 +25,21 @@ const ResetPhone: FC<Props> = () => {
         againPwd: "",
     });
 
+    let alter = searchParams.get("alter");
+    const sendCodeRequest = () => {
+        if (!user_phone) return;
+        getSendCodeApi({ user_phone }).then((res) => {
+            if (res.code == 200) {
+                return;
+            }
+            setMsgError(res.msg);
+        });
+    };
+    useEffect(() => {
+        alter && sendCodeRequest()
+        // eslint-disable-next-line react-hooks/exhaustive-deps
+    },[alter])
+
     const setInputVal = (e: { target: { name: any; value: any } }) => {
         const { name, value } = e.target;
         setFromParam({
@@ -45,6 +62,7 @@ const ResetPhone: FC<Props> = () => {
         return false;
     }, [fromParam]);
 
+    const { setToken, setUserInfo } = useGlobalStore();
     let [msgError, setMsgError] = useState("");
     const findPwdRequest = () => {
         let { pwd, againPwd } = fromParam;
@@ -56,6 +74,8 @@ const ResetPhone: FC<Props> = () => {
             setMsgError(res.msg || "");
             if (res.code == 200) {
                 Toast.show({ icon: "success", content: "修改成功", maskClickable: false });
+                setUserInfo('')
+                setToken('')
                 setTimeout(() => {
                     router.replace("/login");
                 }, 1000);
@@ -68,8 +88,8 @@ const ResetPhone: FC<Props> = () => {
             <HeaderBack />
             <div className="main">
                 <div className="title">
-                    <h2>Ativa a sua conta por entrar a Senha de Verificação!</h2>
-                    <div>A senha de verificação foi enviado para o teu telemóvel 16982013895</div>
+                    {/* <h2>修改密码</h2> */}
+                    {/* <div>修改密码 {user_phone}</div> */}
                 </div>
                 <div className="phoneInput">
                     <input
@@ -78,7 +98,7 @@ const ResetPhone: FC<Props> = () => {
                         value={fromParam.pwd}
                         onChange={setInputVal}
                         onInput={verifyPwd}
-                        placeholder="Senha"
+                        placeholder="请输入新密码"
                         maxLength={12}
                     />
                 </div>
@@ -88,7 +108,7 @@ const ResetPhone: FC<Props> = () => {
                         type="password"
                         value={fromParam.againPwd}
                         onChange={setInputVal}
-                        placeholder="Senha"
+                        placeholder="请再次输入新密码"
                         maxLength={12}
                     />
                 </div>

+ 7 - 0
src/components/Footer/index.tsx

@@ -3,6 +3,7 @@ import { usePathname, useRouter } from "@/i18n";
 import clsx from "clsx";
 import { FC, PropsWithChildren, ReactNode } from "react";
 import "./style.scss";
+import { useGlobalStore } from "@/stores";
 
 /**
  * @description 底部Tab组件
@@ -14,6 +15,8 @@ export interface FooterProps {
 }
 
 const Footer: FC<PropsWithChildren> = () => {
+    const { token } = useGlobalStore();
+
     const tabList = [
         {
             iconSpanName: "icon-home",
@@ -46,6 +49,10 @@ const Footer: FC<PropsWithChildren> = () => {
 
     const router = useRouter();
     const goPage = (path = "/") => {
+        if(!token && (path == '/deposit' || path == "/profile")) {
+            router.replace(`/login?redirect=${path}`)
+            return
+        }
         router.push(path);
     };
 

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません