docs: 整理工程目录并补上界面稿和测试用例

This commit is contained in:
dongjf 2026-11-24 20:17:36 +08:00
parent 0d1c8ba1c6
commit 8541ff3b49
37 changed files with 450 additions and 58 deletions

View File

@ -2,20 +2,13 @@
Item Atlas 是一个家庭物品台账。它记录东西放在哪、搬动过几次,以及有哪些配件和关联物品。平时也可以顺手给自己喜欢、用得顺手的东西评个分。
## 产品
## 工程目录
- [调研](docs/product/research.md)
- [产品设计](docs/product/overview.md)
- [需求与验收](docs/requirements.md)
- [低保真原型](docs/product/prototype.md)
| 目录 | 内容 |
| --- | --- |
| [backend/](backend/README.md) | Maven 后端,包含网关、物品服务、录入服务 |
| [apps/](apps/README.md) | H5、PC 网页、管理后台及 iOS、Android |
| [deploy/](deploy/README.md) | 本地运行、Kubernetes 和入口配置 |
| [docs/](docs/README.md) | 产品、UI、架构、部署说明和测试材料 |
## 技术方案
- [系统架构](docs/architecture.md)
- [客户端与后台](docs/clients.md)
- [部署与发布](docs/deployment.md)
- [可观测性与排错](docs/observability.md)
- [模型接入](docs/ai-providers.md)
- [测试与演示](docs/verification.md)
当前版本是设计稿。
当前版本处于设计阶段。可先看[产品需求](docs/product/requirements.md)、[界面方向稿](docs/ui/README.md)和[测试用例](docs/testing/cases.md)。

13
apps/README.md Normal file
View File

@ -0,0 +1,13 @@
# 客户端
| 路径 | 构建目标 | 制品名 |
| --- | --- | --- |
| `h5/` | uni-app 移动网页 | `item-atlas-h5` |
| `pc/` | 桌面浏览器网页 | `item-atlas-pc` |
| `admin/` | 管理后台 | `item-atlas-admin` |
| `ios/` | iOS 原生应用 | Item Atlas |
| `android/` | Android 原生应用 | Item Atlas |
前三个客户端独立构建,Web Dockerfile 随各自源码维护。各端对齐 OpenAPI 契约、错误码、术语和关键交互。Web 首版包含 H5、PC 和后台,原生端按各自设计和发布节奏推进。
[选型和交付方式](../docs/architecture/clients.md) · [UI 设计](../docs/ui/README.md)

0
apps/admin/.gitkeep Normal file
View File

0
apps/android/.gitkeep Normal file
View File

0
apps/h5/.gitkeep Normal file
View File

0
apps/ios/.gitkeep Normal file
View File

0
apps/pc/.gitkeep Normal file
View File

15
backend/README.md Normal file
View File

@ -0,0 +1,15 @@
# 后端
后端是一个 Maven 多模块构建。聚合与公共依赖版本放在 `backend/pom.xml`,三个模块各自构建镜像,通过服务接口通信。
| 路径 | 职责 | Maven artifactId |
| --- | --- | --- |
| `gateway/` | API 路由、认证入口、限流和灰度 | `item-atlas-gateway` |
| `inventory-service/` | 家庭权限、物品、位置、搜索、关联、评价和附件 | `item-atlas-inventory-service` |
| `intake-service/` | 草稿、模型、额度、异步任务和确认结果 | `item-atlas-intake-service` |
聚合项目使用 `item-atlas-backend`,Java 根包为 `com.tutudog.itematlas`。各模块采用 Maven 的 `src/main/java`、`src/main/resources`、`src/test/java` 和 `src/test/resources`。部署镜像的 Dockerfile 与各自模块放在一起。
业务服务按领域组织包,例如物品服务的 `item`、`location`、`household`。领域内有相关职责时再拆 `api`、`application`、`domain` 和 `infrastructure`。Flyway 脚本随所属服务放进 `src/main/resources/db/migration`。网关按路由和访问控制组织。
[系统架构](../docs/architecture/system.md) · [Maven 标准目录](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) · [Maven 多模块指南](https://maven.apache.org/guides/mini/guide-multiple-modules.html)

0
backend/gateway/.gitkeep Normal file
View File

View File

View File

11
deploy/README.md Normal file
View File

@ -0,0 +1,11 @@
# 部署配置
| 路径 | 用途 |
| --- | --- |
| `local/` | 本地联调和演示所需的 Compose 配置、样例环境变量 |
| `helm/item-atlas/` | Kubernetes Helm Chart,部署网关、业务服务和 Web 镜像 |
| `nginx/` | 公网入口的 Nginx 配置模板,包含 Host 匹配和转发规则 |
目录内放部署时能直接使用的文件。单个服务或 Web 应用的 Dockerfile 随源码维护。Drone 流水线文件随应用交付放在仓库根目录。提交的配置使用示例值,运行凭证从部署环境注入。
[部署架构与发布流程](../docs/deployment/overview.md)

9
docs/README.md Normal file
View File

@ -0,0 +1,9 @@
# 项目文档
| 阶段 | 内容 |
| --- | --- |
| 产品 | [调研](product/research.md)、[产品设计](product/overview.md)、[需求与验收](product/requirements.md) |
| UI | [界面设计与走查](ui/README.md)、[低保真原型](ui/wireframes.md) |
| 架构 | [系统架构](architecture/system.md)、[客户端选型](architecture/clients.md)、[模型接入](architecture/ai-providers.md)、[可观测性](architecture/observability.md) |
| 部署 | [部署架构、域名与发布](deployment/overview.md) |
| 测试 | [测试与演示计划](testing/plan.md)、[测试用例](testing/cases.md) |

View File

@ -0,0 +1,19 @@
# 客户端与后台
各端共用 API 契约、登录身份和家庭数据。先对齐 OpenAPI、错误码和关键交互,每个端按自己的使用场景安排页面。
| 端 | 技术选型 | 使用与交付 |
| --- | --- | --- |
| H5 | uni-app(Vue 3、TypeScript、Vite),使用 DCloud 的 CLI 模板 | 面向临时找物、相机上传和快速录入。首版构建 H5 静态文件,由 Nginx 镜像托管。 |
| PC 网页 | Vue 3、TypeScript、Vite、Vue Router | 面向批量草稿、详情查看和浏览位置树。独立 Nginx 镜像。 |
| 管理后台 | Vue 3、TypeScript、Vite、Vue Router、Element Plus | 用数据表格和表单处理模型状态、用量、用户及家庭管理。独立 Nginx 镜像。 |
| iOS | Swift、SwiftUI | Xcode 工程。原生调用相机和录音能力,直接请求项目的 HTTPS API。 |
| Android | Kotlin、Jetpack Compose | Gradle 工程。相机、录音走 Android 平台能力,使用同一 HTTPS API。 |
H5 选 uni-app 是为了用贴合移动端的组件和构建方式。正式交付范围只包含网页。微信小程序本期不列入需求、目录或构建目标。PC 和后台要处理高密度列表、桌面键盘交互以及表单,用标准 Vue 网页工程。Web 各端共享合适的 API 类型、校验和文案,H5 的 uni-app 组件单独维护。 [uni-app CLI](https://uniapp.dcloud.net.cn/worktile/CLI.html) · [uni-app Vue 3 TypeScript 模板](https://uniapp.dcloud.net.cn/quickstart-cli.html) · [Vue TypeScript](https://vuejs.org/guide/typescript/overview) · [Vue Router](https://router.vuejs.org/) · [Element Plus](https://element-plus.org/en-US/guide/quickstart)
三个 Web 站点在自己的域名下通过 `/api` 访问网关,原生端连接 `https://api-atlas.tutudog.com`。家庭权限由后端校验,后台接口另验管理角色。模型尚未配置时界面显示状态,凭证从服务环境读取。
首批界面定稿覆盖 H5、PC 和后台。iOS 与 Android 按原生平台的导航、拍照、录音及权限规范单独设计。最低系统版本、签名和商店发布安排在原生端启动时确认。 [SwiftUI](https://developer.apple.com/swiftui/) · [Jetpack Compose](https://developer.android.com/compose)
[客户端工程目录](../../apps/README.md) · [产品需求](../product/requirements.md) · [部署与域名](../deployment/overview.md)

View File

Before

Width:  |  Height:  |  Size: 289 KiB

After

Width:  |  Height:  |  Size: 289 KiB

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

Before

Width:  |  Height:  |  Size: 212 KiB

After

Width:  |  Height:  |  Size: 212 KiB

View File

@ -25,4 +25,4 @@ Prometheus 和 Grafana 先接入服务及集群指标,随后补 Alloy、Loki
演示至少验证一次模型慢请求、一次草稿处理积压和一次灰度回滚。记录观察到的信号、处理动作和恢复结果。
[系统架构](architecture.md) · [部署与发布](deployment.md)
[系统架构](system.md) · [部署与发布](../deployment/overview.md)

View File

@ -54,4 +54,4 @@ Spring Boot 负责服务本身,Spring Cloud 主要用 Gateway。域名和 TLS
普通搜索、手工录入与模型生成分开设超时。单机 Ollama 先按单并发推理,录入服务的任务队列有上限。云端先预留用户和项目额度,拿到实际用量再结算。投递按有限并发和退避重试控制积压,前端定期查状态。演示用两个家庭、并发确认、响应丢失和模型故障验证。吞吐和延迟以实测为准。
[需求与验收](requirements.md) · [模型接入](ai-providers.md) · [部署与发布](deployment.md) · [测试与演示](verification.md)
[需求与验收](../product/requirements.md) · [模型接入](ai-providers.md) · [部署与发布](../deployment/overview.md) · [测试与演示](../testing/plan.md)

View File

@ -1,17 +0,0 @@
# 客户端与后台
所有端共用 HTTPS API、登录身份和家庭数据。先统一接口与错误码,再做每个端的页面。
| 端 | 技术选型 | 交付形式 |
| --- | --- | --- |
| H5 | Vue 3、TypeScript、Vite,移动端自适应 | 独立 Docker 镜像,Nginx 托管。适合临时找物、相机上传和快速录入。 |
| PC 网页 | Vue 3、TypeScript、Vite,和 H5 共用物品组件及 API 类型 | 独立 Docker 镜像,Nginx 托管。适合批量录入、详情和浏览位置树。 |
| 管理后台 | Vue 3、TypeScript、Vite,独立的后台界面 | 独立 Docker 镜像,Nginx 托管。查看服务和模型状态、用户及家庭管理、用量和异常操作。 |
| iOS | 候选 Swift、SwiftUI | 原生应用,直接请求项目专用 HTTPS API。语音、相机和发布方式另行确定。 |
| Android | 候选 Kotlin、Jetpack Compose | 原生应用,直接请求同一 HTTPS API。语音、相机和发布方式另行确定。 |
PC 在本方案指桌面浏览器。Web 三端可以共用 API 类型、登录基础能力和界面组件,仍然分开构建与发布。Web 通过当前站点的 `/api` 访问网关,原生 App 走独立 API 域名。家庭访问权限在后端校验,后台接口使用独立角色。后台页面未配置的模型显示状态,凭证留在服务端。
第一批界面走查覆盖 H5、PC 和后台的主要任务。原生端技术选型作为后续方案,页面与功能顺序待确认。 [Vue TypeScript](https://vuejs.org/guide/typescript/overview) · [SwiftUI](https://developer.apple.com/swiftui/) · [Jetpack Compose](https://developer.android.com/compose)
[产品设计](product/overview.md) · [部署与域名](deployment.md)

View File

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 185 KiB

View File

@ -19,9 +19,9 @@ Kubernetes 的控制面和应用在同一虚拟机内。Helm 管理应用和可
公网 Nginx 负责证书和 HTTPS,保留 Host 和转发协议,走回环地址的 frp visitor。工作 Mac 的虚拟机用 STCP 接入现有 frps。集群入口 Nginx 依据 Host 转发到对应 Web Service,`/api` 统一转给 Spring Cloud Gateway。公网访问以 HTTPS 入口为边界,数据库、模型、监控和 Kubernetes 管理端口留在内网。家用 Mac 的模型请求只走家庭私网。 [frp STCP](https://gofrp.org/en/docs/examples/stcp/)
子域名统一采用 `用途-产品名`。移动网页用 `m`,PC 网页用 `pc`。DNS、证书与入口规则在域名确认后配置。
子域名统一采用 `用途-产品名`。移动网页用 `m`,PC 网页用 `pc`。以下命名已确定,DNS、证书与转发在部署时配置。
| 候选域名 | 指向 |
| 域名 | 指向 |
| --- | --- |
| `pc-atlas.tutudog.com` | PC 网页 |
| `m-atlas.tutudog.com` | 移动网页(H5) |
@ -43,4 +43,6 @@ Kubernetes 的控制面和应用在同一虚拟机内。Helm 管理应用和可
3. API 灰度先用受控请求验证候选版本,再按 Gateway 权重逐步放量。Web 静态制品按站点发布,在相应入口单独验证。兼容迁移先扩表、再切流,清理旧列放到后续版本。
4. 监控错误率、延迟、就绪状态和录入积压。异常时将网关流量切回稳定版并回退对应镜像。回退后检查数据库和未完成的录入任务。 [Gateway 权重路由](https://docs.spring.io/spring-cloud-gateway/reference/5.0/spring-cloud-gateway-server-webflux/request-predicates-factories.html#the-weight-route-predicate-factory)
当前 Gitea 和 Drone 的连接已通过历史构建验证。应用流水线随可编译的服务加入。 [可观测性与排错](observability.md)
当前 Gitea 和 Drone 的连接已通过历史构建验证。应用流水线随可编译的服务加入。 [可观测性与排错](../architecture/observability.md)
[部署配置目录](../../deploy/README.md)

View File

@ -15,10 +15,10 @@ Item Atlas 用来记录家里有什么、放在哪里、用起来怎么样。常
| 家庭范围 | 所有者管理成员,编辑成员录入或移位,查看成员可以找物。首版用两户演示数据验证权限。 |
| 模型辅助 | 本地模型作为默认选项,云端由用户选择。草稿能逐条改位置、跳过或确认。 |
H5、PC 网页和管理后台是首批界面。iOS 和 Android 已纳入整体设计,具体页面和功能顺序单独确定。后台负责管理和运行状态,不承担用户日常记物页面。 [客户端设计](../clients.md)
H5、PC 网页和管理后台是首批界面。iOS 和 Android 已纳入整体设计,按各自平台安排页面和功能。后台负责管理和运行状态。微信小程序暂不纳入。 [客户端设计](../architecture/clients.md)
## 后续方向
家庭邀请、共享扩展、拍照识物、公开物品评价和推荐逐步安排。用户公开分享时只选择愿意分享的物品介绍或使用体验。等有足够的公开评价或互动,再比较按类别推荐和协同过滤的效果。
[需求与验收](../requirements.md) · [低保真原型](prototype.md)
[需求与验收](requirements.md) · [UI 设计](../ui/README.md)

View File

@ -1,12 +1,12 @@
# 需求与验收
首版以家庭内找物、记物和移位为主。各客户端的分工见 [客户端设计](clients.md),页面入口见 [产品设计](product/overview.md)。
首版以家庭内找物、记物和移位为主。各客户端的分工见 [客户端设计](../architecture/clients.md),页面入口见 [产品设计](overview.md)。
| 编号 | 需求 | 验收 |
| --- | --- | --- |
| R01 | 家庭和角色 | 两户演示家庭的数据互相隔离。查看成员可以找物,写入接口按角色检查。 |
| R02 | 多层位置 | 可以建立房间、柜子、收纳盒。同名位置显示完整路径。禁止把上级移动到子节点下,有活动物品或下级的位置归档前须先处理关联。 |
| R03 | 物品和移位 | 可以新增、修改、移位和归档物品。移位后同时查到当前和原来的位置。 |
| R03 | 物品和移位 | 可以新增、修改、移位和归档物品。移位后同时查到当前和原来的位置,用旧版本写入时提示冲突。 |
| R04 | 搜索 | 可以按名称、别名和位置找物。结果带完整位置路径。 |
| R05 | 物品关联 | 可以关联同一家庭里的配件、同类或常一起使用的物品。详情显示关联物品的位置。 |
| R06 | 批量草稿 | 同一句能拆成多条,处理数量、否定和不确定的位置。确认后可以查处理状态,同一次确认只写入一次。 |
@ -19,4 +19,4 @@
- 用带名称、别名、位置和数量的演示数据验证,有实际运行结果后再填写命中率、耗时和人工修正数。
- 备份恢复后核对物品、位置、历史和关系。演示使用独立数据。
[架构设计](architecture.md) · [测试与演示](verification.md)
[架构设计](../architecture/system.md) · [测试与演示](../testing/plan.md)

21
docs/testing/cases.md Normal file
View File

@ -0,0 +1,21 @@
# 首版测试用例
以下是待执行用例。R01–R08 对应[需求与验收](../product/requirements.md)。
| 用例 | 需求 | 准备与操作 | 预期结果 |
| --- | --- | --- | --- |
| TC-01 家庭隔离 | R01 | 以家庭 A 的查看成员打开家庭 A 的物品,再用同一身份请求家庭 B 的物品和写入接口。 | 可查看家庭 A 的物品。家庭 B 的详情不可读,查看成员也不能写入家庭 A,数据无变化。 |
| TC-02 后台角色 | R01 | 普通用户直接访问管理 API,再由管理员查看同一路径。 | 普通用户被拒绝。管理员能查看授权的信息。 |
| TC-03 同名位置 | R02 | 在书房和玄关各建一个白盒,搜索白盒并挑选玄关的那个。 | 两处白盒各有完整位置路径,所选位置对应玄关白盒的记录。 |
| TC-04 位置树保护 | R02 | 把书房移到其子位置下,再归档一个还有物品的白盒。 | 两个请求均失败。原树和物品位置保留。 |
| TC-05 移位和旧版本 | R03 | 将硬盘从客厅移到书房。另一个客户端用移位前的版本提交不同位置。 | 书房为当前位置,历史保留客厅。过期请求提示冲突且不产生移位记录。 |
| TC-06 按别名找物 | R04 | 给 HDMI 线添加「视频线」别名。分别搜索「视频线」和「右抽屉」。 | 两次都能找到相应物品,结果展示完整路径。 |
| TC-07 配件关联 | R05 | 从硬盘详情关联同一家庭的短数据线,再尝试关联其他家庭的物品。 | 详情可直接看到短数据线的位置。跨家庭关联请求被拒绝。 |
| TC-08 草稿里有否定和不确定 | R06 | 输入「两根 HDMI 线放书房右抽屉。读卡器先别动。备用钥匙好像在玄关白盒。」生成草稿。给钥匙选定位置或排除后确认。 | 数量保留为 2。读卡器跳过。钥匙由用户决定。确认前物品不变,确认后可查操作状态。 |
| TC-09 并发确认与重试 | R06 | 两个客户端同时确认同一草稿版本,并模拟物品写入后响应丢失。 | 同一版本只有一份确认任务。重试不重复创建物品或移位记录,操作最终显示已完成。 |
| TC-10 模型不可用 | R07 | 切到未配置的模型,再模拟正在使用的模型超时。 | 未配置模型显示状态且不可发起调用。模型超时后原输入仍在,用户可以切换模型或手工录入。 |
| TC-11 并发额度 | R07 | 剩余额度只够一次请求,两个请求同时预占。再模拟已接受请求的用量暂时未知。 | 只有符合额度的一次可以发起调用。未知用量保留待对账,不能提前释放给下一次调用。 |
| TC-12 个人收藏和评分 | R08 | 两位成员给同一件物品不同的星级。其中一人取消收藏并清除评价。 | 两人评分相互独立。清除只影响当前成员,另一人的评价保留。 |
| TC-13 恢复演示数据 | 质量 | 从同一批次的备份恢复数据库和附件,打开一件有历史和关联的物品。 | 原位置、历史、关联和附件均可查看,正常访问仍受家庭权限保护。 |
[测试与演示计划](plan.md)

21
docs/testing/plan.md Normal file
View File

@ -0,0 +1,21 @@
# 测试与演示
## 测试分工
| 层级 | 关注点 | 工具与位置 |
| --- | --- | --- |
| 后端单元测试 | 角色、位置树、草稿状态和额度规则 | JUnit Jupiter,随 Maven 模块放入 `src/test/java` |
| 后端集成测试 | PostgreSQL 约束和迁移、并发写入、Outbox 重试、幂等和额度结算 | Testcontainers,放在对应后端模块;模型用固定接口替身注入超时和错误 |
| Web 端到端测试 | H5 和 PC 的找物、录入和状态反馈,后台权限与模型状态 | Playwright,规划放在 `tests/e2e/`。桌面浏览器和移动视口分开跑 |
| 原生端验收 | 系统返回、键盘、相机和麦克风权限、弱网恢复 | iOS 用 XCTest / XCUIAutomation,Android 用 Compose UI 测试;相机、录音和网络走真机复查 |
| 发布与恢复 | 灰度切回、指标日志定位、持久数据备份恢复 | 在演示环境执行,记录镜像版本、操作号、日志和回滚结果 |
[Playwright 设备模拟](https://playwright.dev/docs/emulation) · [Apple UI 测试](https://developer.apple.com/documentation/xcuiautomation) · [Compose 测试](https://developer.android.com/develop/ui/compose/testing)
## 数据和记录
准备两个互相隔离的演示家庭,覆盖所有者、编辑成员和查看成员。测试数据包含两个同名白盒、HDMI 线及别名、一个关联配件、历史位置和可修改的个人评分。
批量录入先用固定模型响应验证业务行为。接通实际模型后,再记录模型和版本、样本、解析正确率、延迟及人工修正数。按项目额度限制实际请求。
[测试用例](cases.md)用于开发与验收。走查从[界面稿](../ui/README.md)开始,实际执行时记录版本、环境、用例编号、输入、实际结果和证据。演示先走搜索和移位,再验证草稿确认与故障回退。

22
docs/ui/README.md Normal file
View File

@ -0,0 +1,22 @@
# UI 设计
找东西时,希望搜索结果就能告诉人去哪拿。登记时,把输入留在原处,数量、位置和要跳过的物品放在确认前看清。页面里的「位置」用完整路径区分。收藏、评分和配件放物品详情,留出列表空间给名称和位置。
## 界面方向稿
- [本地预览源文件](concept.html),用浏览器打开即可。H5 画了搜索和草稿核对,PC 画了列表和详情并排的方式。
- [H5 预览图](mobile-concept.png) · [PC 预览图](desktop-concept.png)
- [低保真原型](wireframes.md) · [产品需求](../product/requirements.md) · [测试用例](../testing/cases.md)
界面主色用深绿,背景用偏暖的白。主操作用实底按钮,待确认用文字和浅琥珀色标记,跳过的条目保留文字说明。移动端优先照顾拇指操作,PC 左侧用于导航和位置选择,详情留在同一屏。管理后台沿用标识和状态颜色,表格按可扫描性排版。
## UI 定稿安排
| 走查 | 要看的页面和状态 |
| --- | --- |
| H5 | 找物、详情、移位、位置树、手工与批量录入。补齐空结果、权限不足、模型不可用、确认中、失败重试。 |
| PC | 列表和详情、位置树导航、批量草稿表格。补键盘导航、窄窗口和长位置路径。 |
| 管理后台 | 用户和家庭、模型状态、额度及异常操作。明确筛选、记录详情和角色权限。 |
| iOS、Android | 从同一套术语和任务出发,单独画原生导航、相机、录音权限与返回后的状态。 |
定稿时按页面记录对应需求和错误状态,补上字号、间距、字色、焦点、长文案换行和移动端触控尺寸。浏览器版本的稿件可直接纳入 Git,导出截图用于评审。当前方向稿用示例数据展示页面,控件用于说明设计。

298
docs/ui/concept.html Normal file
View File

@ -0,0 +1,298 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Item Atlas · 界面方向稿</title>
<style>
:root {
color-scheme: light;
--surface: #ffffff;
--paper: #faf9f5;
--board: #efeee8;
--ink: #192922;
--muted: #526059;
--accent: #245443;
--accent-hover: #1d4436;
--green-wash: #e9f1ea;
--line: #dfe4dc;
--amber: #815008;
--amber-wash: #fcf0d8;
font: 15px/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft Yahei", sans-serif;
color: var(--ink);
background: var(--board);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.artboard { padding: 42px 36px 44px; margin: 0 auto; }
.mobile-artboard { max-width: 886px; }
.desktop-artboard { max-width: 1292px; }
.board-title { margin-bottom: 23px; }
.board-title h1 { font-size: 26px; letter-spacing: -.025em; }
.board-title p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.mobile-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.screen-label { font-size: 13px; color: var(--muted); margin: 0 0 9px 6px; }
.product { background: var(--paper); border: 1px solid #d7ddd3; }
.phone { display: flex; flex-direction: column; min-height: 586px; border-radius: 20px; overflow: hidden; }
.phone-bar {
display: flex; justify-content: space-between; align-items: center;
min-height: 63px; padding: 8px 18px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 730; letter-spacing: -.02em; }
.brand-mark {
display: grid; grid-template-columns: repeat(2, 5px); grid-template-rows: repeat(2, 5px);
place-content: center; gap: 3px; width: 25px; height: 25px;
background: var(--accent); border-radius: 7px;
}
.brand-mark i { background: #fff; border-radius: 1px; }
.brand-mark i:last-child { opacity: .56; }
.home-name { color: var(--muted); font-size: 13px; white-space: nowrap; }
.phone-content { padding: 20px 18px; flex: 1; }
.page-title { font-size: 25px; letter-spacing: -.025em; font-weight: 720; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.search {
display: flex; align-items: center; gap: 10px; min-height: 46px;
background: var(--surface); border: 1px solid #cbd7cc; border-radius: 9px; padding: 8px 12px;
font-weight: 550;
}
.search-icon { width: 13px; height: 13px; border: 1.8px solid var(--accent); border-radius: 50%; position: relative; margin-right: 2px; flex: 0 0 13px; }
.search-icon::after { content: ""; width: 6px; height: 1.8px; background: var(--accent); position: absolute; top: 9px; left: 8px; transform: rotate(45deg); transform-origin: left; }
.small-label { font-size: 12px; color: var(--muted); }
.search-meta { margin: 20px 0 8px; }
.item-list { display: grid; gap: 8px; }
.item-row {
display: grid; grid-template-columns: 37px minmax(0, 1fr) auto; align-items: center; gap: 11px;
border: 1px solid var(--line); border-radius: 10px; min-height: 73px; padding: 10px 11px;
background: var(--surface);
}
.item-glyph {
background: var(--green-wash); color: var(--accent); width: 37px; height: 37px;
border-radius: 8px; display: grid; place-content: center; font-size: 11px; font-weight: 780;
}
.item-name { font-weight: 690; font-size: 15px; line-height: 1.3; }
.item-path { font-size: 12px; color: var(--muted); margin-top: 4px; }
.quantity { margin-left: 5px; color: var(--muted); font-weight: 520; white-space: nowrap; }
.chevron { font-size: 17px; color: var(--muted); padding-right: 1px; }
.action-row { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.button {
min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 650;
}
.button.primary { color: #fff; background: var(--accent); border: 1px solid var(--accent); }
a.button.primary:hover { background: var(--accent-hover); }
.button.secondary { color: var(--accent); background: var(--surface); border: 1px solid #c9d7cc; }
.button.pending { background: #e6e9e1; color: #4f5d55; border: 1px solid #e6e9e1; }
.phone-nav { min-height: 51px; display: flex; border-top: 1px solid var(--line); background: var(--surface); }
.phone-nav > * { display: grid; place-content: center; flex: 1; color: var(--muted); font-size: 13px; }
.phone-nav .active { color: var(--accent); font-weight: 700; box-shadow: inset 0 2px 0 var(--accent); }
.draft-input { margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; }
.draft-input p + p { margin-top: 4px; font-size: 13px; line-height: 1.6; }
.draft-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; }
.draft-head h3 { font-size: 14px; }
.draft-list { display: grid; gap: 7px; }
.draft-row {
display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
min-height: 55px; background: var(--surface); border: 1px solid var(--line);
border-radius: 9px; padding: 8px 11px;
}
.draft-row.needs-review { background: #fffbf1; border-color: #ebd6aa; }
.draft-row .item-name { font-size: 14px; }
.row-text { color: var(--accent); font-size: 12px; font-weight: 650; white-space: nowrap; }
.row-text.skip { color: var(--muted); }
.row-text.review { color: var(--amber); }
.draft-actions .button { flex: 1; }
.desktop-surface {
display: grid; grid-template-columns: 186px minmax(0, 1fr); min-height: 530px;
border-radius: 13px; overflow: hidden;
}
.desktop-menu { padding: 21px 15px; border-right: 1px solid var(--line); background: #f1f3ed; }
.desktop-menu .brand { margin: 0 0 27px 5px; }
.desktop-menu .home-name { display: block; margin: 0 0 10px 5px; }
.menu-list { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.menu-list li { padding: 8px 10px; border-radius: 7px; color: var(--muted); }
.menu-list li.active { font-weight: 700; background: var(--green-wash); color: var(--accent); }
.desktop-content { min-width: 0; padding: 23px; }
.desktop-columns { display: grid; grid-template-columns: minmax(210px, .93fr) minmax(225px, 1fr); gap: 18px; }
.results, .detail { min-width: 0; }
.results .search-meta { margin-top: 15px; }
.selected { background: #f1f6f0; border-color: #9bb7a6; }
.detail { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.detail .page-head { margin-bottom: 12px; }
.detail h3 { font-size: 20px; }
.detail-place { display: grid; gap: 4px; background: var(--green-wash); border-radius: 7px; padding: 11px 12px; }
.detail-place p:last-child { font-weight: 670; }
.detail-group { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-group:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-group dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.detail-group dd { margin: 0; font-size: 14px; }
.stars { color: var(--accent); letter-spacing: 2px; margin-right: 6px; }
@media (max-width: 760px) {
.mobile-pair { grid-template-columns: minmax(0, 388px); justify-content: center; }
.desktop-surface { grid-template-columns: minmax(0, 1fr); }
.desktop-menu { border-right: 0; border-bottom: 1px solid var(--line); }
.desktop-menu .brand { margin-bottom: 10px; }
.menu-list { display: flex; flex-wrap: wrap; }
.desktop-columns { grid-template-columns: minmax(0, 1fr); }
.artboard { padding: 25px 15px 27px; }
}
@media (prefers-reduced-motion: no-preference) {
.button { transition: background-color .14s ease; }
}
</style>
</head>
<body>
<main>
<section id="mobile" class="artboard mobile-artboard" aria-labelledby="mobile-title">
<header class="board-title">
<h1 id="mobile-title">Item Atlas · 移动网页</h1>
<p>找物与批量录入</p>
</header>
<div class="mobile-pair">
<section id="mobile-search" aria-labelledby="mobile-search-label">
<h2 id="mobile-search-label" class="screen-label">找物 · 搜索结果</h2>
<div class="product phone">
<header class="phone-bar">
<div class="brand"><span class="brand-mark" aria-hidden="true"><i></i><i></i><i></i><i></i></span>Item Atlas</div>
<span class="home-name">我家</span>
</header>
<div class="phone-content">
<header class="page-head"><h3 class="page-title">找东西</h3></header>
<div class="search"><span class="search-icon" aria-hidden="true"></span>视频线</div>
<p class="small-label search-meta">搜索结果 · 2 件</p>
<div class="item-list">
<article class="item-row">
<span class="item-glyph" aria-hidden="true">HD</span>
<div>
<p class="item-name">HDMI 线<span class="quantity">×2</span></p>
<p class="item-path">书房 / 书桌 / 右抽屉</p>
</div>
<span class="chevron" aria-hidden="true">›</span>
</article>
<article class="item-row">
<span class="item-glyph" aria-hidden="true">DP</span>
<div>
<p class="item-name">DisplayPort 线</p>
<p class="item-path">客厅 / 电视柜 / 左边收纳盒</p>
</div>
<span class="chevron" aria-hidden="true">›</span>
</article>
</div>
<div class="action-row">
<span class="button secondary">记一件</span>
<a class="button primary" href="#mobile-intake">批量记</a>
</div>
</div>
<nav class="phone-nav" aria-label="找物页导航">
<span class="active" aria-current="page">找物</span>
<span>位置</span>
<a href="#mobile-intake">录入</a>
<span>收藏</span>
</nav>
</div>
</section>
<section id="mobile-intake" aria-labelledby="mobile-intake-label">
<h2 id="mobile-intake-label" class="screen-label">录入 · 核对草稿</h2>
<div class="product phone">
<header class="phone-bar">
<div class="brand"><span class="brand-mark" aria-hidden="true"><i></i><i></i><i></i><i></i></span>Item Atlas</div>
<span class="home-name">我家</span>
</header>
<div class="phone-content">
<header class="page-head"><h3 class="page-title">核对草稿</h3></header>
<div class="draft-input">
<p class="small-label">原始输入</p>
<p>两根 HDMI 线放书房右抽屉。读卡器先别动。备用钥匙好像在玄关白盒。</p>
</div>
<header class="draft-head"><h3>识别结果</h3><span class="small-label">1 项待确认</span></header>
<div class="draft-list">
<article class="draft-row">
<div><p class="item-name">HDMI 线<span class="quantity">×2</span></p><p class="item-path">书房 / 书桌 / 右抽屉</p></div>
<span class="row-text">修改</span>
</article>
<article class="draft-row">
<div><p class="item-name">读卡器</p><p class="item-path">按原话保留在原处</p></div>
<span class="row-text skip">跳过</span>
</article>
<article class="draft-row needs-review">
<div><p class="item-name">备用钥匙</p><p class="item-path">可能在 玄关 / 白盒</p></div>
<span class="row-text review">选择位置</span>
</article>
</div>
<div class="action-row draft-actions">
<span class="button secondary">手工录入</span>
<span class="button pending" aria-disabled="true">确认并提交</span>
</div>
</div>
<nav class="phone-nav" aria-label="录入页导航">
<a href="#mobile-search">找物</a>
<span>位置</span>
<span class="active" aria-current="page">录入</span>
<span>收藏</span>
</nav>
</div>
</section>
</div>
</section>
<section id="desktop" class="artboard desktop-artboard" aria-labelledby="desktop-title">
<header class="board-title">
<h2 id="desktop-title" style="font-size:26px;letter-spacing:-.025em">Item Atlas · PC 网页</h2>
<p>找物列表与物品详情</p>
</header>
<div class="product desktop-surface">
<aside class="desktop-menu">
<div class="brand"><span class="brand-mark" aria-hidden="true"><i></i><i></i><i></i><i></i></span>Item Atlas</div>
<span class="home-name">我家</span>
<ul class="menu-list">
<li class="active">找物</li>
<li>位置</li>
<li>录入草稿</li>
<li>我的收藏</li>
</ul>
</aside>
<div class="desktop-content">
<header class="page-head">
<h3 class="page-title">找东西</h3>
<span class="button primary">+ 记一件</span>
</header>
<div class="desktop-columns">
<div class="results">
<div class="search"><span class="search-icon" aria-hidden="true"></span>视频线</div>
<p class="small-label search-meta">搜索结果 · 2 件</p>
<div class="item-list">
<article class="item-row selected">
<span class="item-glyph" aria-hidden="true">HD</span>
<div><p class="item-name">HDMI 线<span class="quantity">×2</span></p><p class="item-path">书房 / 书桌 / 右抽屉</p></div>
<span class="chevron" aria-hidden="true">›</span>
</article>
<article class="item-row">
<span class="item-glyph" aria-hidden="true">DP</span>
<div><p class="item-name">DisplayPort 线</p><p class="item-path">客厅 / 电视柜 / 左边收纳盒</p></div>
<span class="chevron" aria-hidden="true">›</span>
</article>
</div>
</div>
<section class="detail" aria-labelledby="detail-name">
<header class="page-head">
<h3 id="detail-name">HDMI 线<span class="quantity">×2</span></h3>
<span class="button secondary">移位</span>
</header>
<div class="detail-place">
<p class="small-label">当前位置</p>
<p>书房 / 书桌 / 右抽屉</p>
</div>
<dl class="detail-group"><dt>别名</dt><dd>视频线</dd></dl>
<dl class="detail-group"><dt>关联物品</dt><dd>HDMI 转接头 <span class="item-path">· 玄关 / 白盒</span></dd></dl>
<dl class="detail-group"><dt>上一次移位</dt><dd>客厅 / 电视柜 → 书房 / 书桌 / 右抽屉</dd></dl>
<dl class="detail-group"><dt>我的使用记录</dt><dd><span class="stars" aria-label="4 星">★★★★☆</span>已收藏</dd></dl>
</section>
</div>
</div>
</div>
</section>
</main>
</body>
</html>

BIN
docs/ui/desktop-concept.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

BIN
docs/ui/mobile-concept.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

View File

@ -67,4 +67,4 @@ HDMI 线 ×2 书房 / 书桌 / 右抽屉 [修改]
白盒同名时,在选择位置的地方显示从房间开始的路径。
[产品设计](overview.md) · [需求与验收](../requirements.md)
[产品设计](../product/overview.md) · [需求与验收](../product/requirements.md) · [界面方向稿](README.md)

View File

@ -1,15 +0,0 @@
# 测试与演示
| 需求 | 验证 |
| --- | --- |
| R01 | 用两户演示用户对照查询、编辑和后台权限。 |
| R02 | 创建同名白盒,用完整路径区分。尝试把上级移到子节点下。 |
| R03 | 移位后核对当前路径和旧记录。并发提交旧版本时提示冲突。 |
| R04、R05 | 用「视频线」搜 HDMI 线,再找到关联的转接头。 |
| R06 | 用含数量、否定和不确定位置的语句生成草稿。并发确认或模拟写入后响应丢失,核对物品只写一次及状态能恢复。 |
| R07 | 模型超时、额度即将耗尽和用量待结算时,核对显示、额度和手工路径。 |
| R08 | 两个家庭成员给同一物品评分,互不覆盖。取消收藏和清除评价后再查。 |
单元测试检查排序、权限、草稿状态和额度。集成测试验证数据库约束、并发操作和异步恢复。客户端接口核对 H5、PC、后台和移动端用到的响应及错误码。
设计走查用 [低保真原型](product/prototype.md)。环境可运行后,准备独立演示数据,验证搜索、确认录入、指标追踪、灰度切回和数据库恢复。对每次实测记录版本、输入、预期和实际结果。