소스 검색

fix: 修改124地址以及pwa安装弹窗

Before 8 달 전
부모
커밋
f40ac2be7b
4개의 변경된 파일26개의 추가작업 그리고 7개의 파일을 삭제
  1. 3 3
      .env.uat
  2. 1 1
      src/app/[locale]/(TabBar)/[[...share]]/@popupWidget/page.tsx
  3. 17 3
      src/components/Box/Desktop.tsx
  4. 5 0
      src/types/index.ts

+ 3 - 3
.env.uat

@@ -1,7 +1,7 @@
 #baseurl
-NEXT_PUBLIC_BASE_URL=http://206.168.191.124:8800
-#sharelink
-NEXT_PUBLIC_SHARE_URL=http://206.168.191.124:3000
+NEXT_PUBLIC_BASE_URL=https://api.bcwin777.bet
+#share link
+NEXT_PUBLIC_SHARE_URL=https://ot-site.bcwin777.bet
 #firebase
 NEXT_PUBLIC_FIREBASE_APIKEY=AIzaSyCIE8xtySsYztsSgmQJx_aqPrrpHEuvgvw
 NEXT_PUBLIC_FIREBASE_AUTHDOMAIN=bcwin777-1bdda.firebaseapp.com

+ 1 - 1
src/app/[locale]/(TabBar)/[[...share]]/@popupWidget/page.tsx

@@ -1,9 +1,9 @@
 import { NoticeRep, PromotionRep } from "@/api/home";
 import UserRecharge from "@/app/[locale]/(TabBar)/[[...share]]/@popupWidget/UserRecharge";
+import Desktop from "@/components/Box/Desktop";
 import { server } from "@/utils/server";
 import HomeMessage from "../_home/HomeMessage";
 import HomePromotion from "../_home/HomePromotion";
-import Desktop from "./Desktop";
 const getPromotions = async () => {
     return server
         .request<PromotionRep[], { summery: { showType: 1 | 2 } }>({

+ 17 - 3
src/app/[locale]/(TabBar)/[[...share]]/@popupWidget/Desktop.tsx → src/components/Box/Desktop.tsx

@@ -3,14 +3,19 @@ import { useSystemStore } from "@/stores/useSystemStore";
 import { Button, Popup } from "antd-mobile";
 import { useTranslations } from "next-intl";
 import Image from "next/image";
-import { useEffect, useRef } from "react";
+import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
 
 /**
  * @description 检测pwa是否下载
  * if 下载 不弹窗 , else 弹窗
  *
  */
-const Desktop = () => {
+export interface DesktopRef {
+    onOpen: () => void;
+    onClose: () => void;
+}
+interface Props {}
+const Desktop = forwardRef<DesktopRef, Props>(function Desktop(props, ref) {
     const prompt = useRef<Event | null>(null);
 
     const t = useTranslations("HomePage");
@@ -49,6 +54,15 @@ const Desktop = () => {
         };
         return () => window.removeEventListener("beforeinstallprompt", initDesktop);
     }, []);
+
+    useImperativeHandle(ref, () => {
+        return {
+            onClose: () => setHasDesktop(false),
+            onOpen: () => {
+                setHasDesktop(true);
+            },
+        };
+    });
     return (
         <Popup
             visible={!!isHasDesktop}
@@ -90,5 +104,5 @@ const Desktop = () => {
             </div>
         </Popup>
     );
-};
+});
 export default Desktop;

+ 5 - 0
src/types/index.ts

@@ -50,3 +50,8 @@ export type Result<T> = {
     data: T;
 };
 export type Response<T> = T extends any[] ? Result<T> & { page: Pagination } : Result<T>;
+
+export enum PopupTypes {
+    red_packet = "red_packet",
+    pwa_install = "pwa_install",
+}