证件接口

This commit is contained in:
2025-11-18 13:18:35 +08:00
parent 5f12905eff
commit 3a9efab8ad
2 changed files with 35 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import 'package:getx_scaffold/getx_scaffold.dart';
import 'package:ln_jq_app/common/model/base_model.dart';
import 'package:ln_jq_app/common/model/vehicle_info.dart';
import 'package:ln_jq_app/storage_service.dart';
@@ -24,7 +25,7 @@ class CarInfoController extends GetxController with BaseControllerMixin {
super.onClose();
}
void getUserBindCarInfo() {
void getUserBindCarInfo() async {
if (StorageService.to.hasVehicleInfo) {
VehicleInfo? bean = StorageService.to.vehicleInfo;
if (bean == null) {
@@ -35,6 +36,36 @@ class CarInfoController extends GetxController with BaseControllerMixin {
modelName = bean.modelName;
brandName = bean.brandName;
final response = await HttpService.to.get(
'appointment/vehicle/getPicInfoByVin?vin=${vin}',
);
if (response != null) {
final result = BaseModel.fromJson(response.data);
if (result.code == 0 && result.data != null) {
result.data;
/*{
"plateNumber": "浙F08860F",
"vin": "LA9GG64L9NBAF4174",
"drivingAttachment": [
"https://lnh2e.com/api/lingniu-export-v1/v1/resource/file/2024/05/202405162107520002.pdf",
"https://lnh2e.com/api/lingniu-export-v1/v1/resource/file/2024/05/202405162107530002.jpg",
"https://lnh2e.com/api/lingniu-export-v1/v1/resource/file/2024/12/202412101043260001.jpg"
],
"operationAttachment": [
"https://lnh2e.com/api/lingniu-export-v1/v1/resource/file/2024/05/202405162107530003.pdf",
"https://lnh2e.com/api/lingniu-export-v1/v1/resource/file/2024/12/202412101043460001.jpg",
"https://lnh2e.com/api/lingniu-export-v1/v1/resource/file/2024/12/202412181551190001.pdf"
],
"hydrogenationAttachment": [
"https://lnh2e.com/api/lingniu-export-v1/v1/resource/file/2024/05/202405162107570001.pdf"
],
"registerAttachment": [
"https://lnh2e.com/api/lingniu-export-v1/v1/resource/file/2024/05/202405162108010001.pdf"
]
}*/
}
}
updateUi();
}
}

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_scaffold/getx_scaffold.dart';
import 'package:ln_jq_app/common/styles/theme.dart';
import 'package:ln_jq_app/pages/qr_code/view.dart';
import 'package:ln_jq_app/storage_service.dart';
// import 'package:getx_scaffold/getx_scaffold.dart'; // 如果不使用其中的扩展,可以注释掉
@@ -256,7 +257,7 @@ class CarInfoPage extends GetView<CarInfoController> {
backgroundColor: Colors.blue.withOpacity(0.1),
child: Icon(icon, color: Colors.blue, size: 28),
),
title: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)),
title: Text(title, style: const TextStyle(fontWeight: FontWeight.bold,fontSize: 14)),
subtitle: Text(subtitle, style: const TextStyle(color: Colors.grey, fontSize: 12)),
trailing: Container(
padding: const EdgeInsets.all(8),
@@ -265,7 +266,7 @@ class CarInfoPage extends GetView<CarInfoController> {
borderRadius: BorderRadius.circular(8),
),
// 图片中的图标是“查看”的意思,这里用一个类似的图标代替
child: const Icon(Icons.find_in_page_outlined, color: Colors.black54),
child: const Icon(Icons.find_in_page_outlined, color: AppTheme.themeColor),
),
onTap: () {
// TODO: 查看证件详情逻辑