大洲分组逻辑微调

This commit is contained in:
2569718930@qq.com
2026-05-25 06:57:28 +08:00
parent 41e322642a
commit 699ef065b7
@@ -20,8 +20,8 @@ export function detectLocalRegion(): TradingRegionKey {
if (offset >= 4.5) return "central_asia";
if (offset >= 2) return "west_asia";
if (offset >= -2) return "europe_africa";
if (offset >= -7) return "north_america";
return "south_america";
if (offset >= -4) return "south_america";
return "north_america";
}
const TRADING_REGION_KEYS = new Set<string>(TRADING_REGIONS.map((region) => region.key));
@@ -72,10 +72,11 @@ const CITY_REGION_FALLBACK: Record<string, TradingRegionKey> = {
"los angeles": "north_america",
miami: "north_america",
"new york": "north_america",
"panama city": "north_america",
"panama city": "south_america",
"san francisco": "north_america",
seattle: "north_america",
toronto: "north_america",
wellington: "east_asia",
};
function normalizeRegionValue(value?: string | null) {
@@ -111,10 +112,10 @@ export function resolveTradingRegionKey(row: ScanOpportunityRow): TradingRegionK
const hours = offset / 3600;
if (hours >= 8) return "east_asia";
if (hours >= 7) return "southeast_asia";
if (hours >= 5) return "central_asia";
if (hours >= 3) return "west_asia";
if (hours >= 0) return "europe_africa";
if (hours >= -5) return "south_america";
if (hours >= 4.5) return "central_asia";
if (hours >= 2) return "west_asia";
if (hours >= -2) return "europe_africa";
if (hours >= -4) return "south_america";
return "north_america";
}