未车辆显示

This commit is contained in:
2026-02-05 14:50:03 +08:00
parent 211d0225e4
commit f68c2d0938
4 changed files with 50 additions and 23 deletions

View File

@@ -15,9 +15,9 @@ class CarInfoController extends GetxController with BaseControllerMixin {
// --- 车辆基本信息 --- // --- 车辆基本信息 ---
String plateNumber = ""; String plateNumber = "";
String vin = "未知"; String vin = "-";
String modelName = "未知"; String modelName = "-";
String brandName = "未知"; String brandName = "-";
// --- 证件附件列表 --- // --- 证件附件列表 ---
final RxList<String> drivingAttachments = <String>[].obs; final RxList<String> drivingAttachments = <String>[].obs;

View File

@@ -133,7 +133,7 @@ class CarInfoPage extends GetView<CarInfoController> {
), ),
), ),
IconButton( IconButton(
onPressed: () async{ onPressed: () async {
var scanResult = await Get.to(() => const MessagePage()); var scanResult = await Get.to(() => const MessagePage());
if (scanResult == null) { if (scanResult == null) {
controller.msgNotice(); controller.msgNotice();
@@ -163,11 +163,26 @@ class CarInfoPage extends GetView<CarInfoController> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
_buildModernStatItem('本月里程数', 'Accumulated', '2,852km', ''), _buildModernStatItem(
'本月里程数',
'Accumulated',
StorageService.to.hasVehicleInfo ? '2,852km' : '-',
'',
),
const SizedBox(width: 8), const SizedBox(width: 8),
_buildModernStatItem('总里程', 'Refuel Count', "2.5W km", ''), _buildModernStatItem(
'总里程',
'Refuel Count',
StorageService.to.hasVehicleInfo ? "2.5W km" : '-',
'',
),
const SizedBox(width: 8), 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<CarInfoController> {
children: [ children: [
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
child: const LinearProgressIndicator( child: LinearProgressIndicator(
value: 0.75, value: StorageService.to.hasVehicleInfo ? 0.75 : 0,
minHeight: 8, minHeight: 8,
backgroundColor: Color(0xFFF0F2F5), backgroundColor: Color(0xFFF0F2F5),
valueColor: AlwaysStoppedAnimation<Color>(Color.fromRGBO(16, 185, 129, 1)), valueColor: AlwaysStoppedAnimation<Color>(Color.fromRGBO(16, 185, 129, 1)),
), ),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
const Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text("H2 Level", style: TextStyle(fontSize: 11, color: Colors.grey)), Text("H2 Level", style: TextStyle(fontSize: 11, color: Colors.grey)),
Text( Text(
"75%", StorageService.to.hasVehicleInfo ? "75%" : "0%",
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
color: Color.fromRGBO(16, 185, 129, 1), color: Color.fromRGBO(16, 185, 129, 1),
@@ -382,7 +397,11 @@ class CarInfoPage extends GetView<CarInfoController> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
_buildCertDetailItem('所属公司', controller.rentFromCompany, isFull: false), _buildCertDetailItem(
'所属公司',
controller.rentFromCompany,
isFull: false,
),
_buildCertDetailItem('运营城市', controller.address), _buildCertDetailItem('运营城市', controller.address),
], ],
), ),

View File

@@ -536,13 +536,13 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
} }
} }
String workEfficiency = "0"; String workEfficiency = "-";
String fillingWeight = "0"; String fillingWeight = "-";
String fillingTimes = "0"; String fillingTimes = "-";
String modeImage = ""; String modeImage = "";
String plateNumber = ""; String plateNumber = "";
String vin = ""; String vin = "";
String leftHydrogen = "0"; String leftHydrogen = "-";
num maxHydrogen = 0; num maxHydrogen = 0;
String difference = ""; String difference = "";
var progressValue = 0.0; var progressValue = 0.0;
@@ -691,8 +691,8 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
var result = BaseModel.fromJson(responseData.data); var result = BaseModel.fromJson(responseData.data);
leftHydrogen = result.data["leftHydrogen"].toString(); leftHydrogen = "${result.data["leftHydrogen"]}Kg";
workEfficiency = result.data["workEfficiency"].toString(); workEfficiency = "${result.data["workEfficiency"]}Kg";
final leftHydrogenNum = double.tryParse(leftHydrogen) ?? 0.0; final leftHydrogenNum = double.tryParse(leftHydrogen) ?? 0.0;
difference = (maxHydrogen - leftHydrogenNum).toStringAsFixed(2); difference = (maxHydrogen - leftHydrogenNum).toStringAsFixed(2);

View File

@@ -179,7 +179,12 @@ class ReservationPage extends GetView<C_ReservationController> {
const SizedBox(width: 8), const SizedBox(width: 8),
_buildModernStatItem('总加氢次数', '', controller.fillingTimes, ''), _buildModernStatItem('总加氢次数', '', controller.fillingTimes, ''),
const SizedBox(width: 8), const SizedBox(width: 8),
_buildModernStatItem('今日里程', '', "7kg", ''), _buildModernStatItem(
'今日里程',
'',
StorageService.to.hasVehicleInfo ? "7kg" : "-",
'',
),
], ],
), ),
), ),
@@ -258,11 +263,14 @@ class ReservationPage extends GetView<C_ReservationController> {
flex: 6, flex: 6,
child: Column( child: Column(
children: [ children: [
_buildCarDataItem('剩余电量', '36.8%'), _buildCarDataItem(
'剩余电量',
StorageService.to.hasVehicleInfo ? '36.8%' : '-',
),
const SizedBox(height: 8), const SizedBox(height: 8),
_buildCarDataItem('剩余氢量', '${controller.leftHydrogen}Kg'), _buildCarDataItem('剩余氢量', controller.leftHydrogen),
const SizedBox(height: 8), const SizedBox(height: 8),
_buildCarDataItem('百公里氢耗', '${controller.workEfficiency}Kg'), _buildCarDataItem('百公里氢耗', controller.workEfficiency),
const SizedBox(height: 12), const SizedBox(height: 12),
Column( Column(
children: [ children: [
@@ -290,7 +298,7 @@ class ReservationPage extends GetView<C_ReservationController> {
), ),
), ),
Text( Text(
"${controller.leftHydrogen}Kg", controller.leftHydrogen,
style: const TextStyle( style: const TextStyle(
fontSize: 10, fontSize: 10,
color: Color(0xFF006633), color: Color(0xFF006633),