|
@@ -1,5 +1,12 @@
|
|
|
"use client";
|
|
|
-import { Category, GameListRep, getGameHistory, searchGameListApi, SearchProps } from "@/api/home";
|
|
|
+import {
|
|
|
+ Category,
|
|
|
+ GameListRep,
|
|
|
+ getFavoriteList,
|
|
|
+ getGameHistory,
|
|
|
+ searchGameListApi,
|
|
|
+ SearchProps,
|
|
|
+} from "@/api/home";
|
|
|
import Box from "@/components/Box";
|
|
|
import GroupCard from "@/components/Card/GroupCard";
|
|
|
import HeaderBack from "@/components/HeaderBack";
|
|
@@ -49,7 +56,10 @@ const GameListFlag: FC<Props> = (props) => {
|
|
|
res = await searchGameListApi(params.current);
|
|
|
}
|
|
|
if (Number(pageType) === PageType.History) {
|
|
|
- res = await getGameHistory();
|
|
|
+ res = await getGameHistory(params as any);
|
|
|
+ }
|
|
|
+ if (Number(pageType) === PageType.Favorite) {
|
|
|
+ res = await getFavoriteList(params as any);
|
|
|
}
|
|
|
|
|
|
if (res?.code === 200) {
|
|
@@ -66,7 +76,12 @@ const GameListFlag: FC<Props> = (props) => {
|
|
|
<HeaderBack showBack={true} title={searchParams.name} />
|
|
|
<main className={"main-header pb-[.8rem]"}>
|
|
|
<Box>
|
|
|
- <GroupCard data={target.games} row={1} />
|
|
|
+ <GroupCard
|
|
|
+ data={target.games}
|
|
|
+ row={1}
|
|
|
+ isShowFavorite={true}
|
|
|
+ isShowOnline={true}
|
|
|
+ />
|
|
|
<InfiniteScroll loadMore={loadMore} hasMore={!target?.page?.is_end!} />
|
|
|
</Box>
|
|
|
</main>
|