Bläddra i källkod

fix: 414 【bcwin网站】免费游戏-重玩游戏页面标题优化

Before 7 månader sedan
förälder
incheckning
09d728d01a

+ 1 - 3
src/app/[locale]/(TabBar)/[[...share]]/@actionWidget/Service.tsx

@@ -85,9 +85,7 @@ const ServiceWidget: FC<Props> = (props) => {
             return actList.filter((aItem: any) => {
                 return aItem.can_receive && aItem.is_start && !aItem.is_receive;
             });
-        } catch (error) {
-            console.log("redPacketInfo===>error:", error);
-        }
+        } catch (error) {}
     };
     // 红包雨轮询
     const { data: packets, run } = useRequest<any[], any>(getRedPacketInfo, {

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

@@ -12,7 +12,7 @@ const Manufacturer = (props: { data: GameListRep[]; group: Category }) => {
     const { data, group } = props;
     const todoHandler = (item: GameListRep) => {
         router.push({
-            pathname: `/gameList/?gameListFlag=${item.id}&type=2&bet_type=${group.bet_type}`,
+            pathname: `/gameList/?gameListFlag=${item.id}&type=2&bet_type=${group.bet_type}&name=${item.provider}`,
         });
     };
     const elements = data.map((item, index) => {
@@ -35,7 +35,7 @@ const HomeGames = (props: Props) => {
     const { groupGames = [] } = props;
     const todoHandler = (item: Category) => {
         router.push(
-            `/gameList/?gameListFlag=${item.jump_id}&type=${item.type}&bet_type=${item.bet_type}`
+            `/gameList/?gameListFlag=${item.jump_id}&type=${item.type}&bet_type=${item.bet_type}&name=${item.category_name}`
         );
     };
     return (

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

@@ -2,16 +2,23 @@
 import { Category, GameListRep, searchGameListApi, SearchProps } from "@/api/home";
 import Box from "@/components/Box";
 import GroupCard from "@/components/Card/GroupCard";
+import HeaderBack from "@/components/HeaderBack";
 import { Pagination } from "@/types";
 import { useSetState } from "ahooks";
 import { InfiniteScroll } from "antd-mobile";
 import { FC, useRef } from "react";
 interface Props {
-    searchParams: { gameListFlag: string; type: 1 | 2; bet_type: Category["bet_type"] };
+    searchParams: {
+        gameListFlag: string;
+        type: 1 | 2;
+        bet_type: Category["bet_type"];
+        name: string;
+    };
 }
 
 const GameListFlag: FC<Props> = (props) => {
     const { searchParams } = props;
+
     const [target, setTarget] = useSetState<{ games: GameListRep[]; page: Partial<Pagination> }>({
         games: [],
         page: { is_end: false },
@@ -40,14 +47,19 @@ const GameListFlag: FC<Props> = (props) => {
         await getGames();
     };
     return (
-        <Box>
-            <GroupCard
-                data={target.games}
-                row={1}
-                groupType={Number(searchParams.bet_type) as Category["bet_type"]}
-            />
-            <InfiniteScroll loadMore={loadMore} hasMore={!target.page.is_end!} />
-        </Box>
+        <>
+            <HeaderBack showBack={true} title={searchParams.name} />
+            <main className={"main-header bg-[#1f1f1f]"}>
+                <Box>
+                    <GroupCard
+                        data={target.games}
+                        row={1}
+                        groupType={Number(searchParams.bet_type) as Category["bet_type"]}
+                    />
+                    <InfiniteScroll loadMore={loadMore} hasMore={!target.page.is_end!} />
+                </Box>
+            </main>
+        </>
     );
 };
 

+ 1 - 7
src/app/[locale]/(TabBar)/gameList/layout.tsx

@@ -1,4 +1,3 @@
-import HeaderBack from "@/components/HeaderBack";
 import { getTranslations } from "next-intl/server";
 import { ReactNode } from "react";
 
@@ -15,10 +14,5 @@ export default async function LocaleLayout({
     children: ReactNode;
     params: { locale: string };
 }) {
-    return (
-        <>
-            <HeaderBack showBack={true} />
-            <main className={"main-header bg-[#1f1f1f]"}>{children}</main>
-        </>
-    );
+    return <>{children}</>;
 }