Before 7 місяців тому
батько
коміт
783a3418de

+ 3 - 0
src/api/user.ts

@@ -239,6 +239,9 @@ export interface Wallet {
     gift_packet: {
         amount: number;
     };
+    notice: {
+        lose_score: number;
+    };
 }
 // 前台用户获取金额信息
 export const getUserMoneyApi = () => {

+ 3 - 2
src/app/[locale]/(TabBar)/[[...share]]/@popupWidget/ActivityMask.tsx

@@ -7,11 +7,12 @@ const ActivityMask = () => {
     const [visible, setVisible] = useState<boolean>(false);
 
     const wallet = useWalletStore((state) => state.wallet);
+    console.log(`🚀🚀🚀🚀🚀-> in ActivityMask.tsx on 10`, wallet);
     useEffect(() => {
-        if (wallet.gift_packet.amount > 0) {
+        if (wallet?.notice?.lose_score > 0) {
             setVisible(true);
         }
-    }, [wallet.gift_packet.amount]);
+    }, [wallet?.notice?.lose_score]);
 
     return (
         <Mask visible={visible} destroyOnClose={true} getContainer={null}>

+ 3 - 0
src/stores/useWalletStore.ts

@@ -42,6 +42,9 @@ const initialState: State = {
         gift_packet: {
             amount: 0,
         },
+        notice: {
+            lose_score: 0,
+        },
     },
     score: undefined,
 };