|
@@ -31,7 +31,7 @@ const VipCard = (props: { userVip: UserVipInfo }) => {
|
|
|
|
|
|
// Vip 图标
|
|
// Vip 图标
|
|
const vipIconElement = vipImages.map((item, index) => {
|
|
const vipIconElement = vipImages.map((item, index) => {
|
|
- if (item.leve === userVip.vip_level) {
|
|
|
|
|
|
+ if (item.leve === userVip?.vip_level) {
|
|
return (
|
|
return (
|
|
<Fragment key={index}>
|
|
<Fragment key={index}>
|
|
<Image src={item.src} alt={"vip"} height={110} width={100} />
|
|
<Image src={item.src} alt={"vip"} height={110} width={100} />
|
|
@@ -42,6 +42,8 @@ const VipCard = (props: { userVip: UserVipInfo }) => {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ if (!userVip) return null;
|
|
return (
|
|
return (
|
|
<div className={"vip-card"}>
|
|
<div className={"vip-card"}>
|
|
<div className={"vip-card__icon"}>{vipIconElement}</div>
|
|
<div className={"vip-card__icon"}>{vipIconElement}</div>
|
|
@@ -49,7 +51,7 @@ const VipCard = (props: { userVip: UserVipInfo }) => {
|
|
{/*<div className={"process-top"}>{userVip.vip_exp}xp</div>*/}
|
|
{/*<div className={"process-top"}>{userVip.vip_exp}xp</div>*/}
|
|
<div>
|
|
<div>
|
|
<ProgressBar
|
|
<ProgressBar
|
|
- percent={percentage(userVip.vip_exp, userVip.vip_score_exp)}
|
|
|
|
|
|
+ percent={percentage(userVip?.vip_exp, userVip?.vip_score_exp)}
|
|
style={{
|
|
style={{
|
|
"--fill-color": "#fb8b05",
|
|
"--fill-color": "#fb8b05",
|
|
"--track-width": "0.0694rem",
|
|
"--track-width": "0.0694rem",
|
|
@@ -57,7 +59,7 @@ const VipCard = (props: { userVip: UserVipInfo }) => {
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div className={"process-bottom"}>
|
|
<div className={"process-bottom"}>
|
|
- <span>VIP{userVip.vip_level}</span>
|
|
|
|
|
|
+ <span>VIP{userVip?.vip_level}</span>
|
|
<span className={"process-bottom-desc"}>
|
|
<span className={"process-bottom-desc"}>
|
|
{t("expTips", {
|
|
{t("expTips", {
|
|
exp: flatPoint(userVip.vip_score_exp - userVip.vip_exp),
|
|
exp: flatPoint(userVip.vip_score_exp - userVip.vip_exp),
|