Explorar o código

fix: 无邀请链接优化

Before hai 10 meses
pai
achega
253ac7cec9

+ 3 - 0
src/app/[locale]/(TabBar)/(ordinary)/deposit/DepositData.tsx

@@ -21,6 +21,8 @@ const DepositData: FC<Props> = (props) => {
     let [amount, setAmount] = useState(0);
     const ChangeAmount = (e: any) => {
         let newAmount = e.target.value.replace(/[^0-9]/g, "");
+        if (newAmount > activeType.max_amount) newAmount = activeType.max_amount;
+        if (newAmount < activeType.min_amount) newAmount = activeType.min_amount;
         setAmount(newAmount);
     };
 
@@ -36,6 +38,7 @@ const DepositData: FC<Props> = (props) => {
         }
     };
     const titleChangeHandler = (item: DepositsTypes, index: number) => {
+        setAmount(0);
         setActiveType(item);
     };
 

+ 2 - 0
src/app/[locale]/(TabBar)/(ordinary)/deposit/page.tsx

@@ -1,4 +1,5 @@
 import { DepositsTypes } from "@/api/depositsApi";
+import Empty from "@/components/Empty";
 import { server } from "@/utils/server";
 import DepositData from "./DepositData";
 
@@ -15,6 +16,7 @@ const getDepositApi = async () => {
 };
 const Deposit = async () => {
     const deposits = await getDepositApi();
+    if (!deposits.length) return <Empty />;
     return (
         <>
             <DepositData deposits={deposits} />

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

@@ -54,7 +54,7 @@ const Layout: FC<PropsWithChildren<Props>> = (props) => {
     const pathname = usePathname();
     useEffect(() => {
         const [, shareId] = pathname.split("/");
-        if (!shareId) return;
+        if (!shareId || shareId === "xxxxxx") return;
         sessionStorage.setItem("shareId", shareId);
     }, []);
     return (

+ 2 - 0
src/app/[locale]/(navbar)/notification/components/Notices.tsx

@@ -1,6 +1,7 @@
 "use client";
 import { GlobalNoticeRep } from "@/api/home";
 import Box from "@/components/Box";
+import Empty from "@/components/Empty";
 import { timeFormat } from "@/utils/methods";
 import { Collapse } from "antd-mobile";
 import { useLocale } from "next-intl";
@@ -11,6 +12,7 @@ interface Props {
 const SystemMessage = (props: Props) => {
     const { data } = props;
     const locale = useLocale();
+    if (!data.length) return <Empty />;
     return (
         <div className={style.messageCollapse}>
             <Collapse accordion>

+ 3 - 0
src/app/[locale]/affiliate/payments/page.tsx

@@ -71,6 +71,9 @@ const App: FC<Props> = (props) => {
         {
             title: t("Status"),
             dataIndex: "withdrawal_status",
+            render: (item: UserWithdrawalList) => {
+                return <span>{item.withdrawal_status === 1 ? "Success" : ""}</span>;
+            },
         },
     ];
 

+ 2 - 2
src/utils/methods/index.ts

@@ -20,8 +20,8 @@ export function debounce(fn: Function, delay = 200, immediate = false) {
 
 export const phoneConvert = (number: string) => {
     if (!number) return "";
-    let pat = /(\d{3})\d*(\d{4})/;
-    return number.replace(pat, "$1***$2");
+    let pat = /(\d{3})\d*(\d{3})/;
+    return number.replace(pat, "$1****$2");
 };
 
 /**