feat(custom): recharge bonus pay-1-get-2, topup page & docs & about promo display, Chinese-first i18n

- payment_setting.amount_bonus: uniform top-up bonus (1 = pay ¥1 credit ¥2),
  applied to credited quota in model/topupQuotaFromAmount and
  controller/getTopUpQuota (epay/waffo/pancake/manual paths), exposed via
  /api/user/topup/info; regression test TestTopUpQuotaAppliesAmountBonus
- wallet recharge card: bonus banner, credited amount per preset,
  custom-amount credited line, credited row in payment confirm dialog;
  hardcoded Chinese copy (支付/到账/最低充值)
- list locale defaults: Chinese-first, browser locale no longer auto-selects
  English; new localStorage key resets stale language caches
- /docs top-up section: bonus notice box
- README: record the recharge-bonus update in 'About This Custom Fork'
This commit is contained in:
CaIon committed 2026-09-24 15:47:06 +08:00
1 parent 14a9acd368
commit cf06cd72be
19 files changed
+172 -22

No files matched your search

+3
View File
@@ -15,6 +15,8 @@ import (
// topupQuotaFromAmount 将充值记录的 Amount 换算为到账 quota。
// CNY 展示模式下 Amount 为人民币金额,需先除以 Price 再乘 QuotaPerUnit。
// 充值赠送比例(payment_setting.amount_bonus)在所有换算路径统一叠加,
// 例如 amount_bonus=1.0 时充值 1 元实际到账 2 元。
func topupQuotaFromAmount(amount int64) decimal.Decimal {
d := decimal.NewFromInt(amount)
if operation_setting.GetQuotaDisplayType() == operation_setting.QuotaDisplayTypeCNY {
@@ -23,6 +25,7 @@ func topupQuotaFromAmount(amount int64) decimal.Decimal {
d = d.Div(dPrice)
}
}
d = d.Mul(decimal.NewFromFloat(1 + operation_setting.GetTopupBonusRatio()))
return d.Mul(decimal.NewFromFloat(common.QuotaPerUnit))
}