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:
1 parent
14a9acd368
commit
cf06cd72be
19 files changed
+172
-22
No files matched your search
@@ -5,6 +5,7 @@ import "github.com/QuantumNous/new-api/setting/config"
|
||||
type PaymentSetting struct {
|
||||
AmountOptions []int `json:"amount_options"`
|
||||
AmountDiscount map[int]float64 `json:"amount_discount"` // 充值金额对应的折扣,例如 100 元 0.9 表示 100 元充值享受 9 折优惠
|
||||
AmountBonus float64 `json:"amount_bonus"` // 统一赠送比例:1.0 表示充值多少到账双倍(充1到2),0 表示无赠送
|
||||
|
||||
ComplianceConfirmed bool `json:"compliance_confirmed"`
|
||||
ComplianceTermsVersion string `json:"compliance_terms_version"`
|
||||
@@ -30,6 +31,14 @@ func GetPaymentSetting() *PaymentSetting {
|
||||
return &paymentSetting
|
||||
}
|
||||
|
||||
// GetTopupBonusRatio 返回充值赠送比例(负值视为 0,0 表示无赠送,1.0 表示到账翻倍)
|
||||
func GetTopupBonusRatio() float64 {
|
||||
if paymentSetting.AmountBonus > 0 {
|
||||
return paymentSetting.AmountBonus
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func IsPaymentComplianceConfirmed() bool {
|
||||
return paymentSetting.ComplianceConfirmed &&
|
||||
paymentSetting.ComplianceTermsVersion == CurrentComplianceTermsVersion
|
||||
|
||||
Reference in new issue
Block a user