更新快检功能必传mac参数
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/tool/NewTopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/setting/language/language_controller.dart';
|
||||
import 'package:vbvs_app/enum/APPPackageType.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
@@ -46,10 +47,13 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
|
||||
RxList cqHistoryList = [].obs;
|
||||
RxMap currentCq = {}.obs;
|
||||
LanguageController languageController = Get.find();
|
||||
// 404:未找到快检信息 200:快检进行中 201:快检完成 202:快检超时 203:已取消 500:计算错误
|
||||
// 404:未找到快检信息 200:快检进行中 201:快检完成 202:快检超时 203:已取消 500:计算错误 501 有效数据不足
|
||||
RxInt experience_status = 404.obs;
|
||||
RxInt experience_percent = 0.obs; //体验进度
|
||||
RxString experience_id = "".obs; //体验id
|
||||
RxBool own = false.obs; //体验id
|
||||
RxString errmsg = "".obs;
|
||||
RxBool qcListLoading = true.obs;
|
||||
|
||||
Future<ApiResponse> getDeviceType() async {
|
||||
ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败".tr);
|
||||
@@ -112,23 +116,37 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
|
||||
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;
|
||||
},
|
||||
);
|
||||
return flag;
|
||||
}
|
||||
|
||||
Future<bool> getCheckHistory({String? id}) async {
|
||||
Future<bool> getCheckHistory({required String mac, String? id}) async {
|
||||
qcListLoading.value = true;
|
||||
String serviceAddress = ServiceConstant.qc_service_address;
|
||||
String serviceApi = ServiceConstant.getCheckHistory;
|
||||
String queryUrl = "$serviceAddress$serviceApi";
|
||||
|
||||
// 如果id不为空,拼接到url上
|
||||
// 构建查询参数
|
||||
List<String> params = [];
|
||||
|
||||
// 添加mac参数(必选)
|
||||
params.add("mac=$mac");
|
||||
|
||||
// 如果id不为空,添加到参数列表
|
||||
if (id != null && id.isNotEmpty) {
|
||||
queryUrl = "$queryUrl?id=$id";
|
||||
params.add("id=$id");
|
||||
}
|
||||
|
||||
// 如果有参数,拼接到url上
|
||||
if (params.isNotEmpty) {
|
||||
queryUrl = "$queryUrl?${params.join('&')}";
|
||||
}
|
||||
|
||||
bool flag = false;
|
||||
@@ -146,11 +164,15 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
|
||||
// 如果是Map,赋值给currentCq
|
||||
currentCq.value = res.data as Map<String, dynamic>;
|
||||
}
|
||||
qcListLoading.value = false;
|
||||
updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
flag = false;
|
||||
qcListLoading.value = false;
|
||||
currentCq.value = {};
|
||||
NewTopSlideNotification.show(
|
||||
text: "数据加载失败", textColor: themeController.currentColor.sc9);
|
||||
},
|
||||
);
|
||||
return flag;
|
||||
|
||||
Reference in New Issue
Block a user