feat: 新增作息报时器功能并替换短链接前缀为/to/

- 新增作息报时器独立模块,包含完整的日程管理、语音播报和待机功能
- 短链接正式前缀由/l/改为/to/,解决手机小屏下与I、i、1字形混淆问题
- 保留旧前缀/l/、/L/、/I/、/i/兼容已分发的旧短链
- 新增短码大小写兜底匹配,仅唯一匹配时生效避免歧义
- 新增防爆紧急替换功能,可轮换首页鉴权并替换短链接
- 新增多个调试和集成测试脚本,保障数据安全和功能回归
This commit is contained in:
yangxiangyuan
2026-10-09 14:04:37 +08:00
parent ac475b6659
commit a3e8911deb
131 changed files with 7695 additions and 60 deletions
+112 -2
View File
@@ -6,7 +6,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#080b12">
<title>框子 - 运动提醒宝</title>
<title>框子</title>
<link rel="icon" href="/tools/web_order_box/favicon.ico">
<link rel="stylesheet" href="/tools/web_order_box/order_box.css">
</head>
@@ -28,6 +28,16 @@
</div>
<svg class="kit-arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"/></svg>
</button>
<button class="kit-card" id="btnEnterSchedule" disabled>
<div class="kit-icon-wrap">
<svg class="kit-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><polyline points="12 7 12 12 15.5 14"/></svg>
</div>
<div class="kit-info">
<span class="kit-name">作息报时器</span>
<span class="kit-desc">按「时:分」到点播报、重复提醒、大字时钟常驻待机。</span>
</div>
<svg class="kit-arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"/></svg>
</button>
</div>
</div>
@@ -87,7 +97,7 @@
</div>
<!-- 底部 Tab -->
<div class="tab-bar">
<div class="tab-bar" id="motionTabBar">
<button class="tab-item active" data-tab="cards">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
<span>卡片</span>
@@ -99,6 +109,80 @@
</div>
</div>
<!-- ===== 作息报时器 主容器 ===== -->
<div id="viewSchedule" class="view" style="display:none">
<div class="motion-header">
<button class="btn-back" id="btnBackHubFromSchedule">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"/></svg>
<span>返回框子</span>
</button>
</div>
<div class="motion-body">
<!-- 语音不可用预警(作息报时器独立一份) -->
<div id="schedVoiceWarning" class="stale-warning voice-warning" style="display:none">
<div class="stale-title">语音播报可能不可用</div>
<div class="stale-desc" id="schedVoiceWarningDesc">本机系统语音未启动,已尝试云端语音兜底。</div>
<button class="btn-stale-clean" id="btnSchedRetryVoice">重新检测</button>
</div>
<!-- 待机大屏 -->
<div class="standby-panel" id="schedStandbyPanel">
<div class="standby-clock" id="schedClock">--:--:--</div>
<div class="standby-date" id="schedDate">--</div>
<div class="standby-next" id="schedNext">请先选择一套日程</div>
<div class="standby-status" id="schedStatus">未待机</div>
<div class="standby-actions">
<button class="btn-primary standby-btn" id="btnSchedStandby"><span>开始待机</span></button>
</div>
</div>
<!-- 错过显示条 -->
<div id="schedMissed" class="stale-warning missed-warning" style="display:none">
<div class="stale-title">已错过以下时刻</div>
<div class="stale-desc" id="schedMissedDesc"></div>
<button class="btn-stale-clean" id="btnSchedMissedClear">知道了</button>
</div>
<!-- 日程页 -->
<div id="pageSchedules" class="page">
<div class="cards-toolbar">
<button class="btn-primary" id="btnNewSchedule">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
<span>新建日程</span>
</button>
</div>
<div id="schedulesList" class="cards-list"></div>
<div id="schedulesEmpty" class="empty-state" style="display:none">
<div class="empty-title">还没有作息日程</div>
<div class="empty-desc">建一套日程,把起床、做饭、喂鱼这些时刻按「时:分」排进去。</div>
</div>
<div id="schedulesLoading" class="loading-wrap"><div class="spinner"></div></div>
</div>
<!-- 播报记录页 -->
<div id="pageSchedLogs" class="page" style="display:none">
<div id="schedLogsList" class="history-list"></div>
<div id="schedLogsEmpty" class="empty-state" style="display:none">
<div class="empty-title">还没有播报记录</div>
<div class="empty-desc">开始待机并到点播报后,这里会出现记录。</div>
</div>
<div id="schedLogsLoading" class="loading-wrap"><div class="spinner"></div></div>
</div>
</div>
<div class="tab-bar" id="schedTabBar">
<button class="tab-item active" data-sched-tab="schedules">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"/><polyline points="12 7 12 12 15.5 14"/></svg>
<span>日程</span>
</button>
<button class="tab-item" data-sched-tab="logs">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 6h16M4 12h16M4 18h10"/></svg>
<span>记录</span>
</button>
</div>
</div>
<!-- ===== 卡片编辑器 Modal ===== -->
<div id="editorModal" class="modal-overlay" style="display:none">
<div class="modal-sheet">
@@ -121,6 +205,32 @@
</div>
</div>
<!-- ===== 作息日程编辑器 Modal ===== -->
<div id="schedEditorModal" class="modal-overlay" style="display:none">
<div class="modal-sheet">
<div class="sheet-header">
<span class="sheet-title" id="schedEditorTitle">新建作息日程</span>
<button class="btn-icon" id="btnSchedEditorClose">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div class="sheet-body" id="schedEditorBody">
<!-- 动态渲染 -->
</div>
</div>
</div>
<!-- ===== 作息播报全屏 Modal ===== -->
<div id="schedAlertModal" class="modal-overlay modal-fullscreen" style="display:none">
<div class="sched-alert-container">
<div class="sched-alert-badge">作息提醒</div>
<div class="sched-alert-time" id="schedAlertTime">--:--</div>
<div class="sched-alert-name" id="schedAlertName"></div>
<div class="sched-alert-repeat" id="schedAlertRepeat"></div>
<button class="btn-primary sched-alert-ack" id="btnSchedAck"><span>我知道了</span></button>
</div>
</div>
<!-- ===== 通用弹窗 ===== -->
<div id="dialogOverlay" class="dialog-overlay" style="display:none">
<div class="dialog-box" id="dialogBox">