浏览代码

feat: 修改

year 3 周之前
父节点
当前提交
35d0323a02

+ 1 - 1
src/app/[locale]/(doings)/rank/detail/page.tsx

@@ -122,7 +122,7 @@ const Page = () => {
                     setModalType(-1);
                     historyRef.current?.onOpen();
                 }}
-                className="absolute right-[0px] top-[320px] z-[5] rounded-[.08rem_0_0_.08rem] bg-[rgba(255,255,255,.2)] px-[.1rem] py-[.04rem]"
+                className="absolute right-[0px] top-[320px] z-[1] rounded-[.08rem_0_0_.08rem] bg-[rgba(255,255,255,.2)] px-[.1rem] py-[.04rem]"
             >
                 <i className="iconfont icon-tubiaozhizuomoban- mr-[.06rem]"></i>
                 <span>Histórico</span>

+ 6 - 6
src/app/[locale]/(navbar)/gameList2/Left.tsx

@@ -58,12 +58,12 @@ const Left: React.FC<Props> = ({ actInfo, onChage, onInit }) => {
                 return;
             }
         }
-        if ((providers?.length || tags?.length) && typeof onChage === "function") {
-            onChage({ type: GameListTypeEnum.TAG, id: tags[0].id });
-            router.replace({
-                pathname: "/gameList2",
-                query: { tag_id: tags[0].id },
-            });
+        if (providers?.length && typeof onChage === "function") {
+            // onChage({ type: GameListTypeEnum.TAG, id: tags[0].id });
+            // router.replace({
+            //     pathname: "/gameList2",
+            //     query: { tag_id: tags[0].id },
+            // });
             if (typeof onInit === "function") onInit();
         }
         // eslint-disable-next-line react-hooks/exhaustive-deps

+ 17 - 6
src/app/[locale]/(navbar)/gameList2/Right.tsx

@@ -16,23 +16,33 @@ const Left: React.FC<Props> = ({ actInfo }) => {
     const [loading, setLoading] = React.useState<boolean>(true);
     const [hasMore, setHasMore] = React.useState(true);
     const [isInit, setIsInit] = React.useState(true);
+    const [isToggle, setIsToggle] = React.useState(false);
+
     const PageRef = React.useRef({
         current_page: 0,
         page_size: 15,
     });
 
-    useDebounceEffect(() => {
-        toInitFn();
-    }, [actInfo]);
+    useDebounceEffect(
+        () => {
+            toInitFn();
+        },
+        [actInfo],
+        { wait: 1000 }
+    );
 
     React.useEffect(() => {
-        setData([]);
+        setIsToggle(true);
         setIsInit(true);
         setLoading(true);
     }, [actInfo]);
 
     const toInitFn = () => {
         PageRef.current.current_page = 0;
+        setIsToggle(false);
+        setIsInit(true);
+        setLoading(true);
+        setData([]);
         setHasMore(true);
     };
 
@@ -41,6 +51,7 @@ const Left: React.FC<Props> = ({ actInfo }) => {
         try {
             setLoading(true);
             setIsInit(false);
+
             const params: any = {
                 ...PageRef.current,
                 use_page: true,
@@ -70,12 +81,12 @@ const Left: React.FC<Props> = ({ actInfo }) => {
 
     return (
         <div className={styles.right}>
-            {loading && isInit && (
+            {loading && isInit && isToggle && (
                 <div className="flex h-[100%] items-center justify-center">
                     <Loading></Loading>
                 </div>
             )}
-            {(isInit || data.length > 0) && (
+            {(isInit || data.length > 0) && !isToggle && (
                 <>
                     <div className={styles.rightBox}>
                         {data.map((item) => {

+ 1 - 1
src/app/[locale]/(navbar)/gameList2/page.module.scss

@@ -15,7 +15,7 @@
         overflow: auto;
         .rightBox {
             display: grid;
-            grid-template-columns: repeat(3, auto);
+            grid-template-columns: repeat(3, 1fr);
             grid-gap: 5px;
         }
     }

+ 6 - 2
src/app/[locale]/(navbar)/gameList2/page.tsx

@@ -21,13 +21,17 @@ const Page = () => {
                 id: Number(searchParams.get(GameListTypeEnum.TAG)),
             });
             return;
-        }
-        if (searchParams.has(GameListTypeEnum.PROVIDER)) {
+        } else if (searchParams.has(GameListTypeEnum.PROVIDER)) {
             setCurInfo({
                 type: GameListTypeEnum.PROVIDER,
                 id: Number(searchParams.get(GameListTypeEnum.PROVIDER)),
             });
             return;
+        } else {
+            setCurInfo({
+                type: GameListTypeEnum.TAG,
+                id: 1,
+            });
         }
     }, []);