调整和修改

This commit is contained in:
2025-12-19 13:18:04 +08:00
parent 62ca3888d3
commit 21a528d6d1
4 changed files with 44 additions and 37 deletions

View File

@@ -32,13 +32,16 @@ class HistoryController extends GetxController {
final args = Get.arguments as Map<String, dynamic>;
stationName = args['stationName'] as String;
fetchHistoryData();
getAllOrderCounts();
}
Future<void> getAllOrderCounts() async {
var response = await HttpService.to.post(
"appointment/orderAddHyd/getAllOrderCounts",
data: {
// --- 直接使用 DateFormat 来格式化日期 ---
'startTime': _apiDateFormat.format(startDate.value),
'endTime': _apiDateFormat.format(endDate.value),
'plateNumber': plateNumberController.text,
'stationName': stationName, // 加氢站名称
},
);
@@ -60,6 +63,10 @@ class HistoryController extends GetxController {
Future<void> fetchHistoryData() async {
isLoading.value = true;
//获取数据
getAllOrderCounts();
try {
var response = await HttpService.to.post(
"appointment/orderAddHyd/sitOrderPage",

View File

@@ -191,6 +191,7 @@ class SiteController extends GetxController with BaseControllerMixin {
showToast('暂时无法获取预约数据');
hasReservationData = false;
reservationList = [];
dismissLoading();
return;
}

View File

@@ -657,7 +657,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
return;
}
showLoading("加载中");
showLoading("氢站数据加载中");
final originalHeaders = Map<String, dynamic>.from(HttpService.to.dio.options.headers);
try {
HttpService.to.setBaseUrl(AppTheme.jiaqing_service_url);
@@ -670,8 +670,6 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
dismissLoading();
return;
}
try {
dismissLoading();
var result = BaseModel.fromJson(responseData.data);
var stationDataList = result.data['data'] as List;
@@ -710,9 +708,8 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
selectedStationId.value = null;
}
} catch (e) {
dismissLoading();
showToast('数据异常');
}
} catch (e) {
} finally {
dismissLoading();
HttpService.to.setBaseUrl(AppTheme.test_service_url);

View File

@@ -181,6 +181,7 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
if (result.code != 0) {
showToast(result.error);
dismissLoading();
return;
}
@@ -346,6 +347,7 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
if (result.code != 0) {
showToast(result.error);
dismissLoading();
return;
}