feat(foam_roller): 交付【主页面_四个下拉选项页面/泡沫轴】重构方案1A全量6件套并严格区分连接态与原版文字
This commit is contained in:
@@ -0,0 +1,440 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>泡沫轴 - 方案 1A:经典工控立体滚轮 (推荐·已连接态/未连接态区分)</title>
|
||||
<style>
|
||||
/* =========================================================================
|
||||
全局统一色彩与 Design Tokens (严格对齐 #2563EB 体系)
|
||||
========================================================================= */
|
||||
:root {
|
||||
--color-primary: #2563EB;
|
||||
--color-primary-dark: #1D4ED8;
|
||||
--color-on-primary-container: #1E40AF;
|
||||
--color-primary-light: #EFF6FF;
|
||||
--color-primary-container: #EFF6FF;
|
||||
--color-primary-border: #DBEAFE;
|
||||
--color-primary-glow: rgba(37, 99, 235, 0.22);
|
||||
--color-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;
|
||||
|
||||
--color-success: #059669;
|
||||
--color-success-bg: #ECFDF5;
|
||||
--color-success-border: #A7F3D0;
|
||||
|
||||
--color-danger: #E11D48;
|
||||
--color-danger-bg: #FFF1F2;
|
||||
--color-danger-border: #FFE4E6;
|
||||
--color-danger-gradient: linear-gradient(135deg, #E11D48 0%, #BE123C 100%);
|
||||
|
||||
--content-max-width: 1240px;
|
||||
--content-gutter: clamp(14px, 2vw, 24px);
|
||||
--appbar-height: 56px;
|
||||
}
|
||||
|
||||
* { 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: var(--content-gutter); display: flex; flex-direction: column; -webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.device-wrapper {
|
||||
width: 100%; max-width: var(--content-max-width); 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: 720px; display: flex; flex-direction: column;
|
||||
}
|
||||
|
||||
/* 1. AppBar */
|
||||
.appbar {
|
||||
height: var(--appbar-height); 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: 38px; height: 38px; 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: 18px; font-weight: 700; margin-left: 10px; }
|
||||
|
||||
/* 2. 核心三栏工控布局 */
|
||||
.tri-body {
|
||||
padding: clamp(16px, 2vw, 24px); background: #F8FAFC; flex: 1; overflow-y: auto;
|
||||
display: grid; grid-template-columns: 310px 1.15fr 1fr; gap: 18px;
|
||||
}
|
||||
|
||||
.panel-card {
|
||||
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 20px;
|
||||
display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
|
||||
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03); position: relative;
|
||||
}
|
||||
|
||||
.panel-header-title {
|
||||
font-size: 17px; font-weight: 700; color: var(--text-main);
|
||||
}
|
||||
|
||||
/* 左栏:设备状态与蓝牙扫描 */
|
||||
.left-stack { display: flex; flex-direction: column; gap: 16px; }
|
||||
|
||||
.device-status-box {
|
||||
display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
|
||||
padding: 8px 0 16px; border-bottom: 1px solid var(--divider); min-height: 190px; justify-content: center;
|
||||
}
|
||||
.fr100-product-img {
|
||||
width: 170px; height: 85px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.12));
|
||||
}
|
||||
.fr100-disconnected-img {
|
||||
width: 130px; height: 65px; display: flex; align-items: center; justify-content: center; opacity: 0.6;
|
||||
}
|
||||
|
||||
.device-meta-list { width: 100%; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
|
||||
.meta-item { display: flex; justify-content: space-between; align-items: center; }
|
||||
.meta-label { color: var(--text-sub); }
|
||||
.meta-val { font-weight: 700; color: var(--text-main); font-family: ui-monospace, monospace; }
|
||||
|
||||
.battery-pill {
|
||||
background: var(--color-success-bg); color: var(--color-success); border: 1px solid var(--color-success-border);
|
||||
padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px;
|
||||
}
|
||||
|
||||
.device-btn-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
|
||||
.btn-mini {
|
||||
height: 38px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer;
|
||||
display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.15s ease; border: 1.5px solid transparent;
|
||||
}
|
||||
.btn-ghost-neutral { background: #F1F5F9; color: var(--text-main); border-color: #CBD5E1; }
|
||||
.btn-ghost-neutral:hover { background: #E2E8F0; }
|
||||
.btn-primary-blue { background: var(--color-primary-gradient); color: white; box-shadow: 0 4px 10px var(--color-primary-glow); }
|
||||
.btn-danger-outline { background: white; color: var(--color-danger); border-color: #FECDD3; }
|
||||
.btn-danger-outline:hover { background: var(--color-danger-bg); }
|
||||
|
||||
.scan-list-card {
|
||||
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 16px;
|
||||
display: flex; flex-direction: column; gap: 10px; flex: 1; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
|
||||
}
|
||||
.scan-item {
|
||||
height: 44px; padding: 0 12px; border-radius: 8px; background: #F8FAFC; border: 1px solid var(--divider);
|
||||
display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: all 0.15s ease;
|
||||
}
|
||||
.scan-item:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
|
||||
.scan-name { font-size: 13.5px; font-weight: 700; font-family: ui-monospace, monospace; }
|
||||
.rssi-bars { display: flex; gap: 2px; align-items: flex-end; height: 12px; }
|
||||
.rssi-bar { width: 3px; background: #94A3B8; border-radius: 1px; }
|
||||
.rssi-bar.active { background: var(--color-primary); }
|
||||
|
||||
/* 中栏:开始 (倒计时控制) */
|
||||
.center-timer-panel {
|
||||
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 24px;
|
||||
display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center;
|
||||
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
|
||||
}
|
||||
|
||||
.countdown-hero {
|
||||
font-size: clamp(54px, 6.5vw, 80px); font-weight: 900; font-family: "SF Pro Display", ui-monospace, monospace;
|
||||
color: var(--text-main); letter-spacing: -0.03em; margin: 12px 0 8px;
|
||||
}
|
||||
|
||||
.wheel-picker-box {
|
||||
width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 12px 0; position: relative;
|
||||
mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
|
||||
}
|
||||
.wheel-item {
|
||||
height: 36px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600;
|
||||
color: var(--text-dim); transition: all 0.2s ease; cursor: pointer; border-radius: 8px;
|
||||
}
|
||||
.wheel-item.selected {
|
||||
font-size: 18px; font-weight: 800; color: var(--color-primary); background: var(--color-primary-light);
|
||||
border: 1px solid var(--color-primary-border);
|
||||
}
|
||||
|
||||
.timer-actions-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
|
||||
.btn-ctrl {
|
||||
height: 46px; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer;
|
||||
display: flex; align-items: center; justify-content: center; gap: 8px; border: none; transition: all 0.15s ease;
|
||||
}
|
||||
.btn-start { background: var(--color-primary-gradient); color: white; box-shadow: 0 4px 12px var(--color-primary-glow); }
|
||||
.btn-start:hover { transform: translateY(-1px); }
|
||||
.btn-pause { background: var(--color-danger-gradient); color: white; box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25); }
|
||||
.btn-pause:hover { transform: translateY(-1px); }
|
||||
|
||||
/* 右栏:设备信息 (模式与参数) */
|
||||
.right-config-panel {
|
||||
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 22px;
|
||||
display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
|
||||
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
|
||||
}
|
||||
|
||||
.mode-segmented-capsule {
|
||||
display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #F1F5F9; border-radius: 10px; padding: 4px;
|
||||
}
|
||||
.mode-cap-btn {
|
||||
height: 36px; border-radius: 8px; border: none; font-size: 13.5px; font-weight: 700; cursor: pointer;
|
||||
display: flex; align-items: center; justify-content: center; color: var(--text-sub); background: transparent;
|
||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
.mode-cap-btn.active-blue {
|
||||
background: white; color: var(--color-primary); box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
.mode-cap-btn.active-red {
|
||||
background: white; color: var(--color-danger); box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
|
||||
.dual-wheel-matrix {
|
||||
display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px;
|
||||
}
|
||||
.wheel-col {
|
||||
background: #F8FAFC; border: 1px solid var(--divider); border-radius: 10px; padding: 8px 4px;
|
||||
display: flex; flex-direction: column; gap: 2px;
|
||||
}
|
||||
.col-header { font-size: 12px; font-weight: 700; color: var(--text-sub); text-align: center; margin-bottom: 4px; }
|
||||
.matrix-item {
|
||||
height: 32px; font-size: 13.5px; font-weight: 600; color: var(--text-dim); display: flex; align-items: center;
|
||||
justify-content: center; border-radius: 6px; cursor: pointer; transition: all 0.15s ease;
|
||||
}
|
||||
.matrix-item.selected {
|
||||
background: var(--color-primary-light); color: var(--color-primary); font-weight: 800;
|
||||
border: 1px solid var(--color-primary-border);
|
||||
}
|
||||
|
||||
.strength-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
|
||||
.strength-btn {
|
||||
height: 36px; border-radius: 8px; border: 1px solid var(--divider); background: #F8FAFC;
|
||||
font-size: 13px; font-weight: 700; color: var(--text-sub); cursor: pointer; display: flex; align-items: center;
|
||||
justify-content: center; transition: all 0.15s ease;
|
||||
}
|
||||
.strength-btn.active {
|
||||
background: var(--color-primary); color: white; border-color: var(--color-primary);
|
||||
box-shadow: 0 2px 8px var(--color-primary-glow);
|
||||
}
|
||||
|
||||
.btn-save-full {
|
||||
width: 100%; height: 44px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer;
|
||||
background: var(--color-primary-gradient); color: white; border: none; box-shadow: 0 4px 12px var(--color-primary-glow);
|
||||
display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.15s ease;
|
||||
}
|
||||
.btn-save-full:hover { transform: translateY(-1px); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="device-wrapper">
|
||||
<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="tri-body">
|
||||
<!-- ================= 左栏:设备连接与蓝牙扫描 ================= -->
|
||||
<div class="left-stack">
|
||||
<div class="panel-card" style="padding: 18px;">
|
||||
<div class="device-status-box" id="deviceStatusBox">
|
||||
<!-- 已连接态使用官方产品实物图 fr100_setup_200.png -->
|
||||
<img src="fr100_setup_200.png" class="fr100-product-img" id="productImg" alt="FR100 Foam Roller">
|
||||
|
||||
<div class="device-meta-list">
|
||||
<div class="meta-item"><span class="meta-label">ID:</span><span class="meta-val" id="valId">12EC</span></div>
|
||||
<div class="meta-item"><span class="meta-label">版本:</span><span class="meta-val" id="valVer">V1.2.8</span></div>
|
||||
<div class="meta-item">
|
||||
<span class="meta-label">电量:</span>
|
||||
<span class="battery-pill" id="valBat">
|
||||
<svg style="width: 12px; height: 12px; fill: currentColor;" viewBox="0 0 24 24"><path d="M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4z"/></svg>
|
||||
<span>100%</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="device-btn-group">
|
||||
<button class="btn-mini btn-ghost-neutral" onclick="handleScanRefresh()">
|
||||
<svg style="width: 14px; height: 14px; fill: currentColor;" viewBox="0 0 24 24"><path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/></svg>
|
||||
<span>刷新设备</span>
|
||||
</button>
|
||||
<button class="btn-mini btn-danger-outline" id="btnToggleConn" onclick="toggleConnectState()">
|
||||
<span>断开连接</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 蓝牙扫描发现列表 -->
|
||||
<div class="scan-list-card">
|
||||
<div style="font-size: 13px; font-weight: 700; color: var(--text-sub); display: flex; align-items: center; justify-content: space-between;">
|
||||
<span>📡 周边设备列表</span>
|
||||
<span style="font-size: 11px; color: var(--color-primary);" id="scanStatusText">自动扫描中</span>
|
||||
</div>
|
||||
<div class="scan-item" onclick="connectDeviceItem('FR100-12EC')">
|
||||
<span class="scan-name">FR100-12EC</span>
|
||||
<div class="rssi-bars">
|
||||
<div class="rssi-bar active" style="height: 4px;"></div>
|
||||
<div class="rssi-bar active" style="height: 7px;"></div>
|
||||
<div class="rssi-bar active" style="height: 10px;"></div>
|
||||
<div class="rssi-bar active" style="height: 13px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scan-item" onclick="connectDeviceItem('FR100-1776')">
|
||||
<span class="scan-name">FR100-1776</span>
|
||||
<div class="rssi-bars">
|
||||
<div class="rssi-bar active" style="height: 4px;"></div>
|
||||
<div class="rssi-bar active" style="height: 7px;"></div>
|
||||
<div class="rssi-bar" style="height: 10px;"></div>
|
||||
<div class="rssi-bar" style="height: 13px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ================= 中栏:开始 (严格对齐真机文字) ================= -->
|
||||
<div class="center-timer-panel">
|
||||
<div style="width: 100%; text-align: left;">
|
||||
<h2 class="panel-header-title">开始</h2>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; flex-direction: column; align-items: center; width: 100%;">
|
||||
<div class="countdown-hero" id="dispTimer">02:58</div>
|
||||
|
||||
<div class="wheel-picker-box" id="wheelPickerBox">
|
||||
<div class="wheel-item" onclick="selectDurationItem(this)">1 : 00 分</div>
|
||||
<div class="wheel-item" onclick="selectDurationItem(this)">2 : 00 分</div>
|
||||
<div class="wheel-item selected" onclick="selectDurationItem(this)">3 : 00 分</div>
|
||||
<div class="wheel-item" onclick="selectDurationItem(this)">4 : 00 分</div>
|
||||
<div class="wheel-item" onclick="selectDurationItem(this)">5 : 00 分</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="timer-actions-row">
|
||||
<button class="btn-ctrl btn-start" id="btnStart">
|
||||
<svg style="width: 18px; height: 18px; fill: currentColor;" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>
|
||||
<span>开始</span>
|
||||
</button>
|
||||
<button class="btn-ctrl btn-pause" id="btnPause">
|
||||
<svg style="width: 18px; height: 18px; fill: currentColor;" viewBox="0 0 24 24"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>
|
||||
<span>暂停</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ================= 右栏:设备信息 (严格对齐真机文字) ================= -->
|
||||
<div class="right-config-panel">
|
||||
<div style="display: flex; flex-direction: column; gap: 14px;">
|
||||
<h2 class="panel-header-title">设备信息</h2>
|
||||
|
||||
<div class="mode-segmented-capsule">
|
||||
<button class="mode-cap-btn active-blue" id="btnModeAuto" onclick="setMode('auto')">自动模式</button>
|
||||
<button class="mode-cap-btn" id="btnModeManual" onclick="setMode('manual')">手动模式</button>
|
||||
</div>
|
||||
|
||||
<div class="dual-wheel-matrix">
|
||||
<div class="wheel-col">
|
||||
<div class="col-header">动作模式</div>
|
||||
<div class="matrix-item" onclick="selectMatrix(this)">徒步</div>
|
||||
<div class="matrix-item" onclick="selectMatrix(this)">骑行</div>
|
||||
<div class="matrix-item selected" onclick="selectMatrix(this)">游泳</div>
|
||||
<div class="matrix-item" onclick="selectMatrix(this)">瑜伽</div>
|
||||
<div class="matrix-item" onclick="selectMatrix(this)">拳击</div>
|
||||
</div>
|
||||
|
||||
<div class="wheel-col">
|
||||
<div class="col-header">肌群</div>
|
||||
<div class="matrix-item" onclick="selectMatrix(this)">大腿</div>
|
||||
<div class="matrix-item" onclick="selectMatrix(this)">背阔肌</div>
|
||||
<div class="matrix-item selected" onclick="selectMatrix(this)">前臂</div>
|
||||
<div class="matrix-item" onclick="selectMatrix(this)">背部</div>
|
||||
<div class="matrix-item" onclick="selectMatrix(this)">足部</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; flex-direction: column; gap: 6px;">
|
||||
<div style="font-size: 12.5px; font-weight: 700; color: var(--text-sub);">力量档位</div>
|
||||
<div class="strength-grid">
|
||||
<button class="strength-btn" onclick="setStrength(1, this)">力量 : 1</button>
|
||||
<button class="strength-btn" onclick="setStrength(2, this)">力量 : 2</button>
|
||||
<button class="strength-btn" onclick="setStrength(3, this)">力量 : 3</button>
|
||||
<button class="strength-btn active" onclick="setStrength(4, this)">力量 : 4</button>
|
||||
<button class="strength-btn" onclick="setStrength(5, this)">力量 : 5</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button class="btn-save-full">
|
||||
<svg style="width: 16px; height: 16px; fill: currentColor;" viewBox="0 0 24 24"><path d="M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"/></svg>
|
||||
<span>保存</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let isConnected = true;
|
||||
|
||||
function toggleConnectState() {
|
||||
isConnected = !isConnected;
|
||||
const img = document.getElementById('productImg');
|
||||
const valId = document.getElementById('valId');
|
||||
const valVer = document.getElementById('valVer');
|
||||
const valBat = document.getElementById('valBat');
|
||||
const btnToggle = document.getElementById('btnToggleConn');
|
||||
const timer = document.getElementById('dispTimer');
|
||||
|
||||
if (isConnected) {
|
||||
// 切换为已连接状态 (展示真实 3D 产品图)
|
||||
img.src = 'fr100_setup_200.png';
|
||||
img.className = 'fr100-product-img';
|
||||
valId.innerText = '12EC';
|
||||
valVer.innerText = 'V1.2.8';
|
||||
valBat.innerHTML = '<svg style="width:12px;height:12px;fill:currentColor;" viewBox="0 0 24 24"><path d="M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4z"/></svg> <span>100%</span>';
|
||||
btnToggle.innerText = '断开连接';
|
||||
btnToggle.className = 'btn-mini btn-danger-outline';
|
||||
timer.innerText = '02:58';
|
||||
} else {
|
||||
// 切换为未连接状态 (展示未连接专属硬件插画/线框)
|
||||
img.src = 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="70" viewBox="0 0 140 70"><ellipse cx="25" cy="35" rx="14" ry="24" fill="%23E2E8F0" stroke="%2394A3B8" stroke-width="2"/><rect x="25" y="11" width="90" height="48" rx="4" fill="%23F1F5F9" stroke="%23CBD5E1" stroke-width="2"/><ellipse cx="115" cy="35" rx="14" ry="24" fill="%23E2E8F0" stroke="%2394A3B8" stroke-width="2"/><circle cx="70" cy="35" r="10" fill="%23CBD5E1"/><path d="M66 35h8" stroke="%2394A3B8" stroke-width="2"/></svg>';
|
||||
img.className = 'fr100-disconnected-img';
|
||||
valId.innerText = '--';
|
||||
valVer.innerText = '--';
|
||||
valBat.innerHTML = '<span style="color:var(--text-dim)">未连接</span>';
|
||||
btnToggle.innerText = '连接设备';
|
||||
btnToggle.className = 'btn-mini btn-primary-blue';
|
||||
timer.innerText = '00:00';
|
||||
}
|
||||
}
|
||||
|
||||
function selectDurationItem(el) {
|
||||
document.querySelectorAll('.wheel-item').forEach(i => i.classList.remove('selected'));
|
||||
el.classList.add('selected');
|
||||
}
|
||||
|
||||
function setMode(mode) {
|
||||
document.getElementById('btnModeAuto').className = mode === 'auto' ? 'mode-cap-btn active-blue' : 'mode-cap-btn';
|
||||
document.getElementById('btnModeManual').className = mode === 'manual' ? 'mode-cap-btn active-red' : 'mode-cap-btn';
|
||||
}
|
||||
|
||||
function selectMatrix(el) {
|
||||
el.parentElement.querySelectorAll('.matrix-item').forEach(item => item.classList.remove('selected'));
|
||||
el.classList.add('selected');
|
||||
}
|
||||
|
||||
function setStrength(level, btn) {
|
||||
document.querySelectorAll('.strength-btn').forEach(b => b.classList.remove('active'));
|
||||
btn.classList.add('active');
|
||||
}
|
||||
|
||||
function connectDeviceItem(dev) {
|
||||
if (!isConnected) toggleConnectState();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user