From e444c1fedf994548bdce0af7bbfaaeb0b400eea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=90=8C?= <494089941@qq.com> Date: Thu, 28 Jul 2022 01:36:41 +0800 Subject: [PATCH] bug fix --- android/gradle.properties | 1 + lib/const/saas_api.dart | 5 +++++ .../inspection_check_detail_model.dart | 2 +- .../inspection/inspection_point_model.dart | 4 ++-- .../inspection/inspection_qrcode_model.dart | 2 +- .../inspection_manage_details_page.dart | 20 +++++++++++-------- .../inspection_point_detail_page.dart | 8 ++++---- .../inspection_point_input_page.dart | 16 ++++++++++----- pubspec.lock | 9 +-------- 9 files changed, 38 insertions(+), 29 deletions(-) diff --git a/android/gradle.properties b/android/gradle.properties index a673820..e7874d5 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -2,3 +2,4 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true android.enableR8=true +systemProp.https.protocols=TLSv1.3 diff --git a/lib/const/saas_api.dart b/lib/const/saas_api.dart index 227f9b2..6a62e95 100644 --- a/lib/const/saas_api.dart +++ b/lib/const/saas_api.dart @@ -27,11 +27,16 @@ class SAASAPI { static _WorkOrder workOrder = _WorkOrder(); static _HouseHoldAudit householdAudit = _HouseHoldAudit(); static _Home home = _Home(); + static _Upload upload = _Upload(); ///二级分类 static _OtherApi other = _OtherApi(); } +class _Upload { + String get uploadImg => '/butlerApp/user/upload/uploadImg'; +} + class _Home { ///待办事项 String get todoList => '/butlerApp/user/frontPage/pendingList'; diff --git a/lib/models/manager/inspection/inspection_check_detail_model.dart b/lib/models/manager/inspection/inspection_check_detail_model.dart index 526e21c..4c89c97 100644 --- a/lib/models/manager/inspection/inspection_check_detail_model.dart +++ b/lib/models/manager/inspection/inspection_check_detail_model.dart @@ -7,7 +7,7 @@ class InspectionCheckDetialModel { String? code; String? name; int? type; - String? completeDate; + int? completeDate; List? checkList; List? faceImgList; List? spaceImgList; diff --git a/lib/models/manager/inspection/inspection_point_model.dart b/lib/models/manager/inspection/inspection_point_model.dart index 2bc093c..0abe51d 100644 --- a/lib/models/manager/inspection/inspection_point_model.dart +++ b/lib/models/manager/inspection/inspection_point_model.dart @@ -3,8 +3,8 @@ class InspectionPointModel { String? name; int? checkNum; String? completeDate; - int? longitude; - int? latitude; + num? longitude; + num? latitude; InspectionPointModel( {required this.id, this.name, this.checkNum, this.completeDate}); diff --git a/lib/models/manager/inspection/inspection_qrcode_model.dart b/lib/models/manager/inspection/inspection_qrcode_model.dart index d64c7a6..cc500df 100644 --- a/lib/models/manager/inspection/inspection_qrcode_model.dart +++ b/lib/models/manager/inspection/inspection_qrcode_model.dart @@ -15,7 +15,7 @@ class InspectionQRCodeModel { type = json['type']; if (json['checkList'] != null) { checkList = []; - json['checkVoList'].forEach((v) { + json['checkList'].forEach((v) { checkList!.add(new CheckVoList.fromJson(v)); }); } diff --git a/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart index cc28fea..d23d4b6 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart @@ -13,6 +13,7 @@ import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/insp import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/qr_scanner_page.dart'; import 'package:aku_new_community_manager/ui/sub_pages/manage_func.dart'; import 'package:aku_new_community_manager/ui/tool_pages/warning/warning_page.dart'; + // Flutter imports: import 'package:aku_new_community_manager/ui/widgets/common/aku_button.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; @@ -186,11 +187,12 @@ class _InspectionManageDetailsPageState await ManageFunc.getInspectionFindCheckDetailByQr( _detailModel!.id!, result.code); if (baseModel.success) { - Get.to(() => InspectionPointInputPage( + await Get.to(() => InspectionPointInputPage( inspectionName: _detailModel!.name, qrModel: InspectionQRCodeModel.fromJson( baseModel.data), )); + _refreshController?.callRefresh(); } else { showCupertinoDialog( context: context, @@ -532,7 +534,7 @@ class _InspectionManageDetailsPageState BaseModel baseModel = await (_uploadLocation(widget.executeId, argument.latLng.longitude, argument.latLng.latitude)); if (!baseModel.success) { - BotToast.showText(text: baseModel.msg); + // BotToast.showText(text: baseModel.msg); } else { _canUploadLocation = false; //绘制折线 @@ -583,12 +585,14 @@ class _InspectionManageDetailsPageState Future _uploadLocation( int executeId, double longitude, double latitude) async { - BaseModel baseModel = await NetUtil() - .post(SAASAPI.inspection.uploadLocation, params: { - "executeId": executeId, - "longitude": longitude, - "latitude": latitude - }); + BaseModel baseModel = await NetUtil().post( + SAASAPI.inspection.uploadLocation, + params: { + "executeId": executeId, + "longitude": longitude, + "latitude": latitude + }, + showMessage: false); return baseModel; } } diff --git a/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart index 695641a..d0b1406 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart @@ -232,14 +232,14 @@ class _InspectionPointDetailPageState extends State { color: Color(0xFFFFF8E0), border: Border.all(color: Color(0xFFFFC40C), width: 3.w), ), - child: model.status == 1 - ? '正常' + child: model.status == 2 + ? '异常' .text .color(kTextPrimaryColor) .size(32.sp) .bold .make() - : '异常' + : '正常' .text .color(kTextPrimaryColor) .size(32.sp) @@ -460,7 +460,7 @@ class _InspectionPointDetailPageState extends State { ), Spacer(), Text( - '${DateUtil.formatDateStr(model.completeDate!, format: "yyyy-MM-dd HH:mm")}', + '${DateUtil.formatDateMs(model.completeDate!, format: "yyyy-MM-dd HH:mm")}', style: AppStyle().primaryStyle, ), ], diff --git a/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart index 7fa6437..7d36ecb 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart @@ -3,10 +3,12 @@ import 'dart:io'; // Project imports: import 'package:aku_new_community_manager/const/api.dart'; +import 'package:aku_new_community_manager/const/saas_api.dart'; import 'package:aku_new_community_manager/models/manager/inspection/inspection_point_submit_model.dart'; import 'package:aku_new_community_manager/models/manager/inspection/inspection_qrcode_model.dart'; import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart'; import 'package:aku_new_community_manager/style/app_style.dart'; + // Flutter imports: import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_point_submit_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_utils.dart'; @@ -16,6 +18,7 @@ import 'package:aku_new_community_manager/ui/widgets/app_widgets/aku_single_chec import 'package:aku_new_community_manager/ui/widgets/common/aku_button.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/utils/network/net_util.dart'; + // Package imports: import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; @@ -29,6 +32,7 @@ import 'package:velocity_x/src/flutter/widgets.dart'; class InspectionPointInputPage extends StatefulWidget { final InspectionQRCodeModel? qrModel; final String? inspectionName; + InspectionPointInputPage({Key? key, this.qrModel, this.inspectionName}) : super(key: key); @@ -42,6 +46,7 @@ class _InspectionPointInputPageState extends State { InspectionQRCodeModel? _model; List? _selfPhotos; List? _scenePhots; + bool get canSubmit { if (_selfPhotos == null && _scenePhots == null) { return false; @@ -92,11 +97,12 @@ class _InspectionPointInputPageState extends State { bottom: AkuButton( onPressed: canSubmit ? () async { - _submitModel.inspectionFaceImg = await NetUtil() - .uploadFiles(_selfPhotos!, API.upload.uploadInspectionFace); - - _submitModel.inspectionSpaceImg = await NetUtil().uploadFiles( - _scenePhots!, API.upload.uploadInspectionSpace); + // _submitModel.inspectionFaceImg = await NetUtil() + // .uploadFiles(_selfPhotos!, SAASAPI.upload.uploadImg); + _submitModel.inspectionFaceImg = []; + // _submitModel.inspectionSpaceImg = await NetUtil() + // .uploadFiles(_scenePhots!, SAASAPI.upload.uploadImg); + _submitModel.inspectionSpaceImg = []; BaseModel baseModel = await (ManageFunc.getSubmitPoint(_submitModel)); if (baseModel.success) { diff --git a/pubspec.lock b/pubspec.lock index 6b6c743..8c52418 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -618,13 +618,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.11" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" meta: dependency: transitive description: @@ -972,7 +965,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.3" time: dependency: transitive description: