{t('总额度')}:{' '}
- {totalAmount > 0
- ? `${usedAmount}/${totalAmount} · ${t('剩余')} ${remainAmount}`
- : t('不限')}
+ {totalAmount > 0 ? (
+
+
+ {renderQuota(usedAmount)}/
+ {renderQuota(totalAmount)} · {t('剩余')}{' '}
+ {renderQuota(remainAmount)}
+
+
+ ) : (
+ t('不限')
+ )}
{totalAmount > 0 && (
{t('已用')} {usagePercent}%
@@ -453,18 +477,30 @@ const SubscriptionPlansCard = ({
);
const isPopular = index === 0 && plans.length > 1;
const limit = Number(plan?.max_purchase_per_user || 0);
- const limitLabel =
- limit > 0 ? `${t('限购')} ${limit}` : t('不限购');
+ const limitLabel = limit > 0 ? `${t('限购')} ${limit}` : null;
const totalLabel =
totalAmount > 0
- ? `${t('总额度')}: ${totalAmount}`
+ ? `${t('总额度')}: ${renderQuota(totalAmount)}`
: `${t('总额度')}: ${t('不限')}`;
- const planTags = [
- `${t('有效期')}: ${formatDuration(plan, t)}`,
- `${t('重置')}: ${formatResetPeriod(plan, t)}`,
- totalLabel,
- limitLabel,
- ];
+ const upgradeLabel = plan?.upgrade_group
+ ? `${t('升级分组')}: ${plan.upgrade_group}`
+ : null;
+ const resetLabel =
+ formatResetPeriod(plan, t) === t('不重置')
+ ? null
+ : `${t('额度重置')}: ${formatResetPeriod(plan, t)}`;
+ const planBenefits = [
+ { label: `${t('有效期')}: ${formatDuration(plan, t)}` },
+ resetLabel ? { label: resetLabel } : null,
+ totalAmount > 0
+ ? {
+ label: totalLabel,
+ tooltip: `${t('原生额度')}:${totalAmount}`,
+ }
+ : { label: totalLabel },
+ limitLabel ? { label: limitLabel } : null,
+ upgradeLabel ? { label: upgradeLabel } : null,
+ ].filter(Boolean);
return (
- {/* 属性标签 */}
-
- {planTags.map((tag) => (
-
- {tag}
-
- ))}
+ {/* 套餐权益描述 */}
+
+ {planBenefits.map((item) => {
+ const content = (
+
+
+ {item.label}
+
+ );
+ if (!item.tooltip) {
+ return (
+
+ {content}
+
+ );
+ }
+ return (
+
+
+ {content}
+
+
+ );
+ })}