问题修改
This commit is contained in:
@@ -344,7 +344,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
||||
return;
|
||||
}*/
|
||||
|
||||
final reservationEndDateTime = DateTime(
|
||||
DateTime reservationEndDateTime = DateTime(
|
||||
selectedDate.value.year,
|
||||
selectedDate.value.month,
|
||||
selectedDate.value.day,
|
||||
@@ -352,7 +352,13 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
||||
endTime.value.minute,
|
||||
);
|
||||
|
||||
//判断预约区间的结束时间是否早于当前时间(留出1分钟缓冲)
|
||||
// 如果结束的小时数小于开始的小时数,或者结束时间是 00:00,说明是次日
|
||||
if (endTime.value.hour < startTime.value.hour ||
|
||||
(endTime.value.hour == 0 && endTime.value.minute == 0)) {
|
||||
reservationEndDateTime = reservationEndDateTime.add(const Duration(days: 1));
|
||||
}
|
||||
|
||||
// 执行时间检查
|
||||
if (reservationEndDateTime.isBefore(
|
||||
DateTime.now().subtract(const Duration(minutes: 1)),
|
||||
)) {
|
||||
|
||||
@@ -147,12 +147,11 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async{
|
||||
onPressed: () async {
|
||||
var scanResult = await Get.to(() => const MessagePage());
|
||||
if (scanResult == null) {
|
||||
controller.msgNotice();
|
||||
}
|
||||
|
||||
},
|
||||
icon: Badge(
|
||||
smallSize: 8,
|
||||
@@ -567,18 +566,22 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () => _updateAmount(-1),
|
||||
icon: Icon(Icons.remove, size: 14.sp, color: Colors.grey),
|
||||
icon: Icon(Icons.remove, size: 14.sp, color: Colors.grey),
|
||||
),
|
||||
Text(
|
||||
"${controller.amountController.text}Kg",
|
||||
style: TextStyle(
|
||||
fontSize: 11.sp,
|
||||
color: Colors.black87,
|
||||
fontWeight: FontWeight.w500,
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${controller.amountController.text}Kg",
|
||||
textAlign: TextAlign.center,
|
||||
softWrap: false,
|
||||
overflow: TextOverflow.fade,
|
||||
style: TextStyle(
|
||||
fontSize: 11.sp,
|
||||
color: Colors.black87,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
|
||||
@@ -444,12 +444,19 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
||||
data: {'account': account, 'password': encryptedPassword, 'loginType': "station"},
|
||||
);
|
||||
|
||||
if (_rememberPassword) {
|
||||
await StorageService.to.saveStationCredentials(account, password);
|
||||
} else {
|
||||
await StorageService.to.clearStationCredentials();
|
||||
if (responseData != null && responseData.data != null) {
|
||||
var result = BaseModel.fromJson(responseData.data);
|
||||
if (result.code == 0) {
|
||||
// 登录成功,处理记住密码逻辑
|
||||
if (_rememberPassword) {
|
||||
await StorageService.to.saveStationCredentials(account, password);
|
||||
} else {
|
||||
await StorageService.to.clearStationCredentials();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_processLoginResponse(responseData, "station", account);
|
||||
} catch (e) {
|
||||
dismissLoading();
|
||||
@@ -476,7 +483,6 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
||||
) async {
|
||||
if (responseData == null || responseData.data == null) {
|
||||
dismissLoading();
|
||||
showToast('登录失败');
|
||||
return;
|
||||
}
|
||||
var result = BaseModel.fromJson(responseData.data);
|
||||
|
||||
@@ -154,7 +154,7 @@ class QrCodeController extends GetxController with BaseControllerMixin {
|
||||
showErrorToast(result.error);
|
||||
}
|
||||
} catch (e) {
|
||||
showErrorToast("绑定失败,请检查网络");
|
||||
|
||||
} finally {
|
||||
dismissLoading();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user