Before 8 meses atrás
pai
commit
99f181abe5

+ 8 - 8
public/swenv.js

@@ -1,13 +1,13 @@
 
   const process = {
     env: {
-        NEXT_PUBLIC_FIREBASE_APIKEY: 'AIzaSyCIE8xtySsYztsSgmQJx_aqPrrpHEuvgvw',
-        NEXT_PUBLIC_FIREBASE_AUTHDOMAIN: 'bcwin777-1bdda.firebaseapp.com',
-        NEXT_PUBLIC_FIREBASE_PROJECTID: 'bcwin777-1bdda',
-        NEXT_PUBLIC_FIREBASE_STORAGEBUCKET: 'bcwin777-1bdda.firebasestorage.app',
-        NEXT_PUBLIC_FIREBASE_MESSAGINGSENDERID: '542456379513',
-        NEXT_PUBLIC_FIREBASE_APPID: '1:542456379513:web:851a46fc639085170bfca8',
-        NEXT_PUBLIC_FIREBASE_MEASUREMENTID: 'G-GV6Y8DXHHD',
-        NEXT_PUBLIC_FIREBASE_KEYS: 'BOCfpA08vK6uxhMdRblnx9gPVBLx9WpTn9AutVNhHQQpVtXzDIKW0X6cmsNRaFDhyFDJfMqWjqC7mq6uDFIKU_M',
+        NEXT_PUBLIC_FIREBASE_APIKEY: 'AIzaSyDAWORGKhdyzb5KeqTi535VmD5gN2Cdle8',
+        NEXT_PUBLIC_FIREBASE_AUTHDOMAIN: 'bcwin-a99b1.firebaseapp.com',
+        NEXT_PUBLIC_FIREBASE_PROJECTID: 'bcwin-a99b1',
+        NEXT_PUBLIC_FIREBASE_STORAGEBUCKET: 'bcwin-a99b1.appspot.com',
+        NEXT_PUBLIC_FIREBASE_MESSAGINGSENDERID: '1055413612814',
+        NEXT_PUBLIC_FIREBASE_APPID: '1:1055413612814:web:7a563237de8e43849d275f',
+        NEXT_PUBLIC_FIREBASE_MEASUREMENTID: 'G-467M2BYJMS',
+        NEXT_PUBLIC_FIREBASE_KEYS: 'BAOsT7kii-ctLzGrgXe_wYhfuxlme1v4njnD0uPSKp3DpSnrUa2e709b9dRaeYVU7jF_qIx1y9tEv0CvilDCdnM',
     }
 }

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

@@ -1,17 +1,15 @@
 "use client";
-import React, {useState} from 'react'
 import { ServiceTypes } from "@/api/customservice";
+import { lredPacketApi, redPacketApi } from "@/api/promo";
 import { Link } from "@/i18n";
 import { useGlobalNoticeStore } from "@/stores/useGlobalNoticeStore";
 import { useSocialStore } from "@/stores/useSocials";
-import { Badge } from "antd-mobile";
-import { useTranslations } from "next-intl";
-import { FC, useEffect } from "react";
-import PopupHby from "@/app/[locale]/(TabBar)/(entire)/promo/PopupHby";
-import { redPacketApi,lredPacketApi } from "@/api/promo";
 import { getToken } from "@/utils/Cookies";
-import { getUserMoneyApi } from "@/api/user";
 import { useRequest } from "ahooks";
+import { Badge } from "antd-mobile";
+import { useTranslations } from "next-intl";
+import { FC, useEffect, useState } from "react";
+import PopupHby from "../../promo/PopupHby";
 
 interface Props {
     services: ServiceTypes[];
@@ -20,7 +18,7 @@ interface Props {
 const ServiceWidget: FC<Props> = (props) => {
     const token = getToken();
     const [isShowRedPacket, setIsShowRedPacket] = useState<any>(false);
-    const [isShowRedIcon,setIsShowRedIcon] = useState(false)
+    const [isShowRedIcon, setIsShowRedIcon] = useState(false);
     const { services, socials } = props;
     const defaultService = services.find((item) => item.is_suspend === 1);
 
@@ -36,69 +34,66 @@ const ServiceWidget: FC<Props> = (props) => {
         unread: state.unread,
     }));
 
+    const getRedPacketInfo = async () => {
+        try {
+            let redPacketInfo: any;
+            let actList: any = [];
+            if (token) {
+                redPacketInfo = await lredPacketApi();
+                actList = redPacketInfo.data?.red_packets || [];
+            } else {
+                redPacketInfo = await redPacketApi();
+                actList = redPacketInfo.data || [];
+            }
 
-
-
-    const getRedPacketInfo =async()=>{
-      try{  
-
-        let redPacketInfo:any
-        let actList:any = []
-        if(token){
-          redPacketInfo =await lredPacketApi()
-          actList = redPacketInfo.data?.red_packets || []
-        }else{
-          redPacketInfo =await redPacketApi()
-          actList = redPacketInfo.data || []
+            // 是否有已开始但是没领过的红包
+            let isHasStartAct = actList.filter((aItem: any) => {
+                return !!aItem.is_start && !aItem.is_receive;
+            });
+            let isShowRed = isHasStartAct.length > 0;
+            setIsShowRedIcon(isShowRed);
+        } catch (error) {
+            console.log("redPacketInfo===>error:", error);
         }
-      
-
-        // 是否有已开始但是没领过的红包
-        let isHasStartAct = actList.filter((aItem:any)=>{
-          return !!aItem.is_start && !aItem.is_receive
-        })
-        let isShowRed = isHasStartAct.length>0
-        setIsShowRedIcon(isShowRed)
-       
-      }catch(error){
-        console.log('redPacketInfo===>error:',error)
-      }
-     
-    } 
+    };
     // 红包雨轮询
     useRequest(getRedPacketInfo, {
-      pollingInterval: 180000,
-      pollingErrorRetryCount: 1,
-      pollingWhenHidden: false,
-      onSuccess: (data) => {
-         console.log('data',data)
-      },
+        pollingInterval: 180000,
+        pollingErrorRetryCount: 1,
+        pollingWhenHidden: false,
+        onSuccess: (data) => {
+            console.log("data", data);
+        },
     });
 
     return (
-        <>  
-          {/* 红包雨icon */}
-          {
-            isShowRedIcon && (
-              <div
-                className={
-                    "flex h-[0.54rem] w-[0.54rem] items-center" +
-                    " absolute bottom-[2.04rem] right-[0.12rem] z-50 justify-center cursor-pointer"
-                }
-              >
-                <img
-                    className={"h-[0.3889rem] w-[0.3889rem]"}
-                    src='/hby/red-icon.png'
-                    onClick={()=>{setIsShowRedPacket(true)}}
-                />
-              </div>
-            )
-          }
-            
+        <>
+            {/* 红包雨icon */}
+            {isShowRedIcon && (
+                <div
+                    className={
+                        "flex h-[0.54rem] w-[0.54rem] items-center" +
+                        " absolute bottom-[2.04rem] right-[0.12rem] z-50 cursor-pointer justify-center"
+                    }
+                >
+                    <img
+                        className={"h-[0.3889rem] w-[0.3889rem]"}
+                        src="/hby/red-icon.png"
+                        onClick={() => {
+                            setIsShowRedPacket(true);
+                        }}
+                    />
+                </div>
+            )}
+
             {/* 红包弹窗 */}
-            {
-              isShowRedPacket && (<PopupHby  onClose={()=>{setIsShowRedPacket(false)}} />)
-            }
+            {isShowRedPacket && (
+                <PopupHby
+                    onClose={() => {
+                        setIsShowRedPacket(false);
+                    }}
+                />
+            )}
 
             {defaultService && (
                 <Link
@@ -160,10 +155,10 @@ const ServiceWidget: FC<Props> = (props) => {
                             target={"_blank"}
                             className="bg-white m-[0.05rem] h-[0.3889rem] w-[0.3889rem] rounded"
                         >
-                          <img
-                              className={"h-[0.3889rem] w-[0.3889rem]"}
-                              src={service.icon_url}
-                          ></img>
+                            <img
+                                className={"h-[0.3889rem] w-[0.3889rem]"}
+                                src={service.icon_url}
+                            ></img>
                         </Link>
                     );
                 })}