"use client"; import { useState, useEffect } from "react"; import { VideoCard } from "./VideoCard"; import { useVideoProgress } from "./useVideoProgress"; import AuthModal from "../components/AuthModal"; function getStoredUser(): string | null { if (typeof window === "undefined") return null; try { const raw = localStorage.getItem("pb_user"); if (!raw) return null; const user = JSON.parse(raw); return user?.email ?? null; } catch { return null; } } /* ─── data ─── */ const stats = [ { value: "21", label: "节实战课程" }, { value: "150+", label: "分钟视频" }, { value: "3", label: "位实战讲师" }, ]; const audiences = [ { icon: "💼", title: "职场人想转型", desc: "受够了 996?学会远程工作技能,平滑过渡到自由生活方式", }, { icon: "👨‍💻", title: "开发者 / 设计师", desc: "你的技能天然适合远程,学会如何接全球客户、拿美金报酬", }, { icon: "📱", title: "自媒体 / 内容创作者", desc: "边旅行边创作,掌握数字游民内容变现的全套方法论", }, { icon: "🌍", title: "想出国旅居的人", desc: "签证、税务、保险、目的地一站搞定,少走弯路直接出发", }, ]; const benefits = [ { num: 1, title: "完整的远程工作体系", desc: "从技能评估到客户获取,建立可持续的远程收入系统", }, { num: 2, title: "打通 3+ 收入渠道", desc: "远程全职、自由职业、数字产品、内容创作多管齐下", }, { num: 3, title: "掌握 50+ 远程工具", desc: "协作、会议、项目管理、财务,一个背包装下整个办公室", }, { num: 4, title: "签证 + 税务 + 保险全通关", desc: "55 国数字游民签证政策、合规税务方案、保险选购指南", }, { num: 5, title: "跑通第一次数字游民旅程", desc: "从选目的地到打包出发,手把手带你完成首次数字游民体验", }, ]; // 示例视频:w3schools 公开样本,可替换为 MinIO CDN URL(如 https://minioweb.hackrobot.cn/hackrobot/course/xxx.mp4) const SAMPLE_VIDEO = "https://www.w3schools.com/html/mov_bbb.mp4"; // 一级:part 二级:section 三级:lesson const curriculum = [ { emoji: "🚀", part: "基础篇", sections: [ { name: "认识数字游民", lessons: [{ id: "01", title: "什么是数字游民?破除 5 个常见误解", duration: "12:30", videoUrl: SAMPLE_VIDEO }, { id: "02", title: "数字游民三种模式:蜜蜂、乌龟、候鸟", duration: "08:45", videoUrl: SAMPLE_VIDEO }] }, ], }, { emoji: "💡", part: "技能篇", sections: [ { name: "远程工作能力", lessons: [{ id: "03", title: "远程高薪技能全景图:找到你的方向", duration: "14:20", videoUrl: SAMPLE_VIDEO }, { id: "04", title: "30天技能升级路线:从评估到接单", duration: "11:15", videoUrl: SAMPLE_VIDEO }, { id: "05", title: "建立个人品牌:让客户主动找你", duration: "09:40", videoUrl: SAMPLE_VIDEO }] }, ], }, { emoji: "💰", part: "收入篇", sections: [ { name: "构建收入体系", lessons: [{ id: "06", title: "远程全职 vs 自由职业:选哪条路?", duration: "10:05", videoUrl: SAMPLE_VIDEO }, { id: "07", title: "自由职业平台实操:Upwork / Toptal / 电鸭", duration: "13:50", videoUrl: SAMPLE_VIDEO }, { id: "08", title: "被动收入搭建:数字产品 & 在线课程", duration: "12:20", videoUrl: SAMPLE_VIDEO }, { id: "09", title: "定价的艺术:如何报价不心虚", duration: "07:30", videoUrl: SAMPLE_VIDEO }] }, ], }, { emoji: "🛠️", part: "工具篇", sections: [ { name: "移动办公装备", lessons: [{ id: "10", title: "硬件极简主义:一个背包装下办公室", duration: "06:45", videoUrl: SAMPLE_VIDEO }, { id: "11", title: "远程协作工具栈:Slack / Notion / Linear", duration: "08:30", videoUrl: SAMPLE_VIDEO }, { id: "12", title: "安全必修课:VPN / 密码管理 / 2FA", duration: "05:55", videoUrl: SAMPLE_VIDEO }, { id: "13", title: "跨境财务工具:Wise / Stripe / Revolut", duration: "07:10", videoUrl: SAMPLE_VIDEO }] }, ], }, { emoji: "📋", part: "合规篇", sections: [ { name: "签证税务保险", lessons: [{ id: "14", title: "55 国数字游民签证政策全解读", duration: "15:30", videoUrl: SAMPLE_VIDEO }, { id: "15", title: "税务居民身份与合规规划", duration: "11:40", videoUrl: SAMPLE_VIDEO }, { id: "16", title: "数字游民保险选购指南", duration: "06:20", videoUrl: SAMPLE_VIDEO }] }, ], }, { emoji: "🗺️", part: "目的地篇", sections: [ { name: "选择你的城市", lessons: [{ id: "17", title: "亚洲三城:清迈 / 巴厘岛 / 首尔深度对比", duration: "10:50", videoUrl: SAMPLE_VIDEO }, { id: "18", title: "欧洲双雄:里斯本 / 巴塞罗那生活实录", duration: "09:25", videoUrl: SAMPLE_VIDEO }, { id: "19", title: "美洲探索:墨西哥城 / 麦德林旅居指南", duration: "08:15", videoUrl: SAMPLE_VIDEO }] }, ], }, { emoji: "🏆", part: "实战篇", sections: [ { name: "启程出发", lessons: [{ id: "20", title: "出发前检查清单 & 打包哲学", duration: "07:40", videoUrl: SAMPLE_VIDEO }, { id: "21", title: "第一个月生存指南 & 长期可持续策略", duration: "13:10", videoUrl: SAMPLE_VIDEO }] }, ], }, ]; const instructors = [ { name: "Alex", avatar: "🧑‍💻", role: "全栈开发者 / 5年数字游民", tag: "技术导师", desc: "前字节跳动高级工程师,2021年开始数字游民生活,足迹遍布 20+ 国家,远程服务硅谷客户", }, { name: "Lisa", avatar: "👩‍🎨", role: "品牌设计师 / 自由职业教练", tag: "变现专家", desc: "Toptal 认证设计师,年收入 $120K+,帮助 500+ 人成功转型远程自由职业", }, { name: "Marco", avatar: "🧳", role: "旅居作家 / 签证顾问", tag: "旅居达人", desc: "常驻里斯本,持有 3 国数字游民签证,《数字游民签证手册》作者,深谙各国政策", }, ]; /* ─── component ─── */ export default function CoursePage() { const [modalOpen, setModalOpen] = useState(false); const [authOpen, setAuthOpen] = useState(false); const [userEmail, setUserEmail] = useState(null); const [expandedPart, setExpandedPart] = useState(null); const { markCompleted, isCompleted, isPartCompleted } = useVideoProgress(); useEffect(() => { setUserEmail(getStoredUser()); }, []); const handleLogout = () => { localStorage.removeItem("pb_token"); localStorage.removeItem("pb_user"); setUserEmail(null); }; return (
{/* ── Nav ── */}
🌍 数字游民指南
{userEmail ? ( <> {userEmail} ) : ( )}
{/* ── Hero ── */}

数字游民实战课

7天打造你的远程工作体系与自由生活方式

{stats.map((s) => (
{s.value}
{s.label}
))}
{/* ── Audience ── */}

这门课适合谁?

不管你是什么背景,只要想拥有地点自由的生活

{audiences.map((a) => (
{a.icon}

{a.title}

{a.desc}

))}
{/* ── Benefits ── */}

学完你将获得

5 大核心收益,助你顺利开启数字游民生活

{benefits.map((b) => (
{b.num}

{b.title}

{b.desc}

))}
{/* ── Curriculum ── 参考:垂直时间线 + 学习路径视觉 */}
{/* 标题区:大数字 + 学习路径感 */}
21 节实战课程

从入门到启程 · 完整的学习路径

{/* 垂直时间线:左侧竖线 + 节点 */}
{/* 中央竖线 */}
{curriculum.map((ch, idx) => { const allLessons = ch.sections.flatMap((s) => s.lessons); const partCompleted = isPartCompleted(allLessons.map((l) => l.id)); const isExpanded = expandedPart === ch.part; const totalLessons = allLessons.length; return (
{/* 左侧节点圆:完成时显示 ✓ */}
{partCompleted ? ( ) : ( idx + 1 )}
{/* 右侧内容卡片 */}
{/* 一级:Part 标题,点击展开/收起 */} {/* 展开后:二级 section + 三级 lesson */} {isExpanded && (
{ch.sections.map((sec) => (
{/* 二级标题 */}

{sec.name}

{sec.lessons.length} 节
{/* 三级:视频卡片网格 */}
{sec.lessons.map((lesson) => ( markCompleted(lesson.id)} /> ))}
))}
)}
); })}
{/* ── Instructors ── */}

三位实战讲师联合授课

真正的数字游民亲自带你上手

{instructors.map((ins) => (
{ins.avatar}

{ins.name}

{ins.role}

{ins.tag}

{ins.desc}

))}
{/* ── Final CTA ── */}

准备好开启你的数字游民生活了吗?

加入我们,跟着实战讲师一起,从零开始规划属于你的自由生活

21节实战视频 永久回看 社群答疑
{/* ── Footer ── */} setAuthOpen(false)} onSuccess={(email) => setUserEmail(email)} /> {/* ── 报名 Modal ── */} {modalOpen && (
setModalOpen(false)} >
e.stopPropagation()} >

数字游民实战课

7天打造你的远程工作体系

🌍

扫码报名

¥199

微信扫码 · 小程序购买

💬

添加微信进群

交流答疑 · 文档资料 · 权益通知

)}
); }