优化问题修改

This commit is contained in:
2026-01-15 16:28:59 +08:00
parent e7a9e4483a
commit 8302d7c179
7 changed files with 28 additions and 7 deletions

View File

@@ -173,6 +173,10 @@ class HistoryPage extends GetView<HistoryController> {
text = '未加氢';
color = Colors.red;
break;
case ReservationStatus.cancel:
text = '已取消';
color = Colors.red;
break;
default:
text = '未知状态';
color = Colors.grey;

View File

@@ -12,11 +12,13 @@ enum ReservationStatus {
completed, // 完成 ( addStatus: 1)
rejected, // 拒绝 ( -1)
unadded, // 未加 ( 2)
cancel, // 取消预约
unknown, // 未知状态
}
class ReservationModel {
final String id;
final String stationId;
final String plateNumber;
String amount;
final String time;
@@ -40,6 +42,7 @@ class ReservationModel {
ReservationModel({
required this.id,
required this.stationId,
required this.plateNumber,
required this.amount,
required this.time,
@@ -80,6 +83,9 @@ class ReservationModel {
case 2:
currentStatus = ReservationStatus.unadded;
break;
case 6:
currentStatus = ReservationStatus.cancel;
break;
default:
currentStatus = ReservationStatus.unknown;
}
@@ -97,6 +103,7 @@ class ReservationModel {
return ReservationModel(
// 原始字段用于UI兼容
id: json['id']?.toString() ?? '',
stationId: json['stationId']?.toString() ?? '',
plateNumber: json['plateNumber']?.toString() ?? '未知车牌',
amount: '${json['hydAmount']?.toString() ?? '0'}kg',
time: timeRange,
@@ -193,6 +200,7 @@ class SiteController extends GetxController with BaseControllerMixin {
'pageNum': 1,
'pageSize': 50, // 暂时不考虑分页一次获取30条
'keyword': searchText, // 加氢站名称、手机号
'stationId': StorageService.to.userId
},
);

View File

@@ -132,7 +132,7 @@ class SitePage extends GetView<SiteController> {
child: Row(
children: [
Text(
'今日预约信息',
'预约信息',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
@@ -465,6 +465,10 @@ class SitePage extends GetView<SiteController> {
text = '未加氢';
color = Colors.red;
break;
case ReservationStatus.cancel:
text = '已取消';
color = Colors.red;
break;
default:
text = '未知状态';
color = Colors.grey;

View File

@@ -19,6 +19,10 @@ class MessageController extends GetxController {
_loadData(isRefresh: true);
}
void onRefresh() => _loadData(isRefresh: true);
void onLoading() => _loadData(isRefresh: false);
Future<void> _loadData({bool isRefresh = false}) async {
final int targetPage = isRefresh ? 1 : _pageNum + 1;
@@ -100,9 +104,7 @@ class MessageController extends GetxController {
}
}
void onRefresh() => _loadData(isRefresh: true);
void onLoading() => _loadData(isRefresh: false);
// 标记全部已读
void markAllRead() async {

View File

@@ -401,6 +401,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
lastSuccessfulReservation = ReservationModel(
id: selectedStationId.value!,
stationId: '',
hydAmount: ampuntStr,
startTime: startTimeStr,
endTime: endTimeStr,

View File

@@ -132,7 +132,6 @@ class ReservationEditController extends GetxController with BaseControllerMixin
TimeSlot tempSlot = availableSlots[initialItem];
Get.bottomSheet(
Container(
height: 300,
@@ -228,6 +227,7 @@ class ReservationEditController extends GetxController with BaseControllerMixin
'appointment/orderAddHyd/saveOrUpdate',
data: {
'id': reservation.id,
'stationId': reservation.stationId,
'startTime': startTimeStr,
'endTime': endTimeStr,
'hydAmount': amountStr,

View File

@@ -7,6 +7,7 @@ import 'package:getx_scaffold/getx_scaffold.dart';
import 'package:ln_jq_app/common/styles/theme.dart';
import 'package:ln_jq_app/pages/b_page/base_widgets/view.dart';
import 'package:ln_jq_app/pages/c_page/base_widgets/view.dart';
import 'package:ln_jq_app/pages/c_page/message/view.dart';
import 'package:ln_jq_app/pages/login/view.dart';
import '../../storage_service.dart';
@@ -156,6 +157,7 @@ class HomeController extends GetxController with BaseControllerMixin {
Future<void> _onNotificationOpened(Map<dynamic, dynamic> message) async {
Logger.d('onNotificationOpened ====> $message');
await Get.to(() => const MessagePage());
}
Future<void> _onNotificationRemoved(Map<dynamic, dynamic> message) async {