更新快检报告
This commit is contained in:
@@ -106,27 +106,31 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
|
||||
}
|
||||
|
||||
Future<bool> checkReportStatus(String mac) async {
|
||||
String serviceAddress = ServiceConstant.qc_service_address;
|
||||
String serviceApi = ServiceConstant.checkQuickStatus;
|
||||
String queryUrl = "$serviceAddress$serviceApi?mac=${mac}";
|
||||
bool flag = false;
|
||||
await requestWithLog(
|
||||
logTitle: "查询快检状态",
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
flag = res.data['status'] != 200;
|
||||
experience_status.value = res.data['status'];
|
||||
experience_percent.value = res.data['per'] ?? 0;
|
||||
experience_id.value = res.data['id'] ?? "";
|
||||
own.value = res.data['own'] ?? false;
|
||||
updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
flag = false;
|
||||
experience_status.value = -1;
|
||||
},
|
||||
);
|
||||
try {
|
||||
String serviceAddress = ServiceConstant.qc_service_address;
|
||||
String serviceApi = ServiceConstant.checkQuickStatus;
|
||||
String queryUrl = "$serviceAddress$serviceApi?mac=${mac}";
|
||||
await requestWithLog(
|
||||
logTitle: "查询快检状态",
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
flag = res.data['status'] != 200;
|
||||
experience_status.value = res.data['status'];
|
||||
experience_percent.value = res.data['per'] ?? 0;
|
||||
experience_id.value = res.data['id'] ?? "";
|
||||
own.value = res.data['own'] ?? false;
|
||||
updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
flag = false;
|
||||
experience_status.value = -1;
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
print("查询快检状态出错: $e");
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@@ -299,6 +303,9 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
|
||||
flag = true;
|
||||
},
|
||||
onFailure: (res) {
|
||||
NewTopSlideNotification.show(
|
||||
text:res.msg ?? "请求失败".tr,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
flag = false;
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user