feat(ui): 完成【版型切换】与【心率区间设置】页面 UI 重构及标准物料交付
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
---
|
||||
title: "APP界面优化 - 选择版型页面 (Edition Selection)"
|
||||
status: "TODO"
|
||||
created: "2026-08-17"
|
||||
level: 1
|
||||
---
|
||||
|
||||
# 任务目标
|
||||
对系统设置子页面【选择版型 / 版型切换】执行 UI 交互与视觉重构(**严格纯美化,禁止修改/增删字段**)。
|
||||
核心解决两大问题:
|
||||
1. **彻底修复描边逻辑颠倒 Bug**:原版中专业版硬编码为蓝框、自定义版硬编码为绿框,现统一纠正为:选中态 = Primary 蓝描边 + 浅蓝底,未选中态 = 中性细描边;
|
||||
2. **消弭宽屏单列失衡**:升级为 **Split Studio 宽屏沉浸双栏架构**(左侧 320dp 决策说明与当前生效版型联动面板 + 右侧卡片选择区),与【语言设置】形成全 App 统一的控制台体验。
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ 开发依据(标准物料约束)
|
||||
> 🚨 **绝对约束**:请 `@coder` 在修改代码前,**必须**完整阅读本工作台目录下的全部物料,严禁自行发挥排版!
|
||||
>
|
||||
> **工作台路径**:`设置页面UI优化/版型切换/`
|
||||
> 1. `baseline_ui.html`:**[必读]** 终极 HTML/CSS 排版基准源代码(双栏布局、卡片选中态、状态联动、Token 声明)。
|
||||
> 2. `DESIGN_SPEC.md`:**[必读]** 视觉边界手册(双栏尺寸、卡片圆角、描边状态机、响应式断点)。
|
||||
> 3. `implementation_plan.md`:**[必读]** CSS → Android Token 映射字典与原生落地清单。
|
||||
>
|
||||
> **原始出厂截屏**(信息字段保底凭证,只读):
|
||||
> - `Screenshot_20260812_143347.png`
|
||||
|
||||
---
|
||||
|
||||
## 📂 涉及文件清单
|
||||
|
||||
**1. Layout**
|
||||
- `app/src/main/res/layout/activity_edition_selection.xml`
|
||||
|
||||
**2. Java / Activity**
|
||||
- `app/src/main/java/com/umilab/eapmanage/team/edition/EditionSelectionActivity.java`
|
||||
|
||||
**3. 资源与样式 (Resources & Drawables)**
|
||||
- `app/src/main/res/drawable/selector_edition_card_bg.xml`(新建)
|
||||
- `app/src/main/res/values/dimens.xml`(补充 `settings_sidebar_width_wide`)
|
||||
|
||||
---
|
||||
|
||||
## 📋 执行步骤清单
|
||||
1. **重构布局结构**:将 `activity_edition_selection.xml` 改为 AppBar + 居中 940dp 水平双栏容器(左侧 320dp 概览面板,右侧卡片选择区)。
|
||||
2. **两张版型卡片重构**:设置 16dp 圆角,左侧放置 RadioButton 与 4dp Active 竖向光条,右侧为版型名称与描述。
|
||||
3. **修复描边与背景状态机**:移除原硬编码蓝/绿描边,绑定 `selector_edition_card_bg.xml`,选中态展示 `colorPrimaryContainer` 浅蓝底 + `colorPrimary` 蓝描边。
|
||||
4. **左侧当前版型联动**:在 `EditionSelectionActivity.java` 中将点击事件与左侧 `tv_current_selected_edition` 文本实现实时刷新。
|
||||
5. **确认按钮**:底部设置浅绿确认按钮(`Widget.EAPManage.Button.Tonal` / `colorSecondaryContainer`),高度 48dp。
|
||||
6. **字段核验**:确保原图所有文案与红框柱状图图标 100% 完整保留。
|
||||
|
||||
---
|
||||
|
||||
## ✅ 验收标准
|
||||
- [ ] 平板横屏下展示为居中双栏控制台布局,大屏视觉平衡饱满。
|
||||
- [ ] 彻底纠正描边逻辑错误(选中为 Primary 蓝描边+浅蓝底,未选中为中性细描边,两张卡逻辑严格一致)。
|
||||
- [ ] 原版红框柱状图图标与所有文本字段 100% 对应原图,无任何遗漏。
|
||||
- [ ] 点击卡片时,选中背景、指示条、Radio 动画及左侧状态面板同步联动。
|
||||
- [ ] 所有颜色与尺寸严格使用 Android 语义 Token,无任何 XML 硬编码。
|
||||
@@ -0,0 +1,64 @@
|
||||
# 选择版型页面 — 视觉边界手册 DESIGN_SPEC
|
||||
|
||||
- **模块**:系统设置子页面 — 选择版型 / 版型切换 (`EditionSelectionActivity`)
|
||||
- **日期**:2026-08-17
|
||||
- **视觉基准**:同目录 `baseline_ui.html`(Split Studio 双栏专业控制台架构)
|
||||
- **原始出厂截图**(只读引用):`./Screenshot_20260812_143347.png`
|
||||
|
||||
> **铁律复述**:本次重构为纯 UI 视觉升级与描边逻辑修复。全量字段名、描述文本、Icon 图标及按钮交互全部 100% 保留,严禁篡改任何业务字段。
|
||||
|
||||
---
|
||||
|
||||
## 1. 宽屏平板布局架构 (Split Master-Detail 栅格规范)
|
||||
|
||||
### 1.1 现状缺陷剖析
|
||||
1. **描边逻辑颠倒 Bug**:原截图 `Screenshot_20260812_143347.png` 中,“专业版(未选中)”硬编码为蓝框,“自定义功能版(已选中)”硬编码为绿框,描边与卡片身份绑死,严重误导用户。
|
||||
2. **超宽拉伸失衡**:在 16:10 / 16:9 横屏平板下,单列卡片横跨整个屏幕,文字空旷,视觉焦点极度涣散。
|
||||
|
||||
### 1.2 目标架构规范 (Split Studio 双栏控制台)
|
||||
|
||||
| 规范项 | 参数值 | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| **内容容器最大宽度** | **940dp** (`--content-max-width`) | 超出宽度时屏幕左右自动居中留白 (`margin: 0 auto`) |
|
||||
| **左侧概览面板 (Master)** | **固定 320dp** (`--sidebar-width`) | 包含原版红框 3 柱状图图标、大标题“选择版型”、说明副文本、当前选定版型状态卡片 |
|
||||
| **右侧卡片选择区 (Detail)** | **自适应 1fr** (~596dp) | 纵向排布两张版型卡片 + 底部确认按钮 |
|
||||
| **AppBar 顶部栏** | **通栏 60dp** (`--appbar-height`) | 标题 20sp/600,返回箭头 48dp 触控槽 |
|
||||
| **卡片圆角与间距** | **16dp 圆角** / **16dp 间距** | 1.5px 精细边框 + 微投影 Level 1 |
|
||||
| **响应式断点** | **768dp** | `< 768dp`(分屏/竖屏)时自动回落为单列流式堆叠 |
|
||||
|
||||
---
|
||||
|
||||
## 2. 字段与槽位核验清单 (100% 对齐原图)
|
||||
|
||||
| # | 区域 | 字段 / 元素标识 | 初始状态 / 规范 |
|
||||
| :-: | :--- | :--- | :--- |
|
||||
| 1 | **AppBar** | 返回箭头 `(←)` | 48dp 触控槽,点击返回上一级 |
|
||||
| 2 | **AppBar** | `选择版型` | 20sp / 600 字重 / `--text-primary` |
|
||||
| 3 | **Hero 引导** | 红框柱状图图标 | 52dp 尺寸,原版红框 `#FF5252`,内含 3 根垂直条 |
|
||||
| 4 | **Hero 引导** | `选择版型` | 21sp / 700 字重 / `--text-primary` |
|
||||
| 5 | **Hero 引导** | `请选择适合您使用场景的版型,后续可在设置中更改` | 13.5sp / `--text-secondary` / 1.6 行高 |
|
||||
| 6 | **卡片 1** | 单选 Radio 钮 | 未选中态(空心圆圈) |
|
||||
| 7 | **卡片 1** | `专业版` | 17.5sp / 700 字重 |
|
||||
| 8 | **卡片 1** | `为专业场馆管理员设计,布局固定专业化,核心数据字段默认全开,开箱即用` | 13.8sp / `--text-secondary` |
|
||||
| 9 | **卡片 2** | 单选 Radio 钮 | **默认选中态**(实心圆点) |
|
||||
| 10 | **卡片 2** | `自定义功能版` | 17.5sp / 700 字重 |
|
||||
| 11 | **卡片 2** | `高度可配置,所有高级功能开放,适合研究员和高级用户` | 13.8sp / `--text-secondary` |
|
||||
| 12 | **动作区** | `确定` 按钮 | 浅绿底 `--color-secondary-container` + 绿字 `--color-secondary`,48dp 高,12dp 圆角 |
|
||||
|
||||
---
|
||||
|
||||
## 3. 状态机与交互规范
|
||||
|
||||
### 3.1 卡片状态机 (彻底纠正原图颠倒逻辑)
|
||||
|
||||
| 状态 | 描边 (Border) | 背景色 | 左侧 Active 指示条 | RadioButton | 投影 |
|
||||
| :--- | :--- | :--- | :--- | :--- | :--- |
|
||||
| **未选中 (Unselected)** | `1.5dp --divider` (`#E2E8F0`) | `#FFFFFF` | `opacity: 0` | 2dp `#CBD5E1` 空心圈 | Level 1 |
|
||||
| **悬停 (Hover)** | `1.5dp #94A3B8` | `#F8FAFC` | `opacity: 0` | 不变 | Level 2 |
|
||||
| **选中态 (Selected)** | `1.5dp --color-primary` (`#3949AB`) | `--color-primary-container` (`#EEF2FF`) | `opacity: 1; scaleY: 1` (`#3949AB`) | 2dp `#3949AB` 圈 + 10dp 实心蓝点 | Level 2 + 蓝光 |
|
||||
| **点击 (Pressed)** | 保持 | 略微加深 4% | 保持 | 触发缩放涟漪 | Level 1 |
|
||||
|
||||
### 3.2 左右状态联动
|
||||
- 当用户点击右侧任一版型卡片时:
|
||||
1. 当前卡片获得选中态,另一张卡片恢复未选中态;
|
||||
2. 左侧侧边栏底部的「当前选定版型」文案即时联动刷新(如“自定义功能版” $\leftrightarrow$ “专业版”)。
|
||||
@@ -0,0 +1,456 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>EAPManageUI - 选择版型 (UI 重构基准)</title>
|
||||
<style>
|
||||
/* =========================================================================
|
||||
:root 全量 Design Tokens 声明 (与系统设置全局规范严格对齐)
|
||||
========================================================================= */
|
||||
: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-secondary: #00897B;
|
||||
--color-secondary-container: #E0F2F1;
|
||||
--color-on-secondary: #FFFFFF;
|
||||
--color-secondary-hover: #C8ECE7;
|
||||
|
||||
/* ── 表面与背景 ── */
|
||||
--color-surface: #FFFFFF;
|
||||
--color-surface-variant: #F8FAFC;
|
||||
--color-background: #F1F5F9;
|
||||
|
||||
/* ── 文本语义色 ── */
|
||||
--text-primary: #0F172A;
|
||||
--text-secondary: #64748B;
|
||||
--text-disabled: #CBD5E1;
|
||||
|
||||
/* ── 边框与分割线 ── */
|
||||
--divider: #E2E8F0;
|
||||
--outline: #CBD5E1;
|
||||
|
||||
/* ── 圆角阶梯 ── */
|
||||
--corner-sm: 8px;
|
||||
--corner-md: 12px;
|
||||
--corner-lg: 16px;
|
||||
--corner-pill: 999px;
|
||||
|
||||
/* ── 阴影阶梯 ── */
|
||||
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03);
|
||||
--shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
|
||||
--shadow-lg: 0 16px 36px -8px rgba(15, 23, 42, 0.08);
|
||||
|
||||
/* ── 尺寸与栅格 ── */
|
||||
--content-max-width: 940px;
|
||||
--sidebar-width: 320px;
|
||||
--appbar-height: 60px;
|
||||
--touch-min: 48px;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
html {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||
"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
||||
background: var(--color-background);
|
||||
color: var(--text-primary);
|
||||
min-height: 100vh;
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 视口模拟器容器 */
|
||||
.screen-container {
|
||||
width: 100%;
|
||||
max-width: 1060px;
|
||||
margin: 0 auto;
|
||||
background: var(--color-surface);
|
||||
border-radius: 20px;
|
||||
border: 1px solid var(--divider);
|
||||
box-shadow: var(--shadow-lg);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* AppBar 顶部导航栏 */
|
||||
.appbar {
|
||||
height: var(--appbar-height);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 24px;
|
||||
background: var(--color-surface);
|
||||
border-bottom: 1px solid var(--divider);
|
||||
}
|
||||
|
||||
.appbar-nav {
|
||||
width: var(--touch-min);
|
||||
height: var(--touch-min);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: var(--corner-md);
|
||||
cursor: pointer;
|
||||
background: var(--color-surface-variant);
|
||||
border: 1px solid var(--divider);
|
||||
transition: all 0.15s ease;
|
||||
margin-left: -4px;
|
||||
}
|
||||
|
||||
.appbar-nav:hover {
|
||||
background: #E2E8F0;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.appbar-nav svg {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
fill: var(--text-primary);
|
||||
}
|
||||
|
||||
.appbar-title {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-left: 14px;
|
||||
letter-spacing: -0.2px;
|
||||
}
|
||||
|
||||
/* 双栏主体布局 */
|
||||
.page-body {
|
||||
padding: 32px 28px 40px;
|
||||
background: var(--color-background);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.master-detail-layout {
|
||||
width: 100%;
|
||||
max-width: var(--content-max-width);
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
/* 左侧概览面板 (Master Summary) */
|
||||
.summary-sidebar {
|
||||
flex: 0 0 var(--sidebar-width);
|
||||
background: var(--color-surface);
|
||||
border-radius: var(--corner-lg);
|
||||
border: 1px solid var(--divider);
|
||||
box-shadow: var(--shadow-sm);
|
||||
padding: 28px 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 出厂原版粉红/红框柱状图图标 (高精细度还原) */
|
||||
.sidebar-icon-box {
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border: 2.5px solid #FF5252;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
padding: 8px 6px;
|
||||
gap: 4px;
|
||||
background: #FFFFFF;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 4px 12px rgba(255, 82, 82, 0.12);
|
||||
}
|
||||
|
||||
.sidebar-icon-box .bar {
|
||||
width: 6px;
|
||||
background: #FF5252;
|
||||
border-radius: 2px 2px 0 0;
|
||||
}
|
||||
|
||||
.sidebar-icon-box .b1 { height: 14px; }
|
||||
.sidebar-icon-box .b2 { height: 26px; }
|
||||
.sidebar-icon-box .b3 { height: 18px; }
|
||||
|
||||
.sidebar-title {
|
||||
font-size: 21px;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 8px;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.sidebar-desc {
|
||||
font-size: 13.5px;
|
||||
line-height: 1.6;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
/* 当前选定状态联动卡片 */
|
||||
.status-pill-box {
|
||||
margin-top: auto;
|
||||
background: var(--color-surface-variant);
|
||||
border: 1px solid var(--divider);
|
||||
border-radius: var(--corner-md);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.status-label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.status-value {
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
color: var(--color-primary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #10B981;
|
||||
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
|
||||
}
|
||||
|
||||
/* 右侧选择区与操作 */
|
||||
.main-selection {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.edition-card {
|
||||
background: var(--color-surface);
|
||||
border: 1.5px solid var(--divider);
|
||||
border-radius: var(--corner-lg);
|
||||
padding: 22px 24px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 18px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
box-shadow: var(--shadow-sm);
|
||||
position: relative;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.edition-card:hover {
|
||||
border-color: #94A3B8;
|
||||
background: #F8FAFC;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.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);
|
||||
}
|
||||
|
||||
/* 选中左侧指示光条 */
|
||||
.card-active-indicator {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 18px;
|
||||
bottom: 18px;
|
||||
width: 4px;
|
||||
border-radius: 0 4px 4px 0;
|
||||
background: var(--color-primary);
|
||||
opacity: 0;
|
||||
transform: scaleY(0.4);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.edition-card.is-selected .card-active-indicator {
|
||||
opacity: 1;
|
||||
transform: scaleY(1);
|
||||
}
|
||||
|
||||
.radio-slot {
|
||||
margin-top: 2px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.radio-outer {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--outline);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #FFFFFF;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.edition-card.is-selected .radio-outer {
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.radio-inner {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: var(--color-primary);
|
||||
opacity: 0;
|
||||
transform: scale(0.3);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.edition-card.is-selected .radio-inner {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.edition-info { flex: 1; }
|
||||
|
||||
.edition-name {
|
||||
font-size: 17.5px;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 6px;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.edition-card.is-selected .edition-name {
|
||||
color: var(--color-on-primary-container);
|
||||
}
|
||||
|
||||
.edition-desc {
|
||||
font-size: 13.8px;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.btn-confirm-wrap {
|
||||
margin-top: auto;
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
background: var(--color-secondary-container);
|
||||
color: var(--color-secondary);
|
||||
border: 1px solid rgba(0, 137, 123, 0.2);
|
||||
border-radius: var(--corner-md);
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
letter-spacing: 0.05em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-confirm:hover {
|
||||
background: var(--color-secondary-hover);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 12px rgba(0, 137, 123, 0.15);
|
||||
}
|
||||
|
||||
.btn-confirm:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.master-detail-layout {
|
||||
flex-direction: column;
|
||||
}
|
||||
.summary-sidebar {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="screen-container">
|
||||
<header class="appbar">
|
||||
<div 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></div>
|
||||
<h1 class="appbar-title">选择版型</h1>
|
||||
</header>
|
||||
|
||||
<main class="page-body">
|
||||
<div class="master-detail-layout">
|
||||
<!-- 左侧状态概览面板 -->
|
||||
<aside class="summary-sidebar">
|
||||
<div class="sidebar-icon-box">
|
||||
<div class="bar b1"></div>
|
||||
<div class="bar b2"></div>
|
||||
<div class="bar b3"></div>
|
||||
</div>
|
||||
<h2 class="sidebar-title">选择版型</h2>
|
||||
<p class="sidebar-desc">请选择适合您使用场景的版型,后续可在设置中更改</p>
|
||||
|
||||
<div class="status-pill-box">
|
||||
<div class="status-label">当前选定版型</div>
|
||||
<div class="status-value">
|
||||
<span class="status-dot"></span>
|
||||
<span id="currEditionLabel">自定义功能版</span>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- 右侧版型卡片选择区 -->
|
||||
<section class="main-selection" id="editionGroup">
|
||||
<div class="edition-card" onclick="selectEdition(this, '专业版')">
|
||||
<div class="card-active-indicator"></div>
|
||||
<div class="radio-slot"><div class="radio-outer"><div class="radio-inner"></div></div></div>
|
||||
<div class="edition-info">
|
||||
<h3 class="edition-name">专业版</h3>
|
||||
<p class="edition-desc">为专业场馆管理员设计,布局固定专业化,核心数据字段默认全开,开箱即用</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="edition-card is-selected" onclick="selectEdition(this, '自定义功能版')">
|
||||
<div class="card-active-indicator"></div>
|
||||
<div class="radio-slot"><div class="radio-outer"><div class="radio-inner"></div></div></div>
|
||||
<div class="edition-info">
|
||||
<h3 class="edition-name">自定义功能版</h3>
|
||||
<p class="edition-desc">高度可配置,所有高级功能开放,适合研究员和高级用户</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-confirm-wrap">
|
||||
<button class="btn-confirm">确定</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function selectEdition(el, name) {
|
||||
document.querySelectorAll('.edition-card').forEach(c => c.classList.remove('is-selected'));
|
||||
el.classList.add('is-selected');
|
||||
document.getElementById('currEditionLabel').innerText = name;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,81 @@
|
||||
# 选择版型页面 — 原生落地图纸 implementation_plan
|
||||
|
||||
- **模块**:系统设置 — 版型切换 (`EditionSelectionActivity`)
|
||||
- **依据**:同目录 `baseline_ui.html` + `DESIGN_SPEC.md`
|
||||
- **原始出厂截图**:`./Screenshot_20260812_143347.png`
|
||||
- **执行角色**:`@coder` (Android 工程师)
|
||||
|
||||
---
|
||||
|
||||
## 1. CSS → Android Token 映射字典
|
||||
|
||||
### 1.1 颜色语义映射
|
||||
|
||||
| HTML CSS 变量 | 取值 | Android 语义 Token / 资源 ID | 状态 / 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `--color-primary` | `#3949AB` | `?attr/colorPrimary` (`@color/color_primary`) | ✅ 已存在,选中卡片描边与指示器 |
|
||||
| `--color-on-primary` | `#FFFFFF` | `?attr/colorOnPrimary` | ✅ 已存在 |
|
||||
| `--color-primary-container` | `#EEF2FF` | `?attr/colorPrimaryContainer` (`@color/color_primary_container`) | ✅ 已存在,选中卡片底色 |
|
||||
| `--color-on-primary-container` | `#1A237E` | `?attr/colorOnPrimaryContainer` | ✅ 已存在,选中卡片标题色 |
|
||||
| `--color-secondary` | `#00897B` | `?attr/colorSecondary` (`@color/color_secondary`) | ✅ 已存在,确认按钮文字 |
|
||||
| `--color-secondary-container` | `#E0F2F1` | `?attr/colorSecondaryContainer` (`@color/color_secondary_container`) | ✅ 已存在,确认按钮浅绿底色 |
|
||||
| `--color-surface` | `#FFFFFF` | `?attr/colorSurface` (`@color/color_surface`) | ✅ 已存在,卡片背景色 |
|
||||
| `--color-surface-variant` | `#F8FAFC` | `?attr/colorSurfaceVariant` | ✅ 已存在,侧边栏底色 |
|
||||
| `--color-background` | `#F1F5F9` | `?attr/colorBackground` (`@color/color_background`) | ✅ 已存在,页面底色 |
|
||||
| `--text-primary` | `#0F172A` | `@color/text_primary` | ✅ 已存在,主标题与主要文字 |
|
||||
| `--text-secondary` | `#64748B` | `@color/text_secondary` | ✅ 已存在,说明副文本 |
|
||||
| `--divider` | `#E2E8F0` | `@color/divider` | ✅ 已存在,分割线与浅描边 |
|
||||
| `--outline` | `#CBD5E1` | `@color/outline` | ✅ 已存在,单选外圈 |
|
||||
|
||||
### 1.2 尺寸与间距 Token 映射
|
||||
|
||||
| HTML CSS 变量 | 取值 | Android 推荐 Token | 规范落地建议 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `--content-max-width` | 940px | `@dimen/content_max_width_split` (940dp) | 宽屏双栏内容容器最大宽度 |
|
||||
| `--sidebar-width` | 320px | `@dimen/settings_sidebar_width_wide` (320dp) | 左侧状态概览面板固定宽度 |
|
||||
| `--appbar-height` | 60px | `@dimen/appbar_height` (60dp 或复用 56dp) | Toolbar 高度 |
|
||||
| `--corner-md` | 12px | `@dimen/corner_radius_md` (12dp) | 按钮与内部小组件圆角 |
|
||||
| `--corner-lg` | 16px | `@dimen/corner_radius_lg` (16dp) | 版型卡片与侧边面板圆角 |
|
||||
| `--spacing-md` | 16px | `@dimen/spacing_md` (16dp) | 卡片间距 |
|
||||
| `--spacing-lg` | 24px | `@dimen/spacing_xl` (24dp) | 双栏间距与安全边距 |
|
||||
|
||||
---
|
||||
|
||||
## 2. Android 落地代码清单与改动指南
|
||||
|
||||
### 2.1 涉及文件
|
||||
|
||||
1. **布局文件 (Layout)**
|
||||
- `app/src/main/res/layout/activity_edition_selection.xml`
|
||||
2. **逻辑类 (Activity)**
|
||||
- `app/src/main/java/com/umilab/eapmanage/team/edition/EditionSelectionActivity.java`
|
||||
3. **新增资源 (Drawable)**
|
||||
- `app/src/main/res/drawable/selector_edition_card_bg.xml` (卡片背景与描边选择器)
|
||||
- `app/src/main/res/drawable/ic_edition_histogram.xml` (原版红框柱状图矢量图标)
|
||||
|
||||
---
|
||||
|
||||
### 2.2 具体实施步骤
|
||||
|
||||
#### 步骤 1:重构 `activity_edition_selection.xml`
|
||||
- 将原有的单列居中布局重构为 **AppBar + 居中 940dp 水平双栏容器 (`LinearLayout horizontal`)**。
|
||||
- 左侧 `summary-sidebar`:放置原版红框柱状图图标、大标题“选择版型”、说明、及 `tv_current_selected_edition` 状态卡片。
|
||||
- 右侧 `main-selection`:放置两张 `MaterialCardView`(专业版与自定义功能版)以及底部 `btn_confirm` 确认按钮。
|
||||
|
||||
#### 步骤 2:修复卡片描边与选中状态
|
||||
- 移除原代码中与卡片身份死绑的硬编码边框颜色(彻底去除专业版硬编码蓝框、自定义版硬编码绿框)。
|
||||
- 卡片采用 `MaterialCardView` 统一绑定 `selector_edition_card_bg.xml` 或在 Activity 中动态设置 `strokeColor`/`cardBackgroundColor`:
|
||||
- 选中态:`strokeColor = ?attr/colorPrimary` (1.5dp), `cardBackgroundColor = ?attr/colorPrimaryContainer`
|
||||
- 未选中态:`strokeColor = ?attr/colorOutlineVariant` (1dp), `cardBackgroundColor = ?attr/colorSurface`
|
||||
|
||||
#### 步骤 3:`EditionSelectionActivity.java` 交互与联动
|
||||
- 点击卡片时,更新选中状态并刷新左侧 `tv_current_selected_edition` 文本。
|
||||
- 点击底部 `btn_confirm` 执行版型生效逻辑。
|
||||
|
||||
---
|
||||
|
||||
## 3. 验收核验标准
|
||||
- [ ] 平板横屏下展示为居中双栏控制台布局,视觉平衡饱满。
|
||||
- [ ] 彻底修复原图中一蓝一绿的描边逻辑错误(选中为 Primary 蓝描边+浅蓝底,未选中为中性浅描边)。
|
||||
- [ ] 原版红框柱状图图标、文案“选择版型”、“请选择适合您使用场景的版型,后续可在设置中更改”、“专业版”、“自定义功能版”、“确定”全量保留无遗漏。
|
||||
- [ ] 所有颜色与尺寸严格使用 Android 语义 Token。
|
||||
Reference in New Issue
Block a user