diff --git a/ln_jq_app/lib/pages/c_page/car_info/controller.dart b/ln_jq_app/lib/pages/c_page/car_info/controller.dart index ee2045c..a2e99b3 100644 --- a/ln_jq_app/lib/pages/c_page/car_info/controller.dart +++ b/ln_jq_app/lib/pages/c_page/car_info/controller.dart @@ -15,9 +15,9 @@ class CarInfoController extends GetxController with BaseControllerMixin { // --- 车辆基本信息 --- String plateNumber = ""; - String vin = "未知"; - String modelName = "未知"; - String brandName = "未知"; + String vin = "-"; + String modelName = "-"; + String brandName = "-"; // --- 证件附件列表 --- final RxList drivingAttachments = [].obs; diff --git a/ln_jq_app/lib/pages/c_page/car_info/view.dart b/ln_jq_app/lib/pages/c_page/car_info/view.dart index 0811bc4..e5a7ab3 100644 --- a/ln_jq_app/lib/pages/c_page/car_info/view.dart +++ b/ln_jq_app/lib/pages/c_page/car_info/view.dart @@ -133,7 +133,7 @@ class CarInfoPage extends GetView { ), ), IconButton( - onPressed: () async{ + onPressed: () async { var scanResult = await Get.to(() => const MessagePage()); if (scanResult == null) { controller.msgNotice(); @@ -163,11 +163,26 @@ class CarInfoPage extends GetView { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - _buildModernStatItem('本月里程数', 'Accumulated', '2,852km', ''), + _buildModernStatItem( + '本月里程数', + 'Accumulated', + StorageService.to.hasVehicleInfo ? '2,852km' : '-', + '', + ), const SizedBox(width: 8), - _buildModernStatItem('总里程', 'Refuel Count', "2.5W km", ''), + _buildModernStatItem( + '总里程', + 'Refuel Count', + StorageService.to.hasVehicleInfo ? "2.5W km" : '-', + '', + ), const SizedBox(width: 8), - _buildModernStatItem('服务评分', 'Driver rating', "4.9分", ''), + _buildModernStatItem( + '服务评分', + 'Driver rating', + StorageService.to.hasVehicleInfo ? "4.9分" : '-', + '', + ), ], ), ), @@ -300,20 +315,20 @@ class CarInfoPage extends GetView { children: [ ClipRRect( borderRadius: BorderRadius.circular(4), - child: const LinearProgressIndicator( - value: 0.75, + child: LinearProgressIndicator( + value: StorageService.to.hasVehicleInfo ? 0.75 : 0, minHeight: 8, backgroundColor: Color(0xFFF0F2F5), valueColor: AlwaysStoppedAnimation(Color.fromRGBO(16, 185, 129, 1)), ), ), const SizedBox(height: 8), - const Row( + Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text("H2 Level", style: TextStyle(fontSize: 11, color: Colors.grey)), Text( - "75%", + StorageService.to.hasVehicleInfo ? "75%" : "0%", style: TextStyle( fontSize: 11, color: Color.fromRGBO(16, 185, 129, 1), @@ -382,7 +397,11 @@ class CarInfoPage extends GetView { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - _buildCertDetailItem('所属公司', controller.rentFromCompany, isFull: false), + _buildCertDetailItem( + '所属公司', + controller.rentFromCompany, + isFull: false, + ), _buildCertDetailItem('运营城市', controller.address), ], ), diff --git a/ln_jq_app/lib/pages/c_page/reservation/controller.dart b/ln_jq_app/lib/pages/c_page/reservation/controller.dart index 0350779..ffad3af 100644 --- a/ln_jq_app/lib/pages/c_page/reservation/controller.dart +++ b/ln_jq_app/lib/pages/c_page/reservation/controller.dart @@ -536,13 +536,13 @@ class C_ReservationController extends GetxController with BaseControllerMixin { } } - String workEfficiency = "0"; - String fillingWeight = "0"; - String fillingTimes = "0"; + String workEfficiency = "-"; + String fillingWeight = "-"; + String fillingTimes = "-"; String modeImage = ""; String plateNumber = ""; String vin = ""; - String leftHydrogen = "0"; + String leftHydrogen = "-"; num maxHydrogen = 0; String difference = ""; var progressValue = 0.0; @@ -691,8 +691,8 @@ class C_ReservationController extends GetxController with BaseControllerMixin { var result = BaseModel.fromJson(responseData.data); - leftHydrogen = result.data["leftHydrogen"].toString(); - workEfficiency = result.data["workEfficiency"].toString(); + leftHydrogen = "${result.data["leftHydrogen"]}Kg"; + workEfficiency = "${result.data["workEfficiency"]}Kg"; final leftHydrogenNum = double.tryParse(leftHydrogen) ?? 0.0; difference = (maxHydrogen - leftHydrogenNum).toStringAsFixed(2); diff --git a/ln_jq_app/lib/pages/c_page/reservation/view.dart b/ln_jq_app/lib/pages/c_page/reservation/view.dart index 58a8f5d..8695ba4 100644 --- a/ln_jq_app/lib/pages/c_page/reservation/view.dart +++ b/ln_jq_app/lib/pages/c_page/reservation/view.dart @@ -179,7 +179,12 @@ class ReservationPage extends GetView { const SizedBox(width: 8), _buildModernStatItem('总加氢次数', '', controller.fillingTimes, ''), const SizedBox(width: 8), - _buildModernStatItem('今日里程', '', "7kg", ''), + _buildModernStatItem( + '今日里程', + '', + StorageService.to.hasVehicleInfo ? "7kg" : "-", + '', + ), ], ), ), @@ -258,11 +263,14 @@ class ReservationPage extends GetView { flex: 6, child: Column( children: [ - _buildCarDataItem('剩余电量', '36.8%'), + _buildCarDataItem( + '剩余电量', + StorageService.to.hasVehicleInfo ? '36.8%' : '-', + ), const SizedBox(height: 8), - _buildCarDataItem('剩余氢量', '${controller.leftHydrogen}Kg'), + _buildCarDataItem('剩余氢量', controller.leftHydrogen), const SizedBox(height: 8), - _buildCarDataItem('百公里氢耗', '${controller.workEfficiency}Kg'), + _buildCarDataItem('百公里氢耗', controller.workEfficiency), const SizedBox(height: 12), Column( children: [ @@ -290,7 +298,7 @@ class ReservationPage extends GetView { ), ), Text( - "${controller.leftHydrogen}Kg", + controller.leftHydrogen, style: const TextStyle( fontSize: 10, color: Color(0xFF006633),