v0.1.0 界面框架:抽屉骨架 + 13 个模块页面

对应服务端 FamilyBook(家书)的鸿蒙客户端首版。本轮只做**界面框架**,
数据全部是演示数据 —— 服务端尚无客户端接口,所有增删改只做入口与样式,
不落任何数据。

## 骨架
左侧抽屉 + 右侧内容。抽屉两套形态由窗口短边决定(≥600vp 为宽屏):
宽屏常驻侧栏、窄屏滑出层。判据取「短边」而非「宽度」,因为短边在旋转时
不变,比例接近 1:1 的设备横竖屏布局天然一致。

## 模块(与 Web 端 Module::LIST 一一对应,key 即路由名)
首页、家谱、名册、观影、旅程、日程、资源、任务、纪念日、财务、读书、
导航、笔记;另有通知消息、个人设置两个附加页。

## 与 Web 端保持一致的几处
· 模块清单唯一来源在 model/Modules.ets,加模块只改那一处;
· 模块主题色三档由主色按 HSL 压明度算出,预设色板与 Web 端逐值一致;
· 术语沿用 Web 端固定下来的口径(旅程 ⊃ 行程;观影的「影院」不单独占
  抽屉位,从模块内设置进);
· 页面结构照 Web 端的信息层次(首页信息面板 / 财务概览在账目之前 /
  纪念日「即将到来」在顶 / 任务按状态而非按看板)。

## 编译验证
hvigorw assembleHap --mode module -p product=default
→ BUILD SUCCESSFUL,0 error / 0 warning(含一次删 build 后的干净重建)

过程中修掉的编译期问题:
· Circle().fill() 是 API 26 才有的重载(compatibleSdk 是 24)
  → 换「方块 + 圆角」画圆,零版本风险;
· setWindowBackgroundColor 对 phone/tablet 不可用 → 去掉(页面已铺满同色);
· window.getLastWindow() 只有异步版 → 由 Ability 侧同步取窗存 AppStorage;
· 颜色类 @Param 声明成 string 导致传 Resource 报错 → 统一改 ResourceColor;
· 页面在 pages/<模块>/ 下,公共件 import 相对路径要多退一级。

(首轮编译 95 error / 18 warn,逐条定位到 5 类根因后归零。)
This commit is contained in:
2026-10-11 22:07:48 +08:00
commit 41e3aa3d95
80 changed files with 6985 additions and 0 deletions
@@ -0,0 +1,21 @@
{
"color": [
{ "name": "start_window_background", "value": "#F7F3EA" },
{ "name": "page_bg", "value": "#F7F3EA" },
{ "name": "surface", "value": "#FFFFFF" },
{ "name": "surface_alt", "value": "#FBF8F1" },
{ "name": "input_bg", "value": "#F2EDE2" },
{ "name": "ink", "value": "#2C231D" },
{ "name": "muted", "value": "#7E6B5A" },
{ "name": "faint", "value": "#A8988A" },
{ "name": "brand", "value": "#A84A28" },
{ "name": "brand_2", "value": "#C96F45" },
{ "name": "brand_ink", "value": "#6E3820" },
{ "name": "line", "value": "#1A2C231D" },
{ "name": "line_2", "value": "#0F2C231D" },
{ "name": "green", "value": "#6F9E5C" },
{ "name": "red", "value": "#C0533F" },
{ "name": "blue", "value": "#2F6FB0" },
{ "name": "yellow", "value": "#B8860B" }
]
}
@@ -0,0 +1,7 @@
{
"float": [
{ "name": "page_padding", "value": "16vp" },
{ "name": "card_radius", "value": "16vp" },
{ "name": "card_radius_s", "value": "10vp" }
]
}
@@ -0,0 +1,16 @@
{
"string": [
{
"name": "module_desc",
"value": "家书 · 家庭生活档案客户端"
},
{
"name": "EntryAbility_desc",
"value": "家书主界面"
},
{
"name": "EntryAbility_label",
"value": "家书"
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1011 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,3 @@
{
"allowToBackupRestore": true
}
@@ -0,0 +1,5 @@
{
"src": [
"pages/Index"
]
}
@@ -0,0 +1,21 @@
{
"color": [
{ "name": "start_window_background", "value": "#1B1712" },
{ "name": "page_bg", "value": "#1B1712" },
{ "name": "surface", "value": "#262019" },
{ "name": "surface_alt", "value": "#2E2720" },
{ "name": "input_bg", "value": "#332B23" },
{ "name": "ink", "value": "#F0E8DC" },
{ "name": "muted", "value": "#B3A192" },
{ "name": "faint", "value": "#8A7A6B" },
{ "name": "brand", "value": "#C96F45" },
{ "name": "brand_2", "value": "#DE8C63" },
{ "name": "brand_ink", "value": "#E7A582" },
{ "name": "line", "value": "#26F0E8DC" },
{ "name": "line_2", "value": "#14F0E8DC" },
{ "name": "green", "value": "#7FB16A" },
{ "name": "red", "value": "#D46852" },
{ "name": "blue", "value": "#5A93CF" },
{ "name": "yellow", "value": "#D4A017" }
]
}