Quellcode durchsuchen

fix: 修改首页clientWidget组件

ansoni vor 5 Monaten
Ursprung
Commit
48615ced95

+ 1 - 1
next.config.mjs

@@ -5,7 +5,7 @@ const withNextIntl = createNextIntlPlugin();
 /** @type {import('next').NextConfig} */
 const nextConfig = {
     output: "standalone",
-    reactStrictMode: true,
+    reactStrictMode: false,
     env: {
         BUILD_ENV: process.env.BUILD_ENV,
     },

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

@@ -7,7 +7,6 @@ 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,7 +16,6 @@ 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 {
@@ -283,16 +281,9 @@ const ServiceWidget: FC<Props> = (props) => {
         });
     };
 
-    const serach = useSearchParams();
-
     useEffect(() => {
         // 数据存储,侧边栏使用
         // setSocials(socials);
-
-        // 分享地址
-        if (serach.get("ch")) {
-            getShareApi({ channel_url: window.location.href });
-        }
     }, []);
 
     const t = useTranslations("HomePage");

+ 7 - 2
src/app/[locale]/(TabBar)/[[...share]]/@clientWidget/page.tsx

@@ -1,4 +1,5 @@
 "use client";
+import { getShareApi } from "@/api/config";
 import { useEventPoint } from "@/hooks/useEventPoint";
 import { usePathname } from "@/i18n/routing";
 import { useEffect } from "react";
@@ -13,6 +14,12 @@ const Page = () => {
     const pathname = usePathname();
     useEffect(() => {
         localStorage.setItem("channel_code", window.location.href);
+        // 统计访问
+        getShareApi({ channel_url: window.location.href }).then((res) => {
+            console.log(`🚀🚀🚀🚀🚀-> in page.tsx on 28`, res);
+        });
+        // pixel 埋点
+        eventView();
 
         const [, shareId] = pathname.split("/");
         if (!shareId || shareId === "xxxxxx") return;
@@ -23,8 +30,6 @@ const Page = () => {
         sessionStorage.setItem("shareId", shareId);
     }, []);
 
-    eventView();
-
     return null;
 };