From a05d4ebb9b89a35c8d42225c980763b3af5ac976 Mon Sep 17 00:00:00 2001 From: userGyl Date: Thu, 12 Feb 2026 18:01:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/pages/c_page/base_widgets/view.dart | 2 +- .../lib/pages/c_page/reservation/view.dart | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ln_jq_app/lib/pages/c_page/base_widgets/view.dart b/ln_jq_app/lib/pages/c_page/base_widgets/view.dart index 9dd88b3..314ba7b 100644 --- a/ln_jq_app/lib/pages/c_page/base_widgets/view.dart +++ b/ln_jq_app/lib/pages/c_page/base_widgets/view.dart @@ -41,7 +41,7 @@ class BaseWidgetsPage extends GetView { Widget _buildNavigationBar() { return SafeArea( child: Container( - height: 50.h, + height: Get.height * 0.05, margin: const EdgeInsets.fromLTRB(24, 0, 24, 10), // 悬浮边距 decoration: BoxDecoration( color: Color.fromRGBO(240, 244, 247, 1), // 浅灰色背景 diff --git a/ln_jq_app/lib/pages/c_page/reservation/view.dart b/ln_jq_app/lib/pages/c_page/reservation/view.dart index 1720f39..9db425a 100644 --- a/ln_jq_app/lib/pages/c_page/reservation/view.dart +++ b/ln_jq_app/lib/pages/c_page/reservation/view.dart @@ -49,7 +49,7 @@ class ReservationPage extends GetView { Positioned( left: 20.w, right: 20.w, - bottom: 110.h, + bottom: Get.height * (Get.height < 826 ? 0.08 : 0.11), child: _buildReservationItem(context), ), ], @@ -457,18 +457,17 @@ class ReservationPage extends GetView { /// 时间 Slider 选择器 Widget _buildTimeSlider(BuildContext context) { return Obx(() { - - // 1. 获取站点信息 + // 获取站点信息 final station = controller.stationOptions.firstWhereOrNull( - (s) => s.hydrogenId == controller.selectedStationId.value, + (s) => s.hydrogenId == controller.selectedStationId.value, ); - // 如果没有站点数据,说明正在加载或未选择,直接不显示进度条,避免范围跳变产生的滑动 + // 如果没有站点数据,默认隐藏 if (station == null) { return const SizedBox(height: 100); } - // 2. 解析营业范围 + // 解析营业范围 final startParts = station.startBusiness.split(':'); final endParts = station.endBusiness.split(':'); int bizStartHour = int.tryParse(startParts[0]) ?? 0; @@ -476,19 +475,17 @@ class ReservationPage extends GetView { int bizEndMinute = (endParts.length > 1) ? (int.tryParse(endParts[1]) ?? 0) : 0; if (bizEndMinute == 0 && bizEndHour > bizStartHour) bizEndHour--; - // 3. 确定当前滑块值 + //确定当前滑块值 int currentHour = controller.startTime.value.hour; double sliderValue = currentHour.toDouble().clamp( - bizStartHour.toDouble(), - bizEndHour.toDouble() + bizStartHour.toDouble(), + bizEndHour.toDouble(), ); double minVal = bizStartHour.toDouble(); double maxVal = bizEndHour.toDouble(); if (minVal >= maxVal) maxVal = minVal + 1; - - return Column( children: [ Stack(