限制条件
This commit is contained in:
@@ -169,8 +169,6 @@ class SitePage extends GetView<SiteController> {
|
|||||||
children: [
|
children: [
|
||||||
_buildInfoItem(Icons.info_outline, '数据每5分钟自动刷新一次'),
|
_buildInfoItem(Icons.info_outline, '数据每5分钟自动刷新一次'),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
_buildInfoItem(Icons.help_outline, '点击车牌号可查看详细信息'),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
_buildInfoItem(Icons.headset_mic_outlined, '如有疑问请联系客服: 400-021-1773'),
|
_buildInfoItem(Icons.headset_mic_outlined, '如有疑问请联系客服: 400-021-1773'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -303,6 +303,20 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
if (selectedStationId.value == null || selectedStationId.value!.isEmpty) {
|
if (selectedStationId.value == null || selectedStationId.value!.isEmpty) {
|
||||||
showToast("请先选择加氢站");
|
showToast("请先选择加氢站");
|
||||||
return;
|
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 {
|
try {
|
||||||
showLoading("提交中");
|
showLoading("提交中");
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:getx_scaffold/getx_scaffold.dart';
|
import 'package:getx_scaffold/getx_scaffold.dart';
|
||||||
import 'package:ln_jq_app/common/model/station_model.dart';
|
import 'package:ln_jq_app/common/model/station_model.dart';
|
||||||
import 'package:ln_jq_app/pages/qr_code/view.dart';
|
import 'package:ln_jq_app/pages/qr_code/view.dart';
|
||||||
@@ -390,6 +391,9 @@ class ReservationPage extends GetView<C_ReservationController> {
|
|||||||
TextFormField(
|
TextFormField(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
keyboardType: keyboardType,
|
keyboardType: keyboardType,
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.digitsOnly, // 只允许数字输入
|
||||||
|
],
|
||||||
enabled: enabled,
|
enabled: enabled,
|
||||||
style: const TextStyle(fontSize: 14),
|
style: const TextStyle(fontSize: 14),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
|||||||
Reference in New Issue
Block a user