Files
EAP_Interface_html/.preview/dfu_upgrade/option_4_cyber_precision.html
T
zhy200308 221fa34250 feat(ui): 交付手环升级(DFU固件升级)方案5落地物料并严格统一1:1双栏等比占比
1. 【手环升级 / DFU固件升级】:根据用户选定方案5(Master-Detail Inset Pro)完成6件套标准物料全量交付:
   - 左右两大板块严格统一为 1:1 双栏等比均衡占比,与【手环配置】板块占比完全一致;
   - 视觉体系严格对齐全局主色蓝规范 #2563EB(深色 #1D4ED8、浅底 #EFF6FF、高亮 #1E40AF);
   - 左侧布局:待升级手环硬件状态卡片(采用方案5 Inset 经典属性胶囊条:手环 ID/当前版本/剩余电量 + 取消升级暖黄按钮)与固件包版本源;
   - 右侧布局:升级进度条、毫秒级百分比读数、传输速率与极客暗晶升级日志控制台 Terminal;
   - 弹窗交互:居中底部抽拉式 Sheet(560px 宽度自适应居中),配备顶部阻尼把手、左上角动态雷达声呐动效与 BLE 协议胶囊标签;
   - 交互闭环:支持手环信道建立、固件下发传输、校验重启与安全取消全流程;
   - Chrome Headless 自动渲染生成官方 image.png 交付图。
2. 更新 README.md 项目进度(已完成 6/11 页面)。
2026-08-17 17:36:00 +08:00

202 lines
11 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 4:Cyber Precision 极客遥测风</title>
<style>
:root {
--color-primary: #2563EB;
--accent-cyan: #38BDF8;
--bg: #0B0F19;
--surface: #111827;
--card-bg: #1F2937;
--text-main: #F8FAFC;
--text-sub: #94A3B8;
--divider: #374151;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
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 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: #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; }
.cyber-grid {
padding: clamp(20px, 2.5vw, 30px); display: grid; grid-template-columns: 1fr 1fr;
gap: 20px; background: #0B0F19; flex: 1; overflow-y: auto; max-height: calc(100vh - 120px);
}
.cyber-card {
background: #111827; border: 1px solid var(--divider); border-radius: 14px; padding: 20px;
display: flex; flex-direction: column; gap: 14px;
}
.c-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--divider); padding-bottom: 10px; }
.c-title { font-size: 15px; font-weight: 700; color: var(--accent-cyan); }
.c-cell-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.c-cell { background: #1F2937; border: 1px solid #374151; border-radius: 8px; padding: 8px 12px; }
.btn-cyber-blue {
width: 100%; padding: 12px; border-radius: 8px; background: var(--color-primary); color: white; border: none;
font-weight: 700; cursor: pointer; box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}
.cyber-term {
background: #030712; border: 1px solid #1F2937; border-radius: 8px; padding: 12px; font-family: monospace; font-size: 11.5px;
color: #38BDF8; height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
/* FAB */
.bluetooth-fab {
position: absolute; bottom: 24px; right: 24px; width: 50px; height: 50px; border-radius: 14px;
background: var(--color-primary); box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 50; border: none;
}
.bluetooth-fab 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;
}
.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: #111827; border-radius: 24px 24px 0 0; border: 1px solid var(--divider);
box-shadow: 0 -16px 45px rgba(0,0,0,0.6); transition: transform 0.35s ease;
display: flex; flex-direction: column; max-height: 480px; z-index: 101;
}
.bottom-sheet-mask.open .bottom-sheet { transform: translateX(-50%) translateY(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="cyber-grid">
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="cyber-card">
<div class="c-head">
<span class="c-title">待升级手环状态</span>
<span id="cTag" style="font-size: 11px; color: var(--text-sub);">状态:未连接</span>
</div>
<div class="c-cell-grid">
<div class="c-cell"><div style="font-size: 11px; color: var(--text-sub);">ID:</div><div style="font-weight: 700; font-family: monospace;" id="cId">未连接</div></div>
<div class="c-cell"><div style="font-size: 11px; color: var(--text-sub);">版本:</div><div style="font-weight: 700; font-family: monospace;" id="cVer">未知</div></div>
<div class="c-cell" style="grid-column: span 2;"><div style="font-size: 11px; color: var(--text-sub);">电量:</div><div style="font-weight: 700; font-family: monospace;" id="cBat">未知</div></div>
</div>
<button style="align-self: flex-end; background: #374151; color: #F59E0B; border: none; padding: 6px 14px; border-radius: 6px; font-weight: 700; cursor: pointer;" onclick="cCancel()">取消升级</button>
</section>
<section class="cyber-card">
<div class="c-head"><span class="c-title">固件包与版本源</span></div>
<div style="background: #1F2937; border: 1px solid var(--divider); border-radius: 8px; padding: 10px 12px; font-size: 12px; font-family: monospace; color: #FFF;">
SC106_FW1.00.0036_HW0.1_20260720_DFU.zip (内置 v1.00.0036)
<div style="color: var(--accent-cyan); font-size: 11px; margin-top: 4px;">固件来源: 内置 (优先)</div>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 8px;">
<button style="background: #1F2937; border: 1px solid var(--divider); color: var(--accent-cyan); padding: 8px; border-radius: 6px; font-weight: 700; cursor: pointer;" onclick="cCheck()">检查服务端版本</button>
<button style="background: #1F2937; border: 1px solid var(--divider); color: var(--accent-cyan); padding: 8px; border-radius: 6px; font-weight: 700; cursor: pointer;" onclick="cUse()">使用内置固件</button>
</div>
</section>
</div>
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="cyber-card" style="flex: 1;">
<div class="c-head"><span class="c-title">升级进度与控制</span></div>
<div style="background: #1F2937; border: 1px solid var(--divider); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px;">
<div style="display: flex; justify-content: space-between; font-size: 13px; font-weight: 700;">
<span>升级进度</span><span id="cPct" style="color: var(--accent-cyan);">0%</span>
</div>
<div style="width: 100%; height: 8px; background: #030712; border-radius: 10px; overflow: hidden;">
<div id="cBar" style="width: 0%; height: 100%; background: var(--color-primary); transition: width 0.3s;"></div>
</div>
</div>
<button class="btn-cyber-blue" onclick="cStart()">开始升级</button>
<span style="font-size: 12px; font-weight: 700; color: #FFF;">升级日志控制台</span>
<div class="cyber-term" id="cLog">
<div>[CYBER] DFU Engine Ready...</div>
</div>
</section>
</div>
</main>
<!-- FAB -->
<button class="bluetooth-fab" onclick="openCSheet()"><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="cSheet" onclick="if(event.target===this) closeCSheet()">
<div class="bottom-sheet">
<div style="width: 44px; height: 4px; border-radius: 4px; background: #4B5563; margin: 10px auto 4px;"></div>
<div style="padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--divider);">
<div style="display: flex; align-items: center; gap: 8px;"><span style="font-size: 16px;">📡</span><h2 style="font-size: 15px; font-weight: 700; color: #FFF;">选择设备</h2></div>
<span style="cursor: pointer;" onclick="closeCSheet()">✕</span>
</div>
<div style="padding: 14px 20px; display: flex; flex-direction: column; gap: 8px;">
<div style="border: 1px solid var(--divider); background: #1F2937; padding: 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;" onclick="cPick('CL831-62200026', 'v1.00.0035', '88%')">
<div>
<div style="font-weight: 700; font-family: monospace; color: #FFF;">CL831-62200026</div>
<div style="font-size: 11px; color: var(--text-sub);">D9:24:0F:1C:55:FA · -89 dBm</div>
</div>
<span style="background: rgba(37,99,235,0.2); color: #38BDF8; font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 4px; border: 1px solid rgba(56,189,248,0.3);">BLE</span>
</div>
</div>
</div>
</div>
</div>
<script>
function cLog(t) {
const b = document.getElementById('cLog'); const d = document.createElement('div');
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
b.appendChild(d); b.scrollTop = b.scrollHeight;
}
function openCSheet() { document.getElementById('cSheet').classList.add('open'); cLog("唤起设备选择面板..."); }
function closeCSheet() { document.getElementById('cSheet').classList.remove('open'); }
function cPick(n, v, bat) {
closeCSheet(); cLog(`连接设备 [${n}]...`);
setTimeout(() => {
document.getElementById('cId').innerText = n; document.getElementById('cVer').innerText = v; document.getElementById('cBat').innerText = bat;
document.getElementById('cTag').innerText = "状态:已就绪"; document.getElementById('cTag').style.color = "#38BDF8";
cLog(`手环 [${n}] 通信通道开启!`);
}, 500);
}
function cStart() {
cLog("写入固件分包...");
let p = 0;
const tm = setInterval(() => {
p += 20; if (p > 100) p = 100;
document.getElementById('cBar').style.width = p + '%'; document.getElementById('cPct').innerText = p + '%';
if (p >= 100) { clearInterval(tm); cLog("固件升级成功!", "success"); alert("固件升级完成!"); }
}, 300);
}
function cCancel() { cLog("终止固件传输。"); alert("升级已取消"); }
function cCheck() { cLog("云端检索最新版本..."); alert("当前为最新版本!"); }
function cUse() { cLog("选用内置固件包。"); alert("已选择内置固件!"); }
</script>
</body>
</html>