This commit is contained in:
2026-02-12 18:01:56 +08:00
parent 600cea4379
commit a05d4ebb9b
2 changed files with 9 additions and 12 deletions

View File

@@ -41,7 +41,7 @@ class BaseWidgetsPage extends GetView<BaseWidgetsController> {
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), // 浅灰色背景

View File

@@ -49,7 +49,7 @@ class ReservationPage extends GetView<C_ReservationController> {
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<C_ReservationController> {
/// 时间 Slider 选择器
Widget _buildTimeSlider(BuildContext context) {
return Obx(() {
// 1. 获取站点信息
// 获取站点信息
final station = controller.stationOptions.firstWhereOrNull(
(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<C_ReservationController> {
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()
bizEndHour.toDouble(),
);
double minVal = bizStartHour.toDouble();
double maxVal = bizEndHour.toDouble();
if (minVal >= maxVal) maxVal = minVal + 1;
return Column(
children: [
Stack(