Bladeren bron

feat: update env

Before 1 jaar geleden
bovenliggende
commit
abc00bb758
5 gewijzigde bestanden met toevoegingen van 24 en 11 verwijderingen
  1. 1 0
      next.config.mjs
  2. 7 0
      src/api/home.ts
  3. 7 1
      src/app/[locale]/_home/HomeSwiper.tsx
  4. 0 2
      src/app/[locale]/page.tsx
  5. 9 8
      src/components/Layout/index.tsx

+ 1 - 0
next.config.mjs

@@ -6,6 +6,7 @@ const withNextIntl = createNextIntlPlugin();
 /** @type {import('next').NextConfig} */
 const nextConfig = {
   reactStrictMode: true,
+  output:"standalone",
   transpilePackages: ['antd-mobile'],
 
   sassOptions: {

+ 7 - 0
src/api/home.ts

@@ -168,3 +168,10 @@ export const getGameDetailApi = (data: GameRequest) => {
         data,
     });
 };
+
+export const getBannerApi = (data: any) => {
+    return server.post<any>({
+        url: "/v1/api/front/banner_list",
+        data,
+    });
+};

+ 7 - 1
src/app/[locale]/_home/HomeSwiper.tsx

@@ -1,6 +1,7 @@
 "use client";
-import { FC, PropsWithChildren } from "react";
+import { FC, PropsWithChildren, useEffect } from "react";
 
+import { getBannerApi } from "@/api/home";
 import { Autoplay, Pagination } from "swiper/modules";
 import { Swiper, SwiperSlide } from "swiper/react";
 interface Props {}
@@ -15,6 +16,11 @@ const urls = [
     "https://images.hibigwin.com/9f/202406/veFfaahiTGAyDpy.jpg",
 ];
 const HomeSwiper: FC<PropsWithChildren<Props>> = (props) => {
+    useEffect(() => {
+        getBannerApi({}).then((res) => {
+            console.log(res);
+        });
+    }, []);
     return (
         <div style={{ height: "1.86rem" }}>
             <Swiper

+ 0 - 2
src/app/[locale]/page.tsx

@@ -8,8 +8,6 @@ import HomeCard from "./_home/HomeCard";
 import HomeSearch from "./_home/HomeSearch";
 import HomeSwiper from "./_home/HomeSwiper";
 
-// Information
-// ts-ignore
 const App: FC = (props) => {
     const t = useTranslations("global");
 

+ 9 - 8
src/components/Layout/index.tsx

@@ -17,7 +17,7 @@ const Layout: FC<PropsWithChildren<Props>> = (props) => {
     const [mounted, setMounted] = useState(false);
 
     useEffect(() => {
-      setMounted(true)
+        setMounted(true);
     }, []);
 
     const startHandler = () => {
@@ -51,14 +51,15 @@ const Layout: FC<PropsWithChildren<Props>> = (props) => {
                 swiperRef.current = swiper;
             }}
             allowTouchMove={false}
-        > 
-            <SwiperSlide style={{ width: `${!mounted ? '0' : '70%'}`,overflow:'hidden' }} className={"mx-w-[2.2222rem] bg-[rgb(31,31,31)]"}>
-              <section className="relative h-[100vh]">
-                  <Sidebar></Sidebar>
-              </section>
+        >
+            <SwiperSlide
+                style={{ width: `${!mounted ? "0" : "70%"}`, overflow: "hidden" }}
+                className={"mx-w-[2.2222rem] bg-[rgb(31,31,31)]"}
+            >
+                <section className="relative h-[100vh]">
+                    <Sidebar></Sidebar>
+                </section>
             </SwiperSlide>
-            
-           
 
             <SwiperSlide style={{ width: "100%" }}>
                 <div className="relative h-[100vh]" ref={homeContainerRef}>