|
@@ -26,14 +26,9 @@ type Props = {
|
|
|
userMoney: Wallet;
|
|
|
userVip: UserVipInfo;
|
|
|
};
|
|
|
-export const ProfileHeader = (props: Props) => {
|
|
|
- const { userInfo, userMoney, userVip } = props;
|
|
|
+const VipCard = (props: { userVip: UserVipInfo }) => {
|
|
|
+ const { userVip } = props;
|
|
|
const t = useTranslations("ProfilePage");
|
|
|
-
|
|
|
- const [visible, setVisible] = useState(false);
|
|
|
- const callbackFun = () => {
|
|
|
- setVisible(!visible);
|
|
|
- };
|
|
|
// Vip 图标
|
|
|
const vipIconElement = vipImages.map((item, index) => {
|
|
|
if (item.leve === userVip.vip_level) {
|
|
@@ -47,6 +42,128 @@ export const ProfileHeader = (props: Props) => {
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
+ return (
|
|
|
+ <div className={"vip-card"}>
|
|
|
+ <div className={"vip-card__icon"}>{vipIconElement}</div>
|
|
|
+ <div className={"vip-card-process"}>
|
|
|
+ {/*<div className={"process-top"}>{userVip.vip_exp}xp</div>*/}
|
|
|
+ <div>
|
|
|
+ <ProgressBar
|
|
|
+ percent={percentage(userVip.vip_exp, userVip.vip_score_exp)}
|
|
|
+ style={{
|
|
|
+ "--fill-color": "#fb8b05",
|
|
|
+ "--track-width": "0.0694rem",
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div className={"process-bottom"}>
|
|
|
+ <span>VIP{userVip.vip_level}</span>
|
|
|
+ <span className={"process-bottom-desc"}>
|
|
|
+ {t("expTips", {
|
|
|
+ exp: userVip.vip_score_exp - userVip.vip_exp,
|
|
|
+ })}
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ VIP
|
|
|
+ {userVip.vip_next_level}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+const WalletCard = (props: { userMoney: Wallet }) => {
|
|
|
+ const { userMoney } = props;
|
|
|
+ const t = useTranslations("ProfilePage");
|
|
|
+ const [visible, setVisible] = useState(false);
|
|
|
+
|
|
|
+ const callbackFun = () => {
|
|
|
+ setVisible(!visible);
|
|
|
+ };
|
|
|
+
|
|
|
+ const walletHandler = (key: string) => {
|
|
|
+ console.log(`🚀🚀🚀🚀🚀-> in ProfileHeader.tsx on 86`, key);
|
|
|
+ };
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <MaskCom visible={visible} callbackFun={callbackFun} />
|
|
|
+ <div className="coin">
|
|
|
+ <span className="coin_left__icon iconfont icon-icon-wallet"></span>
|
|
|
+ <div className={"coin_right_wallet"}>
|
|
|
+ <div className={"wallet_left_border"}>
|
|
|
+ <span>{t("Saldo")}</span>
|
|
|
+ <div className="num">
|
|
|
+ <span className="uppercase">brl </span>
|
|
|
+ <span>{userMoney.Score || 0.0}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className={"wallet_right_content"}>
|
|
|
+ <div className={"wallet_header"}>
|
|
|
+ {t("bonus")}
|
|
|
+ <Image
|
|
|
+ className="wallet_header__icon"
|
|
|
+ src="/img/a.png"
|
|
|
+ alt="question"
|
|
|
+ onClick={() => setVisible(true)}
|
|
|
+ width={15}
|
|
|
+ height={15}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div className="num">
|
|
|
+ <span className="uppercase">brl </span>
|
|
|
+ <span>{userMoney.point || 0.0}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className={"wallet_left_border"} onClick={() => walletHandler("free")}>
|
|
|
+ <div className={"wallet_header"}>
|
|
|
+ {t("free")}
|
|
|
+ <Image
|
|
|
+ className="wallet_header__icon"
|
|
|
+ src="/img/a.png"
|
|
|
+ alt="question"
|
|
|
+ width={15}
|
|
|
+ height={15}
|
|
|
+ onClick={(event) => {
|
|
|
+ event.stopPropagation();
|
|
|
+ setVisible(true);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div className="num">
|
|
|
+ <span className="uppercase">brl </span>
|
|
|
+ <span>{userMoney.point || 0.0}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className={"wallet_right_content"} onClick={() => walletHandler("replay")}>
|
|
|
+ <div className={"wallet_header"}>
|
|
|
+ {t("replay")}
|
|
|
+ <Image
|
|
|
+ className="wallet_header__icon"
|
|
|
+ src="/img/a.png"
|
|
|
+ alt="question"
|
|
|
+ onClick={(event) => {
|
|
|
+ event.stopPropagation();
|
|
|
+ setVisible(true);
|
|
|
+ }}
|
|
|
+ width={15}
|
|
|
+ height={15}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div className="num">
|
|
|
+ <span className="uppercase">brl </span>
|
|
|
+ <span>{userMoney.point || 0.0}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </>
|
|
|
+ );
|
|
|
+};
|
|
|
+export const ProfileHeader = (props: Props) => {
|
|
|
+ const { userInfo, userMoney, userVip } = props;
|
|
|
+ const t = useTranslations("ProfilePage");
|
|
|
+
|
|
|
return (
|
|
|
<>
|
|
|
<div className={"userContent"}>
|
|
@@ -65,65 +182,9 @@ export const ProfileHeader = (props: Props) => {
|
|
|
></Link>
|
|
|
</div>
|
|
|
{/*vipcard*/}
|
|
|
- <div className={"vip-card"}>
|
|
|
- <div className={"vip-card__icon"}>{vipIconElement}</div>
|
|
|
- <div className={"vip-card-process"}>
|
|
|
- {/*<div className={"process-top"}>{userVip.vip_exp}xp</div>*/}
|
|
|
- <div>
|
|
|
- <ProgressBar
|
|
|
- percent={percentage(userVip.vip_exp, userVip.vip_score_exp)}
|
|
|
- style={{
|
|
|
- "--fill-color": "#fb8b05",
|
|
|
- "--track-width": "0.0694rem",
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div className={"process-bottom"}>
|
|
|
- <span>VIP{userVip.vip_level}</span>
|
|
|
- <span className={"process-bottom-desc"}>
|
|
|
- {t("expTips", {
|
|
|
- exp: userVip.vip_score_exp - userVip.vip_exp,
|
|
|
- })}
|
|
|
- </span>
|
|
|
- <span>
|
|
|
- VIP
|
|
|
- {userVip.vip_next_level}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <VipCard userVip={userVip} />
|
|
|
|
|
|
- <div className="coin">
|
|
|
- <div>
|
|
|
- <span className="iconfont icon-icon-wallet"></span>
|
|
|
- <div>
|
|
|
- <span>{t("Saldo")}</span>
|
|
|
- <div className="num">
|
|
|
- <span className="uppercase">brl </span>
|
|
|
- <span>{userMoney.Score || 0.0}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <span className="iconfont icon-gift2"></span>
|
|
|
- <div>
|
|
|
- <span onClick={() => setVisible(true)}>
|
|
|
- {t("Bônus")}{" "}
|
|
|
- <Image
|
|
|
- className="a"
|
|
|
- src="/img/a.png"
|
|
|
- alt="question"
|
|
|
- width={50}
|
|
|
- height={50}
|
|
|
- />
|
|
|
- </span>
|
|
|
- <div className="num">
|
|
|
- <span className="uppercase">brl </span>
|
|
|
- <span>{userMoney.point || 0.0}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <WalletCard userMoney={userMoney} />
|
|
|
</div>
|
|
|
|
|
|
<div className="link">
|
|
@@ -134,8 +195,6 @@ export const ProfileHeader = (props: Props) => {
|
|
|
{t("Sacar")}
|
|
|
</Link>
|
|
|
</div>
|
|
|
-
|
|
|
- <MaskCom visible={visible} callbackFun={callbackFun} />
|
|
|
</>
|
|
|
);
|
|
|
};
|