year 3 هفته پیش
والد
کامیت
776ee68043

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

@@ -89,7 +89,7 @@ const Games = React.forwardRef<ModalProps, Props>(({ data }, ref) => {
                     </FormItem>
                 </Form>
                 <div className="flex min-h-[0px] flex-1">
-                    <div className="mr-[.1rem] h-[100%] w-[.9rem] overflow-auto">
+                    <div className="mr-[.1rem] h-[100%] w-[.8rem] overflow-auto">
                         {!!data?.game_list?.length &&
                             data?.game_list.map((item, idx) => {
                                 return (

+ 2 - 2
src/app/[locale]/(doings)/rank/detail/history.tsx

@@ -63,7 +63,7 @@ const History = React.forwardRef<ModalProps, Props>(({ areaId }, ref) => {
             title={
                 <div className="p-[.1rem] text-left">
                     <span className="text-[#fff]">Conjunto de prémios:</span>
-                    <span className={styles.moneyText}>R${data.total}</span>
+                    <span className={styles.moneyText}>R${data.total || 0}</span>
                 </div>
             }
         >
@@ -96,7 +96,7 @@ const History = React.forwardRef<ModalProps, Props>(({ areaId }, ref) => {
                                     ></Vip>
                                 </div>
                                 <div className="flex-1">
-                                    <div>{item?.nickName}</div>
+                                    <div className="text-[.12rem]">{item?.nickName}</div>
                                     <div className={styles.usedPoint}>{item?.score}</div>
                                 </div>
                                 <div className="flex flex-col items-end">

+ 4 - 4
src/app/[locale]/(doings)/rank/detail/middle.tsx

@@ -205,8 +205,8 @@ const MiddleContainer: React.FC<Props> = ({ data, rankList = [], gamesInfo }) =>
                                 key={item.rank}
                             >
                                 <div className="mr-[.1rem] w-[.6rem] text-center text-[.2rem] font-bold text-[#11de68]">
-                                    {/* {item.rank} */}
-                                    {idx + 4}
+                                    {item.rank}
+                                    {/* {idx + 4} */}
                                 </div>
                                 <div className={clsx(styles.normalHeader, "mr-[.2rem]")}>
                                     <img
@@ -225,7 +225,7 @@ const MiddleContainer: React.FC<Props> = ({ data, rankList = [], gamesInfo }) =>
                                     ></Vip>
                                 </div>
                                 <div className="flex-1">
-                                    <div>{item?.nickName}</div>
+                                    <div className="text-[.12rem]">{item?.nickName}</div>
                                     <div className={styles.usedPoint}>{item.score}</div>
                                 </div>
                                 <div className="flex flex-col items-end">
@@ -259,7 +259,7 @@ const MiddleContainer: React.FC<Props> = ({ data, rankList = [], gamesInfo }) =>
                                 ></Vip>
                             </div>
                             <div className="flex-1">
-                                <div>{data.self_rank.nickName}</div>
+                                <div className="text-[.12rem]">{data.self_rank.nickName}</div>
                                 <div className={styles.usedPoint}>{data.self_rank.score}</div>
                             </div>
                             <div className="flex flex-col items-end">

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

@@ -379,6 +379,9 @@
         border-top: none;
         border-bottom: none;
     }
+    :global(.title) {
+        margin-bottom: 0 !important;
+    }
     .card {
         height: auto !important;
         aspect-ratio: 169/234;
@@ -389,7 +392,7 @@
     .gamesContainer {
         display: grid;
         grid-template-columns: repeat(3, 1fr);
-        grid-gap: 0.1rem;
+        grid-gap: 10px;
     }
 }
 

+ 37 - 23
src/app/[locale]/(navbar)/gameList2/Right.tsx

@@ -2,8 +2,8 @@ import { GameListRep, searchGameListApi } from "@/api/home";
 import Card from "@/components/Card/Card";
 import Empty from "@/components/Empty";
 import { GameListTypeEnum } from "@/enums";
-import { debounce } from "@/utils/methods";
-import { InfiniteScroll } from "antd-mobile";
+import { useDebounceEffect } from "ahooks";
+import { InfiniteScroll, Loading } from "antd-mobile";
 import React from "react";
 import styles from "./page.module.scss";
 
@@ -13,7 +13,7 @@ interface Props {
 
 const Left: React.FC<Props> = ({ actInfo }) => {
     const [data, setData] = React.useState<GameListRep[]>([]);
-    const [loading, setLoading] = React.useState<boolean>(false);
+    const [loading, setLoading] = React.useState<boolean>(true);
     const [hasMore, setHasMore] = React.useState(true);
     const [isInit, setIsInit] = React.useState(true);
     const PageRef = React.useRef({
@@ -21,14 +21,21 @@ const Left: React.FC<Props> = ({ actInfo }) => {
         page_size: 15,
     });
 
+    useDebounceEffect(() => {
+        toInitFn();
+    }, [actInfo]);
+
     React.useEffect(() => {
         setData([]);
-        setHasMore(true);
-        setLoading(false);
         setIsInit(true);
-        PageRef.current.current_page = 0;
+        setLoading(true);
     }, [actInfo]);
 
+    const toInitFn = () => {
+        PageRef.current.current_page = 0;
+        setHasMore(true);
+    };
+
     const getData = async () => {
         if (!actInfo?.id) return;
         try {
@@ -55,29 +62,36 @@ const Left: React.FC<Props> = ({ actInfo }) => {
             setLoading(false);
         }
     };
-    const loadMore = debounce(async () => {
-        if (!hasMore || loading || !actInfo?.id) return;
+    const loadMore = async () => {
+        if (!hasMore || (loading && !isInit) || !actInfo?.id) return;
         PageRef.current.current_page += 1;
         getData();
-    }, 500) as () => Promise<void>;
+    };
 
     return (
         <div className={styles.right}>
-            <div className={styles.rightBox}>
-                {data.map((item) => {
-                    return (
-                        <Card
-                            key={`${actInfo?.type}_${actInfo?.id}_${item.id}`}
-                            item={item}
-                            className={styles.gameCard}
-                            isShowFavorite={true}
-                            isShowOnline={true}
-                        ></Card>
-                    );
-                })}
-            </div>
+            {loading && isInit && (
+                <div className="flex h-[100%] items-center justify-center">
+                    <Loading></Loading>
+                </div>
+            )}
             {(isInit || data.length > 0) && (
-                <InfiniteScroll loadMore={loadMore} hasMore={hasMore}></InfiniteScroll>
+                <>
+                    <div className={styles.rightBox}>
+                        {data.map((item) => {
+                            return (
+                                <Card
+                                    key={`${actInfo?.type}_${actInfo?.id}_${item.id}`}
+                                    item={item}
+                                    className={styles.gameCard}
+                                    isShowFavorite={true}
+                                    isShowOnline={true}
+                                ></Card>
+                            );
+                        })}
+                    </div>
+                    <InfiniteScroll loadMore={loadMore} hasMore={hasMore}></InfiniteScroll>
+                </>
             )}
 
             {!isInit && !loading && data.length <= 0 && <Empty></Empty>}

+ 5 - 1
src/components/HeaderBack/index.tsx

@@ -87,7 +87,11 @@ const HeaderBack: FC<PropsWithChildren<HeaderBackProps>> = ({
             {getToken() && (
                 <div>
                     {is_open_no_bonus === 1 && (
-                        <img src="/img/no_bouns.webp" alt="" className="h-[20px]" />
+                        <img
+                            src="/img/no_bouns.webp"
+                            alt=""
+                            className="h-[20px] w-[auto] max-w-[none]"
+                        />
                     )}
                 </div>
             )}

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

@@ -13,7 +13,7 @@ export function debounce<T extends (...args: any[]) => any>(
 ): (...args: Parameters<T>) => ReturnType<T> | undefined {
     let timer: NodeJS.Timeout | null = null;
     let isInvoked = false;
-
+    console.log(1122, timer);
     return function (this: ThisParameterType<T>, ...args: Parameters<T>) {
         const context = this;
 
@@ -22,7 +22,7 @@ export function debounce<T extends (...args: any[]) => any>(
             isInvoked = true;
             return fn.apply(context, args);
         }
-
+        console.log(timer);
         // 清除之前的定时器
         if (timer) {
             clearTimeout(timer);