优化问题修改
This commit is contained in:
@@ -173,6 +173,10 @@ class HistoryPage extends GetView<HistoryController> {
|
|||||||
text = '未加氢';
|
text = '未加氢';
|
||||||
color = Colors.red;
|
color = Colors.red;
|
||||||
break;
|
break;
|
||||||
|
case ReservationStatus.cancel:
|
||||||
|
text = '已取消';
|
||||||
|
color = Colors.red;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
text = '未知状态';
|
text = '未知状态';
|
||||||
color = Colors.grey;
|
color = Colors.grey;
|
||||||
|
|||||||
@@ -12,11 +12,13 @@ enum ReservationStatus {
|
|||||||
completed, // 完成 ( addStatus: 1)
|
completed, // 完成 ( addStatus: 1)
|
||||||
rejected, // 拒绝 ( -1)
|
rejected, // 拒绝 ( -1)
|
||||||
unadded, // 未加 ( 2)
|
unadded, // 未加 ( 2)
|
||||||
|
cancel, // 取消预约
|
||||||
unknown, // 未知状态
|
unknown, // 未知状态
|
||||||
}
|
}
|
||||||
|
|
||||||
class ReservationModel {
|
class ReservationModel {
|
||||||
final String id;
|
final String id;
|
||||||
|
final String stationId;
|
||||||
final String plateNumber;
|
final String plateNumber;
|
||||||
String amount;
|
String amount;
|
||||||
final String time;
|
final String time;
|
||||||
@@ -40,6 +42,7 @@ class ReservationModel {
|
|||||||
|
|
||||||
ReservationModel({
|
ReservationModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
|
required this.stationId,
|
||||||
required this.plateNumber,
|
required this.plateNumber,
|
||||||
required this.amount,
|
required this.amount,
|
||||||
required this.time,
|
required this.time,
|
||||||
@@ -80,6 +83,9 @@ class ReservationModel {
|
|||||||
case 2:
|
case 2:
|
||||||
currentStatus = ReservationStatus.unadded;
|
currentStatus = ReservationStatus.unadded;
|
||||||
break;
|
break;
|
||||||
|
case 6:
|
||||||
|
currentStatus = ReservationStatus.cancel;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
currentStatus = ReservationStatus.unknown;
|
currentStatus = ReservationStatus.unknown;
|
||||||
}
|
}
|
||||||
@@ -97,6 +103,7 @@ class ReservationModel {
|
|||||||
return ReservationModel(
|
return ReservationModel(
|
||||||
// 原始字段,用于UI兼容
|
// 原始字段,用于UI兼容
|
||||||
id: json['id']?.toString() ?? '',
|
id: json['id']?.toString() ?? '',
|
||||||
|
stationId: json['stationId']?.toString() ?? '',
|
||||||
plateNumber: json['plateNumber']?.toString() ?? '未知车牌',
|
plateNumber: json['plateNumber']?.toString() ?? '未知车牌',
|
||||||
amount: '${json['hydAmount']?.toString() ?? '0'}kg',
|
amount: '${json['hydAmount']?.toString() ?? '0'}kg',
|
||||||
time: timeRange,
|
time: timeRange,
|
||||||
@@ -193,6 +200,7 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
'pageNum': 1,
|
'pageNum': 1,
|
||||||
'pageSize': 50, // 暂时不考虑分页,一次获取30条
|
'pageSize': 50, // 暂时不考虑分页,一次获取30条
|
||||||
'keyword': searchText, // 加氢站名称、手机号
|
'keyword': searchText, // 加氢站名称、手机号
|
||||||
|
'stationId': StorageService.to.userId
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class SitePage extends GetView<SiteController> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'今日预约信息',
|
'预约信息',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -465,6 +465,10 @@ class SitePage extends GetView<SiteController> {
|
|||||||
text = '未加氢';
|
text = '未加氢';
|
||||||
color = Colors.red;
|
color = Colors.red;
|
||||||
break;
|
break;
|
||||||
|
case ReservationStatus.cancel:
|
||||||
|
text = '已取消';
|
||||||
|
color = Colors.red;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
text = '未知状态';
|
text = '未知状态';
|
||||||
color = Colors.grey;
|
color = Colors.grey;
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ class MessageController extends GetxController {
|
|||||||
_loadData(isRefresh: true);
|
_loadData(isRefresh: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onRefresh() => _loadData(isRefresh: true);
|
||||||
|
|
||||||
|
void onLoading() => _loadData(isRefresh: false);
|
||||||
|
|
||||||
Future<void> _loadData({bool isRefresh = false}) async {
|
Future<void> _loadData({bool isRefresh = false}) async {
|
||||||
final int targetPage = isRefresh ? 1 : _pageNum + 1;
|
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 {
|
void markAllRead() async {
|
||||||
|
|||||||
@@ -401,6 +401,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
|
|
||||||
lastSuccessfulReservation = ReservationModel(
|
lastSuccessfulReservation = ReservationModel(
|
||||||
id: selectedStationId.value!,
|
id: selectedStationId.value!,
|
||||||
|
stationId: '',
|
||||||
hydAmount: ampuntStr,
|
hydAmount: ampuntStr,
|
||||||
startTime: startTimeStr,
|
startTime: startTimeStr,
|
||||||
endTime: endTimeStr,
|
endTime: endTimeStr,
|
||||||
|
|||||||
@@ -132,7 +132,6 @@ class ReservationEditController extends GetxController with BaseControllerMixin
|
|||||||
|
|
||||||
TimeSlot tempSlot = availableSlots[initialItem];
|
TimeSlot tempSlot = availableSlots[initialItem];
|
||||||
|
|
||||||
|
|
||||||
Get.bottomSheet(
|
Get.bottomSheet(
|
||||||
Container(
|
Container(
|
||||||
height: 300,
|
height: 300,
|
||||||
@@ -228,6 +227,7 @@ class ReservationEditController extends GetxController with BaseControllerMixin
|
|||||||
'appointment/orderAddHyd/saveOrUpdate',
|
'appointment/orderAddHyd/saveOrUpdate',
|
||||||
data: {
|
data: {
|
||||||
'id': reservation.id,
|
'id': reservation.id,
|
||||||
|
'stationId': reservation.stationId,
|
||||||
'startTime': startTimeStr,
|
'startTime': startTimeStr,
|
||||||
'endTime': endTimeStr,
|
'endTime': endTimeStr,
|
||||||
'hydAmount': amountStr,
|
'hydAmount': amountStr,
|
||||||
|
|||||||
@@ -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/common/styles/theme.dart';
|
||||||
import 'package:ln_jq_app/pages/b_page/base_widgets/view.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/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 'package:ln_jq_app/pages/login/view.dart';
|
||||||
|
|
||||||
import '../../storage_service.dart';
|
import '../../storage_service.dart';
|
||||||
@@ -156,6 +157,7 @@ class HomeController extends GetxController with BaseControllerMixin {
|
|||||||
|
|
||||||
Future<void> _onNotificationOpened(Map<dynamic, dynamic> message) async {
|
Future<void> _onNotificationOpened(Map<dynamic, dynamic> message) async {
|
||||||
Logger.d('onNotificationOpened ====> $message');
|
Logger.d('onNotificationOpened ====> $message');
|
||||||
|
await Get.to(() => const MessagePage());
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onNotificationRemoved(Map<dynamic, dynamic> message) async {
|
Future<void> _onNotificationRemoved(Map<dynamic, dynamic> message) async {
|
||||||
|
|||||||
Reference in New Issue
Block a user