year 2 ヶ月 前
コミット
f01014fa76

+ 1 - 0
src/api/user.ts

@@ -135,6 +135,7 @@ export const getUserInfoApi = () => {
 };
 
 export interface Wallet {
+    is_open_no_bonus?: boolean;
     /**
      * 用户头像
      */

+ 2 - 3
src/components/ModalPopup/WalletDescribeModal/index.tsx

@@ -70,7 +70,7 @@ export const BalanceContent = (props: { wallet: Wallet }) => {
 
 export const BonusContent = (props: { wallet: Wallet; handleAcquire?: any }) => {
     const { wallet, handleAcquire } = props;
-    const [switchValue, setSwitchValue] = React.useState<boolean>(false);
+    const [switchValue, setSwitchValue] = React.useState<boolean>(wallet.is_open_no_bonus || false);
     const [isLoading, setIsLoading] = React.useState<boolean>(false);
     const t = useTranslations("ProfilePage");
 
@@ -92,7 +92,6 @@ export const BonusContent = (props: { wallet: Wallet; handleAcquire?: any }) =>
             if (!(res?.code && res?.data?.code === 0)) {
                 throw new Error("error");
             }
-
             setSwitchValue(value);
         } finally {
             setIsLoading(false);
@@ -120,7 +119,7 @@ export const BonusContent = (props: { wallet: Wallet; handleAcquire?: any }) =>
             });
         }
     };
-    //toggleUserBounsApi
+
     return (
         <div>
             <WalletContent