fix: 续费页按钮文案按用户状态区分(续费/开通)

This commit is contained in:
2026-06-02 13:21:05 +08:00
parent 12437975f3
commit ef05d4fed6

View File

@@ -571,7 +571,7 @@ pub async fn payment_index() -> Result<HttpResponse, AppError> {
document.getElementById('paidSection').style.display = 'block'; document.getElementById('paidSection').style.display = 'block';
document.getElementById('paidBadge').textContent = '付费会员'; document.getElementById('paidBadge').textContent = '付费会员';
document.getElementById('pkgsTitle').textContent = '续费套餐'; document.getElementById('pkgsTitle').textContent = '续费套餐';
document.getElementById('pkgsSub').textContent = '选择套餐延长会员有效期,现有权益不受影响'; document.getElementById('pkgsSub').textContent = '选择套餐延长有效期,现有权益不受影响';
if (paidExpiresAt) { if (paidExpiresAt) {
document.getElementById('paidExpires').textContent = new Date(paidExpiresAt).toLocaleString('zh-CN'); document.getElementById('paidExpires').textContent = new Date(paidExpiresAt).toLocaleString('zh-CN');
document.getElementById('expiresRow').style.display = 'flex'; document.getElementById('expiresRow').style.display = 'flex';
@@ -620,7 +620,8 @@ pub async fn payment_index() -> Result<HttpResponse, AppError> {
document.querySelectorAll('.pkg-card').forEach(c => c.classList.remove('selected')); document.querySelectorAll('.pkg-card').forEach(c => c.classList.remove('selected'));
document.querySelector('[data-package="' + pkg + '"]').classList.add('selected'); document.querySelector('[data-package="' + pkg + '"]').classList.add('selected');
var btn = document.getElementById('payBtn'); var btn = document.getElementById('payBtn');
var labels = { monthly: '立即开通 - ¥5.9/月', quarterly: '立即开通 - ¥16.8/季', half_year: '立即开通 - ¥31.9/半年', yearly: '立即开通 - ¥60.2/年' }; var labels = { monthly: '立即续费 - ¥5.9/月', quarterly: '立即续费 - ¥16.8/季', half_year: '立即续费 - ¥31.9/半年', yearly: '立即续费 - ¥60.2/年' };
if (isPaidActive) labels = { monthly: '续费 - ¥5.9/月', quarterly: '续费 - ¥16.8/季', half_year: '续费 - ¥31.9/半年', yearly: '续费 - ¥60.2/年' };
btn.textContent = labels[pkg]; btn.textContent = labels[pkg];
btn.disabled = false; btn.disabled = false;
btn.className = 'btn-pay'; btn.className = 'btn-pay';