Files
EAP_Interface_html/设置页面UI优化/Logo授权管理/baseline_ui.html
T
zhy200308 fa961c8820 feat(ui): 交付第11个收官页面【Logo授权管理】UI重构与全链路真实交互 (11/11 全量完工)
- 页面交付清单 (🎉 设置页面全部 11/11 已 100% 完工交付):
  1. 语言设置 (已完工)
  2. 版型切换 (已完工)
  3. 心率区间设置 (已完工)
  4. 自动连接配置 (已完工)
  5. 手环配置 (已完工)
  6. DFU固件升级 (已完工)
  7. 用户管理 (已完工)
  8. 设备数据库管理 (已完工)
  9. 数据上传 (已完工)
  10. 版本信息 (已完工)
  11. Logo授权管理 (本次交付·已完工·全量大圆满)
- 核心重构亮点:
  1. 采纳 Master-Detail Inset Studio 经典双栏比例 (360px 1fr);
  2. 左侧 360px 品牌控制面板集成【文本Logo / 图片Logo】分段器与当前模式说明;
  3. 右侧 1fr 建立所见即所得的【顶部栏实时效果预览】真实模拟舱;
  4. 文本模式支持 0 延迟实时打字同步回显与 10/15 字数超长校验;
  5. 图片模式支持真实选择本地 PNG/SVG 透明背景图片与预设 Logo 一键切换;
  6. 集齐 6 件套交付物 (baseline_ui.html, image.png, DESIGN_SPEC.md, implementation_plan.md, CARD 任务卡, README 更新)。
2026-08-17 18:53:51 +08:00

438 lines
20 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>Logo 授权管理 - Master-Detail Inset Studio (全功能交互版)</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;
--border-card: #E2E8F0;
--color-success: #059669;
--color-success-bg: #ECFDF5;
--color-success-border: #A7F3D0;
--color-warning: #D97706;
--color-warning-bg: #FFFBEB;
--color-warning-border: #FDE68A;
--color-danger: #E11D48;
--color-danger-bg: #FFF1F2;
--color-danger-border: #FFE4E6;
--corner-card: 16px;
--corner-item: 10px;
--content-max-width: 1160px;
--content-gutter: clamp(16px, 2.5vw, 32px);
--appbar-height: 60px;
}
* { 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: 660px; 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: 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. 经典 360px 1fr 双栏布局 */
.split-body {
padding: clamp(20px, 2.5vw, 30px); background: #F8FAFC; flex: 1; overflow-y: auto;
display: grid; grid-template-columns: 360px 1fr; gap: 20px; max-height: calc(100vh - 120px);
}
/* 左侧 360px 品牌控制面板 */
.left-brand-panel {
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 22px;
display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
}
.panel-header-title { font-size: 17.5px; font-weight: 700; color: var(--color-primary); display: flex; align-items: center; gap: 8px; }
.panel-header-desc { font-size: 12.5px; color: var(--text-sub); margin-top: 4px; }
/* 分段控制器 */
.segmented-control-box {
background: #F1F5F9; border-radius: 10px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.seg-btn {
height: 38px; border-radius: 8px; border: none; font-size: 13.5px; font-weight: 700; cursor: pointer;
display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
color: var(--text-sub); background: transparent;
}
.seg-btn.active {
background: white; color: var(--color-primary); box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
/* 品牌授权说明卡片 */
.brand-info-card {
background: var(--color-primary-light); border: 1.5px solid var(--color-primary-border); border-radius: 12px;
padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.info-row { display: flex; justify-content: space-between; font-size: 12.5px; }
/* 底部全宽保存与恢复按钮 */
.side-actions-stack { display: flex; flex-direction: column; gap: 10px; }
.btn-dynamic-full {
width: 100%; height: 44px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer;
display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.15s ease;
border: 1.5px solid transparent;
}
.btn-primary-gradient {
background: var(--color-primary-gradient); color: white;
box-shadow: 0 4px 12px var(--color-primary-glow);
}
.btn-primary-gradient:hover { transform: translateY(-1px); box-shadow: 0 6px 16px var(--color-primary-glow); }
.btn-secondary-ghost {
background: #FFFFFF; color: var(--text-sub); border-color: #CBD5E1;
}
.btn-secondary-ghost:hover { background: #F1F5F9; color: var(--text-main); }
/* 右侧 1fr 预览舱与编辑工坊 */
.right-studio-panel {
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 24px;
display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
}
.studio-section-header {
display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--divider);
padding-bottom: 12px;
}
.studio-title { font-size: 15px; font-weight: 700; color: var(--text-main); }
/* 顶部栏实时预览模拟舱 (Live Mockup Bar) */
.live-mockup-container {
display: flex; flex-direction: column; gap: 8px;
}
.mockup-label { font-size: 13px; font-weight: 700; color: var(--text-sub); display: flex; align-items: center; gap: 6px; }
.mockup-appbar-frame {
height: 56px; background: #F8FAFC; border: 1.5px dashed #94A3B8; border-radius: 12px;
display: flex; align-items: center; padding: 0 16px; gap: 12px; transition: all 0.2s ease;
}
.mockup-arrow { width: 20px; height: 20px; fill: var(--text-main); }
.mockup-brand-text { font-size: 17px; font-weight: 700; color: var(--text-main); letter-spacing: -0.01em; }
.mockup-brand-img { max-height: 32px; max-width: 160px; object-fit: contain; }
/* 文本模式表单 */
.brand-form-stack { display: flex; flex-direction: column; gap: 16px; }
.input-outline-group {
position: relative; display: flex; flex-direction: column; gap: 6px;
}
.input-label-floating {
font-size: 13.5px; font-weight: 700; color: var(--text-main);
}
.text-input-field {
width: 100%; height: 46px; border: 1.5px solid #CBD5E1; border-radius: 10px; padding: 0 14px;
font-size: 15px; font-weight: 600; color: var(--text-main); outline: none; transition: all 0.15s ease;
}
.text-input-field:focus {
border-color: var(--color-primary); box-shadow: 0 0 0 3.5px var(--color-primary-light);
}
.char-counter-row {
display: flex; justify-content: space-between; font-size: 12px; color: var(--text-sub);
}
.counter-num { font-family: ui-monospace, monospace; font-weight: 700; color: var(--color-primary); }
/* 图片 Logo 模式上传卡与预设选择器 */
.image-upload-dropzone {
border: 2px dashed #93C5FD; border-radius: 12px; background: var(--color-primary-light); padding: 24px;
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
cursor: pointer; transition: all 0.2s ease;
}
.image-upload-dropzone:hover {
border-color: var(--color-primary); background: #DBEAFE;
}
.preset-logos-row {
display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.preset-chip {
height: 30px; padding: 0 12px; border-radius: 6px; background: #F1F5F9; border: 1px solid var(--divider);
font-size: 12px; font-weight: 600; color: var(--text-main); cursor: pointer; display: flex; align-items: center;
transition: all 0.15s ease;
}
.preset-chip:hover {
background: var(--color-primary-light); border-color: var(--color-primary-border); color: var(--color-primary);
}
/* Toast 提示 */
.toast-notice {
position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0;
background: #0F172A; color: white; padding: 12px 24px; border-radius: 100px; font-size: 13.5px; font-weight: 600;
box-shadow: 0 10px 30px rgba(0,0,0,0.25); display: flex; align-items: center; gap: 8px; pointer-events: none;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1000;
}
.toast-notice.show {
transform: translateX(-50%) translateY(0); opacity: 1;
}
</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">Logo 授权管理</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="split-body">
<!-- 左侧 360px 模式切换与授权大盘 -->
<div class="left-brand-panel">
<div style="display: flex; flex-direction: column; gap: 18px;">
<div>
<h2 class="panel-header-title">🛡️ 品牌授权中心</h2>
<p class="panel-header-desc">自定义顶部导航栏团队标识与商业品牌</p>
</div>
<!-- 分段控制器 -->
<div class="segmented-control-box">
<button class="seg-btn active" id="btnModeText" onclick="switchLogoMode('text')">
<svg style="width: 16px; height: 16px; fill: currentColor;" viewBox="0 0 24 24"><path d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/></svg>
<span>文本 Logo</span>
</button>
<button class="seg-btn" id="btnModeImage" onclick="switchLogoMode('image')">
<svg style="width: 16px; height: 16px; fill: currentColor;" viewBox="0 0 24 24"><path d="M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2zM8.5 13.5l2.5 3 3.5-4.5 4.5 6H5l3.5-4.5z"/></svg>
<span>图片 Logo</span>
</button>
</div>
<!-- 授权规则说明卡片 -->
<div class="brand-info-card">
<div class="info-row">
<span style="color: var(--text-sub);">当前模式</span>
<b style="color: var(--color-primary);" id="curModeLabel">文本品牌名称</b>
</div>
<div class="info-row">
<span style="color: var(--text-sub);" id="infoLimitLabel">字符限制</span>
<span style="font-weight: 700; color: var(--text-main);" id="infoLimitVal">最长 15 字符</span>
</div>
<div class="info-row">
<span style="color: var(--text-sub);">全端同步</span>
<span style="color: var(--color-success); font-weight: 700;">实时生效</span>
</div>
</div>
</div>
<!-- 底部全宽保存与恢复按钮 -->
<div class="side-actions-stack">
<button class="btn-dynamic-full btn-primary-gradient" id="btnSaveConfig" onclick="handleSaveConfig()">
<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 id="btnSaveText">保存文本配置</span>
</button>
<button class="btn-dynamic-full btn-secondary-ghost" id="btnResetConfig" onclick="handleResetConfig()">
<span id="btnResetText">恢复默认名称</span>
</button>
</div>
</div>
<!-- 右侧 1fr 实时效果模拟舱与配置工坊 -->
<div class="right-studio-panel">
<div>
<div class="studio-section-header">
<span class="studio-title">顶部栏实时效果预览</span>
<span style="font-size: 12px; color: var(--text-sub);">所见即所得 · 打字/选图即时同步渲染</span>
</div>
<!-- 顶部栏实时预览模拟舱 (Live Mockup Bar) -->
<div class="live-mockup-container" style="margin-top: 14px;">
<div class="mockup-appbar-frame" id="mockupFrame">
<svg class="mockup-arrow" 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>
<span class="mockup-brand-text" id="mockupText">EAP Manage</span>
<img class="mockup-brand-img" id="mockupImg" src="" style="display: none;" alt="Logo Preview">
</div>
</div>
</div>
<!-- 文本模式表单 -->
<div class="brand-form-stack" id="textModeForm">
<div class="input-outline-group">
<label class="input-label-floating" for="iptTeamName">输入自定义团队名称</label>
<input type="text" class="text-input-field" id="iptTeamName" value="EAP Manage" maxlength="15" oninput="handleInputSync(this.value)">
<div class="char-counter-row">
<span>用于替换系统所有页面的顶部团队标头</span>
<span class="counter-num" id="charCounter">10/15</span>
</div>
</div>
</div>
<!-- 图片模式表单 (可点击真机上传文件,也可选择预设) -->
<div class="brand-form-stack" id="imageModeForm" style="display: none;">
<input type="file" id="realFileInput" accept="image/png, image/svg+xml, image/jpeg" style="display: none;" onchange="handleRealFileSelected(event)">
<div class="image-upload-dropzone" onclick="document.getElementById('realFileInput').click()">
<svg style="width: 36px; height: 36px; fill: var(--color-primary);" viewBox="0 0 24 24"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/></svg>
<b style="font-size: 14.5px; color: var(--color-primary);" id="uploadZoneText">点击或拖拽上传企业 Logo 图片</b>
<span style="font-size: 12px; color: var(--text-sub);">支持 PNG / SVG 透明背景,建议尺寸 180×48 px,单张小于 2MB</span>
</div>
<div>
<span style="font-size: 12.5px; font-weight: 700; color: var(--text-sub);">快速预设体验:</span>
<div class="preset-logos-row">
<button class="preset-chip" onclick="applyPresetLogo('MedTech', '%23059669', '🏥 MedTech Pro')">🏥 医疗健康 (MedTech)</button>
<button class="preset-chip" onclick="applyPresetLogo('GymHub', '%232563EB', '⚡ GYM HUB')">⚡ 极客健身 (GymHub)</button>
<button class="preset-chip" onclick="applyPresetLogo('UmiLab', '%23E11D48', '🧬 UmiLab AI')">🧬 智能实验室 (UmiLab)</button>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="toast-notice" id="toastBox">
<span id="toastIcon">✅</span>
<span id="toastMsg">配置已保存!</span>
</div>
<script>
let currentMode = 'text';
function showToast(msg, icon = '✅') {
const toast = document.getElementById('toastBox');
document.getElementById('toastMsg').innerText = msg;
document.getElementById('toastIcon').innerText = icon;
toast.classList.add('show');
setTimeout(() => toast.classList.remove('show'), 2400);
}
function switchLogoMode(mode) {
currentMode = mode;
const btnText = document.getElementById('btnModeText');
const btnImg = document.getElementById('btnModeImage');
const textForm = document.getElementById('textModeForm');
const imgForm = document.getElementById('imageModeForm');
const curModeLabel = document.getElementById('curModeLabel');
const infoLimitLabel = document.getElementById('infoLimitLabel');
const infoLimitVal = document.getElementById('infoLimitVal');
const btnSaveText = document.getElementById('btnSaveText');
const btnResetText = document.getElementById('btnResetText');
const mockupText = document.getElementById('mockupText');
const mockupImg = document.getElementById('mockupImg');
if (mode === 'text') {
btnText.className = 'seg-btn active';
btnImg.className = 'seg-btn';
textForm.style.display = 'flex';
imgForm.style.display = 'none';
curModeLabel.innerText = '文本品牌名称';
infoLimitLabel.innerText = '字符限制';
infoLimitVal.innerText = '最长 15 字符';
btnSaveText.innerText = '保存文本配置';
btnResetText.innerText = '恢复默认名称';
mockupText.style.display = 'inline';
mockupImg.style.display = 'none';
} else {
btnText.className = 'seg-btn';
btnImg.className = 'seg-btn active';
textForm.style.display = 'none';
imgForm.style.display = 'flex';
curModeLabel.innerText = '自定义图片 Logo';
infoLimitLabel.innerText = '建议规格';
infoLimitVal.innerText = '180×48 px (PNG/SVG)';
btnSaveText.innerText = '保存图片配置';
btnResetText.innerText = '恢复默认 Logo';
mockupText.style.display = 'none';
mockupImg.style.display = 'inline';
if (!mockupImg.src) {
applyPresetLogo('MedTech', '%232563EB', 'COMPANY LOGO');
}
}
}
function handleInputSync(val) {
document.getElementById('mockupText').innerText = val || 'EAP Manage';
const counter = document.getElementById('charCounter');
counter.innerText = `${val.length}/15`;
counter.style.color = val.length > 15 ? 'var(--color-danger)' : 'var(--color-primary)';
}
function handleRealFileSelected(event) {
const file = event.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
const mockupImg = document.getElementById('mockupImg');
mockupImg.src = e.target.result;
document.getElementById('uploadZoneText').innerText = `已载入: ${file.name} (${Math.round(file.size/1024)} KB)`;
showToast(`已成功载入图片 ${file.name}!顶部栏已即时预览`);
};
reader.readAsDataURL(file);
}
}
function applyPresetLogo(tag, colorHex, textLabel) {
const mockupImg = document.getElementById('mockupImg');
mockupImg.src = `data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="32" viewBox="0 0 140 32"><rect width="140" height="32" rx="6" fill="${colorHex}"/><text x="70" y="21" fill="white" font-size="13" font-family="sans-serif" font-weight="bold" text-anchor="middle">${textLabel}</text></svg>`;
document.getElementById('uploadZoneText').innerText = `已应用预设: ${textLabel}`;
showToast(`已应用预设 Logo:${textLabel}`);
}
function handleSaveConfig() {
if (currentMode === 'text') {
const val = document.getElementById('iptTeamName').value.trim();
showToast(`文本配置已保存!全端顶部标头已同步为 "${val || 'EAP Manage'}"`);
} else {
showToast('图片 Logo 配置已成功保存并下发全端!');
}
}
function handleResetConfig() {
if (currentMode === 'text') {
document.getElementById('iptTeamName').value = 'EAP Manage';
handleInputSync('EAP Manage');
showToast('已恢复默认团队名称: EAP Manage');
} else {
applyPresetLogo('Default', '%232563EB', 'COMPANY LOGO');
document.getElementById('uploadZoneText').innerText = '点击或拖拽上传企业 Logo 图片';
showToast('已恢复为默认企业 Logo');
}
}
</script>
</body>
</html>