style: tabBar 贴底、设备操作横排、设备条改为卡片

- 底部导航去掉悬浮圆角胶囊,改为贴底全宽 + 顶部细分隔线 + 安全区
- 修复设备操作竖排:补 .ops-row display:flex
- 顶部设备切换条改为卡片(复用 .card 阴影),删除占位说明文案
- 同步调整页面底部留白与 AGENTS.md 约定
This commit is contained in:
tongtong committed 2026-11-27 21:17:58 +08:00
1 parent f1c0739570
commit 16d6b65e9a
5 files changed
+20 -24

No files matched your search

+4 -3
View File
@@ -30,13 +30,14 @@
## 界面与交互约定
- 底部导航固定 3 个 Tab:**首页 / 管理 / 我的**,对应 `pages/home`、`pages/manage`、`pages/profile`,与 Flutter 端 `HomePage` 的三个分支一致。
- Tab 栏为自定义组件 `custom-tab-bar/`(`app.json` 中 `tabBar.custom: true`),视觉上模仿 Flutter 的悬浮胶囊:圆角、轻阴影、毛玻璃、图标 + 文案,选中态同同绿 `#07C160`。
- Tab 栏为自定义组件 `custom-tab-bar/`(`app.json` 中 `tabBar.custom: true`),**贴底全宽**:左右与底部无缝贴合、顶部 1rpx 分隔线、安全区内边距,图标 + 文案,选中态同同绿 `#07C160`;不要改回悬浮胶囊/圆角矩形。
- 每个 Tab 页面必须在 `onShow` 里调用 `syncTabBar(this, index)`(`utils/tab-bar.ts`),保证从二级页返回后高亮正确;`custom-tab-bar` 自身在 `attached` 里按当前路由兜底。
- Tab 页面之间只能点击切换(`wx.switchTab`),不要用 `navigateTo` 打开 Tab 页,也不要做跨页面的左滑切换;页内横向滑动只允许用 `swiper`(如引导页、卡片翻页)。
- **未接入的功能一律用 `showTodo(label)`(`utils/todo.ts`)给出明确占位提示**,不要静默失败或做假成功;演示数据需在页面 data 注释里标注「演示数据」。
- 页面样式沿用 `app.wxss` 里的设计变量(`--green` / `--ink` / `--sub` / `--surface` / `--track` 等)与 `.card`、`.card-head`、`.tile` 等通用类,颜色与 `ttstd_family_care/lib/core/widgets/feature_ui.dart` 的 `AppColors` 保持一致,不要写新的近似色。
- 卡片规格对齐 Flutter `CardBox`:左右外边距 32rpx、内边距 32rpx、圆角 36rpx、阴影 `0 8rpx 32rpx rgba(20,30,60,0.08)`。
- 页面底部需预留 tabBar 空间(`.page` 已统一 `padding-bottom: calc(200rpx + env(safe-area-inset-bottom))`)。
- 卡片规格对齐 Flutter `CardBox`:左右外边距 32rpx、内边距 32rpx、圆角 36rpx、阴影 `0 8rpx 32rpx rgba(20,30,60,0.08)`;顶部设备切换条同样是卡片。
- 横向排列的一组图标入口(设备操作、常用功能)必须给容器 `display: flex`,子项 `flex: 1`,不要靠默认块级布局(曾因此竖排)。
- 页面底部需预留 tabBar 空间(`.page` 已统一 `padding-bottom: calc(150rpx + env(safe-area-inset-bottom))`)。
## 后端对接
+2 -2
View File
@@ -25,9 +25,9 @@ page {
-webkit-font-smoothing: antialiased;
}
/* 页面容器:为悬浮 tabBar 预留底部空间 */
/* 页面容器:为贴底 tabBar(104rpx + 安全区)预留底部空间 */
.page {
padding-bottom: calc(200rpx + env(safe-area-inset-bottom));
padding-bottom: calc(150rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
}
+5 -8
View File
@@ -1,22 +1,19 @@
/* 自定义 tabBar:悬浮胶囊,参考 ttstd_family_care 的 GlassTabBar(3 项、底部留白 20) */
/* 自定义 tabBar:贴底全宽,左右与底部无缝贴合 */
.tab-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
padding: 0 40rpx calc(24rpx + env(safe-area-inset-bottom));
background: #ffffff;
border-top: 1rpx solid rgba(20, 30, 60, 0.06);
padding-bottom: env(safe-area-inset-bottom);
}
.tab-inner {
display: flex;
align-items: center;
height: 112rpx;
border-radius: 56rpx;
background: rgba(255, 255, 255, 0.94);
border: 1rpx solid rgba(20, 30, 60, 0.05);
box-shadow: 0 8rpx 32rpx rgba(20, 30, 60, 0.12);
backdrop-filter: blur(20px);
height: 104rpx;
}
.tab-item {
+1 -3
View File
@@ -1,6 +1,6 @@
<view class="page">
<!-- 设备概览条:对应 Flutter 导航栏右侧的设备切换入口 -->
<view class="device-bar" bindtap="onSwitchDevice">
<view class="card device-bar" bindtap="onSwitchDevice">
<view class="device-avatar">📱</view>
<view class="device-info">
<view class="device-name-row">
@@ -15,8 +15,6 @@
</view>
</view>
<view class="demo-tip">界面占位版本,数据与操作待接入后端</view>
<!-- 实时位置 -->
<view class="card">
<view class="card-head">
+8 -8
View File
@@ -1,10 +1,11 @@
/* 首页:布局对齐 ttstd_family_care/lib/features/home/presentation/home_tab.dart */
/* 设备概览条 */
/* 设备概览条:复用 .card 的圆角与阴影,只覆盖内外边距 */
.device-bar {
display: flex;
align-items: center;
padding: 20rpx 36rpx 4rpx;
margin: 20rpx 32rpx 4rpx;
padding: 24rpx 32rpx;
}
.device-avatar {
@@ -62,12 +63,6 @@
color: var(--blue);
}
.demo-tip {
margin: 6rpx 36rpx 0;
font-size: 20rpx;
color: var(--sub);
}
/* 地图占位 */
.map-wrap {
position: relative;
@@ -247,6 +242,11 @@
align-items: center;
}
.ops-row {
display: flex;
align-items: flex-start;
}
.ops-row .tile {
flex: 1;
}