nomadro/apps/miniprogram/h5/src/data/vipCourse.ts
Eric 932f912087 Ship WeChat VIP↔Web bridge, netdisk sheet, and per-lesson materials gate for audit.
Freeze pre4 as the in-review weapp package; document pre5 as the next iteration branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-24 20:14:31 +08:00

139 lines
4.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/** VIP 云手机课程目录(对照 nomadvip / modules/vip cloudphone) */
export type VipLesson = {
key: string
moduleIndex: number
lessonIndex: number
name: string
duration: string
videoUrl: string
}
export type VipModule = {
emoji: string
title: string
lessons: VipLesson[]
}
const V: Record<string, string> = {
'0-0': 'https://minioweb.hackrobot.cn/hackrobot/1. 安装安卓img_20260326_095335_848.mp4',
'0-1': 'https://minioweb.hackrobot.cn/hackrobot/2. 安卓扩容_20260326_095426_1002.mp4',
'1-0': 'https://minioweb.hackrobot.cn/hackrobot/3. 设置竖屏_20260326_095414_979.mp4',
'1-1': 'https://minioweb.hackrobot.cn/hackrobot/4. 安装magisk以及模块_20260326_095427_1018.mp4',
'1-2': 'https://minioweb.hackrobot.cn/hackrobot/5. 修改机型参数_20260326_095438_1051.mp4',
'2-0': 'https://minioweb.hackrobot.cn/hackrobot/6. gps定位_20260326_095430_1031.mp4',
'2-1': 'https://minioweb.hackrobot.cn/hackrobot/7无人直播-录播_20260326_100335_2814.mp4',
'2-2': 'https://minioweb.hackrobot.cn/hackrobot/8. tiktok直播_20260326_095441_1064.mp4',
'2-3': 'https://minioweb.hackrobot.cn/hackrobot/9. tiktok直播-2_20260326_095403_943.mp4',
}
/** 无正式片源时留空,避免国内微信卡在 Google 示例片 */
const FALLBACK = ''
/** 网盘/对象存储路径常含空格与中文;微信 Video 需编码后才能播 */
export function encodeVideoSrc(url: string): string {
const raw = String(url || '').trim()
if (!raw) return ''
try {
const u = new URL(raw)
u.pathname = u.pathname
.split('/')
.map((seg) => {
if (!seg) return seg
try {
return encodeURIComponent(decodeURIComponent(seg))
} catch {
return encodeURIComponent(seg)
}
})
.join('/')
return u.toString()
} catch {
try {
return encodeURI(raw)
} catch {
return raw
}
}
}
const RAW = [
{
emoji: '🚀',
title: '基础篇 · 云手机入门',
lessons: [
{ name: '01 从0到1:安卓镜像安装与首次开机', duration: '08:32', key: '0-0' },
{ name: '02 性能翻倍:安卓存储扩容实操', duration: '12:15', key: '0-1' },
],
},
{
emoji: '⚙️',
title: '技术篇 · Redroid 与 AOSP',
lessons: [
{ name: '03 竖屏直播必备:系统显示方向设置', duration: '15:20', key: '1-0' },
{ name: '04 一次搞定 Root:Magisk + 模块安装', duration: '18:00', key: '1-1' },
{ name: '05 防风控第一步:机型参数改造', duration: '14:30', key: '1-2' },
],
},
{
emoji: '📺',
title: '直播篇 · 无人推流',
lessons: [
{ name: '06 降低风控命中:GPS 精准定位', duration: '16:00', key: '2-0' },
{ name: '07 无人直播入门:录播素材循环推流', duration: '12:45', key: '2-1' },
{ name: '08 TikTok 实战开播:完整流程演示', duration: '11:20', key: '2-2' },
{ name: '09 TikTok 进阶优化:稳定推流与细节调优', duration: '20:00', key: '2-3' },
],
},
{
emoji: '🌐',
title: '网络篇 · 出海基础',
lessons: [
{ name: '10 软路由与科学上网', duration: '13:00', key: '3-0' },
{ name: '11 静态住宅 IP 配置', duration: '10:30', key: '3-1' },
],
},
{
emoji: '🏆',
title: '进阶篇 · 产品化',
lessons: [
{ name: '12 HDMI 辅助板方案', duration: '15:00', key: '4-0' },
{ name: '13 多设备群控与远控', duration: '12:00', key: '4-1' },
],
},
] as const
export const VIP_COURSE_MODULES: VipModule[] = RAW.map((m, mi) => ({
emoji: m.emoji,
title: m.title,
lessons: m.lessons.map((l, li) => ({
key: l.key,
moduleIndex: mi,
lessonIndex: li,
name: l.name,
duration: l.duration,
videoUrl: V[l.key] || FALLBACK,
})),
}))
export function getVipLesson(moduleIndex: number, lessonIndex: number): VipLesson | null {
const mod = VIP_COURSE_MODULES[moduleIndex]
if (!mod) return null
return mod.lessons[lessonIndex] || null
}
export const VIP_EBOOKS = [
{
id: 'nomad',
title: '数字游民',
desc: '地理套利与自动化杠杆',
free: true,
readerId: 'default',
},
{
id: 'cloudphone',
title: '云手机',
desc: '低成本工作室搭建指南',
free: false,
readerId: 'cloudphone',
},
] as const