Explorar el Código

fix: 更改首页模块跳转以及提现页面请求

Before hace 8 meses
padre
commit
3cd174e737

+ 1 - 0
src/api/home.ts

@@ -237,6 +237,7 @@ export type SearchProps = {
     page_size: number;
     use_page: boolean;
     provider_id?: number;
+    category_id?: number;
 };
 // 获取游戏列表-(跳转 搜索)
 export const searchGameListApi = (props: SearchProps) => {

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

@@ -20,7 +20,7 @@ const HomeGames = (props: Props) => {
     const router = useRouter();
     const { groupGames = [] } = props;
     const todoHandler = (item: Category) => {
-        router.push(`/gameList/?gameListFlag=${item.jump_id}`);
+        router.push(`/gameList/?gameListFlag=${item.jump_id}&type=${item.type}`);
     };
     return (
         <>

+ 5 - 1
src/app/[locale]/(TabBar)/gameList/[[...gameListFlag]]/page.tsx

@@ -21,8 +21,12 @@ const GameListFlag: FC<Props> = (props) => {
         current_page: 0,
         page_size: 15,
         use_page: true,
-        provider_id: +searchParams.gameListFlag,
     });
+    if (+searchParams.type === 2) {
+        params.current.provider_id = +searchParams.gameListFlag;
+    } else {
+        params.current.category_id = +searchParams.gameListFlag;
+    }
     const getGames = async (): Promise<GameListRep[] | undefined> => {
         return searchGameListApi(params.current).then((res) => {
             if (res.code === 200) {

+ 6 - 7
src/app/[locale]/(navbar)/transactions/Bouns.tsx

@@ -9,9 +9,9 @@ import Message from "./components/Message";
 
 type Params = { current_page: number; page_size: number; use_page: boolean };
 
-const getBetsApi = async (data: Params) => {
+const getTransactionsApi = async (data: Params) => {
     return server.post<DepositsRep[]>({
-        url: "/v1/api/user/user_bets",
+        url: "/v1/api/user/user_transactions",
         data: data,
     });
 };
@@ -23,22 +23,21 @@ const Bouns = () => {
         page: Partial<Pagination>;
     }>({ list: [], page: { is_end: false } });
 
-    // TODO 接口暂无
     const getDepositsData = async () => {
-        return getBetsApi(params.current).then((res) => {
+        return getTransactionsApi(params.current).then((res) => {
             setSourceData((value) => ({ page: res.page, list: [...value.list, ...res.data] }));
             return res;
         });
     };
     const loadMore = async () => {
-        // params.current.current_page += 1;
-        // await getDepositsData();
+        params.current.current_page += 1;
+        await getDepositsData();
         return Promise.resolve();
     };
     return (
         <>
             <Message data={sourceData.list} />
-            <InfiniteScroll loadMore={loadMore} hasMore={sourceData.page.is_end!} />
+            <InfiniteScroll loadMore={loadMore} hasMore={!sourceData.page.is_end!} />
         </>
     );
 };

+ 0 - 1
src/app/[locale]/(wallet)/free/page.tsx

@@ -2,7 +2,6 @@ import { getMoneyApi } from "@/api/userWallt";
 import WalletHeader from "./WalletHeader";
 const Page = async () => {
     const userWallet = await getMoneyApi();
-    console.log(`🚀🚀🚀🚀🚀-> in page.tsx on 5`, userWallet);
     return (
         <>
             <WalletHeader wallet={userWallet} />