Browse Source

feat: 修改

year 1 month ago
parent
commit
213a721db8

+ 15 - 0
src/api/home.ts

@@ -424,3 +424,18 @@ export const getGameHistory = (data: SearchProps) => {
         data,
     });
 };
+
+export interface NavigateItem {
+    id: number;
+    name: string;
+    icon_url: string;
+    action_type: number;
+    action_params: string;
+}
+
+export const getNavigateBar = () => {
+    ////v1/api/front/home/navigate_bars3
+    return server.post<NavigateItem[]>({
+        url: "/v1/api/front/home/navigate_bars",
+    });
+};

+ 22 - 0
src/app/[locale]/(TabBar)/[[...share]]/@navigateWidget/page.tsx

@@ -0,0 +1,22 @@
+import { NavigateItem } from "@/api/home";
+import NavigateBarComponent from "@/app/[locale]/(TabBar)/[[...share]]/_home/NavigateBar";
+import { server } from "@/utils/server";
+
+const getNavibarData = async () => {
+    return server.request<NavigateItem[]>({
+        url: "/v1/api/front/home/navigate_bars",
+        method: "POST",
+        body: JSON.stringify({}),
+        next: { revalidate: 0 },
+    });
+};
+
+const NavigateBar = async () => {
+    const res = await getNavibarData();
+    console.log(1122, res);
+    if (res?.code !== 200) return null;
+
+    return <NavigateBarComponent data={res?.data || []}></NavigateBarComponent>;
+};
+
+export default NavigateBar;

+ 30 - 0
src/app/[locale]/(TabBar)/[[...share]]/_home/NavigateBar.tsx

@@ -0,0 +1,30 @@
+"use client";
+import { NavigateItem } from "@/api/home";
+import React from "react";
+import { Swiper, SwiperSlide } from "swiper/react";
+import "swiper/css";
+
+interface Props {
+    data: NavigateItem[];
+}
+
+const NavigateBar: React.FC<Props> = ({ data }) => {
+    return (
+        <div>
+            <Swiper>
+                {data.map((item) => {
+                    return (
+                        <SwiperSlide>
+                            <div>
+                                <img src={item?.img} alt={item?.name} />
+                                <div>{item.name}</div>
+                            </div>
+                        </SwiperSlide>
+                    );
+                })}
+            </Swiper>
+        </div>
+    );
+};
+
+export default NavigateBar;

+ 6 - 0
src/app/[locale]/(TabBar)/[[...share]]/layout.tsx

@@ -25,6 +25,7 @@ type Props = {
     mediaWidget: ReactNode;
     sportSwiperWidget: ReactNode;
     categoryWidget: ReactNode;
+    navigateWidget: ReactNode;
     group: any;
 };
 
@@ -44,6 +45,7 @@ const Layout: FC<PropsWithChildren<Props>> = async (props) => {
         mediaWidget,
         sportSwiperWidget,
         clientWidget,
+        navigateWidget,
         categoryWidget,
     } = props;
 
@@ -71,6 +73,10 @@ const Layout: FC<PropsWithChildren<Props>> = async (props) => {
                 <div className="px-spacing-x">
                     <Suspense fallback={<NoticePlaceHolder />}>{noticeWidget}</Suspense>
                 </div>
+                <div className="px-spacing-x">
+                    <Suspense fallback={<Placeholder />}>{navigateWidget}</Suspense>
+                </div>
+
                 {/* <Box>
                        {categoryWidget}
                     </Box> */}

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

@@ -140,4 +140,6 @@ const Games = React.forwardRef<ModalProps, Props>(({ data }, ref) => {
     );
 });
 
+Games.displayName = "Games";
+
 export default Games;

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

@@ -181,4 +181,6 @@ const History = React.forwardRef<ModalProps, Props>(({ areaId }, ref) => {
     );
 });
 
+History.displayName = "History";
+
 export default History;

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

@@ -99,6 +99,7 @@ const MiddleContainer: React.FC<Props> = ({ data, rankList = [], gamesInfo }) =>
                             onClick={() => {
                                 scrollInto(item);
                             }}
+                            key={item.id}
                         >
                             {item.text}
                         </div>
@@ -174,7 +175,6 @@ const MiddleContainer: React.FC<Props> = ({ data, rankList = [], gamesInfo }) =>
             {!!moreList?.length && (
                 <div className="mt-[.1rem] px-[.1rem]">
                     {moreList.map((item) => {
-                        const curVip = vipImagesMap.get(item.vipLevel || 1);
                         return (
                             <div
                                 className={clsx(styles.normalItem, {