限制条件

This commit is contained in:
2025-11-19 16:34:12 +08:00
parent 797afb63b1
commit 38d08ad613
3 changed files with 18 additions and 2 deletions

View File

@@ -303,6 +303,20 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
if (selectedStationId.value == null || selectedStationId.value!.isEmpty) {
showToast("请先选择加氢站");
return;
}
// 将选择的日期和时间组合成一个完整的 DateTime 对象
final reservationStartDateTime = DateTime(
selectedDate.value.year,
selectedDate.value.month,
selectedDate.value.day,
startTime.value.hour,
startTime.value.minute,
);
// 检查预约时间是否在当前时间之前
if (reservationStartDateTime.isBefore(DateTime.now())) {
showToast("不可预约过去的时间");
return;
}
try {
showLoading("提交中");