完成产品审查剩余修复:新手指引、反馈入口、付费墙预览

P1-4:新增 WelcomeOverlay 新手指引
- 首次访问时显示 3 步引导:①从地图选城市 ②查看城市简报 ③解锁 Pro 深入分析
- 圆点进度指示、跳过/下一步按钮、点背景可关闭
- 看过一次后 localStorage 标记不再显示

P1-5:付费墙增加功能预览
- HistoryModal 在付费墙上方展示功能说明文案
- 新增 i18n 键 history.previewTitle / history.previewDesc(中英双语)

P2-9:新增反馈入口
- 顶栏增加 Telegram 反馈按钮(MessageCircle 图标)
- 点击跳转 PolyWeather 社群

Tested: npx tsc --noEmit
This commit is contained in:
2569718930@qq.com
2026-05-10 16:19:21 +08:00
parent de0f037bf4
commit ce1da6a686
5 changed files with 259 additions and 1 deletions
+11 -1
View File
@@ -92,7 +92,17 @@ export function HistoryModal() {
</div>
</div>
) : !isPro ? (
<ProFeaturePaywall feature="history" onClose={store.closeHistory} />
<>
<div className="modal-content" style={{ padding: "24px 28px 0", textAlign: "center" }}>
<h3 style={{ fontSize: 18, fontWeight: 800, color: "var(--color-text-primary)", margin: "0 0 8px" }}>
{t("history.previewTitle")}
</h3>
<p style={{ fontSize: 13, color: "var(--color-text-secondary)", lineHeight: 1.6, margin: 0 }}>
{t("history.previewDesc")}
</p>
</div>
<ProFeaturePaywall feature="history" onClose={store.closeHistory} />
</>
) : (
<div className="modal-content history-modal">
<div className="modal-header">
@@ -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() {
<UserRound size={15} />
</Link>
) : null}
<a
href="https://t.me/+nMG7SjziUKYyZmM1"
target="_blank"
rel="noopener noreferrer"
className="scan-account-button"
aria-label={isEn ? "Feedback" : "反馈"}
title={isEn ? "Join Telegram for feedback" : "加入 Telegram 反馈"}
>
<MessageCircle size={15} />
</a>
</div>
</div>
@@ -575,6 +587,7 @@ function ScanTerminalScreen() {
<CityDetailPanel variant="rail" />
</div>
<WelcomeOverlay locale={locale} onDismiss={() => {}} />
<FutureForecastModal />
{showScanPaywall ? (
<div
@@ -314,3 +314,114 @@
transform: scaleY(1);
}
}
/* ── Welcome onboarding overlay ── */
.root :global(.scan-welcome-overlay) {
position: fixed;
inset: 0;
z-index: 1000;
display: grid;
place-items: center;
background: rgba(2, 6, 23, 0.72);
backdrop-filter: blur(4px);
animation: fadeIn 0.25s ease;
padding: 24px;
}
.root :global(.scan-welcome-card) {
width: 100%;
max-width: 400px;
padding: 32px 28px 24px;
border: 1px solid rgba(77, 163, 255, 0.22);
border-radius: 24px;
background: linear-gradient(160deg, rgba(17, 26, 46, 0.98), rgba(11, 18, 32, 0.98));
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
text-align: center;
animation: fadeUpIn 0.3s ease;
}
.root :global(.scan-welcome-steps) {
display: flex;
justify-content: center;
gap: 8px;
margin-bottom: 20px;
}
.root :global(.scan-welcome-dot) {
width: 8px;
height: 8px;
border-radius: 999px;
background: rgba(77, 163, 255, 0.2);
transition: all 0.2s;
}
.root :global(.scan-welcome-dot.active) {
width: 24px;
background: var(--color-accent-primary);
}
.root :global(.scan-welcome-dot.done) {
background: rgba(77, 163, 255, 0.5);
}
.root :global(.scan-welcome-icon-wrap) {
width: 64px;
height: 64px;
margin: 0 auto 16px;
display: grid;
place-items: center;
border-radius: 18px;
background: rgba(77, 163, 255, 0.12);
border: 1px solid rgba(77, 163, 255, 0.18);
}
.root :global(.scan-welcome-icon) {
color: var(--color-accent-secondary);
}
.root :global(.scan-welcome-title) {
font-size: 20px;
font-weight: 800;
color: var(--color-text-primary);
margin: 0 0 8px;
}
.root :global(.scan-welcome-desc) {
font-size: 14px;
color: var(--color-text-secondary);
line-height: 1.6;
margin: 0 0 24px;
}
.root :global(.scan-welcome-actions) {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.root :global(.scan-welcome-skip) {
border: none;
background: transparent;
color: var(--color-text-muted);
font-size: 13px;
font-weight: 600;
cursor: pointer;
padding: 8px 12px;
border-radius: 8px;
transition: color 0.15s;
}
.root :global(.scan-welcome-skip:hover) {
color: var(--color-text-secondary);
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeUpIn {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
@@ -0,0 +1,120 @@
"use client";
import { useEffect, useState } from "react";
import { MapPin, FileText, Crown } from "lucide-react";
const STORAGE_KEY = "polyweather_welcome_seen";
type Props = {
locale: string;
onDismiss: () => 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 (
<div
className="scan-welcome-overlay"
role="dialog"
aria-label={isEn ? "Welcome guide" : "新手指引"}
onClick={handleDismiss}
>
<div
className="scan-welcome-card"
onClick={(e) => e.stopPropagation()}
>
<div className="scan-welcome-steps">
{steps.map((_, i) => (
<span
key={i}
className={`scan-welcome-dot ${i === step ? "active" : ""} ${i < step ? "done" : ""}`}
/>
))}
</div>
<div className="scan-welcome-icon-wrap">
<current.icon size={32} className="scan-welcome-icon" />
</div>
<h2 className="scan-welcome-title">
{isEn ? current.titleEn : current.titleZh}
</h2>
<p className="scan-welcome-desc">
{isEn ? current.descEn : current.descZh}
</p>
<div className="scan-welcome-actions">
<button
type="button"
className="scan-welcome-skip"
onClick={handleDismiss}
>
{isEn ? "Skip" : "跳过"}
</button>
<button
type="button"
className="scan-primary-button"
onClick={handleNext}
>
{isLast
? isEn ? "Got it" : "知道了"
: isEn ? "Next" : "下一步"}
</button>
</div>
</div>
</div>
);
}
+4
View File
@@ -77,6 +77,8 @@ const MESSAGES: Record<Locale, Record<string, string>> = {
"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<Locale, Record<string, string>> = {
"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)",