From ce1da6a6866553c74ed4328ca8e4edf0e90572e9 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Sun, 10 May 2026 16:19:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=A7=E5=93=81=E5=AE=A1?= =?UTF-8?q?=E6=9F=A5=E5=89=A9=E4=BD=99=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=96=B0?= =?UTF-8?q?=E6=89=8B=E6=8C=87=E5=BC=95=E3=80=81=E5=8F=8D=E9=A6=88=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E3=80=81=E4=BB=98=E8=B4=B9=E5=A2=99=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P1-4:新增 WelcomeOverlay 新手指引 - 首次访问时显示 3 步引导:①从地图选城市 ②查看城市简报 ③解锁 Pro 深入分析 - 圆点进度指示、跳过/下一步按钮、点背景可关闭 - 看过一次后 localStorage 标记不再显示 P1-5:付费墙增加功能预览 - HistoryModal 在付费墙上方展示功能说明文案 - 新增 i18n 键 history.previewTitle / history.previewDesc(中英双语) P2-9:新增反馈入口 - 顶栏增加 Telegram 反馈按钮(MessageCircle 图标) - 点击跳转 PolyWeather 社群 Tested: npx tsc --noEmit --- .../components/dashboard/HistoryModal.tsx | 12 +- .../dashboard/ScanTerminalDashboard.tsx | 13 ++ .../dashboard/ScanTerminalState.module.css | 111 ++++++++++++++++ .../scan-terminal/WelcomeOverlay.tsx | 120 ++++++++++++++++++ frontend/lib/i18n.ts | 4 + 5 files changed, 259 insertions(+), 1 deletion(-) create mode 100644 frontend/components/dashboard/scan-terminal/WelcomeOverlay.tsx diff --git a/frontend/components/dashboard/HistoryModal.tsx b/frontend/components/dashboard/HistoryModal.tsx index 5257c9e0..ea4a4978 100644 --- a/frontend/components/dashboard/HistoryModal.tsx +++ b/frontend/components/dashboard/HistoryModal.tsx @@ -92,7 +92,17 @@ export function HistoryModal() { ) : !isPro ? ( - + <> +
+

+ {t("history.previewTitle")} +

+

+ {t("history.previewDesc")} +

+
+ + ) : (
diff --git a/frontend/components/dashboard/ScanTerminalDashboard.tsx b/frontend/components/dashboard/ScanTerminalDashboard.tsx index 9170c880..a0c81f3b 100644 --- a/frontend/components/dashboard/ScanTerminalDashboard.tsx +++ b/frontend/components/dashboard/ScanTerminalDashboard.tsx @@ -5,6 +5,7 @@ import dynamic from "next/dynamic"; import Link from "next/link"; import { LogIn, + MessageCircle, Moon, RefreshCw, Sun, @@ -31,6 +32,7 @@ import type { } from "@/lib/dashboard-types"; import { AiPinnedForecastView } from "@/components/dashboard/scan-terminal/AiPinnedForecastView"; import { LoadingSignal } from "@/components/dashboard/scan-terminal/LoadingSignal"; +import { WelcomeOverlay } from "@/components/dashboard/scan-terminal/WelcomeOverlay"; import { findDetailForCity } from "@/components/dashboard/scan-terminal/city-detail-utils"; import { findRowForCity, @@ -451,6 +453,16 @@ function ScanTerminalScreen() { ) : null} + + +
@@ -575,6 +587,7 @@ function ScanTerminalScreen() { + {}} /> {showScanPaywall ? (
void; +}; + +const steps = [ + { + icon: MapPin, + titleEn: "Pick a city on the map", + titleZh: "从地图选城市", + descEn: "Click any colored bubble to view real-time weather and forecasts.", + descZh: "点击地图上的彩色气泡,查看实时天气和预报。", + }, + { + icon: FileText, + titleEn: "Read the city briefing", + titleZh: "查看城市简报", + descEn: "The right panel shows current temperature, DEB forecast, and detailed metrics.", + descZh: "右侧面板展示当前温度、DEB 预报和各项指标。", + }, + { + icon: Crown, + titleEn: "Unlock Pro for deep analysis", + titleZh: "解锁 Pro 深入分析", + descEn: "Pro unlocks AI-powered METAR reads, model evidence, market layer, and intraday analysis.", + descZh: "Pro 解锁 AI 机场报文解读、模型证据、市场层、日内分析。", + }, +]; + +export function WelcomeOverlay({ locale, onDismiss }: Props) { + const [visible, setVisible] = useState(false); + const [step, setStep] = useState(0); + const isEn = locale === "en-US"; + + useEffect(() => { + const seen = localStorage.getItem(STORAGE_KEY); + if (!seen) { + setVisible(true); + } + }, []); + + if (!visible) return null; + + const current = steps[step]; + const isLast = step === steps.length - 1; + + const handleDismiss = () => { + localStorage.setItem(STORAGE_KEY, "1"); + setVisible(false); + onDismiss(); + }; + + const handleNext = () => { + if (isLast) { + handleDismiss(); + } else { + setStep(step + 1); + } + }; + + return ( +
+
e.stopPropagation()} + > +
+ {steps.map((_, i) => ( + + ))} +
+ +
+ +
+ +

+ {isEn ? current.titleEn : current.titleZh} +

+

+ {isEn ? current.descEn : current.descZh} +

+ +
+ + +
+
+
+ ); +} diff --git a/frontend/lib/i18n.ts b/frontend/lib/i18n.ts index 3a8fdfad..4f98d8e1 100644 --- a/frontend/lib/i18n.ts +++ b/frontend/lib/i18n.ts @@ -77,6 +77,8 @@ const MESSAGES: Record> = { "history.loading": "正在获取历史数据...", "history.error": "获取历史信息失败", "history.empty": "近 15 天暂无该城市历史数据", + "history.previewTitle": "历史准确率对账", + "history.previewDesc": "对比 DEB 预报与实际结算温度,查看命中率、MAE 和模型对比。升级 Pro 即可解锁。", "history.hitRate": "DEB 结算胜率 (METAR)", "history.mae": "DEB MAE", "history.debHitRate": "DEB 结算胜率 (METAR)", @@ -274,6 +276,8 @@ const MESSAGES: Record> = { "history.loading": "Loading historical data...", "history.error": "Failed to load historical data", "history.empty": "No historical records for this city in the last 15 days", + "history.previewTitle": "Historical Reconciliation", + "history.previewDesc": "Compare DEB forecasts to actual settlement temperatures with hit rate, MAE, and model comparison. Unlock Pro to access.", "history.hitRate": "DEB Settlement Hit Rate (METAR)", "history.mae": "DEB MAE", "history.debHitRate": "DEB Settlement Hit Rate (METAR)",