|
@@ -7,6 +7,7 @@ import SlotsModal, { SlotModalRefProps } from "@/components/ModalPopup/SlotsModa
|
|
|
import WheelModal, { WheelModalProps } from "@/components/ModalPopup/WheelModal";
|
|
|
|
|
|
import { getWheelApi } from "@/api/cashWheel";
|
|
|
+import { getShareApi } from "@/api/config";
|
|
|
import { getGiveInfoApi } from "@/api/slots";
|
|
|
import { Link } from "@/i18n/routing";
|
|
|
import { useGlobalNoticeStore } from "@/stores/useGlobalNoticeStore";
|
|
@@ -17,6 +18,7 @@ import { useRequest } from "ahooks";
|
|
|
import { Badge } from "antd-mobile";
|
|
|
import { useTranslations } from "next-intl";
|
|
|
import Image from "next/image";
|
|
|
+import { useSearchParams } from "next/navigation";
|
|
|
import { FC, useEffect, useRef } from "react";
|
|
|
|
|
|
interface Props {
|
|
@@ -53,6 +55,9 @@ const ServiceWidget: FC<Props> = (props) => {
|
|
|
return res.data;
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+ const serach = useSearchParams();
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
// 数据存储,侧边栏使用
|
|
|
setSocials(socials);
|
|
@@ -61,6 +66,12 @@ const ServiceWidget: FC<Props> = (props) => {
|
|
|
wheelModalRef.current?.onOpen(data);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ // 分享地址
|
|
|
+ if (serach.size > 1 && localStorage.getItem("share_url") !== window.location.href) {
|
|
|
+ getShareApi({ channel_url: window.location.href });
|
|
|
+ localStorage.setItem("share_url", window.location.href);
|
|
|
+ }
|
|
|
}, []);
|
|
|
|
|
|
const t = useTranslations("HomePage");
|