修改绑定车辆接口
登录后查询车辆信息
This commit is contained in:
@@ -28,11 +28,14 @@ class CarInfoController extends GetxController with BaseControllerMixin {
|
||||
super.onInit();
|
||||
getUserBindCarInfo();
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
// 如果未绑定车辆,且本次会话尚未提示过,则弹出提示
|
||||
if (!StorageService.to.hasShownBindVehicleDialog && StorageService.to.isLoggedIn) {
|
||||
if (!StorageService.to.hasShownBindVehicleDialog &&
|
||||
StorageService.to.isLoggedIn &&
|
||||
!StorageService.to.hasVehicleInfo) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
DialogX.to.showConfirmDialog(
|
||||
title: '当前尚未绑定车辆',
|
||||
@@ -71,7 +74,7 @@ class CarInfoController extends GetxController with BaseControllerMixin {
|
||||
final response = await HttpService.to.get(
|
||||
'appointment/vehicle/getPicInfoByVin?vin=$vin',
|
||||
);
|
||||
|
||||
|
||||
if (response != null && response.data != null) {
|
||||
final result = BaseModel.fromJson(response.data);
|
||||
if (result.code == 0 && result.data != null) {
|
||||
@@ -88,7 +91,9 @@ class CarInfoController extends GetxController with BaseControllerMixin {
|
||||
// 将解析出的 URL 列表赋值给对应的 RxList
|
||||
drivingAttachments.assignAll(parseAttachments(data['drivingAttachment']));
|
||||
operationAttachments.assignAll(parseAttachments(data['operationAttachment']));
|
||||
hydrogenationAttachments.assignAll(parseAttachments(data['hydrogenationAttachment']));
|
||||
hydrogenationAttachments.assignAll(
|
||||
parseAttachments(data['hydrogenationAttachment']),
|
||||
);
|
||||
registerAttachments.assignAll(parseAttachments(data['registerAttachment']));
|
||||
}
|
||||
}
|
||||
@@ -98,7 +103,7 @@ class CarInfoController extends GetxController with BaseControllerMixin {
|
||||
|
||||
/// 跳转到证件查看页面
|
||||
void navigateToCertificateViewer(String title, List<String> attachments) {
|
||||
if(!StorageService.to.hasVehicleInfo){
|
||||
if (!StorageService.to.hasVehicleInfo) {
|
||||
showToast('请先绑定车辆');
|
||||
return;
|
||||
}
|
||||
@@ -108,10 +113,7 @@ class CarInfoController extends GetxController with BaseControllerMixin {
|
||||
}
|
||||
Get.to(
|
||||
() => const CertificateViewerPage(),
|
||||
arguments: {
|
||||
'title': title,
|
||||
'attachments': attachments,
|
||||
},
|
||||
arguments: {'title': title, 'attachments': attachments},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user