feat(ui): 交付手环升级(DFU固件升级)6件套物料并保持全局视觉家族统一
1. 【手环升级 / DFU固件升级】:完成6件套标准物料交付(原图+image.png+baseline_ui.html+DESIGN_SPEC.md+implementation_plan.md+CARD任务卡): - 视觉体系与【手环配置】、【自动连接配置】达成 100% 家族风格统一; - 严格遵循全局主色蓝规范 #2563EB(深色 #1D4ED8、浅底 #EFF6FF、高亮 #1E40AF); - 左侧布局:待升级手环硬件状态卡片(ID/版本/电量参数瓦片+取消升级按钮)与固件包版本源(检查服务端版本+使用内置固件); - 右侧布局:升级进度条、毫秒级百分比读数、传输速率与极客暗晶升级日志控制台 Terminal; - 弹窗交互:居中底部抽拉式 Sheet(560px 宽度自适应居中),配备顶部阻尼把手、左上角动态雷达声呐动效与 BLE 协议胶囊标签; - 交互闭环:支持手环信道建立、固件下发传输、校验重启与安全取消全流程; - Chrome Headless 自动渲染生成官方 image.png 交付图。 2. 更新 README.md 项目进度(已完成 6/11 页面)。
This commit is contained in:
@@ -0,0 +1,202 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>方案 5:Master-Detail Inset Pro 分栏卡片风</title>
|
||||
<style>
|
||||
:root {
|
||||
--color-primary: #2563EB;
|
||||
--color-primary-light: #EFF6FF;
|
||||
--color-primary-border: #DBEAFE;
|
||||
--bg: #EEF2F6;
|
||||
--surface: #FFFFFF;
|
||||
--text-main: #0F172A;
|
||||
--text-sub: #64748B;
|
||||
--divider: #E2E8F0;
|
||||
--terminal-bg: #0F172A;
|
||||
}
|
||||
* { 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: 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;
|
||||
}
|
||||
.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; }
|
||||
|
||||
.inset-layout {
|
||||
padding: clamp(20px, 2.5vw, 30px); display: grid; grid-template-columns: 380px 1fr;
|
||||
gap: 20px; background: #F8FAFC; flex: 1; overflow-y: auto; max-height: calc(100vh - 120px);
|
||||
}
|
||||
.inset-card {
|
||||
background: var(--surface); border: 1px solid var(--divider); border-radius: 16px; padding: 20px;
|
||||
display: flex; flex-direction: column; gap: 14px;
|
||||
}
|
||||
.i-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--divider); padding-bottom: 10px; }
|
||||
.i-title { font-size: 15.5px; font-weight: 700; color: var(--color-primary); }
|
||||
|
||||
.prop-pill-grid { display: flex; flex-direction: column; gap: 8px; }
|
||||
.prop-pill { background: #F8FAFC; border: 1px solid var(--divider); border-radius: 8px; padding: 10px 14px; display: flex; justify-content: space-between; }
|
||||
|
||||
.btn-inset-blue {
|
||||
width: 100%; padding: 12px; border-radius: 10px; background: var(--color-primary); color: white; border: none;
|
||||
font-weight: 700; cursor: pointer;
|
||||
}
|
||||
.term-inset {
|
||||
background: var(--terminal-bg); border-radius: 10px; padding: 12px; font-family: monospace; font-size: 11.5px;
|
||||
color: #38BDF8; height: 140px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
|
||||
}
|
||||
|
||||
/* 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; z-index: 50;
|
||||
}
|
||||
.bluetooth-fab svg { width: 24px; height: 24px; fill: var(--color-primary); }
|
||||
|
||||
/* 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;
|
||||
}
|
||||
.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 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="inset-layout">
|
||||
<div style="display: flex; flex-direction: column; gap: 16px;">
|
||||
<section class="inset-card">
|
||||
<div class="i-head">
|
||||
<span class="i-title">待升级手环状态</span>
|
||||
<span id="iTag" style="font-size: 11.5px; color: var(--text-sub);">未连接</span>
|
||||
</div>
|
||||
<div class="prop-pill-grid">
|
||||
<div class="prop-pill"><span style="color: var(--text-sub); font-size: 12px;">手环 ID</span><b id="iId" style="font-family: monospace;">未连接</b></div>
|
||||
<div class="prop-pill"><span style="color: var(--text-sub); font-size: 12px;">当前版本</span><b id="iVer" style="font-family: monospace;">未知</b></div>
|
||||
<div class="prop-pill"><span style="color: var(--text-sub); font-size: 12px;">剩余电量</span><b id="iBat" style="font-family: monospace;">未知</b></div>
|
||||
</div>
|
||||
<button style="background: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; padding: 8px; border-radius: 8px; font-weight: 700; cursor: pointer;" onclick="iCancel()">取消升级</button>
|
||||
</section>
|
||||
|
||||
<section class="inset-card">
|
||||
<div class="i-head"><span class="i-title">固件包与版本源</span></div>
|
||||
<div style="background: #F8FAFC; border: 1px solid var(--divider); border-radius: 8px; padding: 10px 12px; font-size: 12px; font-family: monospace; font-weight: 700;">
|
||||
SC106_FW1.00.0036_HW0.1_20260720_DFU.zip (内置 v1.00.0036)
|
||||
<div style="color: var(--color-primary); font-size: 11px; margin-top: 4px;">固件来源: 内置 (优先)</div>
|
||||
</div>
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 8px;">
|
||||
<button style="background: white; border: 1px solid var(--divider); padding: 8px; border-radius: 8px; font-weight: 700; color: var(--color-primary); cursor: pointer;" onclick="iCheck()">检查服务端版本</button>
|
||||
<button style="background: white; border: 1px solid var(--divider); padding: 8px; border-radius: 8px; font-weight: 700; color: var(--color-primary); cursor: pointer;" onclick="iUse()">使用内置固件</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; flex-direction: column; gap: 16px;">
|
||||
<section class="inset-card" style="flex: 1;">
|
||||
<div class="i-head"><span class="i-title">升级进度与控制</span></div>
|
||||
<div style="background: #F8FAFC; border: 1px solid var(--divider); border-radius: 10px; 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="iPct" style="color: var(--color-primary);">0%</span>
|
||||
</div>
|
||||
<div style="width: 100%; height: 8px; background: #E2E8F0; border-radius: 10px; overflow: hidden;">
|
||||
<div id="iBar" style="width: 0%; height: 100%; background: var(--color-primary); transition: width 0.3s;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn-inset-blue" onclick="iStart()">开始升级</button>
|
||||
|
||||
<span style="font-size: 12.5px; font-weight: 700;">升级日志控制台</span>
|
||||
<div class="term-inset" id="iLog">
|
||||
<div>[INSET] DFU Core Initialized...</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- FAB -->
|
||||
<button class="bluetooth-fab" onclick="openISheet()"><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="iSheet" onclick="if(event.target===this) closeISheet()">
|
||||
<div class="bottom-sheet">
|
||||
<div style="width: 44px; height: 4px; border-radius: 4px; background: #CBD5E1; 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: 15.5px; font-weight: 700;">选择设备</h2></div>
|
||||
<span style="cursor: pointer;" onclick="closeISheet()">✕</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: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;" onclick="iPick('CL831-62200026', 'v1.00.0035', '88%')">
|
||||
<div>
|
||||
<div style="font-weight: 700; font-family: monospace;">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: var(--color-primary-light); color: var(--color-primary); font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--color-primary-border);">BLE</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function iLog(t) {
|
||||
const b = document.getElementById('iLog'); const d = document.createElement('div');
|
||||
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
|
||||
b.appendChild(d); b.scrollTop = b.scrollHeight;
|
||||
}
|
||||
function openISheet() { document.getElementById('iSheet').classList.add('open'); iLog("打开选择设备弹窗..."); }
|
||||
function closeISheet() { document.getElementById('iSheet').classList.remove('open'); }
|
||||
function iPick(n, v, bat) {
|
||||
closeISheet(); iLog(`选择手环 [${n}]...`);
|
||||
setTimeout(() => {
|
||||
document.getElementById('iId').innerText = n; document.getElementById('iVer').innerText = v; document.getElementById('iBat').innerText = bat;
|
||||
document.getElementById('iTag').innerText = "已就绪"; document.getElementById('iTag').style.color = "#10B981";
|
||||
iLog(`手环 [${n}] 就绪!`);
|
||||
}, 500);
|
||||
}
|
||||
function iStart() {
|
||||
iLog("写入固件中...");
|
||||
let p = 0;
|
||||
const tm = setInterval(() => {
|
||||
p += 20; if (p > 100) p = 100;
|
||||
document.getElementById('iBar').style.width = p + '%'; document.getElementById('iPct').innerText = p + '%';
|
||||
if (p >= 100) { clearInterval(tm); iLog("升级完成!", "success"); alert("固件升级成功!"); }
|
||||
}, 300);
|
||||
}
|
||||
function iCancel() { iLog("取消升级。"); alert("升级已取消"); }
|
||||
function iCheck() { iLog("检查服务端最新版本..."); alert("当前为最新版本!"); }
|
||||
function iUse() { iLog("锁定内置固件。"); alert("已选择内置固件!"); }
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user