fix: bug
This commit is contained in:
@@ -85,6 +85,8 @@ function renderVip(vip) {
|
||||
const enabled = Boolean(vip.vip_enabled);
|
||||
const cycleStart = Number(vip.cycle_started_at || 0);
|
||||
const cycleEnd = Number(vip.cycle_expires_at || 0);
|
||||
const now = Math.floor(Date.now() / 1000);
|
||||
const hasActiveSubscription = cycleStart > 0 && cycleEnd > now;
|
||||
if ($("upgradeTokenBalance")) $("upgradeTokenBalance").textContent = String(totalAvailable);
|
||||
if ($("upgradeTokenBalanceHero")) $("upgradeTokenBalanceHero").textContent = String(totalAvailable);
|
||||
if ($("vipTokenBalance")) $("vipTokenBalance").textContent = String(shared);
|
||||
@@ -103,6 +105,15 @@ function renderVip(vip) {
|
||||
$("vipCycleHint").textContent = "当前未开始月周期,首次支付成功后开始计时。";
|
||||
}
|
||||
}
|
||||
if ($("vipModeHint")) {
|
||||
if (enabled && hasActiveSubscription) {
|
||||
$("vipModeHint").textContent = "当前模型模式:平台模型(订阅有效)";
|
||||
} else if (enabled && !hasActiveSubscription) {
|
||||
$("vipModeHint").textContent = "当前模型模式:自由模型(未开通订阅)";
|
||||
} else {
|
||||
$("vipModeHint").textContent = "当前模型模式:自由模型";
|
||||
}
|
||||
}
|
||||
if (totalAvailable <= 0) {
|
||||
setStatus("Credits 额度已用完,请充值共享加油包或等待下个计费周期。", true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user