浏览代码

feat: 修改

year 3 周之前
父节点
当前提交
3ec5a2f229
共有 3 个文件被更改,包括 14 次插入2 次删除
  1. 1 1
      src/app/[locale]/(TabBar)/[[...share]]/_home/HomeSwiper.tsx
  2. 11 0
      src/components/Layout/Sidebar.tsx
  3. 2 1
      src/i18n/routing.ts

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

@@ -33,7 +33,7 @@ const HomeSwiper: FC<Props> = (props) => {
                             <Image
                                 width={"100%"}
                                 height={"1.86rem"}
-                                lazy
+                                // lazy
                                 className="rounded-[0.1rem]"
                                 src={banner.content}
                                 // style={{ height: "1.86rem", width: "100%" }}

+ 11 - 0
src/components/Layout/Sidebar.tsx

@@ -11,6 +11,7 @@ import { server } from "@/utils/client";
 import clsx from "clsx";
 import { useLocale } from "next-intl";
 import Image from "next/image";
+import Router from "next/router";
 import React, { FC, PropsWithChildren, useEffect, useMemo, useRef, useState } from "react";
 import styles from "./style.module.scss";
 
@@ -96,6 +97,16 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
         })
     );
 
+    React.useEffect(() => {
+        Router.events.on("routeChangeComplete", () => {
+            console.log(99990);
+        });
+
+        setTimeout(() => {
+            Router.events.emit("routeChangeComplete");
+        }, 10000);
+    }, []);
+
     React.useEffect(() => {
         if (!providers || providers.length === 0) {
             getGames().then((res) => {

+ 2 - 1
src/i18n/routing.ts

@@ -28,7 +28,8 @@ const useRouter = () => {
     const cfg: any = { ...router };
     Object.keys(router).forEach((key: any) => {
         cfg[key] = (...args: any) => {
-            // document.querySelector("#globalMask").style.display = "block";
+            const dom: any = document.querySelector("#globalMask");
+            if (dom) dom.style.display = "block";
             (router as any)[key].apply(null, args);
         };
     });