From 9efd1177b7f6a92337aa8b1ba09170e9eb538c28 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Sat, 4 Jul 2026 20:31:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(client):=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E6=A8=AA=E6=BB=91=E6=89=8B=E5=8A=BF=E2=80=94=E2=80=94tab=20?= =?UTF-8?q?=E6=A0=B9=E5=B7=A6=E5=8F=B3=E6=BB=91=E5=88=87=20tab=E3=80=81?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=B1=8F=E5=B7=A6=E6=BB=91=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tab 根(库存/入库/出库/财务/我的):左滑下一个 tab、右滑上一个(不循环) - 二级屏:左滑返回(同顶栏返回箭头语义),右滑无响应 - 仅窄屏生效;内容区横向滚动(分段 tab/表格横滚)在手势竞技场优先,不冲突 Co-Authored-By: Claude Fable 5 --- client/lib/screens/shell/app_shell.dart | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/client/lib/screens/shell/app_shell.dart b/client/lib/screens/shell/app_shell.dart index 7b46c27..39ee3a1 100644 --- a/client/lib/screens/shell/app_shell.dart +++ b/client/lib/screens/shell/app_shell.dart @@ -224,6 +224,29 @@ class _AppShellState extends ConsumerState { // 并在顶栏出返回箭头(_buildTopBar 内)。 final isTabRoot = _tabRoots.contains(widget.location); + // 窄屏横滑手势(2026-07-04 拍板):tab 根左右滑切换相邻 tab(不循环); + // 二级屏左滑退出(回来源/我的),右滑无响应。内容区里的横向滚动 + //(分段 tab / 表格横滚)在手势竞技场中优先,互不冲突。 + Widget shellContent = widget.navigationShell; + if (isMobile) { + shellContent = GestureDetector( + behavior: HitTestBehavior.translucent, + onHorizontalDragEnd: (d) { + final v = d.primaryVelocity ?? 0; + if (v.abs() < 200) return; // 轻微拖动不触发 + if (isTabRoot) { + final pos = _tabForBranch(widget.navigationShell.currentIndex); + final next = v < 0 ? pos + 1 : pos - 1; // 左滑→下一个 tab + if (next < 0 || next >= _mobileTabs.length) return; + _goBranch(_mobileTabs[next].$3); + } else if (v < 0) { + _backFromSecondary(); // 左滑退出;右滑无响应 + } + }, + child: widget.navigationShell, + ); + } + final Widget shell = SelectionArea( child: Scaffold( body: Column( @@ -238,7 +261,7 @@ class _AppShellState extends ConsumerState { children: [ ..._buildBanners(context, isOnline, updateInfo, updateNotifier, licenseInfo), - Expanded(child: widget.navigationShell), + Expanded(child: shellContent), if (!isMobile) AppStatusBar(loginTime: _loginTime), ], ),