diff --git a/frontend/components/account/AccountCenter.tsx b/frontend/components/account/AccountCenter.tsx index 2bd1c200..9cbec801 100644 --- a/frontend/components/account/AccountCenter.tsx +++ b/frontend/components/account/AccountCenter.tsx @@ -633,6 +633,17 @@ export function AccountCenter() { const address = String(accounts?.[0] || "").toLowerCase(); if (!address) throw new Error("钱包账户为空"); + const existingWallet = boundWallets.find( + (w) => String(w.address || "").toLowerCase() === address, + ); + if (existingWallet) { + setWalletAddress(address); + setSelectedWallet(address); + setPaymentInfo(`${walletLabel} 已绑定: ${shortAddress(address)}`); + setPaymentBusy(false); + return; + } + setWalletAddress(address); const challengeRes = await fetch("/api/payments/wallets/challenge", { method: "POST", diff --git a/frontend/components/subscription/UnlockProOverlay.tsx b/frontend/components/subscription/UnlockProOverlay.tsx index afc3065c..b239ae68 100644 --- a/frontend/components/subscription/UnlockProOverlay.tsx +++ b/frontend/components/subscription/UnlockProOverlay.tsx @@ -82,8 +82,16 @@ export function UnlockProOverlay({ const finalPayLabel = payLabel || (isEn ? "Subscribe & Activate" : "立即订阅并激活服务"); + const maxDiscountUsdInt = Math.max(1, Math.floor(billing.maxDiscountUsd || 0)); + const maxPointsForFullDiscount = Math.max( + billing.pointsPerUsd, + billing.pointsPerUsd * maxDiscountUsdInt, + ); + const redeemableUsdNow = billing.pointsEnabled + ? Math.min(maxDiscountUsdInt, Math.floor(points / Math.max(1, billing.pointsPerUsd))) + : 0; const progressPct = billing.pointsEnabled - ? Math.min(100, Math.round((points / billing.pointsPerUsd) * 100)) + ? Math.min(100, Math.round((points / maxPointsForFullDiscount) * 100)) : 0; return ( @@ -202,6 +210,11 @@ export function UnlockProOverlay({ ? `Toggle to save up to $${billing.maxDiscountUsd.toFixed(2)}` : `开启可最多抵扣 $${billing.maxDiscountUsd.toFixed(2)}`}
++ {isEn + ? `Now redeemable: $${redeemableUsdNow.toFixed(0)} / $${maxDiscountUsdInt.toFixed(0)}` + : `当前可抵:${redeemableUsdNow.toFixed(0)}U / ${maxDiscountUsdInt.toFixed(0)}U`} +
{deb_query_cost} 积分。")
return "\n".join(lines)
-
diff --git a/src/bot/services/deb_command_service.py b/src/bot/services/deb_command_service.py
index 8e9bb66d..6b817af0 100644
--- a/src/bot/services/deb_command_service.py
+++ b/src/bot/services/deb_command_service.py
@@ -18,10 +18,10 @@ class DebCommandService:
self.analysis = analysis
def resolve_city(self, city_input: str) -> str:
- return self.analysis.resolve_deb_city(city_input)
+ return self.analysis.resolve_city(city_input)
def has_history(self, city_name: str) -> bool:
- return self.analysis.has_deb_history(city_name)
+ return self.analysis.has_history(city_name)
def build_report(self, city_name: str, deb_query_cost: int) -> DebReportResult:
try:
diff --git a/src/bot/settings.py b/src/bot/settings.py
index 23bfca52..ba2e8c40 100644
--- a/src/bot/settings.py
+++ b/src/bot/settings.py
@@ -18,5 +18,5 @@ MESSAGE_POINTS = _env_int("POLYWEATHER_BOT_MESSAGE_POINTS", 4, min_value=1)
MESSAGE_DAILY_CAP = _env_int("POLYWEATHER_BOT_MESSAGE_DAILY_CAP", 40, min_value=1)
MESSAGE_MIN_LENGTH = _env_int("POLYWEATHER_BOT_MESSAGE_MIN_LENGTH", 3, min_value=1)
MESSAGE_COOLDOWN_SEC = _env_int("POLYWEATHER_BOT_MESSAGE_COOLDOWN_SEC", 30, min_value=0)
-CITY_QUERY_COST = _env_int("POLYWEATHER_BOT_CITY_QUERY_COST", 1, min_value=0)
-DEB_QUERY_COST = _env_int("POLYWEATHER_BOT_DEB_QUERY_COST", 1, min_value=0)
+CITY_QUERY_COST = _env_int("POLYWEATHER_BOT_CITY_QUERY_COST", 2, min_value=0)
+DEB_QUERY_COST = _env_int("POLYWEATHER_BOT_DEB_QUERY_COST", 2, min_value=0)