Forráskód Böngészése

fix: 首充倒计时

ansoni 3 hónapja
szülő
commit
a0bf8442f6

+ 2 - 3
src/app/[locale]/(doings)/depositing/Client.tsx

@@ -1,10 +1,9 @@
 "use client";
-import { useCountDown } from "ahooks";
+import useCountDown from "@/hooks/useCountdown";
 
 export const TimeLeft = (props: { endTime: number }) => {
     const [countdown, time] = useCountDown({
-        targetDate: props.endTime,
-        onEnd: () => {},
+        leftTime: props.endTime * 1000,
     });
     return (
         <div className={"flex text-[0.0972rem]"}>

+ 3 - 3
src/components/ModalPopup/RechargeModal/index.tsx

@@ -1,7 +1,7 @@
 "use client";
+import useCountDown from "@/hooks/useCountdown";
 import { useRouter } from "@/i18n/routing";
 import { getToken } from "@/utils/Cookies";
-import { useCountDown } from "ahooks";
 import { Mask } from "antd-mobile";
 import clsx from "clsx";
 import { useTranslations } from "next-intl";
@@ -24,7 +24,7 @@ export interface RechargeContentProps {
 export function Timeout(props: { endTime: number; className?: string; onEndHandler?: () => void }) {
     const { endTime, className, onEndHandler } = props;
     const [countdown, time] = useCountDown({
-        targetDate: endTime * 1000,
+        leftTime: endTime * 1000,
         onEnd: () => {
             onEndHandler && onEndHandler();
         },
@@ -88,7 +88,7 @@ export const RechargeContent: FC<RechargeContentProps> = (props) => {
                     <img src={"/recharge/bg.png"} className={"h-[100%] w-[100%]"} />
                 </div>
                 <div
-                    className={"animate-slow-bounce absolute left-0 top-0 -z-[9] h-[100%] w-[100%]"}
+                    className={"absolute left-0 top-0 -z-[9] h-[100%] w-[100%] animate-slow-bounce"}
                 >
                     <img src={"/recharge/bg1.png"} className={"h-[100%] w-[100%]"} />
                 </div>