feat(ui): 交付手环配置6件物料并全局统一核心主色蓝规范

1. 完成页面优化交付:
   - 【手环配置】:完成6件标准物料交付(原图+image.png+baseline_ui.html+DESIGN_SPEC.md+implementation_plan.md+CARD任务卡),采用流体双栏仪表盘架构、居中底部抽拉式Sheet面板、左上角动态雷达声呐动效、右下角悬浮蓝牙FAB、实时同步日志控制台Terminal,并将设备列表按钮精简为BLE标签且支持整行点击直连。
2. 全局主色蓝规范统一与旧页面修复:
   - README.md 固化《全局核心主色蓝统一规范》,全量统一收敛为 #2563EB(深色 #1D4ED8、浅底 #EFF6FF、高亮 #1E40AF、微光 rgba(37,99,235,0.25))。
   - 同步修复【语言设置】、【版型切换】、【心率区间设置】、【自动连接配置】中的杂色与偏紫蓝色,全部对齐为标准主色蓝。
   - 通过 Chrome Headless 自动批量重新渲染并更新了前 5 个页面的官方 image.png 效果图。
This commit is contained in:
zhy200308
2026-08-17 17:15:54 +08:00
parent c50d6f00f5
commit 4a77427c4a
24 changed files with 2866 additions and 18 deletions
@@ -0,0 +1,630 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 1:Apple HealthKit 灵动岛屿 + 底部抽拉 Sheet</title>
<style>
:root {
--primary: #2563EB;
--primary-light: #EFF6FF;
--primary-glow: rgba(37, 99, 235, 0.2);
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--danger: #EF4444;
--danger-light: #FEF2F2;
--success: #10B981;
--terminal-bg: #0F172A;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
background: var(--bg);
color: var(--text-main);
min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px);
display: flex;
flex-direction: column;
}
.device-wrapper {
width: 100%;
max-width: min(100%, 1160px);
margin: 0 auto;
background: var(--surface);
border-radius: 24px;
border: 1px solid var(--divider);
box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.08);
overflow: hidden;
position: relative;
min-height: 640px;
display: flex;
flex-direction: column;
}
/* AppBar 统一规范 */
.appbar {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
border-bottom: 1px solid var(--divider);
background: var(--surface);
flex-shrink: 0;
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%;
display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none; transition: all 0.15s ease;
}
.appbar-nav:hover, .appbar-more:hover { background: rgba(15, 23, 42, 0.06); transform: scale(0.96); }
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
/* 2列非对称现代仪表盘 */
.main-dashboard {
flex: 1;
padding: clamp(20px, 2.5vw, 28px);
display: grid;
grid-template-columns: 1fr 1.15fr;
gap: clamp(16px, 2vw, 24px);
background: #F8FAFC;
overflow-y: auto;
max-height: 660px;
}
.dash-col { display: flex; flex-direction: column; gap: 18px; }
.health-card {
background: var(--surface);
border-radius: 18px;
border: 1.5px solid var(--divider);
padding: 20px 22px;
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
display: flex;
flex-direction: column;
gap: 14px;
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--divider);
padding-bottom: 12px;
}
.card-title-wrap {
display: flex;
align-items: center;
gap: 10px;
}
.card-icon {
width: 32px;
height: 32px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
}
.icon-blue { background: #EFF6FF; fill: #2563EB; }
.icon-red { background: #FEF2F2; fill: #EF4444; }
.icon-green { background: #ECFDF5; fill: #10B981; }
.card-title-text { font-size: 15.5px; font-weight: 700; color: var(--text-main); }
.status-pill {
font-size: 11.5px;
font-weight: 700;
padding: 3px 8px;
border-radius: 100px;
background: #F1F5F9;
color: var(--text-sub);
}
.status-pill.connected { background: #ECFDF5; color: #10B981; }
/* 遥测参数流 */
.telemetry-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.tele-cell {
background: #F8FAFC;
border: 1px solid var(--divider);
border-radius: 12px;
padding: 10px 14px;
}
.tele-lbl { font-size: 11.5px; color: var(--text-sub); }
.tele-val { font-size: 14px; font-weight: 700; color: var(--text-main); margin-top: 3px; font-family: ui-monospace, monospace; }
.action-line {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 2px;
}
.btn-text-danger { color: var(--danger); background: transparent; border: none; font-size: 13px; font-weight: 700; cursor: pointer; padding: 6px; }
.btn-action-primary {
background: #E2E8F0;
color: var(--text-sub);
border: none;
padding: 8px 18px;
border-radius: 10px;
font-size: 13px;
font-weight: 700;
cursor: pointer;
transition: all 0.2s;
}
.btn-action-primary.active { background: var(--primary); color: white; box-shadow: 0 4px 12px var(--primary-glow); }
/* 心率调节卡片 */
.hr-stack {
display: flex;
flex-direction: column;
gap: 10px;
}
.hr-row-card {
background: #F8FAFC;
border: 1px solid var(--divider);
border-radius: 12px;
padding: 10px 14px;
display: flex;
align-items: center;
justify-content: space-between;
}
.hr-row-name { font-size: 13px; font-weight: 600; }
.hr-select-pill {
background: white;
border: 1.5px solid var(--divider);
border-radius: 8px;
padding: 5px 28px 5px 12px;
font-size: 13.5px;
font-weight: 700;
color: var(--primary);
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748B' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 8px center;
cursor: pointer;
}
.btn-wide {
width: 100%;
padding: 11px;
border-radius: 10px;
font-size: 13.5px;
font-weight: 700;
cursor: pointer;
border: none;
transition: all 0.2s;
}
.btn-wide.secondary { background: #E2E8F0; color: #334155; }
.btn-wide.primary { background: var(--primary); color: white; box-shadow: 0 4px 14px var(--primary-glow); }
/* 控制台终端 */
.terminal-hud {
background: var(--terminal-bg);
border-radius: 12px;
border: 1px solid #1E293B;
padding: 12px 14px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 11.5px;
color: #94A3B8;
height: 140px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 4px;
}
.term-line { line-height: 1.5; }
.term-line.info { color: #38BDF8; }
.term-line.success { color: #4ADE80; }
.term-line.warn { color: #FBBF24; }
/* Switch 开关 */
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
background-color: #CBD5E1; transition: .25s; border-radius: 24px;
}
.slider:before {
position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
background-color: white; transition: .25s; border-radius: 50%;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }
/* 右下角悬浮蓝牙按钮 (FAB) */
.bt-floating-btn {
position: absolute;
bottom: 24px;
right: 24px;
width: 52px;
height: 52px;
border-radius: 16px;
background: var(--surface);
border: 1.5px solid var(--divider);
box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
z-index: 40;
}
.bt-floating-btn:hover {
transform: scale(1.08) translateY(-2px);
border-color: var(--primary);
box-shadow: 0 14px 28px var(--primary-glow);
}
.bt-floating-btn svg { width: 24px; height: 24px; fill: var(--primary); }
/* =========================================================================
【核心升级】从底部滑出的抽拉式 Sheet (Bottom Sheet)
========================================================================= */
.bottom-sheet-mask {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(15, 23, 42, 0.45);
backdrop-filter: blur(4px);
z-index: 100;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}
.bottom-sheet-mask.open { opacity: 1; pointer-events: auto; }
.bottom-sheet {
position: absolute;
bottom: 0; left: 0; right: 0;
background: var(--surface);
border-radius: 28px 28px 0 0;
border-top: 1.5px solid var(--divider);
box-shadow: 0 -15px 40px rgba(15, 23, 42, 0.2);
transform: translateY(100%);
transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
display: flex;
flex-direction: column;
max-height: 480px;
z-index: 101;
}
.bottom-sheet-mask.open .bottom-sheet { transform: translateY(0); }
/* 抽屉顶部把手条 */
.sheet-handle-bar {
width: 44px;
height: 5px;
border-radius: 10px;
background: #CBD5E1;
margin: 10px auto 4px;
cursor: grab;
}
.sheet-head {
padding: 12px 24px 14px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--divider);
}
/* 动态雷达声呐图标 */
.radar-box {
position: relative;
width: 34px;
height: 34px;
border-radius: 50%;
background: #EFF6FF;
display: flex;
align-items: center;
justify-content: center;
}
.radar-wave-ring {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
border: 2px solid var(--primary);
animation: radarWave 1.8s infinite ease-out;
}
@keyframes radarWave {
0% { transform: scale(0.6); opacity: 1; }
100% { transform: scale(1.6); opacity: 0; }
}
.radar-box svg { width: 18px; height: 18px; fill: var(--primary); z-index: 2; }
.sheet-chips-line {
padding: 10px 24px;
background: #F8FAFC;
display: flex;
gap: 8px;
border-bottom: 1px solid var(--divider);
overflow-x: auto;
}
.s-chip {
padding: 5px 12px;
border-radius: 100px;
font-size: 12px;
font-weight: 600;
border: 1px solid var(--divider);
background: white;
cursor: pointer;
white-space: nowrap;
}
.s-chip.active { background: var(--primary-light); color: var(--primary); border-color: #BFDBFE; }
.sheet-device-list {
padding: 14px 24px;
display: flex;
flex-direction: column;
gap: 10px;
overflow-y: auto;
max-height: 220px;
}
.sheet-dev-card {
border: 1.5px solid var(--divider);
border-radius: 14px;
padding: 12px 16px;
display: flex;
align-items: center;
justify-content: space-between;
background: white;
transition: all 0.15s ease;
cursor: pointer;
}
.sheet-dev-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08); }
.sheet-foot {
padding: 14px 24px 20px;
border-top: 1px solid var(--divider);
background: #F8FAFC;
}
.btn-pause-scan {
width: 100%;
background: #DCFCE7;
color: #15803D;
border: 1px solid #BBF7D0;
padding: 10px;
border-radius: 12px;
font-size: 13.5px;
font-weight: 700;
cursor: pointer;
}
</style>
</head>
<body>
<div class="device-wrapper">
<!-- AppBar 统一规范 -->
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav" title="返回"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">手环配置</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<!-- 主仪表盘双栏 -->
<main class="main-dashboard">
<!-- 左列:设备信息与心率预警 -->
<div class="dash-col">
<!-- 1. 手环设备信息 -->
<section class="health-card">
<div class="card-header">
<div class="card-title-wrap">
<div class="card-icon icon-blue"><svg width="18" height="18" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg></div>
<span class="card-title-text">手环设备信息</span>
</div>
<span class="status-pill" id="connTag">状态:未连接</span>
</div>
<div class="telemetry-grid">
<div class="tele-cell"><div class="tele-lbl">设备名称:</div><div class="tele-val" id="valName">未连接</div></div>
<div class="tele-cell"><div class="tele-lbl">MAC 地址:</div><div class="tele-val" id="valMac">设备ID: 未知</div></div>
<div class="tele-cell"><div class="tele-lbl">设备电量:</div><div class="tele-val" id="valBat">电量: 未知</div></div>
<div class="tele-cell"><div class="tele-lbl">固件版本:</div><div class="tele-val" id="valFw">固件版本: 未知</div></div>
</div>
<div class="action-line">
<button class="btn-text-danger" onclick="triggerReset()">重置手环</button>
<button class="btn-action-primary" id="btnDisconnect" onclick="toggleConnect()">断开连接</button>
</div>
</section>
<!-- 2. 心率预警设置 -->
<section class="health-card">
<div class="card-header">
<div class="card-title-wrap">
<div class="card-icon icon-red"><svg width="18" height="18" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg></div>
<span class="card-title-text">心率预警设置</span>
</div>
<label class="switch"><input type="checkbox" id="swHr" checked onchange="toggleHr()"><span class="slider"></span></label>
</div>
<div class="hr-stack">
<div class="hr-row-card"><span class="hr-row-name">最低心率 (Min):</span><select class="hr-select-pill" id="selMin"><option>40</option><option>50</option><option>60</option></select></div>
<div class="hr-row-card"><span class="hr-row-name">最高心率 (Max):</span><select class="hr-select-pill" id="selMax"><option>40</option><option selected>180</option></select></div>
<div class="hr-row-card"><span class="hr-row-name">心率目标 (Goal):</span><select class="hr-select-pill" id="selGoal"><option>40</option><option selected>140</option></select></div>
</div>
<button class="btn-wide secondary" onclick="saveHrThresholds()">保存警报阈值</button>
<div style="font-size: 12px; color: #10B981; font-weight: 600;" id="statusHint">● 正在主动断开连接...</div>
</section>
</div>
<!-- 右列:历史离线数据同步与终端日志 -->
<div class="dash-col">
<section class="health-card" style="flex: 1;">
<div class="card-header">
<div class="card-title-wrap">
<div class="card-icon icon-green"><svg width="18" height="18" viewBox="0 0 24 24"><path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg></div>
<span class="card-title-text">历史离线数据同步</span>
</div>
</div>
<div class="hr-row-card">
<span class="hr-row-name">选择同步的时间段:</span>
<select class="hr-select-pill" id="selSyncDur"><option>过去 1 小时</option><option>过去 6 小时</option><option>过去 24 小时</option></select>
</div>
<button class="btn-wide primary" onclick="syncOfflineData()">一键同步历史心率/运动</button>
<div style="display: flex; flex-direction: column; gap: 8px; margin-top: 6px; flex: 1;">
<span style="font-size: 13px; font-weight: 700; color: var(--text-main);">同步日志控制台</span>
<div class="terminal-hud" id="termConsole">
<div class="term-line info">[SYS] 蓝牙驱动就绪,等待手环连接指令...</div>
<div class="term-line">正在主动断开连接...</div>
</div>
</div>
</section>
</div>
</main>
<!-- 右下角悬浮蓝牙按钮 (FAB) -->
<button class="bt-floating-btn" onclick="openBottomSheet()" title="扫描并选择手环">
<svg viewBox="0 0 24 24"><path d="M17.71 7.71L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88z"/></svg>
</button>
<!-- 底部抽拉式 Sheet (Bottom Sheet) -->
<div class="bottom-sheet-mask" id="sheetMask" onclick="if(event.target===this) closeBottomSheet()">
<div class="bottom-sheet">
<div class="sheet-handle-bar"></div>
<div class="sheet-head">
<div style="display: flex; align-items: center; gap: 10px;">
<div class="radar-box">
<div class="radar-wave-ring"></div>
<svg viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>
</div>
<h2 style="font-size: 16px; font-weight: 700;">选择设备</h2>
</div>
<span style="cursor: pointer; font-size: 16px; color: var(--text-sub);" onclick="closeBottomSheet()">✕</span>
</div>
<div class="sheet-chips-line">
<span class="s-chip active">✓ 扫描顺序</span>
<span class="s-chip">名称</span>
<span class="s-chip">信号强度</span>
<span class="s-chip">类型</span>
</div>
<div class="sheet-device-list">
<div class="sheet-dev-card" onclick="connectDevice('CL831-62200026', 'D9:24:0F:1C:55:FA', '88%')">
<div>
<div style="font-weight: 700; font-family: monospace; font-size: 14px;">CL831-62200026 <span style="background: #EFF6FF; color: var(--primary); font-size: 10.5px; padding: 2px 6px; border-radius: 4px;">BLE</span></div>
<div style="font-size: 11.5px; color: var(--text-sub); margin-top: 2px;">D9:24:0F:1C:55:FA · 信号: -89 dBm</div>
</div>
<button style="background: var(--primary); color: white; border: none; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 12.5px; cursor: pointer;">连接</button>
</div>
<div class="sheet-dev-card" onclick="connectDevice('CL831-2200006', 'DF:16:BC:22:2E:5B', '95%')">
<div>
<div style="font-weight: 700; font-family: monospace; font-size: 14px;">CL831-2200006 <span style="background: #EFF6FF; color: var(--primary); font-size: 10.5px; padding: 2px 6px; border-radius: 4px;">BLE</span></div>
<div style="font-size: 11.5px; color: var(--text-sub); margin-top: 2px;">DF:16:BC:22:2E:5B · 信号: -98 dBm</div>
</div>
<button style="background: var(--primary); color: white; border: none; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 12.5px; cursor: pointer;">连接</button>
</div>
</div>
<div class="sheet-foot">
<button class="btn-pause-scan" id="btnScan" onclick="toggleScan()">暂停扫描</button>
</div>
</div>
</div>
</div>
<script>
let isConnected = false;
let isScanning = true;
function appendLog(t, type = '') {
const c = document.getElementById('termConsole');
const d = document.createElement('div');
d.className = `term-line ${type}`;
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
c.appendChild(d);
c.scrollTop = c.scrollHeight;
}
function openBottomSheet() {
document.getElementById('sheetMask').classList.add('open');
appendLog("从底部抽拉展开【选择设备】面板,雷达声呐正在扫描周围 BLE 广播...", "info");
}
function closeBottomSheet() {
document.getElementById('sheetMask').classList.remove('open');
}
function toggleScan() {
const b = document.getElementById('btnScan');
isScanning = !isScanning;
if (isScanning) {
b.innerText = "暂停扫描";
b.style.background = "#DCFCE7";
b.style.color = "#15803D";
appendLog("已恢复 BLE 设备雷达广播扫描...", "info");
} else {
b.innerText = "继续扫描";
b.style.background = "#FEF3C7";
b.style.color = "#D97706";
appendLog("已暂停 BLE 广播扫描。", "warn");
}
}
function connectDevice(name, mac, bat) {
closeBottomSheet();
appendLog(`正在尝试连接手环 [${name} | ${mac}]...`, "info");
setTimeout(() => {
isConnected = true;
document.getElementById('valName').innerText = name;
document.getElementById('valMac').innerText = mac;
document.getElementById('valBat').innerText = `${bat} (正常)`;
document.getElementById('valFw').innerText = "v2.1.04-BLE";
document.getElementById('connTag').innerText = "状态:已连接";
document.getElementById('connTag').classList.add('connected');
document.getElementById('btnDisconnect').classList.add('active');
document.getElementById('statusHint').innerText = `● 设备已在线 [${name}]`;
appendLog(`成功建立 GATT 通信!手环 [${name}] 在线,电量: ${bat}`, "success");
}, 600);
}
function toggleConnect() {
if (!isConnected) { openBottomSheet(); return; }
isConnected = false;
document.getElementById('valName').innerText = "未连接";
document.getElementById('valMac').innerText = "设备ID: 未知";
document.getElementById('valBat').innerText = "电量: 未知";
document.getElementById('valFw').innerText = "固件版本: 未知";
document.getElementById('connTag').innerText = "状态:未连接";
document.getElementById('connTag').classList.remove('connected');
document.getElementById('btnDisconnect').classList.remove('active');
document.getElementById('statusHint').innerText = "● 正在主动断开连接...";
appendLog("正在主动断开连接... 设备已释放。", "warn");
}
function triggerReset() {
appendLog("向手环发送恢复出厂设置指令 (Factory Reset)...", "warn");
alert("手环重置指令已成功下发!");
}
function toggleHr() {
const v = document.getElementById('swHr').checked;
appendLog(`心率预警开关切换为: ${v ? '开启' : '关闭'}`, "info");
}
function saveHrThresholds() {
const min = document.getElementById('selMin').value;
const max = document.getElementById('selMax').value;
const goal = document.getElementById('selGoal').value;
appendLog(`写入心率预警阈值 -> Min: ${min} BPM | Max: ${max} BPM | Goal: ${goal} BPM`, "success");
alert("心率预警阈值已保存生效!");
}
function syncOfflineData() {
if (!isConnected) {
appendLog("同步中断:请先连接手环设备。", "warn");
openBottomSheet();
return;
}
const dur = document.getElementById('selSyncDur').value;
appendLog(`正在同步 [${dur}] 历史离线数据包...`, "info");
setTimeout(() => {
appendLog(`历史离线数据包已同步入库:读取 280 个心率帧,CRC 校验通过。`, "success");
alert("历史离线数据同步完成!");
}, 1000);
}
</script>
</body>
</html>
@@ -0,0 +1,298 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 2:Linear Precision 工控极客网格 + 底部抽拉 Sheet</title>
<style>
:root {
--primary: #5B21B6;
--accent: #7C3AED;
--accent-light: #F5F3FF;
--bg: #0B0F19;
--surface: #111827;
--card-bg: #1F2937;
--text-main: #F9FAFB;
--text-sub: #9CA3AF;
--divider: #374151;
--danger: #F43F5E;
--success: #10B981;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: ui-monospace, SFMono-Regular, "Segoe UI", Roboto, "PingFang SC", sans-serif;
background: #030712;
color: var(--text-main);
min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px);
display: flex;
flex-direction: column;
}
.device-wrapper {
width: 100%;
max-width: min(100%, 1160px);
margin: 0 auto;
background: var(--surface);
border-radius: 20px;
border: 1px solid #1F2937;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
overflow: hidden;
position: relative;
min-height: 640px;
display: flex;
flex-direction: column;
}
/* AppBar */
.appbar {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
border-bottom: 1px solid var(--divider);
background: #111827;
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%;
display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav:hover, .appbar-more:hover { background: rgba(255, 255, 255, 0.08); }
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
/* 复合 Bento 栅格 */
.linear-grid {
padding: clamp(20px, 2.5vw, 28px);
display: grid;
grid-template-columns: 1.1fr 1fr;
gap: clamp(16px, 2vw, 22px);
background: #0B0F19;
flex: 1;
overflow-y: auto;
max-height: 660px;
}
.linear-card {
background: #111827;
border: 1px solid var(--divider);
border-radius: 14px;
padding: 18px 20px;
display: flex;
flex-direction: column;
gap: 14px;
}
.l-head {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--divider);
padding-bottom: 10px;
}
.l-title { font-size: 14.5px; font-weight: 700; color: #A78BFA; }
/* 参数矩阵 */
.l-param-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.l-cell { background: #1F2937; border: 1px solid #374151; border-radius: 8px; padding: 10px 12px; }
.l-k { font-size: 11px; color: var(--text-sub); }
.l-v { font-size: 13.5px; font-weight: 700; color: #FFF; margin-top: 2px; }
.l-btn-row { display: flex; justify-content: space-between; align-items: center; }
.btn-red { color: var(--danger); background: transparent; border: none; font-weight: 700; cursor: pointer; }
.btn-connect {
background: #374151; color: var(--text-sub); border: none; border-radius: 6px; padding: 7px 16px;
font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.btn-connect.on { background: var(--accent); color: white; }
/* 心率设置 */
.hr-l-grid { display: flex; flex-direction: column; gap: 8px; }
.hr-l-box {
background: #1F2937; border: 1px solid #374151; border-radius: 8px; padding: 8px 12px;
display: flex; align-items: center; justify-content: space-between;
}
.hr-select-dark {
background: #111827; color: #A78BFA; border: 1px solid var(--divider); border-radius: 6px;
padding: 4px 10px; font-weight: 700;
}
.btn-linear-wide {
width: 100%; padding: 10px; border-radius: 8px; background: #374151; color: #F9FAFB; font-weight: 700;
border: none; cursor: pointer; transition: background 0.2s;
}
.btn-linear-wide.glow { background: var(--accent); }
/* 控制台 */
.linear-term {
background: #030712; border: 1px solid #1F2937; border-radius: 8px; padding: 10px 12px;
font-size: 11.5px; color: #9CA3AF; height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
/* FAB */
.fab-btn {
position: absolute; bottom: 24px; right: 24px; width: 50px; height: 50px; border-radius: 14px;
background: var(--accent); box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 40; border: none;
}
.fab-btn svg { width: 22px; height: 22px; fill: white; }
/* 底部抽拉式 Sheet */
.bottom-sheet-mask {
position: absolute; top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.bottom-sheet-mask.open { opacity: 1; pointer-events: auto; }
.bottom-sheet {
position: absolute; bottom: 0; left: 0; right: 0;
background: #111827; border-radius: 24px 24px 0 0; border-top: 1px solid var(--divider);
box-shadow: 0 -15px 40px rgba(0,0,0,0.6); transform: translateY(100%);
transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
display: flex; flex-direction: column; max-height: 480px; z-index: 101;
}
.bottom-sheet-mask.open .bottom-sheet { transform: translateY(0); }
.sheet-handle-bar { width: 44px; height: 4px; border-radius: 4px; background: #4B5563; margin: 10px auto 4px; }
.radar-pulse-icon {
position: relative; width: 30px; height: 30px; border-radius: 50%; background: rgba(124, 58, 237, 0.2);
display: flex; align-items: center; justify-content: center;
}
.radar-ring {
position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--accent);
animation: radarWave 1.6s infinite ease-out;
}
@keyframes radarWave { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">手环配置</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<main class="linear-grid">
<!-- 左列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="linear-card">
<div class="l-head">
<span class="l-title">手环设备信息</span>
<span id="lTag" style="font-size: 11px; color: var(--text-sub);">状态:未连接</span>
</div>
<div class="l-param-row">
<div class="l-cell"><div class="l-k">设备名称:</div><div class="l-v" id="lName">未连接</div></div>
<div class="l-cell"><div class="l-k">MAC 地址:</div><div class="l-v" id="lMac">设备ID: 未知</div></div>
<div class="l-cell"><div class="l-k">设备电量:</div><div class="l-v" id="lBat">电量: 未知</div></div>
<div class="l-cell"><div class="l-k">固件版本:</div><div class="l-v" id="lFw">固件版本: 未知</div></div>
</div>
<div class="l-btn-row">
<button class="btn-red" onclick="lReset()">重置手环</button>
<button class="btn-connect" id="lBtnDis" onclick="lDis()">断开连接</button>
</div>
</section>
<section class="linear-card">
<div class="l-head">
<span class="l-title">心率预警设置</span>
<input type="checkbox" checked style="accent-color: var(--accent);">
</div>
<div class="hr-l-grid">
<div class="hr-l-box"><span>最低心率 (Min):</span><select class="hr-select-dark"><option>40</option></select></div>
<div class="hr-l-box"><span>最高心率 (Max):</span><select class="hr-select-dark"><option>180</option></select></div>
<div class="hr-l-box"><span>心率目标 (Goal):</span><select class="hr-select-dark"><option>140</option></select></div>
</div>
<button class="btn-linear-wide" onclick="lSaveHr()">保存警报阈值</button>
<div style="font-size: 11.5px; color: #10B981;">● 正在主动断开连接...</div>
</section>
</div>
<!-- 右列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="linear-card" style="flex: 1;">
<div class="l-head"><span class="l-title">历史离线数据同步</span></div>
<div style="display: flex; justify-content: space-between; align-items: center; background: #1F2937; padding: 10px 12px; border-radius: 8px;">
<span style="font-size: 12.5px;">选择同步的时间段:</span>
<select class="hr-select-dark"><option>过去 1 小时</option></select>
</div>
<button class="btn-linear-wide glow" onclick="lSync()">一键同步历史心率/运动</button>
<span style="font-size: 12px; font-weight: 700; color: #A78BFA; margin-top: 4px;">同步日志控制台</span>
<div class="linear-term" id="lTerm">
<div>[INIT] Linear BLE Service 就绪...</div>
<div>正在主动断开连接...</div>
</div>
</section>
</div>
</main>
<!-- FAB -->
<button class="fab-btn" onclick="openLSheet()"><svg viewBox="0 0 24 24"><path d="M17.71 7.71L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88z"/></svg></button>
<!-- 底部抽拉式 Sheet -->
<div class="bottom-sheet-mask" id="lSheetMask" onclick="if(event.target===this) closeLSheet()">
<div class="bottom-sheet">
<div class="sheet-handle-bar"></div>
<div style="padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--divider);">
<div style="display: flex; align-items: center; gap: 10px;">
<div class="radar-pulse-icon"><div class="radar-ring"></div><svg width="16" height="16" viewBox="0 0 24 24" fill="#A78BFA"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg></div>
<h2 style="font-size: 15px; font-weight: 700; color: #FFF;">选择设备</h2>
</div>
<span style="cursor: pointer;" onclick="closeLSheet()">✕</span>
</div>
<div style="padding: 14px 20px; display: flex; flex-direction: column; gap: 8px;">
<div style="border: 1px solid var(--divider); background: #1F2937; padding: 10px 14px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;" onclick="lPick('CL831-62200026', 'D9:24:0F:1C:55:FA')">
<div>
<div style="font-weight: 700; font-family: monospace;">CL831-62200026 <span style="background: rgba(167, 139, 250, 0.2); color: #A78BFA; font-size: 10px; padding: 2px 4px; border-radius: 4px;">BLE</span></div>
<div style="font-size: 11px; color: var(--text-sub); margin-top: 2px;">D9:24:0F:1C:55:FA · -89 dBm</div>
</div>
<button style="background: var(--accent); color: white; border: none; border-radius: 6px; padding: 6px 12px; font-weight: 700; font-size: 12px; cursor: pointer;">连接</button>
</div>
</div>
</div>
</div>
</div>
<script>
function lLog(t) {
const b = document.getElementById('lTerm');
const d = document.createElement('div');
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
b.appendChild(d);
b.scrollTop = b.scrollHeight;
}
function openLSheet() { document.getElementById('lSheetMask').classList.add('open'); lLog("从底部抽拉展开【选择设备】面板..."); }
function closeLSheet() { document.getElementById('lSheetMask').classList.remove('open'); }
function lPick(n, m) {
closeLSheet();
lLog(`GATT 连接手环 [${n}]...`);
setTimeout(() => {
document.getElementById('lName').innerText = n;
document.getElementById('lMac').innerText = m;
document.getElementById('lBat').innerText = "90% (正常)";
document.getElementById('lFw').innerText = "v2.1.04";
document.getElementById('lTag').innerText = "状态:已连接";
document.getElementById('lTag').style.color = "#10B981";
document.getElementById('lBtnDis').classList.add('on');
lLog(`手环 [${n}] 已成功在线!`);
}, 500);
}
function lDis() {
document.getElementById('lName').innerText = "未连接";
document.getElementById('lMac').innerText = "设备ID: 未知";
document.getElementById('lBat').innerText = "电量: 未知";
document.getElementById('lFw').innerText = "固件版本: 未知";
document.getElementById('lTag').innerText = "状态:未连接";
document.getElementById('lBtnDis').classList.remove('on');
lLog("正在主动断开连接...");
}
function lReset() { lLog("发送重置指令..."); alert("手环重置请求已发送!"); }
function lSaveHr() { lLog("保存心率预警阈值成功!"); alert("心率预警阈值保存成功!"); }
function lSync() { lLog("离线同步历史数据完成!"); alert("历史离线数据同步完成!"); }
</script>
</body>
</html>
@@ -0,0 +1,281 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 3:Sport Racing 运动遥测风 + 底部抽拉 Sheet</title>
<style>
:root {
--primary: #F59E0B;
--accent: #0EA5E9;
--bg: #0F172A;
--surface: #1E293B;
--card-bg: #1E293B;
--text-main: #F8FAFC;
--text-sub: #94A3B8;
--divider: #334155;
--danger: #EF4444;
--success: #10B981;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: #020617;
color: var(--text-main);
min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px);
display: flex;
flex-direction: column;
}
.device-wrapper {
width: 100%;
max-width: min(100%, 1160px);
margin: 0 auto;
background: var(--bg);
border-radius: 24px;
border: 1px solid var(--divider);
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
overflow: hidden;
position: relative;
min-height: 640px;
display: flex;
flex-direction: column;
}
.appbar {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
border-bottom: 1px solid var(--divider);
background: #1E293B;
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%;
display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav:hover, .appbar-more:hover { background: rgba(255, 255, 255, 0.08); }
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
/* 运动仪表盘布局 */
.sport-dashboard {
padding: clamp(20px, 2.5vw, 28px);
display: grid;
grid-template-columns: 1fr 1fr;
gap: clamp(16px, 2vw, 24px);
flex: 1;
background: #0B0F19;
overflow-y: auto;
max-height: 660px;
}
.sport-card {
background: #131A2B;
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 18px;
padding: 20px;
display: flex;
flex-direction: column;
gap: 14px;
}
.s-head {
display: flex; align-items: center; justify-content: space-between;
border-bottom: 1px solid var(--divider); padding-bottom: 10px;
}
.s-title { font-size: 15px; font-weight: 700; color: var(--primary); }
.s-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.s-box { background: #1E293B; border-radius: 10px; padding: 10px 12px; border: 1px solid var(--divider); }
.s-lbl { font-size: 11px; color: var(--text-sub); }
.s-val { font-size: 13.5px; font-weight: 700; margin-top: 3px; font-family: monospace; color: #FFF; }
.s-action-row { display: flex; justify-content: space-between; align-items: center; }
.btn-s-danger { color: var(--danger); background: transparent; border: none; font-weight: 700; cursor: pointer; }
.btn-s-primary { background: #334155; color: #94A3B8; border: none; border-radius: 8px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.btn-s-primary.active { background: var(--primary); color: #000; }
.hr-s-triple { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.hr-s-card { background: #1E293B; border-radius: 10px; padding: 10px; text-align: center; border: 1px solid var(--divider); }
.hr-s-select { background: #0F172A; color: var(--accent); border: 1px solid var(--divider); border-radius: 6px; padding: 4px; font-weight: 700; width: 100%; margin-top: 4px; }
.btn-wide-sport {
width: 100%; padding: 11px; border-radius: 10px; font-size: 13.5px; font-weight: 700; border: none; cursor: pointer;
background: #334155; color: #FFF;
}
.btn-wide-sport.amber { background: var(--primary); color: #000; box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4); }
.sport-terminal {
background: #020617; border: 1px solid var(--divider); border-radius: 10px; padding: 12px;
font-family: monospace; font-size: 11.5px; color: #38BDF8; height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
/* FAB */
.fab-sport {
position: absolute; bottom: 24px; right: 24px; width: 52px; height: 52px; border-radius: 16px;
background: var(--primary); box-shadow: 0 8px 24px rgba(245, 158, 11, 0.5);
display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; z-index: 40;
}
.fab-sport svg { width: 24px; height: 24px; fill: #000; }
/* 底部抽拉式 Sheet */
.bottom-sheet-mask {
position: absolute; top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.bottom-sheet-mask.open { opacity: 1; pointer-events: auto; }
.bottom-sheet {
position: absolute; bottom: 0; left: 0; right: 0;
background: #131A2B; border-radius: 24px 24px 0 0; border-top: 1px solid var(--divider);
box-shadow: 0 -15px 40px rgba(0,0,0,0.6); transform: translateY(100%);
transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
display: flex; flex-direction: column; max-height: 480px; z-index: 101;
}
.bottom-sheet-mask.open .bottom-sheet { transform: translateY(0); }
.sheet-handle-bar { width: 44px; height: 4px; border-radius: 4px; background: #475569; margin: 10px auto 4px; }
.radar-sport-icon {
position: relative; width: 30px; height: 30px; border-radius: 50%; background: rgba(245, 158, 11, 0.2);
display: flex; align-items: center; justify-content: center;
}
.radar-ring {
position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--primary);
animation: radarWave 1.6s infinite ease-out;
}
@keyframes radarWave { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">手环配置</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<main class="sport-dashboard">
<!-- 左列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="sport-card">
<div class="s-head">
<span class="s-title">手环设备信息</span>
<span id="sTag" style="font-size: 11px; color: var(--text-sub);">状态:未连接</span>
</div>
<div class="s-grid">
<div class="s-box"><div class="s-lbl">设备名称:</div><div class="s-val" id="sName">未连接</div></div>
<div class="s-box"><div class="s-lbl">MAC 地址:</div><div class="s-val" id="sMac">设备ID: 未知</div></div>
<div class="s-box"><div class="s-lbl">设备电量:</div><div class="s-val" id="sBat">电量: 未知</div></div>
<div class="s-box"><div class="s-lbl">固件版本:</div><div class="s-val" id="sFw">固件版本: 未知</div></div>
</div>
<div class="s-action-row">
<button class="btn-s-danger" onclick="sReset()">重置手环</button>
<button class="btn-s-primary" id="sDisBtn" onclick="sDis()">断开连接</button>
</div>
</section>
<section class="sport-card">
<div class="s-head">
<span class="s-title">心率预警设置</span>
<input type="checkbox" checked style="accent-color: var(--primary);">
</div>
<div class="hr-s-triple">
<div class="hr-s-card"><div class="s-lbl">最低心率 (Min)</div><select class="hr-s-select"><option>40</option></select></div>
<div class="hr-s-card"><div class="s-lbl">最高心率 (Max)</div><select class="hr-s-select"><option>180</option></select></div>
<div class="hr-s-card"><div class="s-lbl">心率目标 (Goal)</div><select class="hr-s-select"><option>140</option></select></div>
</div>
<button class="btn-wide-sport" onclick="sSaveHr()">保存警报阈值</button>
<div style="font-size: 11.5px; color: #10B981;">● 正在主动断开连接...</div>
</section>
</div>
<!-- 右列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="sport-card" style="flex: 1;">
<div class="s-head"><span class="s-title">历史离线数据同步</span></div>
<div style="display: flex; justify-content: space-between; align-items: center; background: #1E293B; padding: 10px 14px; border-radius: 8px;">
<span style="font-size: 13px;">选择同步的时间段:</span>
<select class="hr-s-select" style="width: auto;"><option>过去 1 小时</option></select>
</div>
<button class="btn-wide-sport amber" onclick="sSync()">一键同步历史心率/运动</button>
<span style="font-size: 12px; font-weight: 700; color: #FFF; margin-top: 4px;">同步日志控制台</span>
<div class="sport-terminal" id="sTerm">
<div>[TELEMETRY] 运动数据引擎就绪...</div>
<div>正在主动断开连接...</div>
</div>
</section>
</div>
</main>
<!-- FAB -->
<button class="fab-sport" onclick="openSSheet()"><svg viewBox="0 0 24 24"><path d="M17.71 7.71L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88z"/></svg></button>
<!-- 底部抽拉式 Sheet -->
<div class="bottom-sheet-mask" id="sSheetMask" onclick="if(event.target===this) closeSSheet()">
<div class="bottom-sheet">
<div class="sheet-handle-bar"></div>
<div style="padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--divider);">
<div style="display: flex; align-items: center; gap: 10px;">
<div class="radar-sport-icon"><div class="radar-ring"></div><svg width="16" height="16" viewBox="0 0 24 24" fill="#F59E0B"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg></div>
<h2 style="font-size: 15px; font-weight: 700; color: #FFF;">选择设备</h2>
</div>
<span style="cursor: pointer;" onclick="closeSSheet()">✕</span>
</div>
<div style="padding: 14px 20px; display: flex; flex-direction: column; gap: 8px;">
<div style="border: 1px solid var(--divider); background: #1E293B; padding: 10px 14px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;" onclick="sPick('CL831-62200026', 'D9:24:0F:1C:55:FA')">
<div>
<div style="font-weight: 700; font-family: monospace; color: #FFF;">CL831-62200026 <span style="background: rgba(245, 158, 11, 0.2); color: var(--primary); font-size: 10px; padding: 2px 4px; border-radius: 4px;">BLE</span></div>
<div style="font-size: 11px; color: var(--text-sub); margin-top: 2px;">D9:24:0F:1C:55:FA · -89 dBm</div>
</div>
<button style="background: var(--primary); color: #000; border: none; border-radius: 6px; padding: 6px 12px; font-weight: 700; font-size: 12px; cursor: pointer;">连接</button>
</div>
</div>
</div>
</div>
</div>
<script>
function sLog(t) {
const b = document.getElementById('sTerm');
const d = document.createElement('div');
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
b.appendChild(d);
b.scrollTop = b.scrollHeight;
}
function openSSheet() { document.getElementById('sSheetMask').classList.add('open'); sLog("从底部抽拉展开【选择设备】面板..."); }
function closeSSheet() { document.getElementById('sSheetMask').classList.remove('open'); }
function sPick(n, m) {
closeSSheet();
sLog(`建立遥测通道 [${n}]...`);
setTimeout(() => {
document.getElementById('sName').innerText = n;
document.getElementById('sMac').innerText = m;
document.getElementById('sBat').innerText = "95% (高能)";
document.getElementById('sFw').innerText = "v2.1.04";
document.getElementById('sTag').innerText = "状态:已连接";
document.getElementById('sTag').style.color = "#F59E0B";
document.getElementById('sDisBtn').classList.add('active');
sLog(`手环 [${n}] 实时遥测数据流建立!`);
}, 500);
}
function sDis() {
document.getElementById('sName').innerText = "未连接";
document.getElementById('sMac').innerText = "设备ID: 未知";
document.getElementById('sBat').innerText = "电量: 未知";
document.getElementById('sFw').innerText = "固件版本: 未知";
document.getElementById('sTag').innerText = "状态:未连接";
document.getElementById('sDisBtn').classList.remove('active');
sLog("正在主动断开连接...");
}
function sReset() { sLog("重置指令已发送..."); alert("手环重置请求已发送!"); }
function sSaveHr() { sLog("保存心率预警阈值成功!"); alert("心率预警阈值保存成功!"); }
function sSync() { sLog("拉取离线数据帧完成!"); alert("历史离线数据同步完成!"); }
</script>
</body>
</html>
@@ -0,0 +1,277 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 4:Nordic Slate 极简极净风格 + 底部抽拉 Sheet</title>
<style>
:root {
--primary: #0F766E;
--primary-light: #F0FDFA;
--bg: #F8FAFC;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--danger: #E11D48;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: #F1F5F9;
color: var(--text-main);
min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px);
display: flex;
flex-direction: column;
}
.device-wrapper {
width: 100%;
max-width: min(100%, 1160px);
margin: 0 auto;
background: var(--surface);
border-radius: 24px;
border: 1px solid var(--divider);
box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.06);
overflow: hidden;
position: relative;
min-height: 640px;
display: flex;
flex-direction: column;
}
.appbar {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
border-bottom: 1px solid var(--divider);
background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%;
display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav:hover, .appbar-more:hover { background: rgba(0, 0, 0, 0.04); }
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
/* 极简双列仪表盘 */
.nordic-dash {
padding: clamp(20px, 2.5vw, 28px);
display: grid;
grid-template-columns: 1fr 1fr;
gap: clamp(16px, 2vw, 24px);
flex: 1;
background: #FAFAFA;
overflow-y: auto;
max-height: 660px;
}
.nordic-card {
background: #FFFFFF;
border: 1px solid var(--divider);
border-radius: 16px;
padding: 22px;
display: flex;
flex-direction: column;
gap: 16px;
}
.n-head {
display: flex; align-items: center; justify-content: space-between;
border-bottom: 1px solid var(--divider); padding-bottom: 10px;
}
.n-title { font-size: 15.5px; font-weight: 700; color: var(--primary); }
.n-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.n-box { background: #F8FAFC; border: 1px solid var(--divider); border-radius: 10px; padding: 10px 14px; }
.n-action-row { display: flex; justify-content: space-between; align-items: center; }
.btn-n-danger { color: var(--danger); background: transparent; border: none; font-weight: 700; cursor: pointer; }
.btn-n-primary { background: #F1F5F9; color: var(--text-sub); border: 1px solid var(--divider); border-radius: 8px; padding: 8px 18px; font-weight: 700; cursor: pointer; }
.btn-n-primary.active { background: var(--primary); color: white; border-color: var(--primary); }
.hr-n-row { display: flex; flex-direction: column; gap: 8px; }
.hr-n-box { display: flex; justify-content: space-between; align-items: center; background: #F8FAFC; border: 1px solid var(--divider); border-radius: 8px; padding: 10px 14px; }
.hr-n-select { border: 1px solid var(--divider); border-radius: 6px; padding: 4px 10px; font-weight: 700; background: white; }
.btn-n-wide {
width: 100%; padding: 11px; border-radius: 10px; font-size: 13.5px; font-weight: 700; cursor: pointer; border: 1px solid var(--divider);
background: #F1F5F9; color: var(--text-main);
}
.btn-n-wide.teal { background: var(--primary); color: white; border: none; }
.nordic-term {
background: #0F172A; border-radius: 10px; padding: 12px 14px; font-family: monospace; font-size: 11.5px; color: #2DD4BF;
height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
/* FAB */
.fab-nordic {
position: absolute; bottom: 24px; right: 24px; width: 50px; height: 50px; border-radius: 16px;
background: var(--primary); box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35);
display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; z-index: 40;
}
.fab-nordic svg { width: 24px; height: 24px; fill: white; }
/* 底部抽拉式 Sheet */
.bottom-sheet-mask {
position: absolute; top: 0; left: 0; right: 0; bottom: 0;
background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px);
z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.bottom-sheet-mask.open { opacity: 1; pointer-events: auto; }
.bottom-sheet {
position: absolute; bottom: 0; left: 0; right: 0;
background: #FFFFFF; border-radius: 28px 28px 0 0; border-top: 1px solid var(--divider);
box-shadow: 0 -15px 40px rgba(15, 23, 42, 0.15); transform: translateY(100%);
transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
display: flex; flex-direction: column; max-height: 480px; z-index: 101;
}
.bottom-sheet-mask.open .bottom-sheet { transform: translateY(0); }
.sheet-handle-bar { width: 44px; height: 4px; border-radius: 4px; background: #CBD5E1; margin: 10px auto 4px; }
.radar-nordic-icon {
position: relative; width: 32px; height: 32px; border-radius: 50%; background: #F0FDFA;
display: flex; align-items: center; justify-content: center;
}
.radar-ring {
position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--primary);
animation: radarWave 1.6s infinite ease-out;
}
@keyframes radarWave { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">手环配置</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<main class="nordic-dash">
<!-- 左列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="nordic-card">
<div class="n-head">
<span class="n-title">手环设备信息</span>
<span id="nTag" style="font-size: 12px; color: var(--text-sub);">状态:未连接</span>
</div>
<div class="n-grid">
<div class="n-box"><div style="font-size: 11.5px; color: var(--text-sub);">设备名称:</div><div style="font-weight: 700; margin-top: 2px;" id="nName">未连接</div></div>
<div class="n-box"><div style="font-size: 11.5px; color: var(--text-sub);">MAC 地址:</div><div style="font-weight: 700; margin-top: 2px;" id="nMac">设备ID: 未知</div></div>
<div class="n-box"><div style="font-size: 11.5px; color: var(--text-sub);">设备电量:</div><div style="font-weight: 700; margin-top: 2px;" id="nBat">电量: 未知</div></div>
<div class="n-box"><div style="font-size: 11.5px; color: var(--text-sub);">固件版本:</div><div style="font-weight: 700; margin-top: 2px;" id="nFw">固件版本: 未知</div></div>
</div>
<div class="n-action-row">
<button class="btn-n-danger" onclick="nReset()">重置手环</button>
<button class="btn-n-primary" id="nDisBtn" onclick="nDis()">断开连接</button>
</div>
</section>
<section class="nordic-card">
<div class="n-head">
<span class="n-title">心率预警设置</span>
<input type="checkbox" checked style="accent-color: var(--primary);">
</div>
<div class="hr-n-row">
<div class="hr-n-box"><span>最低心率 (Min):</span><select class="hr-n-select"><option>40</option></select></div>
<div class="hr-n-box"><span>最高心率 (Max):</span><select class="hr-n-select"><option>180</option></select></div>
<div class="hr-n-box"><span>心率目标 (Goal):</span><select class="hr-n-select"><option>140</option></select></div>
</div>
<button class="btn-n-wide" onclick="nSaveHr()">保存警报阈值</button>
<div style="font-size: 12px; color: #10B981; font-weight: 600;">正在主动断开连接...</div>
</section>
</div>
<!-- 右列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="nordic-card" style="flex: 1;">
<div class="n-head"><span class="n-title">历史离线数据同步</span></div>
<div style="display: flex; justify-content: space-between; align-items: center; background: #F8FAFC; border: 1px solid var(--divider); padding: 10px 14px; border-radius: 8px;">
<span style="font-size: 13px; font-weight: 600;">选择同步的时间段:</span>
<select class="hr-n-select"><option>过去 1 小时</option></select>
</div>
<button class="btn-n-wide teal" onclick="nSync()">一键同步历史心率/运动</button>
<span style="font-size: 13px; font-weight: 700; color: var(--text-main); margin-top: 4px;">同步日志控制台</span>
<div class="nordic-term" id="nTerm">
<div>[NORDIC] 设备总线就绪...</div>
<div>正在主动断开连接...</div>
</div>
</section>
</div>
</main>
<!-- FAB -->
<button class="fab-nordic" onclick="openNSheet()"><svg viewBox="0 0 24 24"><path d="M17.71 7.71L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88z"/></svg></button>
<!-- 底部抽拉式 Sheet -->
<div class="bottom-sheet-mask" id="nSheetMask" onclick="if(event.target===this) closeNSheet()">
<div class="bottom-sheet">
<div class="sheet-handle-bar"></div>
<div style="padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--divider);">
<div style="display: flex; align-items: center; gap: 10px;">
<div class="radar-nordic-icon"><div class="radar-ring"></div><svg width="16" height="16" viewBox="0 0 24 24" fill="#0F766E"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg></div>
<h2 style="font-size: 15px; font-weight: 700;">选择设备</h2>
</div>
<span style="cursor: pointer;" onclick="closeNSheet()">✕</span>
</div>
<div style="padding: 14px 20px; display: flex; flex-direction: column; gap: 8px;">
<div style="border: 1px solid var(--divider); padding: 12px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;" onclick="nPick('CL831-62200026', 'D9:24:0F:1C:55:FA')">
<div>
<div style="font-weight: 700; font-family: monospace;">CL831-62200026 <span style="background: #F0FDFA; color: var(--primary); font-size: 10px; padding: 2px 4px; border-radius: 4px;">BLE</span></div>
<div style="font-size: 11px; color: var(--text-sub); margin-top: 2px;">D9:24:0F:1C:55:FA · -89 dBm</div>
</div>
<button style="background: var(--primary); color: white; border: none; border-radius: 6px; padding: 6px 12px; font-weight: 700; font-size: 12px; cursor: pointer;">连接</button>
</div>
</div>
</div>
</div>
</div>
<script>
function nLog(t) {
const b = document.getElementById('nTerm');
const d = document.createElement('div');
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
b.appendChild(d);
b.scrollTop = b.scrollHeight;
}
function openNSheet() { document.getElementById('nSheetMask').classList.add('open'); nLog("从底部抽拉展开【选择设备】面板..."); }
function closeNSheet() { document.getElementById('nSheetMask').classList.remove('open'); }
function nPick(n, m) {
closeNSheet();
nLog(`连接手环 [${n}]...`);
setTimeout(() => {
document.getElementById('nName').innerText = n;
document.getElementById('nMac').innerText = m;
document.getElementById('nBat').innerText = "88%";
document.getElementById('nFw').innerText = "v2.1.04";
document.getElementById('nTag').innerText = "状态:已连接";
document.getElementById('nTag').style.color = "#0F766E";
document.getElementById('nDisBtn').classList.add('active');
nLog(`手环 [${n}] 连接成功!`);
}, 500);
}
function nDis() {
document.getElementById('nName').innerText = "未连接";
document.getElementById('nMac').innerText = "设备ID: 未知";
document.getElementById('nBat').innerText = "电量: 未知";
document.getElementById('nFw').innerText = "固件版本: 未知";
document.getElementById('nTag').innerText = "状态:未连接";
document.getElementById('nDisBtn').classList.remove('active');
nLog("正在主动断开连接...");
}
function nReset() { nLog("下发重置指令..."); alert("手环重置请求已发送!"); }
function nSaveHr() { nLog("保存心率预警阈值成功!"); alert("心率预警保存成功!"); }
function nSync() { nLog("离线同步历史数据完成!"); alert("历史离线数据同步完成!"); }
</script>
</body>
</html>
@@ -0,0 +1,291 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 5:Fluid Modern Studio 流体工作室 + 底部抽拉 Sheet</title>
<style>
:root {
--primary: #2563EB;
--primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--danger: #EF4444;
--success: #10B981;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg);
color: var(--text-main);
min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px);
display: flex;
flex-direction: column;
}
.device-wrapper {
width: 100%;
max-width: min(100%, 1160px);
margin: 0 auto;
background: var(--surface);
border-radius: 24px;
border: 1px solid var(--divider);
box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden;
position: relative;
min-height: 640px;
display: flex;
flex-direction: column;
}
.appbar {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
border-bottom: 1px solid var(--divider);
background: var(--surface);
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%;
display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav:hover, .appbar-more:hover { background: rgba(15, 23, 42, 0.06); }
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
/* 现代流体双栏 */
.fluid-studio {
padding: clamp(20px, 2.5vw, 28px);
display: grid;
grid-template-columns: 1fr 1fr;
gap: clamp(16px, 2vw, 24px);
flex: 1;
background: #F8FAFC;
overflow-y: auto;
max-height: 660px;
}
.studio-card {
background: var(--surface);
border: 1.5px solid var(--divider);
border-radius: 18px;
padding: 22px;
display: flex;
flex-direction: column;
gap: 16px;
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}
.card-head {
display: flex; align-items: center; justify-content: space-between;
border-bottom: 1px solid var(--divider); padding-bottom: 12px;
}
.card-title { font-size: 16px; font-weight: 700; color: var(--primary); }
.grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cell-box { background: #F8FAFC; border: 1px solid var(--divider); border-radius: 10px; padding: 10px 14px; }
.cell-k { font-size: 11.5px; color: var(--text-sub); }
.cell-v { font-size: 14px; font-weight: 700; color: var(--text-main); margin-top: 2px; font-family: monospace; }
.btn-row { display: flex; justify-content: space-between; align-items: center; }
.btn-red-link { color: var(--danger); background: transparent; border: none; font-weight: 700; cursor: pointer; }
.btn-dis-pill { background: #E2E8F0; color: var(--text-sub); border: none; border-radius: 8px; padding: 8px 18px; font-weight: 700; cursor: pointer; }
.btn-dis-pill.active { background: var(--primary-gradient); color: white; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.hr-box-list { display: flex; flex-direction: column; gap: 8px; }
.hr-box-item { display: flex; justify-content: space-between; align-items: center; background: #F8FAFC; border: 1px solid var(--divider); border-radius: 10px; padding: 10px 14px; }
.hr-select { background: white; border: 1.5px solid var(--divider); border-radius: 6px; padding: 4px 10px; font-weight: 700; color: var(--primary); }
.btn-fluid-wide {
width: 100%; padding: 11px; border-radius: 10px; font-size: 13.5px; font-weight: 700; border: none; cursor: pointer;
background: #E2E8F0; color: #334155;
}
.btn-fluid-wide.blue { background: var(--primary-gradient); color: white; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35); }
.terminal-stream {
background: #0F172A; border-radius: 12px; padding: 12px 14px; font-family: monospace; font-size: 11.5px; color: #38BDF8;
height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
/* FAB */
.fab-studio {
position: absolute; bottom: 24px; right: 24px; width: 52px; height: 52px; border-radius: 16px;
background: var(--primary-gradient); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.4);
display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; z-index: 40;
}
.fab-studio svg { width: 24px; height: 24px; fill: white; }
/* 底部抽拉式 Sheet */
.bottom-sheet-mask {
position: absolute; top: 0; left: 0; right: 0; bottom: 0;
background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px);
z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.bottom-sheet-mask.open { opacity: 1; pointer-events: auto; }
.bottom-sheet {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%) translateY(100%);
width: min(92%, 560px);
background: #FFFFFF;
border-radius: 24px 24px 0 0;
border: 1.5px solid var(--divider);
border-bottom: none;
box-shadow: 0 -16px 45px rgba(15, 23, 42, 0.18);
transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
display: flex;
flex-direction: column;
max-height: 480px;
z-index: 101;
}
.bottom-sheet-mask.open .bottom-sheet { transform: translateX(-50%) translateY(0); }
.sheet-handle-bar { width: 44px; height: 4px; border-radius: 4px; background: #CBD5E1; margin: 10px auto 4px; }
.radar-fluid-icon {
position: relative; width: 32px; height: 32px; border-radius: 50%; background: #EFF6FF;
display: flex; align-items: center; justify-content: center;
}
.radar-ring {
position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--primary);
animation: radarWave 1.6s infinite ease-out;
}
@keyframes radarWave { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">手环配置</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<main class="fluid-studio">
<!-- 左列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="studio-card">
<div class="card-head">
<span class="card-title">手环设备信息</span>
<span id="fTag" style="font-size: 12px; color: var(--text-sub);">状态:未连接</span>
</div>
<div class="grid-2x2">
<div class="cell-box"><div class="cell-k">设备名称:</div><div class="cell-v" id="fName">未连接</div></div>
<div class="cell-box"><div class="cell-k">MAC 地址:</div><div class="cell-v" id="fMac">设备ID: 未知</div></div>
<div class="cell-box"><div class="cell-k">设备电量:</div><div class="cell-v" id="fBat">电量: 未知</div></div>
<div class="cell-box"><div class="cell-k">固件版本:</div><div class="cell-v" id="fFw">固件版本: 未知</div></div>
</div>
<div class="btn-row">
<button class="btn-red-link" onclick="fReset()">重置手环</button>
<button class="btn-dis-pill" id="fDisBtn" onclick="fDis()">断开连接</button>
</div>
</section>
<section class="studio-card">
<div class="card-head">
<span class="card-title">心率预警设置</span>
<input type="checkbox" checked style="accent-color: var(--primary);">
</div>
<div class="hr-box-list">
<div class="hr-box-item"><span style="font-size: 13px; font-weight: 600;">最低心率 (Min):</span><select class="hr-select"><option>40</option></select></div>
<div class="hr-box-item"><span style="font-size: 13px; font-weight: 600;">最高心率 (Max):</span><select class="hr-select"><option>180</option></select></div>
<div class="hr-box-item"><span style="font-size: 13px; font-weight: 600;">心率目标 (Goal):</span><select class="hr-select"><option>140</option></select></div>
</div>
<button class="btn-fluid-wide" onclick="fSaveHr()">保存警报阈值</button>
<div style="font-size: 12px; color: #10B981; font-weight: 600;">● 正在主动断开连接...</div>
</section>
</div>
<!-- 右列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="studio-card" style="flex: 1;">
<div class="card-head"><span class="card-title">历史离线数据同步</span></div>
<div style="display: flex; justify-content: space-between; align-items: center; background: #F8FAFC; border: 1px solid var(--divider); padding: 10px 14px; border-radius: 8px;">
<span style="font-size: 13px; font-weight: 600;">选择同步的时间段:</span>
<select class="hr-select"><option>过去 1 小时</option></select>
</div>
<button class="btn-fluid-wide blue" onclick="fSync()">一键同步历史心率/运动</button>
<span style="font-size: 13px; font-weight: 700; color: var(--text-main); margin-top: 4px;">同步日志控制台</span>
<div class="terminal-stream" id="fTerm">
<div>[STUDIO] 离线数据同步管道已建立...</div>
<div>正在主动断开连接...</div>
</div>
</section>
</div>
</main>
<!-- FAB -->
<button class="fab-studio" onclick="openFSheet()"><svg viewBox="0 0 24 24"><path d="M17.71 7.71L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88z"/></svg></button>
<!-- 底部抽拉式 Sheet -->
<div class="bottom-sheet-mask" id="fSheetMask" onclick="if(event.target===this) closeFSheet()">
<div class="bottom-sheet">
<div class="sheet-handle-bar"></div>
<div style="padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--divider);">
<div style="display: flex; align-items: center; gap: 10px;">
<div class="radar-fluid-icon"><div class="radar-ring"></div><svg width="16" height="16" viewBox="0 0 24 24" fill="#2563EB"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg></div>
<h2 style="font-size: 15px; font-weight: 700;">选择设备</h2>
</div>
<span style="cursor: pointer;" onclick="closeFSheet()">✕</span>
</div>
<div style="padding: 14px 20px; display: flex; flex-direction: column; gap: 8px;">
<div style="border: 1px solid var(--divider); padding: 12px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;" onclick="fPick('CL831-62200026', 'D9:24:0F:1C:55:FA')">
<div>
<div style="font-weight: 700; font-family: monospace;">CL831-62200026 <span style="background: #EFF6FF; color: var(--primary); font-size: 10px; padding: 2px 4px; border-radius: 4px;">BLE</span></div>
<div style="font-size: 11px; color: var(--text-sub); margin-top: 2px;">D9:24:0F:1C:55:FA · -89 dBm</div>
</div>
<button style="background: var(--primary); color: white; border: none; border-radius: 6px; padding: 6px 12px; font-weight: 700; font-size: 12px; cursor: pointer;">连接</button>
</div>
</div>
</div>
</div>
</div>
<script>
function fLog(t) {
const b = document.getElementById('fTerm');
const d = document.createElement('div');
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
b.appendChild(d);
b.scrollTop = b.scrollHeight;
}
function openFSheet() { document.getElementById('fSheetMask').classList.add('open'); fLog("从底部抽拉展开【选择设备】面板..."); }
function closeFSheet() { document.getElementById('fSheetMask').classList.remove('open'); }
function fPick(n, m) {
closeFSheet();
fLog(`建立连接 [${n}]...`);
setTimeout(() => {
document.getElementById('fName').innerText = n;
document.getElementById('fMac').innerText = m;
document.getElementById('fBat').innerText = "88% (正常)";
document.getElementById('fFw').innerText = "v2.1.04";
document.getElementById('fTag').innerText = "状态:已连接";
document.getElementById('fTag').style.color = "#10B981";
document.getElementById('fDisBtn').classList.add('active');
fLog(`手环 [${n}] 已连接在线!`);
}, 500);
}
function fDis() {
document.getElementById('fName').innerText = "未连接";
document.getElementById('fMac').innerText = "设备ID: 未知";
document.getElementById('fBat').innerText = "电量: 未知";
document.getElementById('fFw').innerText = "固件版本: 未知";
document.getElementById('fTag').innerText = "状态:未连接";
document.getElementById('fDisBtn').classList.remove('active');
fLog("正在主动断开连接...");
}
function fReset() { fLog("发送重置指令..."); alert("手环重置请求已发送!"); }
function fSaveHr() { fLog("保存心率预警阈值成功!"); alert("心率预警保存成功!"); }
function fSync() { fLog("离线同步历史数据完成!"); alert("历史离线数据同步完成!"); }
</script>
</body>
</html>
@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>【手环配置】全新架构 5 套竞标方案全景对比看板 (支持底部抽拉 Sheet 与实时日志交互)</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
background: #0F172A;
color: #F8FAFC;
min-height: 100vh;
display: flex;
flex-direction: column;
}
header {
padding: 14px 24px;
background: #1E293B;
border-bottom: 1px solid #334155;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
h1 { font-size: 16.5px; font-weight: 700; color: #38BDF8; white-space: nowrap; }
.tabs { display: flex; gap: 8px; overflow-x: auto; }
.tab-btn {
padding: 8px 14px;
background: #334155;
color: #CBD5E1;
border: 1px solid #475569;
border-radius: 8px;
cursor: pointer;
font-size: 12.5px;
font-weight: 600;
white-space: nowrap;
transition: all 0.2s;
}
.tab-btn:hover { background: #475569; color: #FFF; }
.tab-btn.active { background: #2563EB; color: #FFF; border-color: #3B82F6; box-shadow: 0 0 12px rgba(37, 99, 235, 0.4); }
.preview-container {
flex: 1;
display: flex;
position: relative;
}
iframe {
width: 100%;
height: calc(100vh - 65px);
border: none;
background: #EEF2F6;
}
</style>
</head>
<body>
<header>
<h1>【手环配置】全新 5 套竞标方案(支持底部抽拉 Sheet & 交互控制台)</h1>
<div class="tabs">
<button class="tab-btn active" onclick="loadFrame('option_1_ipados_island.html', this)">方案 1:Apple HealthKit Pro 灵动双栏 (推荐)</button>
<button class="tab-btn" onclick="loadFrame('option_2_neo_bento.html', this)">方案 2:Linear Precision 极客网格</button>
<button class="tab-btn" onclick="loadFrame('option_3_cyber_obsidian.html', this)">方案 3:Sport Racing 运动遥测风</button>
<button class="tab-btn" onclick="loadFrame('option_4_nordic_slate.html', this)">方案 4:Nordic Slate 极简极净风格</button>
<button class="tab-btn" onclick="loadFrame('option_5_master_detail_hub.html', this)">方案 5:Fluid Studio 流体双栏</button>
</div>
</header>
<div class="preview-container">
<iframe id="main-frame" src="option_1_ipados_island.html"></iframe>
</div>
<script>
function loadFrame(src, btn) {
document.getElementById('main-frame').src = src;
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
}
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

+30 -2
View File
@@ -32,7 +32,7 @@
| 2 | `版型切换/` | `Screenshot_20260812_143347.png` | ✅ | **已完工**(6 件齐) |
| 3 | `心率区间设置/` | `Screenshot_20260817-135129.png` | ✅ | **已完工**(6 件齐) |
| 4 | `自动连接配置/` | `Screenshot_20260812_143357.png` | ✅ | **已完工**(6 件齐) |
| 5 | `手环配置/` | `Screenshot_20260812_143405.png` | ❌ | 待办 |
| 5 | `手环配置/` | `Screenshot_20260812_143405.png` | ✅ | **已完工**(6 件齐) |
| 6 | `DFU固件升级/` | `Screenshot_20260812_143413.png` | ❌ | 待办 |
| 7 | `用户管理/` | `Screenshot_20260812_143424.png` | ❌ | 待办 |
| 8 | `设备数据库管理/` | `Screenshot_20260812_143432.png` | ❌ | 待办 |
@@ -115,7 +115,35 @@
---
## 📐 全局栅格比例与动态响应式页边距规范 (Fluid Layout & Split Standard)
## 🎨 全局核心主色蓝统一规范 (Global Primary Blue Standard)
为了彻底消除各页面蓝色色号不一致(如部分页面出现偏紫蓝 `#3949AB`、深藏青 `#1A237E` 等杂色)的问题,**所有 11 个设置子页面的所有蓝色元素必须 100% 严格统一使用以下唯一的极客科技蓝 Token 体系**:
```css
/* =========================================================================
全局核心主色蓝统一规范 (Global Primary Blue Token Standard)
========================================================================= */
:root {
--color-primary: #2563EB; /* 核心主色蓝 (Royal Tech Blue) */
--color-primary-dark: #1D4ED8; /* 深蓝 / Hover 悬停态 */
--color-on-primary-container: #1E40AF; /* 选中深色文字 / 高亮标题 */
--color-primary-light: #EFF6FF; /* 极浅蓝背景 / 选中浅底容器 */
--color-primary-container: #EFF6FF; /* 选中卡片微底 */
--color-primary-border: #DBEAFE; /* 浅蓝边框 (Border / Chip) */
--color-primary-glow: rgba(37, 99, 235, 0.25); /* 蓝色弥散发光与阴影 */
--color-primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%); /* 渐变主按钮 */
}
```
### 🎯 蓝色应用强制约束原则
1. **标题与分区卡片名**:所有卡片标题、分类标题、模块主文案一律使用 `--color-primary` (`#2563EB`);
2. **选中态组件**:
- 单选框 Radio、复选框 Checkbox、滑动开关 Switch 开启态、滑块 Slider 游标与轨道;
- 选中的卡片边框(`border-color: #2563EB`)、选中左侧光条(`background: #2563EB`)、选中底色(`background: #EFF6FF`);
3. **主操作按钮**:一律采用 `--color-primary` 或 `--color-primary-gradient`;
4. **普通强调蓝色文字与标签**:如 `BLE` 协议标签、时段读数、选中文本一律采用 `#2563EB`,浅底搭配 `#EFF6FF`。
---
为了彻底杜绝大屏幕固定像素导致的不适配与留白失衡,所有设置页面实行统一的 **自适应动态页边距体系**,并按业务类型划分为两大栅格策略:
@@ -31,8 +31,10 @@
--color-z1-glow: rgba(142, 142, 147, 0.35);
/* ── 核心品牌与基础表面 ── */
--color-primary: #3949AB;
--color-primary-container: #EEF2FF;
--color-primary: #2563EB;
--color-primary-dark: #1D4ED8;
--color-primary-container: #EFF6FF;
--color-primary-glow: rgba(37, 99, 235, 0.25);
--color-surface: #FFFFFF;
--color-surface-variant: #F8FAFC;
--color-background: #F1F5F9;
@@ -205,7 +207,7 @@ body {
border-radius: 50%;
background: var(--color-primary);
border: 2px solid #FFF;
box-shadow: 0 2px 8px rgba(57, 73, 171, 0.4);
box-shadow: 0 2px 8px var(--color-primary-glow);
cursor: pointer;
transition: transform 0.15s ease;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB

After

Width:  |  Height:  |  Size: 227 KiB

@@ -0,0 +1,28 @@
# UI 交付任务卡 (CARD-20260817-UITask-手环配置)
- **页面名称**:手环配置
- **原机截屏**:`Screenshot_20260812_143405.png`
- **中选方案**:方案 5 (Fluid Modern Studio 双栏 + 底部抽拉 Sheet + 实时日志控制台)
- **交付状态**:`COMPLETED (6 件齐)`
- **交付日期**:2026-08-17
---
## 交付文件清单
1. 📷 **原厂截屏**:[`Screenshot_20260812_143405.png`](file:///Users/z/source/repos/kmcc/EAP_Interface_html/设置页面UI优化/手环配置/Screenshot_20260812_143405.png)
2. 🖼️ **高保真渲染图**:[`image.png`](file:///Users/z/source/repos/kmcc/EAP_Interface_html/设置页面UI优化/手环配置/image.png)
3. 💻 **标准交互前端**:[`baseline_ui.html`](file:///Users/z/source/repos/kmcc/EAP_Interface_html/设置页面UI优化/手环配置/baseline_ui.html)
4. 📐 **设计规格文档**:[`DESIGN_SPEC.md`](file:///Users/z/source/repos/kmcc/EAP_Interface_html/设置页面UI优化/手环配置/DESIGN_SPEC.md)
5. 📝 **工程实施计划**:[`implementation_plan.md`](file:///Users/z/source/repos/kmcc/EAP_Interface_html/设置页面UI优化/手环配置/implementation_plan.md)
6. 🗂️ **UI 任务卡片**:[`CARD-20260817-UITask-手环配置.md`](file:///Users/z/source/repos/kmcc/EAP_Interface_html/设置页面UI优化/手环配置/CARD-20260817-UITask-手环配置.md)
---
## 核心设计与交互指标
- **版面布局**:1:1 流体双栏自适应体系,左侧承载设备信息与心率预警,右侧承载离线数据同步与全高度日志控制台;
- **抽拉面板**:从底部向上抽拉的 Bottom Sheet 面板,配备拖拽把手、左上角动态雷达声呐波纹、排序/过滤 Chips 与设备发现列表;
- **悬浮按钮**:右下角常驻 52dp 悬浮蓝牙 FAB;
- **控制台终端**:深色 Terminal 实时打印带时间戳的蓝牙操作日志;
- **规范遵循**:40dp 纯净透明 AppBar 触控槽 + `clamp(16px, 2.5vw, 32px)` 动态响应式页边距。
@@ -0,0 +1,49 @@
# 【手环配置】设计规格规范 (DESIGN_SPEC.md)
## 1. 业务功能与信息架构
- **页面定位**:心率手环 BLE 连接管理、运行参数遥测、心率预警区间阈值下发与离线运动历史数据拉取终端。
- **页面形态**:现代流体双栏仪表盘架构(左侧硬件参数与心率预警核心栈 + 右侧离线同步与实时日志控制台) + 底部平滑抽拉式设备选择面板(Bottom Sheet Drawer)。
---
## 2. 字段与槽位 100% 完整度对照
| 区域 / 组件 | 字段 / 控件名称 | 视觉与默认值 | 交互响应 |
| :--- | :--- | :--- | :--- |
| **AppBar** | 返回按键 `(←)` | 40dp 纯净圆形透明触控槽 | 点击返回上一级菜单 |
| | 页面标题 | `手环配置` (19px 粗体) | 居左对齐 |
| | 更多操作 `(⋮)` | 40dp 纯净圆形透明触控槽 | 点击展开辅助菜单 |
| **手环设备信息** | 标题与状态 | `手环设备信息` + `状态:未连接` / `状态:已连接` | 实时根据连接状态点亮绿色徽章 |
| | 设备名称 | `设备名称: 未连接` / `CL831-62200026` | 动态绑定 GATT 配对设备名 |
| | MAC 地址 | `MAC 地址: 设备ID: 未知` / `D9:24:0F:1C:55:FA` | 等宽字体展示 MAC |
| | 设备电量 | `设备电量: 电量: 未知` / `88% (正常)` | 实时电量遥测数值 |
| | 固件版本 | `固件版本: 固件版本: 未知` / `v2.1.04-BLE` | 固件版本号 |
| | 重置手环 | `重置手环` (红色危险文字按钮) | 点击下发 Factory Reset 并在控制台打印 |
| | 断开连接 | `断开连接` (主控胶囊按钮) | 点击断开释放链路或唤起底部抽拉面板 |
| **心率预警设置** | 标题与开关 | `心率预警设置` + Switch 滑动开关 | 开启/关闭心率预警监控 |
| | 最低心率 (Min) | `最低心率 (Min):` + 下拉选择 (`40`, `50`, `60`) | 调整最低心率阈值 |
| | 最高心率 (Max) | `最高心率 (Max):` + 下拉选择 (`40`, `160`, `180`, `200`) | 调整最高心率阈值 |
| | 心率目标 (Goal) | `心率目标 (Goal):` + 下拉选择 (`40`, `130`, `140`, `150`) | 调整目标心率阈值 |
| | 保存警报阈值 | `保存警报阈值` (宽卡片按钮) | 点击下发寄存器,弹出 Toast 并在控制台记录 |
| | 状态指示文本 | `● 正在主动断开连接...` / `● 设备已在线` | 实时连接状态文字指示 |
| **历史离线数据同步** | 同步时间段选择 | `选择同步的时间段:` + 下拉框 (`过去 1 小时`, `过去 6 小时`...) | 选择拉取的时间跨度 |
| | 一键同步动作 | `一键同步历史心率/运动` (渐变主色宽按钮) | 触发离线数据包拉取动效与校验 |
| | 同步日志控制台 | `同步日志控制台` + 深色终端 HUD | 实时滚屏追加带时间戳的彩色日志流 |
| **右下角悬浮按钮** | 蓝牙 FAB 按钮 | 52dp 悬浮胶囊 `ᛒ` 图标 | 点击平滑从屏幕底部向上抽拉【选择设备】面板 |
| **底部抽拉面板** | 顶部阻尼把手 | 44×5dp 居中灰色圆角把手 | 抽屉把手 |
| | 左上角动态雷达 | 动态声呐扩散脉冲动画波纹 + `选择设备` | 实时声呐波纹旋转与扩散 |
| | 排序/过滤 Chips | `✓ 扫描顺序`, `名称`, `信号强度`, `类型` | 点击切换列表排序策略 |
| | 扫描设备列表 | `CL831-62200026`, `CL831-2200006` 等 (右侧展示 `BLE` 协议标签,移除冗余连接按钮) | 点击设备条目整行直连手环并自动收起面板 |
| | 暂停/继续扫描 | `暂停扫描` / `继续扫描` 切换按钮 | 控制蓝牙广播扫描启停 |
---
## 3. 设计 Token 与视觉规范
- **全局响应式页边距**:`padding: clamp(16px, 2.5vw, 32px);`
- **容器最大宽度**:`max-width: min(100%, 1160px);`
- **双栏栅格间距**:`gap: clamp(16px, 2vw, 24px);`
- **主色调**:`#2563EB` (Primary), `linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%)` (Gradient)
- **控制台终端背景**:`#0F172A` (Slate Dark), 终端文字 `#94A3B8` / `#38BDF8`
- **圆角体系**:外层容器 20px,主卡片 16px,参数块 10px,底部抽拉 Sheet 28px。
@@ -0,0 +1,849 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>手环配置</title>
<style>
:root {
--primary: #2563EB;
--primary-hover: #1D4ED8;
--primary-light: #EFF6FF;
--primary-glow: rgba(37, 99, 235, 0.25);
--primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
--bg: #EEF2F6;
--surface: #FFFFFF;
--surface-sub: #F8FAFC;
--text-main: #0F172A;
--text-sub: #64748B;
--text-dim: #94A3B8;
--divider: #E2E8F0;
--danger: #EF4444;
--danger-light: #FEF2F2;
--success: #10B981;
--success-light: #ECFDF5;
--terminal-bg: #0F172A;
--terminal-text: #38BDF8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", Roboto, sans-serif;
background: var(--bg);
color: var(--text-main);
min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px);
display: flex;
flex-direction: column;
-webkit-font-smoothing: antialiased;
}
.device-wrapper {
width: 100%;
max-width: min(100%, 1160px);
margin: 0 auto;
background: var(--surface);
border-radius: 20px;
border: 1px solid var(--divider);
box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
overflow: hidden;
position: relative;
min-height: 640px;
display: flex;
flex-direction: column;
}
/* =========================================================================
1. AppBar 统一全局规范
========================================================================= */
.appbar {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
border-bottom: 1px solid var(--divider);
background: var(--surface);
flex-shrink: 0;
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px;
height: 40px;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
background: transparent;
border: none;
transition: all 0.15s ease;
}
.appbar-nav:hover, .appbar-more:hover {
background: rgba(15, 23, 42, 0.06);
transform: scale(0.96);
}
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
/* =========================================================================
2. 主界面流体双栏仪表盘 (Fluid Studio Dual-Column)
========================================================================= */
.main-dashboard {
padding: clamp(20px, 2.5vw, 30px);
display: grid;
grid-template-columns: 1fr 1fr;
gap: clamp(16px, 2vw, 24px);
background: #F8FAFC;
flex: 1;
overflow-y: auto;
max-height: calc(100vh - 120px);
}
.dash-column {
display: flex;
flex-direction: column;
gap: 18px;
}
.card-box {
background: var(--surface);
border: 1.5px solid var(--divider);
border-radius: 16px;
padding: 22px;
display: flex;
flex-direction: column;
gap: 16px;
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
transition: all 0.2s ease;
}
.card-box:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05); }
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--divider);
padding-bottom: 12px;
}
.card-title-group {
display: flex;
align-items: center;
gap: 8px;
}
.card-title {
font-size: 16px;
font-weight: 700;
color: var(--primary);
}
.conn-tag {
font-size: 12px;
font-weight: 700;
color: var(--text-sub);
background: #F1F5F9;
padding: 3px 9px;
border-radius: 100px;
transition: all 0.2s ease;
}
.conn-tag.online {
background: var(--success-light);
color: var(--success);
}
/* 2.1 手环设备信息 4格网格 */
.device-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.param-tile {
background: #F8FAFC;
border: 1px solid var(--divider);
border-radius: 10px;
padding: 10px 14px;
}
.param-label { font-size: 11.5px; color: var(--text-sub); margin-bottom: 2px; }
.param-value {
font-size: 13.5px;
font-weight: 700;
color: var(--text-main);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.device-action-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 4px;
}
.btn-text-danger {
background: transparent;
color: var(--danger);
border: none;
font-size: 13.5px;
font-weight: 700;
cursor: pointer;
padding: 6px 10px;
border-radius: 6px;
transition: background 0.15s;
}
.btn-text-danger:hover { background: var(--danger-light); }
.btn-disconnect {
background: #E2E8F0;
color: var(--text-sub);
border: none;
font-size: 13px;
font-weight: 700;
padding: 8px 20px;
border-radius: 9px;
cursor: pointer;
transition: all 0.2s ease;
}
.btn-disconnect.active {
background: var(--primary-gradient);
color: white;
box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-disconnect.active:hover { transform: translateY(-1px); }
/* 2.2 心率预警设置 */
.switch { position: relative; width: 46px; height: 25px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
background-color: #CBD5E1; transition: .25s; border-radius: 25px;
}
.slider:before {
position: absolute; content: ""; height: 19px; width: 19px; left: 3px; bottom: 3px;
background-color: white; transition: .25s; border-radius: 50%;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(21px); }
.hr-control-stack {
display: flex;
flex-direction: column;
gap: 8px;
}
.hr-control-row {
display: flex;
align-items: center;
justify-content: space-between;
background: #F8FAFC;
border: 1px solid var(--divider);
border-radius: 10px;
padding: 10px 14px;
}
.hr-row-label { font-size: 13px; font-weight: 600; color: var(--text-main); }
.custom-select {
background: white;
border: 1.5px solid var(--divider);
border-radius: 8px;
padding: 5px 28px 5px 12px;
font-size: 13.5px;
font-weight: 700;
color: var(--primary);
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748B' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 8px center;
cursor: pointer;
transition: border-color 0.15s;
}
.custom-select:hover, .custom-select:focus { border-color: var(--primary); outline: none; }
.btn-wide-action {
width: 100%;
background: #E2E8F0;
color: #334155;
border: none;
padding: 11px;
border-radius: 10px;
font-size: 13.5px;
font-weight: 700;
cursor: pointer;
transition: all 0.2s;
}
.btn-wide-action:hover { background: #CBD5E1; color: var(--text-main); }
.status-hint-text {
font-size: 12px;
color: var(--success);
font-weight: 600;
display: flex;
align-items: center;
gap: 6px;
}
/* 2.3 历史离线数据同步与控制台 */
.sync-time-row {
display: flex;
align-items: center;
justify-content: space-between;
background: #F8FAFC;
border: 1px solid var(--divider);
border-radius: 10px;
padding: 10px 14px;
}
.btn-sync-primary {
width: 100%;
background: var(--primary-gradient);
color: white;
border: none;
padding: 11px;
border-radius: 10px;
font-size: 13.5px;
font-weight: 700;
cursor: pointer;
box-shadow: 0 4px 14px var(--primary-glow);
transition: all 0.2s;
}
.btn-sync-primary:hover {
transform: translateY(-1px);
box-shadow: 0 6px 18px var(--primary-glow);
}
.terminal-container {
display: flex;
flex-direction: column;
gap: 8px;
flex: 1;
margin-top: 4px;
}
.terminal-title { font-size: 13px; font-weight: 700; color: var(--text-main); }
.terminal-hud {
background: var(--terminal-bg);
border-radius: 12px;
border: 1px solid #334155;
padding: 12px 14px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 11.5px;
color: #94A3B8;
height: 150px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 4px;
}
.term-line { line-height: 1.5; }
.term-line.info { color: #38BDF8; }
.term-line.success { color: #4ADE80; }
.term-line.warn { color: #FBBF24; }
/* =========================================================================
3. 右下角悬浮蓝牙按钮 (FAB)
========================================================================= */
.bluetooth-fab {
position: absolute;
bottom: 24px;
right: 24px;
width: 52px;
height: 52px;
border-radius: 16px;
background: var(--surface);
border: 1.5px solid var(--divider);
box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
z-index: 50;
}
.bluetooth-fab:hover {
transform: scale(1.08) translateY(-2px);
border-color: var(--primary);
box-shadow: 0 14px 30px var(--primary-glow);
}
.bluetooth-fab svg { width: 24px; height: 24px; fill: var(--primary); }
/* =========================================================================
4. 底部抽拉式 Sheet (Bottom Sheet Drawer)
========================================================================= */
.bottom-sheet-mask {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(15, 23, 42, 0.45);
backdrop-filter: blur(4px);
z-index: 100;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}
.bottom-sheet-mask.open { opacity: 1; pointer-events: auto; }
.bottom-sheet {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%) translateY(100%);
width: min(92%, 560px);
background: var(--surface);
border-radius: 24px 24px 0 0;
border: 1.5px solid var(--divider);
border-bottom: none;
box-shadow: 0 -16px 45px rgba(15, 23, 42, 0.2);
transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
display: flex;
flex-direction: column;
max-height: 490px;
z-index: 101;
}
.bottom-sheet-mask.open .bottom-sheet { transform: translateX(-50%) translateY(0); }
.sheet-handle-bar {
width: 44px;
height: 5px;
border-radius: 10px;
background: #CBD5E1;
margin: 10px auto 4px;
cursor: grab;
}
.sheet-head {
padding: 12px 24px 14px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--divider);
}
.sheet-title-box { display: flex; align-items: center; gap: 10px; }
/* 动态雷达波纹动效 */
.radar-scanner {
position: relative;
width: 34px;
height: 34px;
border-radius: 50%;
background: var(--primary-light);
display: flex;
align-items: center;
justify-content: center;
}
.radar-ring {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
border: 2px solid var(--primary);
animation: radarWave 1.8s infinite ease-out;
}
@keyframes radarWave {
0% { transform: scale(0.6); opacity: 1; }
100% { transform: scale(1.6); opacity: 0; }
}
.radar-scanner svg { width: 18px; height: 18px; fill: var(--primary); z-index: 2; }
.sheet-close-btn {
width: 32px; height: 32px; border-radius: 50%; border: none; background: #F1F5F9;
cursor: pointer; display: flex; align-items: center; justify-content: center;
color: var(--text-sub); font-size: 16px; font-weight: 700; transition: all 0.15s;
}
.sheet-close-btn:hover { background: #E2E8F0; color: var(--text-main); }
/* 排序与过滤 Chips */
.sheet-chips-line {
padding: 10px 24px;
background: #F8FAFC;
display: flex;
gap: 8px;
border-bottom: 1px solid var(--divider);
overflow-x: auto;
}
.filter-chip {
padding: 5px 14px;
border-radius: 100px;
font-size: 12px;
font-weight: 600;
border: 1px solid var(--divider);
background: white;
cursor: pointer;
white-space: nowrap;
transition: all 0.15s ease;
}
.filter-chip.active {
background: var(--primary-light);
color: var(--primary);
border-color: #BFDBFE;
}
/* 扫描设备列表 */
.sheet-device-list {
padding: 14px 24px;
display: flex;
flex-direction: column;
gap: 10px;
overflow-y: auto;
max-height: 220px;
}
.device-item-card {
border: 1.5px solid var(--divider);
border-radius: 14px;
padding: 12px 16px;
display: flex;
align-items: center;
justify-content: space-between;
background: white;
transition: all 0.15s ease;
cursor: pointer;
}
.device-item-card:hover {
border-color: var(--primary);
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
.dev-badge-ble-right {
background: #EFF6FF;
color: var(--primary);
font-size: 12px;
font-weight: 800;
padding: 4px 10px;
border-radius: 6px;
border: 1px solid #DBEAFE;
letter-spacing: 0.5px;
}
.sheet-foot {
padding: 14px 24px 20px;
border-top: 1px solid var(--divider);
background: #F8FAFC;
}
.btn-pause-scan {
width: 100%;
background: #DCFCE7;
color: #15803D;
border: 1px solid #BBF7D0;
padding: 10px;
border-radius: 12px;
font-size: 13.5px;
font-weight: 700;
cursor: pointer;
transition: all 0.15s;
}
.btn-pause-scan:hover { background: #BBF7D0; }
/* Toast 提示 */
.toast-msg {
position: absolute;
top: 70px;
left: 50%;
transform: translateX(-50%) translateY(-20px);
background: rgba(15, 23, 42, 0.9);
color: white;
padding: 8px 20px;
border-radius: 30px;
font-size: 13px;
font-weight: 600;
opacity: 0;
pointer-events: none;
transition: all 0.25s ease;
z-index: 200;
}
.toast-msg.show { opacity: 1; transform: translateX(-50%) translateY(0); }
</style>
</head>
<body>
<div class="device-wrapper">
<div id="toast" class="toast-msg">提示消息</div>
<!-- AppBar 统一规范 -->
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav" title="返回"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">手环配置</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<!-- 主体流体双栏布局 -->
<main class="main-dashboard">
<!-- 左列:手环设备信息与心率预警 -->
<div class="dash-column">
<!-- 1. 手环设备信息 -->
<section class="card-box">
<div class="card-header">
<div class="card-title-group">
<span class="card-title">手环设备信息</span>
</div>
<span class="conn-tag" id="connStatusBadge">状态:未连接</span>
</div>
<div class="device-grid">
<div class="param-tile">
<div class="param-label">设备名称:</div>
<div class="param-value" id="valDevName">未连接</div>
</div>
<div class="param-tile">
<div class="param-label">MAC 地址:</div>
<div class="param-value" id="valMac">设备ID: 未知</div>
</div>
<div class="param-tile">
<div class="param-label">设备电量:</div>
<div class="param-value" id="valBattery">电量: 未知</div>
</div>
<div class="param-tile">
<div class="param-label">固件版本:</div>
<div class="param-value" id="valFirmware">固件版本: 未知</div>
</div>
</div>
<div class="device-action-row">
<button class="btn-text-danger" onclick="triggerReset()">重置手环</button>
<button class="btn-disconnect" id="btnDisconnect" onclick="toggleDisconnect()">断开连接</button>
</div>
</section>
<!-- 2. 心率预警设置 -->
<section class="card-box">
<div class="card-header">
<div class="card-title-group">
<span class="card-title">心率预警设置</span>
</div>
<label class="switch"><input type="checkbox" id="swHrAlert" checked onchange="toggleHrSwitch()"><span class="slider"></span></label>
</div>
<div class="hr-control-stack">
<div class="hr-control-row">
<span class="hr-row-label">最低心率 (Min):</span>
<select class="custom-select" id="selMinHr"><option>40</option><option>50</option><option>60</option></select>
</div>
<div class="hr-control-row">
<span class="hr-row-label">最高心率 (Max):</span>
<select class="custom-select" id="selMaxHr"><option>40</option><option>160</option><option selected>180</option><option>200</option></select>
</div>
<div class="hr-control-row">
<span class="hr-row-label">心率目标 (Goal):</span>
<select class="custom-select" id="selGoalHr"><option>40</option><option>130</option><option selected>140</option><option>150</option></select>
</div>
</div>
<button class="btn-wide-action" onclick="saveHrThresholds()">保存警报阈值</button>
<div class="status-hint-text" id="statusHintText">● 正在主动断开连接...</div>
</section>
</div>
<!-- 右列:历史离线数据同步与日志控制台 -->
<div class="dash-column">
<section class="card-box" style="flex: 1;">
<div class="card-header">
<div class="card-title-group">
<span class="card-title">历史离线数据同步</span>
</div>
</div>
<div class="sync-time-row">
<span style="font-size: 13.5px; font-weight: 600; color: var(--text-main);">选择同步的时间段:</span>
<select class="custom-select" id="selSyncDuration" style="min-width: 140px;">
<option>过去 1 小时</option>
<option>过去 6 小时</option>
<option>过去 24 小时</option>
<option>全部离线历史</option>
</select>
</div>
<button class="btn-sync-primary" onclick="startSyncOfflineData()">一键同步历史心率/运动</button>
<!-- 同步日志控制台 -->
<div class="terminal-container">
<span class="terminal-title">同步日志控制台</span>
<div class="terminal-hud" id="logTerminal">
<div class="term-line info">[系统就绪] 手环管理服务已启动,等待指令...</div>
<div class="term-line">正在主动断开连接...</div>
</div>
</div>
</section>
</div>
</main>
<!-- 右下角悬浮蓝牙按钮 (FAB) -->
<button class="bluetooth-fab" id="btFab" title="扫描并选择手环" onclick="openBottomSheet()">
<svg viewBox="0 0 24 24"><path d="M17.71 7.71L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88z"/></svg>
</button>
<!-- 底部抽拉式 Sheet (Bottom Sheet) -->
<div class="bottom-sheet-mask" id="sheetMask" onclick="if(event.target===this) closeBottomSheet()">
<div class="bottom-sheet">
<div class="sheet-handle-bar"></div>
<div class="sheet-head">
<div class="sheet-title-box">
<div class="radar-scanner">
<div class="radar-ring"></div>
<svg viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>
</div>
<h2 style="font-size: 16px; font-weight: 700;">选择设备</h2>
</div>
<button class="sheet-close-btn" onclick="closeBottomSheet()">✕</button>
</div>
<div class="sheet-chips-line">
<span class="filter-chip active" onclick="toggleChip(this)">✓ 扫描顺序</span>
<span class="filter-chip" onclick="toggleChip(this)">名称</span>
<span class="filter-chip" onclick="toggleChip(this)">信号强度</span>
<span class="filter-chip" onclick="toggleChip(this)">类型</span>
</div>
<div class="sheet-device-list">
<div class="device-item-card" onclick="connectDevice('CL831-62200026', 'D9:24:0F:1C:55:FA', '88%')">
<div>
<div style="font-weight: 700; font-size: 14.5px; font-family: ui-monospace, SFMono-Regular, monospace; color: var(--text-main);">
CL831-62200026
</div>
<div style="font-size: 11.5px; color: var(--text-sub); margin-top: 3px;">
D9:24:0F:1C:55:FA · 信号: -89 dBm
</div>
</div>
<span class="dev-badge-ble-right">BLE</span>
</div>
<div class="device-item-card" onclick="connectDevice('CL831-2200006', 'DF:16:BC:22:2E:5B', '95%')">
<div>
<div style="font-weight: 700; font-size: 14.5px; font-family: ui-monospace, SFMono-Regular, monospace; color: var(--text-main);">
CL831-2200006
</div>
<div style="font-size: 11.5px; color: var(--text-sub); margin-top: 3px;">
DF:16:BC:22:2E:5B · 信号: -98 dBm
</div>
</div>
<span class="dev-badge-ble-right">BLE</span>
</div>
</div>
<div class="sheet-foot">
<button class="btn-pause-scan" id="btnScanToggle" onclick="toggleScanState()">暂停扫描</button>
</div>
</div>
</div>
</div>
<script>
let isScanning = true;
let isConnected = false;
function showToast(msg) {
const t = document.getElementById('toast');
t.innerText = msg;
t.classList.add('show');
setTimeout(() => t.classList.remove('show'), 2000);
}
function appendLog(text, type = '') {
const box = document.getElementById('logTerminal');
const time = new Date().toTimeString().split(' ')[0];
const div = document.createElement('div');
div.className = `term-line ${type}`;
div.innerText = `[${time}] ${text}`;
box.appendChild(div);
box.scrollTop = box.scrollHeight;
}
function openBottomSheet() {
document.getElementById('sheetMask').classList.add('open');
appendLog("从底部抽拉展开【选择设备】面板,雷达声呐正在捕获 BLE 广播...", "info");
}
function closeBottomSheet() {
document.getElementById('sheetMask').classList.remove('open');
}
function toggleChip(el) {
document.querySelectorAll('.filter-chip').forEach(c => {
c.classList.remove('active');
c.innerText = c.innerText.replace('✓ ', '');
});
el.classList.add('active');
el.innerText = '✓ ' + el.innerText;
appendLog(`设备发现列表排序规则已切换为: ${el.innerText}`, "info");
}
function toggleScanState() {
const btn = document.getElementById('btnScanToggle');
if (isScanning) {
isScanning = false;
btn.innerText = "继续扫描";
btn.style.background = "#FEF3C7";
btn.style.color = "#D97706";
btn.style.borderColor = "#FDE68A";
appendLog("已暂停 BLE 广播扫描。", "warn");
} else {
isScanning = true;
btn.innerText = "暂停扫描";
btn.style.background = "#DCFCE7";
btn.style.color = "#15803D";
btn.style.borderColor = "#BBF7D0";
appendLog("已恢复 BLE 广播扫描...", "info");
}
}
function connectDevice(name, mac, battery) {
closeBottomSheet();
showToast(`正在连接手环 ${name}...`);
appendLog(`正在尝试与设备 [${name} | ${mac}] 建立 GATT 连接...`, "info");
setTimeout(() => {
isConnected = true;
document.getElementById('valDevName').innerText = name;
document.getElementById('valMac').innerText = mac;
document.getElementById('valBattery').innerText = `${battery} (正常)`;
document.getElementById('valFirmware').innerText = "v2.1.04-BLE";
document.getElementById('connStatusBadge').innerText = "状态:已连接";
document.getElementById('connStatusBadge').classList.add('online');
document.getElementById('btnDisconnect').classList.add('active');
document.getElementById('statusHintText').innerText = `● 设备已在线 [${name}]`;
document.getElementById('statusHintText').style.color = "var(--success)";
appendLog(`成功连接到手环 [${name}]!设备电量: ${battery},固件: v2.1.04-BLE`, "success");
showToast(`已成功连接 ${name}`);
}, 700);
}
function toggleDisconnect() {
if (!isConnected) {
openBottomSheet();
return;
}
isConnected = false;
document.getElementById('valDevName').innerText = "未连接";
document.getElementById('valMac').innerText = "设备ID: 未知";
document.getElementById('valBattery').innerText = "电量: 未知";
document.getElementById('valFirmware').innerText = "固件版本: 未知";
document.getElementById('connStatusBadge').innerText = "状态:未连接";
document.getElementById('connStatusBadge').classList.remove('online');
document.getElementById('btnDisconnect').classList.remove('active');
document.getElementById('statusHintText').innerText = "● 正在主动断开连接...";
document.getElementById('statusHintText').style.color = "#64748B";
appendLog("正在主动断开连接... 设备已释放。", "warn");
showToast("已断开手环连接");
}
function triggerReset() {
appendLog("向手环发送重置指令 (Factory Reset)...", "warn");
showToast("手环重置指令已下发");
}
function toggleHrSwitch() {
const checked = document.getElementById('swHrAlert').checked;
appendLog(`心率预警总开关已切换为: ${checked ? '开启 (ON)' : '关闭 (OFF)'}`, "info");
}
function saveHrThresholds() {
const min = document.getElementById('selMinHr').value;
const max = document.getElementById('selMaxHr').value;
const goal = document.getElementById('selGoalHr').value;
appendLog(`保存警报阈值成功 -> 最低: ${min} BPM | 最高: ${max} BPM | 目标: ${goal} BPM`, "success");
showToast("心率预警阈值保存成功!");
}
function startSyncOfflineData() {
if (!isConnected) {
showToast("请先连接手环后再同步离线数据!");
appendLog("同步失败:未检测到已连接的手环设备。", "warn");
openBottomSheet();
return;
}
const dur = document.getElementById('selSyncDuration').value;
appendLog(`开始同步 [${dur}] 离线历史数据包...`, "info");
showToast(`正在同步 ${dur} 数据...`);
setTimeout(() => {
appendLog(`离线数据包同步完成:共拉取 320 条心率/运动原始帧数据,校验无误。`, "success");
showToast("历史离线数据同步完成!");
}, 1200);
}
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

@@ -0,0 +1,35 @@
# 【手环配置】实施工程计划 (implementation_plan.md)
## 1. 目标与范围
重构手环配置页面,将其从原始单调生硬的上下垂直灰条堆叠,升级为 **高质感现代流体双栏仪表盘架构**,同时将传统的居中设备弹窗重构为 **从底部平滑抽拉的 Bottom Sheet 面板**,并在历史离线数据同步模块下方集成 **实时滚屏日志控制台 Terminal**。
---
## 2. 核心实施模块
1. **结构与布局升级**:
- 顶部统一 40dp 纯净透明圆形触控返回与更多按钮;
- 页面主体采用 `1fr 1fr` 流体响应式双栏:
- 左栏包含:【手环设备信息】4格硬件遥测网格 + 【心率预警设置】三阈值调节与保存;
- 右栏包含:【历史离线数据同步】时段选择 + 同步主按钮 + 高度自适应撑满的【同步日志控制台】。
2. **底部抽拉面板 (Bottom Sheet Drawer)**:
- 采用 `transform: translateY(100%) -> translateY(0)` 贝塞尔平滑过场;
- 左上角集成 CSS Concentric Wave 动态雷达声呐扩散动画;
- 包含 Chips 排序过滤与设备发现列表。
3. **右下角悬浮蓝牙 FAB**:
- 悬浮在页面右下角,点击快速唤起底部抽拉面板,收起后常驻。
4. **JavaScript 真实状态机交互闭环**:
- 具备完整的连接、断开、重置、阈值保存、离线同步、控制台彩色日志追加打印等全套活生生的逻辑。
---
## 3. 验证与交付标准
- [x] 100% 还原真机全部字段与槽位;
- [x] AppBar 40dp 透明无底触控规范落地;
- [x] `clamp(16px, 2.5vw, 32px)` 动态边距与双栏自适应体系落地;
- [x] 底部抽拉式 Sheet 与雷达动画落地;
- [x] 同步日志控制台与全交互状态机落地;
- [x] 无头 Chrome 全自动截图落盘 `image.png`;
- [x] 6 件套交付物齐备。
@@ -10,12 +10,12 @@
========================================================================= */
:root {
/* ── 核心主题色 ── */
--color-primary: #3949AB;
--color-primary-dark: #283593;
--color-primary-container: #EEF2FF;
--color-on-primary-container: #1A237E;
--color-primary-hover: rgba(57, 73, 171, 0.04);
--color-primary-glow: rgba(57, 73, 171, 0.12);
--color-primary: #2563EB;
--color-primary-dark: #1D4ED8;
--color-primary-container: #EFF6FF;
--color-on-primary-container: #1E40AF;
--color-primary-hover: rgba(37, 99, 235, 0.04);
--color-primary-glow: rgba(37, 99, 235, 0.15);
/* ── 辅助确认色 ── */
--color-secondary: #00897B;
@@ -269,7 +269,7 @@ body {
.edition-card.is-selected {
border-color: var(--color-primary);
background: var(--color-primary-container);
box-shadow: 0 4px 20px rgba(57, 73, 171, 0.12);
box-shadow: 0 4px 20px var(--color-primary-glow);
}
/* 选中左侧指示光条 */
Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

@@ -11,12 +11,13 @@
========================================================================= */
:root {
/* ── 核心主题色 ── */
--color-primary: #3949AB;
--color-primary: #2563EB;
--color-primary-dark: #1D4ED8;
--color-on-primary: #FFFFFF;
--color-primary-container: #EEF2FF;
--color-on-primary-container: #1A237E;
--color-primary-hover: rgba(57, 73, 171, 0.04);
--color-primary-glow: rgba(57, 73, 171, 0.12);
--color-primary-container: #EFF6FF;
--color-on-primary-container: #1E40AF;
--color-primary-hover: rgba(37, 99, 235, 0.04);
--color-primary-glow: rgba(37, 99, 235, 0.15);
/* ── 表面与背景 ── */
--color-surface: #FFFFFF;
@@ -32,7 +33,7 @@
/* ── 边框与分割线 ── */
--divider: #E2E8F0;
--outline: #CBD5E1;
--outline-focused: #3949AB;
--outline-focused: #2563EB;
/* ── 圆角阶梯 ── */
--corner-sm: 8px;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB