限制条件

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

@@ -169,8 +169,6 @@ class SitePage extends GetView<SiteController> {
children: [
_buildInfoItem(Icons.info_outline, '数据每5分钟自动刷新一次'),
const SizedBox(height: 8),
_buildInfoItem(Icons.help_outline, '点击车牌号可查看详细信息'),
const SizedBox(height: 8),
_buildInfoItem(Icons.headset_mic_outlined, '如有疑问请联系客服: 400-021-1773'),
],
),

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("提交中");

View File

@@ -1,5 +1,6 @@
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:getx_scaffold/getx_scaffold.dart';
import 'package:ln_jq_app/common/model/station_model.dart';
import 'package:ln_jq_app/pages/qr_code/view.dart';
@@ -390,6 +391,9 @@ class ReservationPage extends GetView<C_ReservationController> {
TextFormField(
controller: controller,
keyboardType: keyboardType,
inputFormatters: [
FilteringTextInputFormatter.digitsOnly, // 只允许数字输入
],
enabled: enabled,
style: const TextStyle(fontSize: 14),
decoration: InputDecoration(