year hace 3 meses
padre
commit
86681b0b25

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

@@ -22,6 +22,7 @@ import { Badge } from "antd-mobile";
 import dayjs from "dayjs";
 import { useTranslations } from "next-intl";
 import Image from "next/image";
+import { usePathname } from "next/navigation";
 import { FC, useEffect, useMemo, useRef, useState } from "react";
 
 interface Props {
@@ -78,7 +79,8 @@ const SlotSection: FC<SlotSectionProps> = ({ onDestory }) => {
 /**
  * 轮盘
  */
-const WheelSection = ({ onDestory }: any) => {
+const WheelSection = () => {
+    const pathname = usePathname();
     const wheelModalRef = useRef<WheelModalProps | null>(null);
     const [data, setData] = useState<any>([]);
     const { modalShow, closeModalShow } = useModalShow((state: any) => ({
@@ -107,7 +109,7 @@ const WheelSection = ({ onDestory }: any) => {
         if (modalShow === keyName) {
             wheelModalRef.current?.onOpen(data);
         }
-    }, [modalShow, data, keyName]);
+    }, [modalShow, data, keyName, pathname]);
 
     const destoryComponent = () => {
         if (modalShow === keyName) {