限制条件
This commit is contained in:
@@ -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("提交中");
|
||||
|
||||
Reference in New Issue
Block a user