From 4b0d3d13feeb6a80ce2a22ea79046df09d8f65e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Mon, 5 Aug 2024 11:39:30 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E5=8F=91=E5=B8=83=E7=89=88=E6=9C=AC=EF=BC=8C=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../minePersonInfoResetPassword_page.dart | 16 ++++++++-------- pre_build.sh | 2 +- pubspec.yaml | 3 ++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_page.dart b/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_page.dart index feb5d399..66a5cb95 100755 --- a/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_page.dart +++ b/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_page.dart @@ -31,12 +31,12 @@ class _MinePersonInfoResetPasswordPageState backgroundColor: AppColors.mainBackgroundColor, appBar: F.sw( skyCall: () => TitleAppBar( - barTitle: TranslationLoader.lanKeys!.resetPasswords!.tr, + barTitle: '重置密码'.tr, haveBack: true, backgroundColor: AppColors.mainColor, ), xhjCall: () => TitleAppBar( - barTitle: TranslationLoader.lanKeys!.resetPasswords!.tr, + barTitle: '重置密码'.tr, haveBack: true, backgroundColor: Colors.white, iconColor: AppColors.blackColor, @@ -95,10 +95,10 @@ class _MinePersonInfoResetPasswordPageState }, isPwd: true, leftWidget: Text( - "${TranslationLoader.lanKeys!.originalPassword!.tr} ", + '${TranslationLoader.lanKeys!.originalPassword!.tr} ', style: TextStyle(fontSize: 22.sp), ), - hintText: "", + hintText: '', inputFormatters: [ LengthLimitingTextInputFormatter(20), ]), @@ -109,10 +109,10 @@ class _MinePersonInfoResetPasswordPageState }, isPwd: true, leftWidget: Text( - "${TranslationLoader.lanKeys!.newPassword!.tr} ", + '${TranslationLoader.lanKeys!.newPassword!.tr} ', style: TextStyle(fontSize: 22.sp), ), - hintText: "", + hintText: '', inputFormatters: [ LengthLimitingTextInputFormatter(20), ]), @@ -124,10 +124,10 @@ class _MinePersonInfoResetPasswordPageState isPwd: true, // isHaveLeftWidget: false, leftWidget: Text( - "${TranslationLoader.lanKeys!.surePassword!.tr} ", + '${'确认密码'.tr} ', style: TextStyle(fontSize: 22.sp), ), - hintText: "", + hintText: '', inputFormatters: [ LengthLimitingTextInputFormatter(20), ]), diff --git a/pre_build.sh b/pre_build.sh index 95cc11b7..ae698199 100755 --- a/pre_build.sh +++ b/pre_build.sh @@ -106,4 +106,4 @@ echo -e "\n* 没有发现废弃 API,开始编译" # 编译命令 #flutter clean && flutter pub get flutter build apk --flavor $environment -t $main_file -flutter build ios --flavor $environment -t $main_file +#flutter build ios --flavor $environment -t $main_file diff --git a/pubspec.yaml b/pubspec.yaml index d2455ea8..1d8b2693 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -81,8 +81,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.70+2024072402:xhj 线上环境,提交测试:回归 bug # 1.0.71+2024072901:xhj 线上环境,提交测试:回归 bug # 1.0.71+2024072902:xhj 线上环境,提交测试:回归 bug +# 1.0.72+2024080501:xhj 线上环境,提交测试:回归 bug -version: 1.0.71+2024072902 +version: 1.0.72+2024080501 environment: sdk: '>=2.12.0 <3.0.0' From 01db54a34694d9fa95d8e0642f1456878e747b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDaisyWu=E2=80=9D?= <“18682150237@163.com”> Date: Wed, 7 Aug 2024 10:54:36 +0800 Subject: [PATCH 02/15] =?UTF-8?q?1=EF=BC=8C=E6=93=8D=E4=BD=9C=E8=AE=B0?= =?UTF-8?q?=E5=BD=95bug=E4=BF=AE=E5=A4=8D=202=EF=BC=8C=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=E6=8E=A8=E9=80=81=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=90=8E=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=8A=A5=E9=94=99=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lan/lan_zh.json | 2 +- .../lockDetail/doorLockLog/doorLockLog_page.dart | 7 +++---- lib/tools/showCupertinoAlertView.dart | 13 ++++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lan/lan_zh.json b/lan/lan_zh.json index 6b833cb2..a3f4307b 100755 --- a/lan/lan_zh.json +++ b/lan/lan_zh.json @@ -65,7 +65,7 @@ "accountNumber": "账号", "volumeAuthorizationLock": "批量授权锁", "authorizedAdminTip": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人", - "lockOperatingRecordTip": "只能保留一定时间内的记录,如果您需要保留历史记录,可以在右上角导出", + "lockOperatingRecordTip": "如果您需要保留历史记录,可以在右上角导出", "rankingList": "排列榜", "earlyArrivalList": "早到榜", "lateList": "迟到榜", diff --git a/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart b/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart index e5ac1bd9..3221ec45 100755 --- a/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart +++ b/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart @@ -53,7 +53,7 @@ class _DoorLockLogPageState extends State with RouteAware { ), onTap: () { ShowTipView().showSureAlertDialog( - '1.锁没有联网,密码、IC卡、指纹等开门记录无法实时上传,可以点击右上角按钮,然后读取记录。\n2.只能保留一定时间内的记录,如果您需要保留历史记录,可以点击右上角按钮,然后导出记录', + '1.锁没有联网,密码、IC卡、指纹等开门记录无法实时上传,可以点击右上角按钮,然后读取记录。\n2.如果您需要保留历史记录,可以点击右上角按钮,然后导出记录', tipTitle: '看不到操作记录,可能原因有', sureStr: '我知道了'.tr); }, @@ -276,9 +276,8 @@ class _DoorLockLogPageState extends State with RouteAware { return GestureDetector( onTap: () { - Get.toNamed(Routers.doorLockLogDetailPage, arguments: { - 'doorLockLogDataItem': timelineData - }); + Get.toNamed(Routers.doorLockLogDetailPage, + arguments: {'doorLockLogDataItem': timelineData}); }, child: Padding( padding: EdgeInsets.only(left: 20.w, top: 20.h), diff --git a/lib/tools/showCupertinoAlertView.dart b/lib/tools/showCupertinoAlertView.dart index 2e67d597..a5eeb46a 100755 --- a/lib/tools/showCupertinoAlertView.dart +++ b/lib/tools/showCupertinoAlertView.dart @@ -30,11 +30,14 @@ class ShowCupertinoAlertView { SizedBox( height: 60.h, ), - Image.network( - qrCodeUrl, - width: 400.w, - height: 400.w, - ), + if (qrCodeUrl.isNotEmpty) + Image.network( + qrCodeUrl, + width: 400.w, + height: 400.w, + ) + else + Container(), SizedBox( height: 20.h, ), From 004a38b341cd2f9eb9e342cd5f376db342204ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDaisyWu=E2=80=9D?= <“18682150237@163.com”> Date: Wed, 7 Aug 2024 13:37:14 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E5=AF=B9=E7=8E=B0=E5=AD=98=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E7=96=91=E7=82=B9=E5=92=8C=E6=9C=AA=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E9=A1=B9=E5=9C=A8=E7=BA=BF=E4=B8=8A=E7=8E=AF=E5=A2=83=E9=9A=90?= =?UTF-8?q?=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockDetail/lockDetail_page.dart | 84 ++++++++---------- .../msgNotification/msgNotification_page.dart | 14 +-- lib/mine/mineSet/mineSet/mineSet_page.dart | 42 ++++----- .../valueAddedServicesHighFunction_page.dart | 18 ++-- .../valueAddedServicesList_page.dart | 88 ++++++++++++------- 5 files changed, 130 insertions(+), 116 deletions(-) diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index d3b922db..c76230e7 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -145,10 +145,11 @@ class _LockDetailPageState extends State 'isOnlyOneData': state.isOnlyOneData }); }), - labelText( - img: 'images/icon_puzzlepiece_extension.png', - text: '配件'.tr, - child: attachmentWidget()), + if (!F.isProductionEnv) + labelText( + img: 'images/icon_puzzlepiece_extension.png', + text: '配件'.tr, + child: attachmentWidget()), ], ), ), @@ -994,19 +995,15 @@ class _LockDetailPageState extends State final List showWidgetArr = []; // 考勤 if (state.isAttendance.value == 1) { - showWidgetArr.add(bottomItem( - 'images/main/icon_main_clockingIn.png', - '考勤'.tr, - state.bottomBtnisEable.value, () { + showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png', + '考勤'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.checkingInListPage, arguments: state.keyInfos.value); })); } // 操作记录 - showWidgetArr.add(bottomItem( - 'images/main/icon_main_operatingRecord.png', - '操作记录'.tr, - state.bottomBtnisEable.value, () { + showWidgetArr.add(bottomItem('images/main/icon_main_operatingRecord.png', + '操作记录'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.doorLockLogPage, arguments: { 'keyInfo': state.keyInfos.value @@ -1032,27 +1029,21 @@ class _LockDetailPageState extends State final List showWidgetArr = []; // 考勤 if (state.isAttendance.value == 1) { - showWidgetArr.add(bottomItem( - 'images/main/icon_main_clockingIn.png', - '考勤'.tr, - state.bottomBtnisEable.value, () { + showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png', + '考勤'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.checkingInListPage, arguments: state.keyInfos.value); })); } // 电子钥匙 - showWidgetArr.add(bottomItem( - 'images/main/icon_main_electronicKey.png', - '电子钥匙'.tr, - state.bottomBtnisEable.value, () { + showWidgetArr.add(bottomItem('images/main/icon_main_electronicKey.png', + '电子钥匙'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.electronicKeyListPage); })); // 密码 - showWidgetArr.add(bottomItem( - 'images/main/icon_main_password.png', - '密码'.tr, + showWidgetArr.add(bottomItem('images/main/icon_main_password.png', '密码'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.passwordKeyListPage, arguments: { @@ -1062,9 +1053,7 @@ class _LockDetailPageState extends State // ic卡 if (state.keyInfos.value.lockFeature!.icCard == 1) { - showWidgetArr.add(bottomItem( - 'images/main/icon_main_icCard.png', - '卡'.tr, + showWidgetArr.add(bottomItem('images/main/icon_main_icCard.png', '卡'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.cardListPage, arguments: { 'lockId': state.keyInfos.value.lockId, @@ -1074,10 +1063,8 @@ class _LockDetailPageState extends State // 指纹 if (state.keyInfos.value.lockFeature!.fingerprint == 1) { - showWidgetArr.add(bottomItem( - 'images/main/icon_main_fingerprint.png', - '指纹'.tr, - state.bottomBtnisEable.value, () { + showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', + '指纹'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.fingerprintListPage, arguments: { 'lockId': state.keyInfos.value.lockId, }); @@ -1086,10 +1073,8 @@ class _LockDetailPageState extends State // 遥控 if (state.keyInfos.value.lockFeature!.bluetoothRemoteControl == 1) { - showWidgetArr.add(bottomItem( - 'images/main/icon_main_remoteControl.png', - '遥控'.tr, - state.bottomBtnisEable.value, () { + showWidgetArr.add(bottomItem('images/main/icon_main_remoteControl.png', + '遥控'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.remoteControlListPage, arguments: { 'lockId': state.keyInfos.value.lockId, }); @@ -1165,9 +1150,7 @@ class _LockDetailPageState extends State final List endWiddget = []; endWiddget.add( // 操作记录 - bottomItem( - 'images/main/icon_main_operatingRecord.png', - '操作记录'.tr, + bottomItem('images/main/icon_main_operatingRecord.png', '操作记录'.tr, state.bottomBtnisEable.value, () { // Get.toNamed(Routers.lockOperatingRecordPage, // arguments: {"keyInfo": state.keyInfos.value}); @@ -1189,18 +1172,21 @@ class _LockDetailPageState extends State }); })); } - endWiddget.add( - // 消息提醒 - bottomItem( - 'images/main/icon_lockDetail_messageReminding.png', - TranslationLoader.lanKeys!.messageReminding!.tr, - state.bottomBtnisEable.value, () { - Get.toNamed(Routers.msgNotificationPage, arguments: { - 'lockId': state.keyInfos.value.lockId, - 'isSupportCatEye': state.keyInfos.value.lockFeature!.isSupportCatEye, - }); - }), - ); + if (!F.isProductionEnv) { + endWiddget.add( + // 消息提醒 + bottomItem( + 'images/main/icon_lockDetail_messageReminding.png', + TranslationLoader.lanKeys!.messageReminding!.tr, + state.bottomBtnisEable.value, () { + Get.toNamed(Routers.msgNotificationPage, arguments: { + 'lockId': state.keyInfos.value.lockId, + 'isSupportCatEye': + state.keyInfos.value.lockFeature!.isSupportCatEye, + }); + }), + ); + } if (F.isSKY) { endWiddget.add( diff --git a/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart b/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart index 2d5887d8..d6251fa4 100755 --- a/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart +++ b/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart @@ -133,13 +133,13 @@ class _MsgNotificationPageState extends State { SizedBox( height: 10.h, ), - Obx(() => CommonItem( - leftTitel: '有人按门铃'.tr, - rightTitle: "", - isHaveLine: true, - isHaveRightWidget: true, - rightWidget: - SizedBox(width: 60.w, height: 50.h, child: _switch(3)))), + // Obx(() => CommonItem( + // leftTitel: '有人按门铃'.tr, + // rightTitle: "", + // isHaveLine: true, + // isHaveRightWidget: true, + // rightWidget: + // SizedBox(width: 60.w, height: 50.h, child: _switch(3)))), SizedBox( height: 10.h, ), diff --git a/lib/mine/mineSet/mineSet/mineSet_page.dart b/lib/mine/mineSet/mineSet/mineSet_page.dart index 496729f2..f813dfb5 100755 --- a/lib/mine/mineSet/mineSet/mineSet_page.dart +++ b/lib/mine/mineSet/mineSet/mineSet_page.dart @@ -221,15 +221,16 @@ class _MineSetPageState extends State Get.toNamed(Routers.authorizedAdministratorListPage); }), //by DaisyWu 新增--批量授权 - CommonItem( - leftTitel: TranslationLoader.lanKeys!.authorityManagement!.tr, - rightTitle: '', - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.authorityManagementPage); - // Toast.show(msg: "功能暂未开放"); - }), + if (!F.isProductionEnv) + CommonItem( + leftTitel: TranslationLoader.lanKeys!.authorityManagement!.tr, + rightTitle: '', + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.authorityManagementPage); + // Toast.show(msg: "功能暂未开放"); + }), CommonItem( leftTitel: TranslationLoader.lanKeys!.lockGroup!.tr, rightTitle: '', @@ -246,14 +247,15 @@ class _MineSetPageState extends State action: () { Get.toNamed(Routers.transferSmartLockPage); }), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.transferGateway!.tr, - rightTitle: '', - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.selectGetewayListPage); - }), + //暂无网关屏蔽 + // CommonItem( + // leftTitel: TranslationLoader.lanKeys!.transferGateway!.tr, + // rightTitle: '', + // isHaveLine: true, + // isHaveDirection: true, + // action: () { + // Get.toNamed(Routers.selectGetewayListPage); + // }), SizedBox( height: 10.h, ), @@ -326,7 +328,7 @@ class _MineSetPageState extends State height: 10.h, ), //上架审核注释 - if (!F.isLite) + if (!F.isProductionEnv) CommonItem( leftTitel: 'Amazon Alexa', rightTitle: '', @@ -335,7 +337,7 @@ class _MineSetPageState extends State action: () { logic.showToast('功能暂未开放'.tr); }), - if (!F.isLite) + if (!F.isProductionEnv) CommonItem( leftTitel: 'Google Home', rightTitle: '', @@ -344,7 +346,7 @@ class _MineSetPageState extends State action: () { logic.showToast('功能暂未开放'.tr); }), - if (!F.isLite) + if (!F.isProductionEnv) CommonItem( leftTitel: TranslationLoader.lanKeys!.xiaomiIOTPlatform!.tr, rightTitle: '', diff --git a/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart b/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart index b7674d2f..cfa191cb 100755 --- a/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart +++ b/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart @@ -236,12 +236,18 @@ class _ValueAddedServicesHighFunctionPageState '群发钥匙'.tr), // _buildItem("images/mine/icon_mine_highFunctionContent_bjft.png", // TranslationLoader.lanKeys!.markedHouseState!.tr), - _buildItem('images/mine/icon_mine_highFunctionContent_fkgj.png', - TranslationLoader.lanKeys!.cardIssuingtool!.tr), - _buildItem( - 'images/mine/icon_mine_highFunctionContent_fkgj.png', '推送'), - _buildItem( - 'images/mine/icon_mine_highFunctionContent_fkgj.png', '考勤'), + // _buildItem('images/mine/icon_mine_highFunctionContent_fkgj.png', + // TranslationLoader.lanKeys!.cardIssuingtool!.tr), + // _buildItem( + // 'images/mine/icon_mine_highFunctionContent_fkgj.png', '推送'), + // _buildItem( + // 'images/mine/icon_mine_highFunctionContent_fkgj.png', '考勤'), + _buildItem('images/mine/icon_mine_highFunctionContent_bjft.png', + '导出锁数据'.tr), + _buildItem('images/mine/icon_mine_highFunctionContent_bjft.png', + '常开模式'.tr), + _buildItem('images/mine/icon_mine_highFunctionContent_bjft.png', + '一键开锁'.tr), ], ), ), diff --git a/lib/mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart b/lib/mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart index 8f31651c..3c56dcf5 100755 --- a/lib/mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart +++ b/lib/mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart @@ -3,6 +3,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; +import 'package:star_lock/flavors.dart'; import 'package:star_lock/mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_logic.dart'; import 'package:star_lock/mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_state.dart'; import 'package:star_lock/tools/commonDataManage.dart'; @@ -57,7 +58,10 @@ class _ValueAddedServicesPageListState Get.toNamed(Routers.valueAddedServicesNoteAndEmailDetailPage, arguments: {'type': 2}); }), - _valueAddedServicesItem(Image.asset('images/mine/icon_mine_valueAddedServices_realName.png'), '实名认证'.tr, () { + _valueAddedServicesItem( + Image.asset( + 'images/mine/icon_mine_valueAddedServices_realName.png'), + '实名认证'.tr, () { Get.toNamed(Routers.valueAddedServicesRealNamePage); }), _valueAddedServicesItem( @@ -89,39 +93,55 @@ class _ValueAddedServicesPageListState // TranslationLoader.lanKeys!.checkingIn!.tr, () { // Navigator.pushNamed(context, Routers.gatewayDetailPage); // }), - _valueAddedServicesItem( - Image.asset( - 'images/mine/icon_mine_valueAddedServices_storage.png'), - TranslationLoader.lanKeys!.recordsRetention!.tr, () { - EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds); - }), - _valueAddedServicesItem( - Image.asset('images/mine/icon_mine_valueAddedServices_vip.png'), - '可视对讲', () { - EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds); - }), - _valueAddedServicesItem( - Text( - 'A', - style: TextStyle( - color: Colors.white, - fontSize: 38.sp, - fontWeight: FontWeight.w600), - ), - 'Amazon Alexa', () { - EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds); - }), - _valueAddedServicesItem( - Text( - 'G', - style: TextStyle( - color: Colors.white, - fontSize: 38.sp, - fontWeight: FontWeight.w600), - ), - 'Google Home', () { - EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds); - }), + //去掉记录保存 + // _valueAddedServicesItem( + // Image.asset( + // 'images/mine/icon_mine_valueAddedServices_storage.png'), + // TranslationLoader.lanKeys!.recordsRetention!.tr, () { + // EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds); + // }), + if (!F.isProductionEnv) + _valueAddedServicesItem( + Image.asset('images/mine/icon_mine_valueAddedServices_vip.png'), + '可视对讲', () { + EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds); + }), + if (!F.isProductionEnv) + _valueAddedServicesItem( + Text( + 'A', + style: TextStyle( + color: Colors.white, + fontSize: 38.sp, + fontWeight: FontWeight.w600), + ), + 'Amazon Alexa', () { + EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds); + }), + if (!F.isProductionEnv) + _valueAddedServicesItem( + Text( + 'G', + style: TextStyle( + color: Colors.white, + fontSize: 38.sp, + fontWeight: FontWeight.w600), + ), + 'Google Home', () { + EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds); + }), + if (!F.isProductionEnv) + _valueAddedServicesItem( + Text( + 'M', + style: TextStyle( + color: Colors.white, + fontSize: 38.sp, + fontWeight: FontWeight.w600), + ), + '小米IOT平台', () { + EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds); + }), ], ), ); From e97d78fe9910eef6e78f3d3544d2feab6cc14ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDaisyWu=E2=80=9D?= <“18682150237@163.com”> Date: Wed, 7 Aug 2024 18:00:35 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=98=9F=E9=94=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../register/starLock_register_xhj_page.dart | 58 ++++++++++--------- .../massSendElectronicKeyManage_page.dart | 1 - .../massSendReceiverCell.dart | 6 +- 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/lib/login/register/starLock_register_xhj_page.dart b/lib/login/register/starLock_register_xhj_page.dart index 39f8631c..f2234e69 100755 --- a/lib/login/register/starLock_register_xhj_page.dart +++ b/lib/login/register/starLock_register_xhj_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -79,7 +78,8 @@ class _StarLockRegisterPageState extends State { onTap: (int index) { state.isIphoneType.value = index == 0; }, - overlayColor: MaterialStateProperty.resolveWith((Set states) { + overlayColor: MaterialStateProperty.resolveWith( + (Set states) { return Colors.transparent; }), dividerHeight: 0, @@ -113,24 +113,26 @@ class _StarLockRegisterPageState extends State { child: Obx(() => Container( color: Colors.white, height: 70.h, - child: Row( - children: [ - SizedBox(width: 5.w), - Text(TranslationLoader.lanKeys!.countryAndRegion!.tr, - style: TextStyle( - fontSize: 26.sp, color: AppColors.blackColor)), - SizedBox(width: 50.w), - Text( - state.isIphoneType.value - ? '${state.countryName.value} +${state.countryCode.value}' - : state.countryName.value, - style: TextStyle( - fontSize: 26.sp, color: AppColors.mainColor), - ), - ], - ), + child: Visibility( + visible: state.isIphoneType.value, + child: Row( + children: [ + SizedBox(width: 5.w), + Text(TranslationLoader.lanKeys!.countryAndRegion!.tr, + style: TextStyle( + fontSize: 26.sp, color: AppColors.blackColor)), + SizedBox(width: 50.w), + Text( + state.isIphoneType.value + ? '${state.countryName.value} +${state.countryCode.value}' + : state.countryName.value, + style: TextStyle( + fontSize: 26.sp, color: AppColors.mainColor), + ), + ], + )), )), - ), + ) ], ); } @@ -270,10 +272,11 @@ class _StarLockRegisterPageState extends State { style: TextStyle( color: AppColors.mainColor, fontSize: 20.sp)), onTap: () { - Get.toNamed(Routers.webviewShowPage, arguments: { - 'url': XSConstantMacro.userAgreementURL, - 'title': '用户协议'.tr - }); + Get.toNamed(Routers.webviewShowPage, + arguments: { + 'url': XSConstantMacro.userAgreementURL, + 'title': '用户协议'.tr + }); }, )), WidgetSpan( @@ -284,10 +287,11 @@ class _StarLockRegisterPageState extends State { style: TextStyle( color: AppColors.mainColor, fontSize: 20.sp)), onTap: () { - Get.toNamed(Routers.webviewShowPage, arguments: { - 'url': XSConstantMacro.privacyPolicyURL, - 'title': '隐私政策'.tr - }); + Get.toNamed(Routers.webviewShowPage, + arguments: { + 'url': XSConstantMacro.privacyPolicyURL, + 'title': '隐私政策'.tr + }); }, )), ], diff --git a/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart b/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart index 35218912..9e687ddf 100755 --- a/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart +++ b/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import '../../../../../../app_settings/app_colors.dart'; import '../../../../../../tools/titleAppBar.dart'; -import '../../../../../../translations/trans_lib.dart'; import 'massSendElectronicKeyManage_tabbar.dart'; class MassSendElectronicKeyManagePage extends StatefulWidget { diff --git a/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart b/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart index ceadf445..c5ad733a 100755 --- a/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart +++ b/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart'; import 'package:star_lock/tools/regexp_tool.dart'; -import 'package:star_lock/translations/trans_lib.dart'; import '../../../../../../app_settings/app_colors.dart'; class MassSendReceiverCell extends StatefulWidget { @@ -207,6 +207,10 @@ class _MassSendReceiverCellState extends State { border: InputBorder.none, ), onSubmitted: onSubmitted, + //限制输入长度 + inputFormatters: [ + LengthLimitingTextInputFormatter(50), + ], ), ), if (isContactPickerEnabled) From 2a66f5e8c5bdd4f34f0d7b3d4b3ed2d36cf509fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Thu, 8 Aug 2024 11:00:03 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9TAPD=20=E4=BC=982?= =?UTF-8?q?=E4=BC=98bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 12292 -> 12292 bytes lan/lan_en.json | 2 +- lan/lan_keys.json | 2 +- lan/lan_zh.json | 2 +- lib/blue/blue_manage.dart | 7 +- lib/blue/io_protocol/io_getPrivateKey.dart | 35 +++--- lib/blue/io_protocol/io_getPublicKey.dart | 14 +-- lib/blue/io_protocol/io_getWifiList.dart | 4 +- lib/blue/io_protocol/io_openLock.dart | 33 +++--- lib/flavors.dart | 3 +- lib/login/login/starLock_login_xhj_page.dart | 112 +++++++++--------- lib/main.dart | 3 +- .../card/cardList/cardList_logic.dart | 42 +++++++ .../otherTypeKeyChangeDate_logic.dart | 4 +- .../lockDetail/lockDetail_logic.dart | 4 +- .../lockDetail/lockDetail_page.dart | 2 +- .../lockOperatingRecord_logic.dart | 1 + .../lockOperatingRecord_state.dart | 2 +- .../palm/palmDetail/palmDetail_page.dart | 12 +- .../palm/palmList/palmList_logic.dart | 2 +- .../palm/palmList/palmList_page.dart | 5 +- .../addRemoteControl_logic.dart | 2 +- .../remoteControlDetail_logic.dart | 2 +- .../lockMian/lockList/lockList_xhj_page.dart | 2 +- .../lockMian/lockMain/lockMain_logic.dart | 2 +- lib/main/lockMian/lockMain/lockMain_page.dart | 3 +- lib/main_dev.dart | 2 + lib/main_local.dart | 2 + lib/main_pre.dart | 2 + lib/main_sky_full.dart | 2 + lib/main_sky_lite.dart | 2 + lib/main_xhj_full.dart | 2 + lib/main_xhj_lite.dart | 2 + .../addLock/nearbyLock/nearbyLock_logic.dart | 19 ++- .../addLock/nearbyLock/nearbyLock_page.dart | 45 ++++--- .../administratorAssociationLock_page.dart | 21 ++-- .../administratorDetails_logic.dart | 4 +- lib/network/api_provider.dart | 2 + lib/network/api_repository.dart | 4 +- lib/tools/appFirstEnterHandle.dart | 1 + lib/widget/permission/permission_dialog.dart | 1 + pre_build.sh | 2 +- 42 files changed, 243 insertions(+), 172 deletions(-) diff --git a/.DS_Store b/.DS_Store index f2fb2aab0ced3b77ff75f1b81bdfe9dc7671128e..1e38da1a35c89dd475c4047258285f4731e9f189 100755 GIT binary patch delta 273 zcmZokXi3;`SGAt$<9fZ<3=9mc3`q>744Di$3@N$!E-pzq`AI-gjzqnx3NgcDj_4{< t2&gE?Fbq!4&n*DzWBR(X0Z1X+P!?R2my@5D&cLuaMy-*35IAB5BLKQJM&bYf delta 273 zcmZokXi3;`SGAs@!{>1)0|NsqLlQ$NLncEGLrQMGi%U{YeiBfWBej3O2OG;VM|2e_ t1XL7c7zQWj=N16%<>cq3Gcat9QEOx$1ddq22mlJ+MT`Id diff --git a/lan/lan_en.json b/lan/lan_en.json index 3a58447b..2d48d88e 100755 --- a/lan/lan_en.json +++ b/lan/lan_en.json @@ -474,7 +474,7 @@ "天后失效": "Days later invalid", "电量更新时间:": "Power update time:", "新增配件": "Add", - "请在锁旁边完成第一次开锁": "Please complete the first unlock next to the lock", + "钥匙不可用": "Key is not available", "正在开锁中...": "Unlocking...", "你的钥匙": "Your key", "常开模式启动!长按闭锁": "Open mode started! Long press to lock", diff --git a/lan/lan_keys.json b/lan/lan_keys.json index 0445b481..48eb4db3 100755 --- a/lan/lan_keys.json +++ b/lan/lan_keys.json @@ -497,7 +497,7 @@ "天后失效":"天后失效", "电量更新时间:":"电量更新时间:", "新增配件":"新增配件", - "请在锁旁边完成第一次开锁":"请在锁旁边完成第一次开锁", + "钥匙不可用":"钥匙不可用", "正在开锁中...":"正在开锁中...", "你的钥匙": "你的钥匙", "常开模式启动!长按闭锁": "常开模式启动!长按闭锁", diff --git a/lan/lan_zh.json b/lan/lan_zh.json index 6b833cb2..c40c06a0 100755 --- a/lan/lan_zh.json +++ b/lan/lan_zh.json @@ -472,7 +472,7 @@ "天后失效": "天后失效", "电量更新时间:": "电量更新时间:", "新增配件": "新增配件", - "请在锁旁边完成第一次开锁": "请在锁旁边完成第一次开锁", + "钥匙不可用": "钥匙不可用", "正在开锁中...": "正在开锁中...", "你的钥匙": "你的钥匙", "常开模式启动!长按闭锁": "常开模式启动!长按闭锁", diff --git a/lib/blue/blue_manage.dart b/lib/blue/blue_manage.dart index 0c2409ee..d0a13911 100755 --- a/lib/blue/blue_manage.dart +++ b/lib/blue/blue_manage.dart @@ -394,6 +394,7 @@ class BlueManage { // 添加这个判断是因为有些苹果设备或者安卓等性能比较好的设备时,添加完锁之后,锁板未改变为已添加状态之前,就进行了蓝牙连接,导致添加完锁就失败,这里进行了判断,如果第一次连接失败,就清除缓存重新扫描连接 if(isReconnect == true){ AppLog.log('该锁已被重置, 重新发送扫描命令'); + scanDevices.clear(); startScanSingle(deviceName, 15, (List scanDevices) { _connectDevice(scanDevices, deviceName, connectStateCallBack, isAddEquipment: isAddEquipment, isReconnect: false); }); @@ -456,10 +457,8 @@ class BlueManage { //循环判断服务 for (final BluetoothService service in services) { if (service.uuid == _serviceIdConnect) { - for (final BluetoothCharacteristic characteristic - in service.characteristics) { - if (characteristic.characteristicUuid == - _characteristicIdSubscription) { + for (final BluetoothCharacteristic characteristic in service.characteristics) { + if (characteristic.characteristicUuid == _characteristicIdSubscription) { _subScribeToCharacteristic(characteristic); bluetoothConnectionState = BluetoothConnectionState.connected; connectStateCallBack(bluetoothConnectionState!); diff --git a/lib/blue/io_protocol/io_getPrivateKey.dart b/lib/blue/io_protocol/io_getPrivateKey.dart index 144751ad..29fde17a 100755 --- a/lib/blue/io_protocol/io_getPrivateKey.dart +++ b/lib/blue/io_protocol/io_getPrivateKey.dart @@ -1,17 +1,16 @@ import 'dart:convert'; +import 'package:crypto/crypto.dart' as crypto; import 'package:star_lock/blue/blue_manage.dart'; import 'package:star_lock/blue/sm4Encipher/sm4.dart'; import 'package:star_lock/tools/dateTool.dart'; -import '../io_tool/io_tool.dart'; import '../io_reply.dart'; import '../io_sender.dart'; +import '../io_tool/io_tool.dart'; import '../io_type.dart'; -import 'package:crypto/crypto.dart' as crypto; - List publicKeyDataList = []; class GetPrivateKeyCommand extends SenderProtocol { @@ -45,25 +44,25 @@ class GetPrivateKeyCommand extends SenderProtocol { List ebcData = []; // 指令类型 - int type = commandType!.typeValue; - double typeDouble = type / 256; - int type1 = typeDouble.toInt(); - int type2 = type % 256; + final int type = commandType!.typeValue; + final double typeDouble = type / 256; + final int type1 = typeDouble.toInt(); + final int type2 = type % 256; data.add(type1); data.add(type2); // 锁id - int lockIDLength = utf8.encode(lockID!).length; + final int lockIDLength = utf8.encode(lockID!).length; data.addAll(utf8.encode(lockID!)); data = getFixedLengthList(data, 40 - lockIDLength); //KeyID 40 - int keyIDLength = utf8.encode(keyID!).length; + final int keyIDLength = utf8.encode(keyID!).length; data.addAll(utf8.encode(keyID!)); data = getFixedLengthList(data, 40 - keyIDLength); - //authUserID 40 - int authUserIDLength = utf8.encode(authUserID!).length; + //authUserID 20 + final int authUserIDLength = utf8.encode(authUserID!).length; data.addAll(utf8.encode(authUserID!)); data = getFixedLengthList(data, 20 - authUserIDLength); @@ -74,12 +73,12 @@ class GetPrivateKeyCommand extends SenderProtocol { data.add((nowTime! & 0xff000000) >> 24); data.add((nowTime! & 0xff0000) >> 16); data.add((nowTime! & 0xff00) >> 8); - data.add((nowTime! & 0xff)); + data.add(nowTime! & 0xff); if (needAuthor == 0) { data.add(0); } else { - List authCodeData = []; + final List authCodeData = []; //authUserID authCodeData.addAll(utf8.encode(authUserID!)); @@ -94,19 +93,19 @@ class GetPrivateKeyCommand extends SenderProtocol { authCodeData.add((nowTime! & 0xff000000) >> 24); authCodeData.add((nowTime! & 0xff0000) >> 16); authCodeData.add((nowTime! & 0xff00) >> 8); - authCodeData.add((nowTime! & 0xff)); + authCodeData.add(nowTime! & 0xff); authCodeData.addAll(publicKeyData!); // 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode - var authCode = crypto.md5.convert(authCodeData); + final authCode = crypto.md5.convert(authCodeData); data.add(authCode.bytes.length); data.addAll(authCode.bytes); } if ((data.length % 16) != 0) { - int add = (16 - data.length % 16); + final int add = 16 - data.length % 16; for (int i = 0; i < add; i++) { data.add(0); } @@ -114,9 +113,7 @@ class GetPrivateKeyCommand extends SenderProtocol { printLog(data); // 拿到数据之后通过LockId进行SM4 ECB加密 key:544d485f633335373034383064613864 - ebcData = SM4.encrypt(data, - key: utf8.encode(BlueManage().connectDeviceName), - mode: SM4CryptoMode.ECB); + ebcData = SM4.encrypt(data, key: utf8.encode(BlueManage().connectDeviceName), mode: SM4CryptoMode.ECB); return ebcData; } diff --git a/lib/blue/io_protocol/io_getPublicKey.dart b/lib/blue/io_protocol/io_getPublicKey.dart index 212f3d9e..71fad94e 100755 --- a/lib/blue/io_protocol/io_getPublicKey.dart +++ b/lib/blue/io_protocol/io_getPublicKey.dart @@ -1,16 +1,16 @@ import 'dart:convert'; -import '../io_tool/io_tool.dart'; import '../io_reply.dart'; import '../io_sender.dart'; +import '../io_tool/io_tool.dart'; import '../io_type.dart'; class GetPublicKeyCommand extends SenderProtocol { - String? lockID; GetPublicKeyCommand({ this.lockID, }) : super(CommandType.getLockPublicKey); + String? lockID; @override @@ -23,14 +23,14 @@ class GetPublicKeyCommand extends SenderProtocol { List data = []; // 指令类型 - int type = commandType!.typeValue; - double typeDouble = type / 256; - int type1 = typeDouble.toInt(); - int type2 = type % 256; + final int type = commandType!.typeValue; + final double typeDouble = type / 256; + final int type1 = typeDouble.toInt(); + final int type2 = type % 256; data.add(type1); data.add(type2); - int length = utf8.encode(lockID!).length; + final int length = utf8.encode(lockID!).length; data.addAll(utf8.encode(lockID!)); data = getFixedLengthList(data, 40 - length); diff --git a/lib/blue/io_protocol/io_getWifiList.dart b/lib/blue/io_protocol/io_getWifiList.dart index a8b4f946..74fe1e0f 100755 --- a/lib/blue/io_protocol/io_getWifiList.dart +++ b/lib/blue/io_protocol/io_getWifiList.dart @@ -1,12 +1,12 @@ import 'dart:convert'; +import 'package:crypto/crypto.dart' as crypto; + import '../io_reply.dart'; import '../io_sender.dart'; import '../io_tool/io_tool.dart'; import '../io_type.dart'; -import 'package:crypto/crypto.dart' as crypto; - import '../sm4Encipher/sm4.dart'; class SenderGetWifiCommand extends SenderProtocol { diff --git a/lib/blue/io_protocol/io_openLock.dart b/lib/blue/io_protocol/io_openLock.dart index b8ccbc5d..a0e89e70 100755 --- a/lib/blue/io_protocol/io_openLock.dart +++ b/lib/blue/io_protocol/io_openLock.dart @@ -1,13 +1,14 @@ import 'dart:convert'; + +import 'package:crypto/crypto.dart' as crypto; import 'package:star_lock/tools/dateTool.dart'; -import '../io_tool/io_tool.dart'; -import '../sm4Encipher/sm4.dart'; import '../io_reply.dart'; import '../io_sender.dart'; +import '../io_tool/io_tool.dart'; import '../io_type.dart'; -import 'package:crypto/crypto.dart' as crypto; +import '../sm4Encipher/sm4.dart'; //TODO:开门 class OpenLockCommand extends SenderProtocol { @@ -47,20 +48,20 @@ class OpenLockCommand extends SenderProtocol { List ebcData = []; // 指令类型 - int type = commandType!.typeValue; - double typeDouble = type / 256; - int type1 = typeDouble.toInt(); - int type2 = type % 256; + final int type = commandType!.typeValue; + final double typeDouble = type / 256; + final int type1 = typeDouble.toInt(); + final int type2 = type % 256; data.add(type1); data.add(type2); //KeyID 40 - int keyIDLength = utf8.encode(lockID!).length; + final int keyIDLength = utf8.encode(lockID!).length; data.addAll(utf8.encode(lockID!)); data = getFixedLengthList(data, 40 - keyIDLength); //userID 要接受钥匙的用户的useid 20 - int userIDLength = utf8.encode(userID!).length; + final int userIDLength = utf8.encode(userID!).length; data.addAll(utf8.encode(userID!)); data = getFixedLengthList(data, 20 - userIDLength); @@ -68,13 +69,13 @@ class OpenLockCommand extends SenderProtocol { data.add(openMode!); // OpenTime 4 - int? d1 = openTime; + final int? d1 = openTime; // AppLog.log("开门时间是:$d1"); data.add((d1! & 0xff000000) >> 24); data.add((d1 & 0xff0000) >> 16); data.add((d1 & 0xff00) >> 8); - data.add((d1 & 0xff)); + data.add(d1 & 0xff); // token 长度4 首次请求 Token 填 0,如果锁需要鉴权 操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。 当token失效或者第一次发送的时候token为0 data.addAll(token!); @@ -83,7 +84,7 @@ class OpenLockCommand extends SenderProtocol { //AuthCodeLen 1 data.add(0); } else { - List authCodeData = []; + final List authCodeData = []; //KeyID authCodeData.addAll(utf8.encode(lockID!)); @@ -96,7 +97,7 @@ class OpenLockCommand extends SenderProtocol { authCodeData.addAll(signKey!); // 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode - var authCode = crypto.md5.convert(authCodeData); + final authCode = crypto.md5.convert(authCodeData); data.add(authCode.bytes.length); data.addAll(authCode.bytes); @@ -104,13 +105,13 @@ class OpenLockCommand extends SenderProtocol { //onlineToken 16 if(onlineToken!.isNotEmpty){ - int onlineTokenLength = utf8.encode(onlineToken!).length; + final int onlineTokenLength = utf8.encode(onlineToken!).length; data.addAll(utf8.encode(onlineToken!)); data = getFixedLengthList(data, 16 - onlineTokenLength); } if ((data.length % 16) != 0) { - int add = (16 - data.length % 16); + final int add = 16 - data.length % 16; for (int i = 0; i < add; i++) { data.add(0); } @@ -127,7 +128,7 @@ class OpenDoorReply extends Reply { OpenDoorReply.parseData(CommandType commandType, List dataDetail) : super.parseData(commandType, dataDetail) { data = dataDetail; - int status = data[6]; + final int status = data[6]; errorWithStstus(status); } } \ No newline at end of file diff --git a/lib/flavors.dart b/lib/flavors.dart index 982acd95..fcc73aca 100755 --- a/lib/flavors.dart +++ b/lib/flavors.dart @@ -86,8 +86,9 @@ class F { static String get apiPrefix { switch (appFlavor) { case Flavor.local: - return 'https://ge.lock.star-lock.cn'; // 葛工 + // return 'https://ge.lock.star-lock.cn'; // 葛工 // return 'http://192.168.1.15:8022'; // 谢工 + return 'http://zhou.lock.star-lock.cn'; // 周工 case Flavor.dev: return 'https://dev.lock.star-lock.cn'; case Flavor.pre: diff --git a/lib/login/login/starLock_login_xhj_page.dart b/lib/login/login/starLock_login_xhj_page.dart index 4f23fb50..c0345671 100755 --- a/lib/login/login/starLock_login_xhj_page.dart +++ b/lib/login/login/starLock_login_xhj_page.dart @@ -152,69 +152,71 @@ class _StarLockLoginPageState extends State { ], ), ), - GestureDetector( - onTap: () { - state.agree.value = !state.agree.value; - logic.changeAgreeState(); - }, - child: Container( - color: Colors.transparent, - padding: - EdgeInsets.symmetric(vertical: 30.h, horizontal: 40.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Obx( - () => Container( - padding: EdgeInsets.only( - left: 5.w, - right: 10.w, - ), - child: Image.asset( - state.agree.value + Container( + color: Colors.transparent, + padding: + EdgeInsets.symmetric(vertical: 30.h, horizontal: 40.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Obx(() => GestureDetector( + onTap: () { + state.agree.value = !state.agree.value; + logic.changeAgreeState(); + }, + child: Container( + width: 40.w, + height: 40.w, + // color: Colors.red, + padding: EdgeInsets.only( + left: 5.w, + right: 10.w, + ), + child: Image.asset( + state.agree.value ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 20.w, height: 20.w, ), ), - ), - Row(children: [ - Text(TranslationLoader.lanKeys!.readAndAgree!.tr, + ), + ), + Row(children: [ + Text(TranslationLoader.lanKeys!.readAndAgree!.tr, + style: TextStyle( + color: const Color(0xff333333), + fontSize: 20.sp)), + GestureDetector( + child: Text( + '《${TranslationLoader.lanKeys!.userAgreement!.tr}》', style: TextStyle( - color: const Color(0xff333333), + color: AppColors.mainColor, fontSize: 20.sp)), - GestureDetector( - child: Text( - '《${TranslationLoader.lanKeys!.userAgreement!.tr}》', - style: TextStyle( - color: AppColors.mainColor, - fontSize: 20.sp)), - onTap: () { - Get.toNamed(Routers.webviewShowPage, - arguments: { - 'url': XSConstantMacro.userAgreementURL, - 'title': '用户协议'.tr - }); - }, - ), - GestureDetector( - child: Text( - '《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》', - style: TextStyle( - color: AppColors.mainColor, - fontSize: 20.sp)), - onTap: () { - Get.toNamed(Routers.webviewShowPage, - arguments: { - 'url': XSConstantMacro.privacyPolicyURL, - 'title': '隐私政策'.tr - }); - }, - ), - ]), - ], - ), + onTap: () { + Get.toNamed(Routers.webviewShowPage, + arguments: { + 'url': XSConstantMacro.userAgreementURL, + 'title': '用户协议'.tr + }); + }, + ), + GestureDetector( + child: Text( + '《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》', + style: TextStyle( + color: AppColors.mainColor, + fontSize: 20.sp)), + onTap: () { + Get.toNamed(Routers.webviewShowPage, + arguments: { + 'url': XSConstantMacro.privacyPolicyURL, + 'title': '隐私政策'.tr + }); + }, + ), + ]), + ], ), ), Padding( diff --git a/lib/main.dart b/lib/main.dart index f25dbcfd..be8484da 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -34,6 +34,7 @@ FutureOr main() async { if (isLogin) { await privacySDKInitialization(); Future.delayed(const Duration(milliseconds: 500), () async { + AppLog.log('main函数调用了获取App信息接口'); final GetAppInfo entity = await ApiRepository.to.getAppInfo(); CustomerTool.init(entity.data?.wechatServiceUrl ?? ''); if (entity.data?.appSiteUrl != null) { @@ -53,7 +54,7 @@ FutureOr main() async { if (AppPlatform.isAndroid) { const SystemUiOverlayStyle systemUiOverlayStyle = - SystemUiOverlayStyle(statusBarColor: Colors.transparent); + SystemUiOverlayStyle(statusBarColor: Colors.transparent); SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); } } diff --git a/lib/main/lockDetail/card/cardList/cardList_logic.dart b/lib/main/lockDetail/card/cardList/cardList_logic.dart index e88131fc..cb5c420c 100755 --- a/lib/main/lockDetail/card/cardList/cardList_logic.dart +++ b/lib/main/lockDetail/card/cardList/cardList_logic.dart @@ -1,17 +1,23 @@ import 'dart:async'; +import 'dart:convert'; + +import 'package:crypto/crypto.dart' as crypto; import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:get/get.dart'; +import 'package:star_lock/app_settings/app_settings.dart'; import 'package:star_lock/login/login/entity/LoginEntity.dart'; import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/dateTool.dart'; + import '../../../../blue/blue_manage.dart'; import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart'; import '../../../../blue/io_reply.dart'; import '../../../../blue/io_tool/io_tool.dart'; import '../../../../blue/io_tool/manager_event_bus.dart'; import '../../../../blue/sender_manage.dart'; +import '../../../../blue/sm4Encipher/sm4.dart'; import '../../../../network/api_repository.dart'; import '../../../../tools/eventBusEventManage.dart'; import '../../../../tools/storage.dart'; @@ -224,6 +230,40 @@ class CardListLogic extends BaseGetXController { return keyDateTypeStr; } + void signBlue(){ + // final authCode = crypto.md5.convert([48,50,57,52,102,179,68,85,170,30,0,0,111,9,183,38,188,37,220,154,158,173,242,98]); + // AppLog.log('authCode:$authCode'); + + // final ebcData = SM4.encrypt([48, 145, 84, 77, 72, 95, 49, 101, 48, 54, 56, 57, 97, 56, 56, 54, 102, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 57, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 179, 68, 85, 32, 98, 99, 101, 101, 56, 97, 50, 51, 51, 99, 102, 51, 52, 53, 48, 101, 57, 53, 52, 51, 98, 49, 51, 56, 53, 52, 49, 48, 57, 100, 56, 54], key: utf8.encode('TMH_1e0689a886f8'), mode: SM4CryptoMode.ECB); + // AppLog.log('ebcData:$ebcData'); + + // final oriDataList = SM4.decrypt([103, 213, 54, 227, 120, 57, 155, 4, 31, 95, 214, 233, 229, 100, 85, 18], key: utf8.encode('TMH_1e0689a886f8'), mode: SM4CryptoMode.ECB); + // AppLog.log('oriDataList:$oriDataList'); + + final List authCodeData = []; + //authUserID + authCodeData.addAll(utf8.encode('294')); + + //KeyID + authCodeData.addAll(utf8.encode('0')); + + //NowTime 4 + // DateTime now = DateTime.now(); + // int timestamp = now.millisecondsSinceEpoch; + var nowTime = 1723083753; + authCodeData.add((nowTime & 0xff000000) >> 24); + authCodeData.add((nowTime & 0xff0000) >> 16); + authCodeData.add((nowTime & 0xff00) >> 8); + authCodeData.add(nowTime & 0xff); + + authCodeData.addAll([168, 37, 0, 0, 190, 240, 188, 129, 150, 249, 113, 15, 44, 243, 227, 30]); + + AppLog.log('authCodeData:$authCodeData'); + // 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode + final authCode = crypto.md5.convert(authCodeData); + AppLog.log('authCode:$authCode authCode.bytes.length:${authCode.bytes.length} authCode.bytes:${authCode.bytes}'); + } + @override Future onReady() async { super.onReady(); @@ -235,6 +275,8 @@ class CardListLogic extends BaseGetXController { _initRefreshAction(); } + + // signBlue(); } @override diff --git a/lib/main/lockDetail/card/otherTypeKeyChangeDate/otherTypeKeyChangeDate_logic.dart b/lib/main/lockDetail/card/otherTypeKeyChangeDate/otherTypeKeyChangeDate_logic.dart index 2c0268fd..2048dd9e 100755 --- a/lib/main/lockDetail/card/otherTypeKeyChangeDate/otherTypeKeyChangeDate_logic.dart +++ b/lib/main/lockDetail/card/otherTypeKeyChangeDate/otherTypeKeyChangeDate_logic.dart @@ -684,7 +684,7 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{ faceRight: state.fingerprintItemData.value.faceRight!, ); if (entity.errorCode!.codeIsSuccessful) { - showToast('修改成功', something: () { + showToast('修改成功'.tr, something: () { Get.back(result: { 'beginTimeTimestamp':state.beginTimeTimestamp.value.toString(), 'endTimeTimestamp':state.endTimeTimestamp.value.toString(), @@ -711,7 +711,7 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{ palmVeinRight: state.fingerprintItemData.value.palmVeinRight!, ); if (entity.errorCode!.codeIsSuccessful) { - showToast('修改成功', something: () { + showToast('修改成功'.tr, something: () { Get.back(result: { 'beginTimeTimestamp':state.beginTimeTimestamp.value.toString(), 'endTimeTimestamp':state.endTimeTimestamp.value.toString(), diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index 5d0dbf01..bf80cee6 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -187,8 +187,7 @@ class LockDetailLogic extends BaseGetXController { state.lockUserNo = state.keyInfos.value.lockUserNo!; - if (state.keyInfos.value.keyStatus == - XSConstantMacro.keyStatusWaitIneffective || + if (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitIneffective || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted || @@ -611,6 +610,7 @@ class LockDetailLogic extends BaseGetXController { getServerDatetime(); await PermissionDialog.request(Permission.location); await PermissionDialog.requestBluetooth(); + } @override diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index d3b922db..489c1570 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -1290,7 +1290,7 @@ class _LockDetailPageState extends State onTap: bottomBtnisEable ? onClick : () { - logic.showToast('请在锁旁边完成第一次开锁'.tr); + logic.showToast('钥匙不可用'.tr); }, child: child, ); diff --git a/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_logic.dart b/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_logic.dart index 1ed1d547..12ac7f80 100755 --- a/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_logic.dart +++ b/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_logic.dart @@ -147,6 +147,7 @@ class LockOperatingRecordLogic extends BaseGetXController { keyId: state.type == 5 ? state.idStr : '', faceId: state.type == 4 ? state.idStr : '', remoteId:state.type == 6 ? state.idStr : '', + palmVeinId:state.type == 7 ? state.idStr : '', pageSize:pageSize, ); if (entity.errorCode!.codeIsSuccessful) { diff --git a/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_state.dart b/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_state.dart index 109e696e..78b4f811 100755 --- a/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_state.dart +++ b/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_state.dart @@ -30,6 +30,6 @@ class LockOperatingRecordState { // 记录名称 bool ifHaveNext = false; // 页码 int logCountPage = 10; // 蓝牙记录一页多少个 String idStr = ''; // - int type = 0; // 1:密码 2:卡 3:指纹 4:人脸 5:钥匙 6:遥控 + int type = 0; // 1:密码 2:卡 3:指纹 4:人脸 5:钥匙 6:遥控 7掌静脉 RxString recordName = ''.obs; } diff --git a/lib/main/lockDetail/palm/palmDetail/palmDetail_page.dart b/lib/main/lockDetail/palm/palmDetail/palmDetail_page.dart index cde24882..7941a11d 100755 --- a/lib/main/lockDetail/palm/palmDetail/palmDetail_page.dart +++ b/lib/main/lockDetail/palm/palmDetail/palmDetail_page.dart @@ -183,10 +183,12 @@ class _PalmDetailPageState extends State with RouteAware { rightTitle: '', isHaveDirection: true, action: () { - // Get.toNamed(Routers.keyOperationRecordPage, arguments: { - // 'lockId': state.fingerprintItemData.value.lockId.toString(), - // 'cardId': state.fingerprintItemData.value.cardId.toString() - // }); + Get.toNamed(Routers.lockOperatingRecordPage, + arguments: { + 'type': 7, + 'id': state.fingerprintItemData.value.palmVeinId.toString(), + 'recordName': state.fingerprintItemData.value.palmVeinName + }); }), // SizedBox(height: 40.h), // addControlsBtn(type), @@ -221,7 +223,7 @@ class _PalmDetailPageState extends State with RouteAware { } Get.back(); state.typeName.value = state.changeNameController.text; - // logic.editICCardData(); + logic.editPalmData(); }, cancelClick: () { Get.back(); diff --git a/lib/main/lockDetail/palm/palmList/palmList_logic.dart b/lib/main/lockDetail/palm/palmList/palmList_logic.dart index cad800a0..15a00abc 100755 --- a/lib/main/lockDetail/palm/palmList/palmList_logic.dart +++ b/lib/main/lockDetail/palm/palmList/palmList_logic.dart @@ -137,7 +137,7 @@ class PalmListLogic extends BaseGetXController { }); } - // 获取IC卡列表 + // 获取掌静脉列表 Future getPalmListData({required bool isRefresh}) async { // 如果是下拉刷新,清空已有数据 if (isRefresh) { diff --git a/lib/main/lockDetail/palm/palmList/palmList_page.dart b/lib/main/lockDetail/palm/palmList/palmList_page.dart index ef2023f0..7cbc8872 100755 --- a/lib/main/lockDetail/palm/palmList/palmList_page.dart +++ b/lib/main/lockDetail/palm/palmList/palmList_page.dart @@ -1,4 +1,4 @@ -import 'package:flutter/cupertino.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -9,19 +9,16 @@ import 'package:star_lock/main/lockDetail/palm/palmList/palmList_logic.dart'; import 'package:star_lock/main/lockDetail/palm/palmList/palmList_state.dart'; import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart'; import 'package:star_lock/tools/keySearchWidget.dart'; -import 'package:star_lock/tools/left_slide/left_slide_actions.dart'; import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/EasyRefreshTool.dart'; import '../../../../tools/appRouteObserver.dart'; import '../../../../tools/noData.dart'; -import '../../../../tools/showIosTipView.dart'; import '../../../../tools/showTipView.dart'; import '../../../../tools/storage.dart'; import '../../../../tools/submitBtn.dart'; import '../../../../tools/titleAppBar.dart'; -import '../../../../translations/trans_lib.dart'; class PalmListPage extends StatefulWidget { const PalmListPage({Key? key}) : super(key: key); diff --git a/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControl_logic.dart b/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControl_logic.dart index e5c0cd23..b280dca7 100644 --- a/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControl_logic.dart +++ b/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControl_logic.dart @@ -142,7 +142,7 @@ class AddRemoteControlLogic extends BaseGetXController{ } } - // 添加卡片 + // 添加遥控 Future senderAddRemoteControl() async { showBlueConnetctToastTimer(action: (){ Get.close(1); diff --git a/lib/main/lockDetail/remoteControl/remoteControlDetail/remoteControlDetail_logic.dart b/lib/main/lockDetail/remoteControl/remoteControlDetail/remoteControlDetail_logic.dart index d40339c5..e39994ac 100644 --- a/lib/main/lockDetail/remoteControl/remoteControlDetail/remoteControlDetail_logic.dart +++ b/lib/main/lockDetail/remoteControl/remoteControlDetail/remoteControlDetail_logic.dart @@ -175,7 +175,7 @@ class RemoteControlDetailLogic extends BaseGetXController { remoteRight: 2, ); if (entity.errorCode!.codeIsSuccessful) { - state.fingerprintItemData.value.cardName = state.changeNameController.text; + state.fingerprintItemData.value.remoteName = state.changeNameController.text; // state.fingerprintItemData.value.isCoerced = state.isStressCard.value ? 1 : 2; // state.fingerprintItemData.value.cardRight = state.isAdministrator.value ? 1 : 0; showToast('修改成功'.tr, something: () { diff --git a/lib/main/lockMian/lockList/lockList_xhj_page.dart b/lib/main/lockMian/lockList/lockList_xhj_page.dart index 4d826a24..8937b161 100755 --- a/lib/main/lockMian/lockList/lockList_xhj_page.dart +++ b/lib/main/lockMian/lockList/lockList_xhj_page.dart @@ -147,7 +147,7 @@ class _LockListXHJPageState extends State with RouteAware { //设备多层级列表 Widget _buildLockExpandedList(BuildContext context, int index, GroupList itemData) { final List lockItemList = itemData.lockList ?? []; - AppLog.log('lockItemList[0].lockAlias:${lockItemList[0].lockAlias}'); + // AppLog.log('lockItemList[0].lockAlias:${lockItemList[0].lockAlias}'); final List list = forItems(lockItemList); return LockListGroupView( onTap: () { diff --git a/lib/main/lockMian/lockMain/lockMain_logic.dart b/lib/main/lockMian/lockMain/lockMain_logic.dart index 7c59b8c5..295f121d 100755 --- a/lib/main/lockMian/lockMain/lockMain_logic.dart +++ b/lib/main/lockMian/lockMain/lockMain_logic.dart @@ -38,7 +38,7 @@ class LockMainLogic extends BaseGetXController { isUnShowLoading: isUnShowLoading, ); if (entity.errorCode!.codeIsSuccessful) { - AppLog.log('请求列表调用 loadMainDataLogic'); + // AppLog.log('请求列表调用 loadMainDataLogic'); await loadMainDataLogic(entity.data!); updateZoneOffsetsAndLanguages(); } diff --git a/lib/main/lockMian/lockMain/lockMain_page.dart b/lib/main/lockMian/lockMain/lockMain_page.dart index 0171aedb..47e01e95 100755 --- a/lib/main/lockMian/lockMain/lockMain_page.dart +++ b/lib/main/lockMian/lockMain/lockMain_page.dart @@ -41,8 +41,7 @@ class _StarLockMainPageState extends State Future getHttpData( {bool clearScanDevices = false, bool isUnShowLoading = false}) async { - LockListInfoGroupEntity? lockListInfoGroupEntity = - await Storage.getLockMainListData(); + LockListInfoGroupEntity? lockListInfoGroupEntity = await Storage.getLockMainListData(); if (lockListInfoGroupEntity != null) { await logic.loadMainDataLogic(lockListInfoGroupEntity); setState(() {}); diff --git a/lib/main_dev.dart b/lib/main_dev.dart index c9275a23..194d5e31 100755 --- a/lib/main_dev.dart +++ b/lib/main_dev.dart @@ -1,8 +1,10 @@ +import 'app_settings/app_settings.dart'; import 'flavors.dart'; import 'main.dart' as runner; Future main() async { F.appFlavor = Flavor.dev; + AppLog.log('dev调用了main函数'); await runner.main(); } diff --git a/lib/main_local.dart b/lib/main_local.dart index a6fd745a..51b4662a 100755 --- a/lib/main_local.dart +++ b/lib/main_local.dart @@ -1,8 +1,10 @@ +import 'app_settings/app_settings.dart'; import 'flavors.dart'; import 'main.dart' as runner; Future main() async { F.appFlavor = Flavor.local; + AppLog.log('local调用了main函数'); await runner.main(); } diff --git a/lib/main_pre.dart b/lib/main_pre.dart index d2e9fed6..3420ca9c 100755 --- a/lib/main_pre.dart +++ b/lib/main_pre.dart @@ -1,8 +1,10 @@ +import 'app_settings/app_settings.dart'; import 'flavors.dart'; import 'main.dart' as runner; Future main() async { F.appFlavor = Flavor.pre; + AppLog.log('pre调用了main函数'); await runner.main(); } diff --git a/lib/main_sky_full.dart b/lib/main_sky_full.dart index ab526bfb..2a8188d5 100755 --- a/lib/main_sky_full.dart +++ b/lib/main_sky_full.dart @@ -1,8 +1,10 @@ +import 'app_settings/app_settings.dart'; import 'flavors.dart'; import 'main.dart' as runner; Future main() async { F.appFlavor = Flavor.sky; + AppLog.log('sky_full调用了main函数'); await runner.main(); } diff --git a/lib/main_sky_lite.dart b/lib/main_sky_lite.dart index 3c0a2b0b..80f60e49 100755 --- a/lib/main_sky_lite.dart +++ b/lib/main_sky_lite.dart @@ -1,3 +1,4 @@ +import 'app_settings/app_settings.dart'; import 'flavors.dart'; import 'main.dart' as runner; @@ -5,5 +6,6 @@ import 'main.dart' as runner; Future main() async { F.appFlavor = Flavor.sky; F.isLite = true; + AppLog.log('sky_lite调用了main函数'); await runner.main(); } diff --git a/lib/main_xhj_full.dart b/lib/main_xhj_full.dart index 8f92a4f0..76db6238 100755 --- a/lib/main_xhj_full.dart +++ b/lib/main_xhj_full.dart @@ -1,8 +1,10 @@ +import 'app_settings/app_settings.dart'; import 'flavors.dart'; import 'main.dart' as runner; Future main() async { F.appFlavor = Flavor.xhj; + AppLog.log('xhj_full调用了main函数'); await runner.main(); } diff --git a/lib/main_xhj_lite.dart b/lib/main_xhj_lite.dart index 7546bbe0..9b6a97c6 100755 --- a/lib/main_xhj_lite.dart +++ b/lib/main_xhj_lite.dart @@ -1,3 +1,4 @@ +import 'app_settings/app_settings.dart'; import 'flavors.dart'; import 'main.dart' as runner; @@ -5,5 +6,6 @@ import 'main.dart' as runner; Future main() async { F.appFlavor = Flavor.xhj; F.isLite = true; + AppLog.log('xhj_lite调用了main函数'); await runner.main(); } diff --git a/lib/mine/addLock/nearbyLock/nearbyLock_logic.dart b/lib/mine/addLock/nearbyLock/nearbyLock_logic.dart index 2477cb87..f34fa137 100755 --- a/lib/mine/addLock/nearbyLock/nearbyLock_logic.dart +++ b/lib/mine/addLock/nearbyLock/nearbyLock_logic.dart @@ -50,7 +50,7 @@ class NearbyLockLogic extends BaseGetXController { }); BlueManage().blueSendData(deviceName, (BluetoothConnectionState state) async { - AppLog.log('点击要添加的设备了'); + // AppLog.log('点击要添加的设备了'); if (state == BluetoothConnectionState.connected) { AppLog.log('开始获取公钥'); IoSenderManage.getPublicKey(lockId: deviceName); @@ -663,9 +663,19 @@ class NearbyLockLogic extends BaseGetXController { Future getNearByLimits() async { if (!Platform.isIOS) { - final bool bluetoothRequest = await PermissionDialog.requestBluetooth(); - final bool locationRequest = - await PermissionDialog.request(Permission.location); + bool bluetoothRequest = false; + try { + bluetoothRequest = await PermissionDialog.requestBluetooth(); + AppLog.log('bluetoothRequest:$bluetoothRequest'); + if (!bluetoothRequest) { + return; + } + } catch (e) { + AppLog.log('bluetoothRequest:$e'); + } + + final bool locationRequest = await PermissionDialog.request(Permission.location); + AppLog.log('locationRequest:$locationRequest'); if (!bluetoothRequest || !locationRequest) { return; } @@ -674,4 +684,5 @@ class NearbyLockLogic extends BaseGetXController { state.ifCurrentScreen.value = true; startScanBlueList(); } + } diff --git a/lib/mine/addLock/nearbyLock/nearbyLock_page.dart b/lib/mine/addLock/nearbyLock/nearbyLock_page.dart index 32d252ca..37274cf2 100755 --- a/lib/mine/addLock/nearbyLock/nearbyLock_page.dart +++ b/lib/mine/addLock/nearbyLock/nearbyLock_page.dart @@ -5,6 +5,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/flavors.dart'; +import 'package:star_lock/mine/addLock/nearbyLock/nearbyLock_state.dart'; import '../../../app_settings/app_colors.dart'; import '../../../tools/appRouteObserver.dart'; import '../../../tools/titleAppBar.dart'; @@ -19,8 +20,8 @@ class NearbyLockPage extends StatefulWidget { } class _NearbyLockPageState extends State with RouteAware { - final logic = Get.put(NearbyLockLogic()); - final state = Get.find().state; + final NearbyLockLogic logic = Get.put(NearbyLockLogic()); + final NearbyLockState state = Get.find().state; @override Widget build(BuildContext context) { @@ -31,7 +32,7 @@ class _NearbyLockPageState extends State with RouteAware { barTitle: TranslationLoader.lanKeys!.nearbyLock!.tr, haveBack: true, backgroundColor: AppColors.mainColor, - actionsList: [ + actionsList: [ CupertinoActivityIndicator( radius: 18.w, color: Colors.white, @@ -44,7 +45,7 @@ class _NearbyLockPageState extends State with RouteAware { backgroundColor: Colors.white, iconColor: AppColors.blackColor, titleColor: AppColors.blackColor, - actionsList: [ + actionsList: [ CupertinoActivityIndicator( radius: 18.w, color: AppColors.blackColor, @@ -52,20 +53,18 @@ class _NearbyLockPageState extends State with RouteAware { SizedBox(width: 30.w) ]), ), - body: Obx(() { - return listView(); - }), + body: Obx(listView), ); } Widget listView() { return Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ Expanded( child: ListView.separated( itemCount: state.devices.length, - itemBuilder: (c, index) { + itemBuilder: (BuildContext c, int index) { return nearbyLockItem('images/icon_lockGroup_item.png', state.devices[index], () { String advName = state.devices[index].advertisementData.advName; state.selectLockName.value = advName; @@ -109,19 +108,19 @@ class _NearbyLockPageState extends State with RouteAware { return GestureDetector( onTap: ((scanResult.advertisementData.serviceUuids.isNotEmpty ? scanResult.advertisementData.serviceUuids[0] - : "") + : '') .toString()[33] == - "1") + '1') ? action : null, child: Column( - children: [ + children: [ Container( height: 89.h, width: 1.sw, color: Colors.white, child: Row( - children: [ + children: [ SizedBox(width: 20.w), Image.asset( lockTypeIcon, @@ -132,7 +131,7 @@ class _NearbyLockPageState extends State with RouteAware { Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ // 第32、33两位00 表示休眠, 01表示唤醒 Text(scanResult.advertisementData.advName, style: TextStyle( @@ -141,9 +140,9 @@ class _NearbyLockPageState extends State with RouteAware { .isNotEmpty ? scanResult.advertisementData .serviceUuids[0] - : "") + : '') .toString()[33] == - "1") + '1') ? AppColors.blackColor : Colors.grey)), ], @@ -152,7 +151,7 @@ class _NearbyLockPageState extends State with RouteAware { width: 10.w, ), Image.asset( - "images/mine/icon_mine_main_about.png", + 'images/mine/icon_mine_main_about.png', width: 22.w, height: 22.w, ), @@ -237,11 +236,9 @@ class _TipDialog extends StatelessWidget { '固件升级提示'.tr, ), content: Text('请先获取固件文件到手机本地,再选择升级'.tr), - actions: [ + actions: [ TextButton( - onPressed: () { - Get.back(); - }, + onPressed: Get.back, child: Text( '取消'.tr, style: TextStyle(fontSize: 22.sp, color: AppColors.blackColor), @@ -274,7 +271,7 @@ class OTAProgressDialog extends StatelessWidget { '固件升级中'.tr, ), content: Column( - children: [ + children: [ Padding( padding: EdgeInsets.only(top: 20.h, bottom: 10.h), child: Text( @@ -283,7 +280,7 @@ class OTAProgressDialog extends StatelessWidget { ), ), Row( - children: [ + children: [ Text( '传输中'.tr, style: TextStyle(fontSize: 18.sp, color: AppColors.mainColor), @@ -300,7 +297,7 @@ class OTAProgressDialog extends StatelessWidget { ), ], ), - actions: [ + actions: [ TextButton( onPressed: () { logic.closeOTADAta(); diff --git a/lib/mine/mineSet/authorizedAdministrator/administratorAssociationLock/administratorAssociationLock_page.dart b/lib/mine/mineSet/authorizedAdministrator/administratorAssociationLock/administratorAssociationLock_page.dart index 5b07ec57..3ea55476 100644 --- a/lib/mine/mineSet/authorizedAdministrator/administratorAssociationLock/administratorAssociationLock_page.dart +++ b/lib/mine/mineSet/authorizedAdministrator/administratorAssociationLock/administratorAssociationLock_page.dart @@ -34,16 +34,17 @@ class _AdministratorAssociationLockPageState barTitle: '锁'.tr, haveBack: true, backgroundColor: AppColors.mainColor, - actionsList: [ - IconButton( - icon: Image.asset( - 'images/icon_bar_more.png', - height: 30.h, - width: 10.w, - ), - onPressed: logic.openModalBottomSheet, - ), - ], + // 功能未做 先隐藏下个版本修改 + // actionsList: [ + // IconButton( + // icon: Image.asset( + // 'images/icon_bar_more.png', + // height: 30.h, + // width: 10.w, + // ), + // onPressed: logic.openModalBottomSheet, + // ), + // ], ), body: Obx(_buildListView), ); diff --git a/lib/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_logic.dart b/lib/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_logic.dart index ad73303a..5b9c293d 100755 --- a/lib/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_logic.dart +++ b/lib/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_logic.dart @@ -36,8 +36,8 @@ class AdministratorDetailsLogic extends BaseGetXController { keyName: isChangeName ? state.changeNameController.text : state.itemData.value.name ?? '', - endDate: '', - startDate: '', + endDate: state.itemData.value.endDate.toString(), + startDate: state.itemData.value.startDate.toString(), isOnlyManageSelf: isChangeName ? state.itemData.value.onlyManageYouCreatesUser ?? 0 : isManageCreateUser, diff --git a/lib/network/api_provider.dart b/lib/network/api_provider.dart index 3d909bc4..0c41a23b 100755 --- a/lib/network/api_provider.dart +++ b/lib/network/api_provider.dart @@ -287,6 +287,7 @@ class ApiProvider extends BaseProvider { required String keyId, required String faceId, required String remoteId, + required String palmVeinId, required String pageSize}) => post( keyOperationRecordURL.toUrl, @@ -303,6 +304,7 @@ class ApiProvider extends BaseProvider { 'keyId': keyId, 'faceId': faceId, 'remoteId': remoteId, + 'palmVeinId': palmVeinId, 'pageSize': pageSize })); diff --git a/lib/network/api_repository.dart b/lib/network/api_repository.dart index d48ab024..454e7fb8 100755 --- a/lib/network/api_repository.dart +++ b/lib/network/api_repository.dart @@ -255,6 +255,7 @@ class ApiRepository { required String keyId, required String faceId, required String remoteId, + required String palmVeinId, required String pageSize, }) async { final res = await apiProvider.lockRecordList( @@ -270,6 +271,7 @@ class ApiRepository { keyId: keyId, faceId: faceId, remoteId: remoteId, + palmVeinId: palmVeinId, pageSize: pageSize, ); return KeyOperationRecordEntity.fromJson(res.body); @@ -1857,7 +1859,7 @@ class ApiRepository { // 校验掌静脉名字是否重复 Future checkPalmNameDuplicatedData( {required String lockId, required String palmVeinName}) async { - final res = await apiProvider.checkRemoteControlNameDuplicatedData(lockId, palmVeinName); + final res = await apiProvider.checkPalmNameDuplicatedData(lockId, palmVeinName); return LoginEntity.fromJson(res.body); } diff --git a/lib/tools/appFirstEnterHandle.dart b/lib/tools/appFirstEnterHandle.dart index 8699f57a..fef9dd99 100755 --- a/lib/tools/appFirstEnterHandle.dart +++ b/lib/tools/appFirstEnterHandle.dart @@ -70,6 +70,7 @@ class AppFirstEnterHandle { } Future getAppInfo() async { + AppLog.log('AppFirstEnterHandle调用了获取App信息接口'); final GetAppInfo entity = await ApiRepository.to.getAppInfo(); CustomerTool.init(entity.data?.wechatServiceUrl ?? ''); WxPayTool.setAssociationUrl(entity.data!.appSiteUrl!); diff --git a/lib/widget/permission/permission_dialog.dart b/lib/widget/permission/permission_dialog.dart index 2a01642b..c15f1737 100755 --- a/lib/widget/permission/permission_dialog.dart +++ b/lib/widget/permission/permission_dialog.dart @@ -282,6 +282,7 @@ class PermissionDialog { //显示权限判断申请框 static Future request(Permission permission, [String? content]) async { + AppLog.log('context:${content}'); if (Get.context == null) { return false; } diff --git a/pre_build.sh b/pre_build.sh index ae698199..f996e68c 100755 --- a/pre_build.sh +++ b/pre_build.sh @@ -34,7 +34,7 @@ case $environment in ;; local) main_file="lib/main_local.dart" - api_prefix='http://192.168.1.15:8022' + api_prefix='http://zhou.lock.star-lock.cn' ;; *) echo "错误: flavor[$environment] mainFile not found" From 496bf744e5a56f57f5be4dd7fb37c1deafcd6273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Thu, 8 Aug 2024 14:29:32 +0800 Subject: [PATCH 06/15] =?UTF-8?q?1.0.73+2024080801=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 1d8b2693..d2cc8821 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -81,9 +81,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.70+2024072402:xhj 线上环境,提交测试:回归 bug # 1.0.71+2024072901:xhj 线上环境,提交测试:回归 bug # 1.0.71+2024072902:xhj 线上环境,提交测试:回归 bug -# 1.0.72+2024080501:xhj 线上环境,提交测试:回归 bug +# 1.0.72+2024080501:xhj 预发布环境,提交测试:回归 bug +# 1.0.73+2024080801:xhj 预发布环境,提交测试:回归 Tapd优2优及测试部门8月8号之前bug -version: 1.0.72+2024080501 +version: 1.0.73+2024080801 environment: sdk: '>=2.12.0 <3.0.0' From 33a1cecb8eaf57c8482173886cdf4e9eb7efaafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Fri, 9 Aug 2024 14:00:36 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=A1=E3=80=81?= =?UTF-8?q?=E6=8C=87=E7=BA=B9=E3=80=81=E4=BA=BA=E8=84=B8=E3=80=81=E9=81=A5?= =?UTF-8?q?=E6=8E=A7=E3=80=81=E6=8E=8C=E9=9D=99=E8=84=89=E3=80=81=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=95=B0=E6=8D=AE=E8=B6=85=E8=BF=87=E4=B8=89=E9=A1=B5?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E5=88=A0=E9=99=A4=E8=BF=9B=E5=85=A5=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=88=A0=E9=99=A4=E6=9C=80=E5=90=8E=E4=B8=80=E6=9D=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=E8=A1=A8=E5=8D=A1=E9=A1=BF=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../card/cardList/cardList_logic.dart | 3 +- .../card/cardList/cardList_page.dart | 24 ++++++----- .../face/faceList/faceList_logic.dart | 41 ++++++++++-------- .../face/faceList/faceList_page.dart | 33 ++++++--------- .../fingerprintList_logic.dart | 3 +- .../fingerprintList/fingerprintList_page.dart | 40 +++++++++--------- .../lockDetail/lockDetail_page.dart | 4 +- .../uploadElectricQuantity_logic.dart | 8 ++-- .../uploadElectricQuantity_page.dart | 8 ++-- .../uploadElectricQuantity_state.dart | 4 ++ .../palm/palmList/palmList_page.dart | 20 ++++----- .../passwordKeyList/passwordKeyList_page.dart | 42 +++++++++---------- .../remoteControlList_page.dart | 18 ++++---- 13 files changed, 124 insertions(+), 124 deletions(-) diff --git a/lib/main/lockDetail/card/cardList/cardList_logic.dart b/lib/main/lockDetail/card/cardList/cardList_logic.dart index cb5c420c..f57cde7c 100755 --- a/lib/main/lockDetail/card/cardList/cardList_logic.dart +++ b/lib/main/lockDetail/card/cardList/cardList_logic.dart @@ -131,8 +131,7 @@ class CardListLogic extends BaseGetXController { privateKey: getPrivateKeyList, token: getTokenList, isBeforeAddUser: false); - } else if (deviceConnectionState == - BluetoothConnectionState.disconnected) { + } else if (deviceConnectionState == BluetoothConnectionState.disconnected) { dismissEasyLoading(); cancelBlueConnetctToastTimer(); if (state.ifCurrentScreen.value == true) { diff --git a/lib/main/lockDetail/card/cardList/cardList_page.dart b/lib/main/lockDetail/card/cardList/cardList_page.dart index 8dba8e5b..9dc6a76f 100755 --- a/lib/main/lockDetail/card/cardList/cardList_page.dart +++ b/lib/main/lockDetail/card/cardList/cardList_page.dart @@ -110,14 +110,16 @@ class _CardListPageState extends State with RouteAware { btnName: '添加卡'.tr, onClick: () async { - final data = await Get.toNamed(Routers.addCardPage, + await Get.toNamed(Routers.addCardPage, arguments: { 'lockId': state.lockId.value, 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - }); - if (data != null) { + })!.then((value) { getHttpData(isRefresh: true); - } + }); + // if (data != null) { + // getHttpData(isRefresh: true); + // } }, ), SizedBox( @@ -174,13 +176,13 @@ class _CardListPageState extends State with RouteAware { fingerprintItemData.cardName!, logic.getKeyType(fingerprintItemData), logic.getKeyDateType(fingerprintItemData), () async { - final data = await Get.toNamed(Routers.cardDetailPage, - arguments: { - 'fingerprintItemData': fingerprintItemData, - }); - if (data != null) { - getHttpData(isRefresh: true); - } + await Get.toNamed(Routers.cardDetailPage, + arguments: { + 'fingerprintItemData': fingerprintItemData, + })!.then((value) => getHttpData(isRefresh: true)); + // if (data != null) { + // getHttpData(isRefresh: true); + // } }), ); }, diff --git a/lib/main/lockDetail/face/faceList/faceList_logic.dart b/lib/main/lockDetail/face/faceList/faceList_logic.dart index 05494f98..c03900a0 100755 --- a/lib/main/lockDetail/face/faceList/faceList_logic.dart +++ b/lib/main/lockDetail/face/faceList/faceList_logic.dart @@ -298,7 +298,11 @@ class FaceListLogic extends BaseGetXController { } // 获取人脸列表 - Future getFaceListData() async { + Future getFaceListData({required bool isRefresh}) async { + if (isRefresh) { + state.faceItemListData.clear(); + pageNo = 1; + } final FingerprintListDataEntity entity = await ApiRepository.to.getFaceListData( lockId: state.lockId.value.toString(), pageNo: pageNo.toString(), @@ -307,21 +311,27 @@ class FaceListLogic extends BaseGetXController { ); if (entity.errorCode!.codeIsSuccessful) { // state.faceItemListData.value = entity.data!.list!; - if (pageNo == 1) { - state.faceItemListData.value = entity.data!.list!; + // if (pageNo == 1) { + // state.faceItemListData.value = entity.data!.list!; + // pageNo++; + // } else { + // if (entity.data!.list!.isNotEmpty) { + // state.faceItemListData.value.addAll(entity.data!.list!); + // pageNo++; + // } + // } + if (entity.errorCode!.codeIsSuccessful) { + // 更新数据列表 + state.faceItemListData.addAll(entity.data!.list!); + // 更新页码 pageNo++; - } else { - if (entity.data!.list!.isNotEmpty) { - state.faceItemListData.value.addAll(entity.data!.list!); - pageNo++; - } } } return entity; } // 删除的人脸 - void deletFacesData() async { + Future deletFacesData() async { String faceId = ''; if (state.isDeletAll == false) { faceId = state.deletKeyID; @@ -331,9 +341,8 @@ class FaceListLogic extends BaseGetXController { lockId: state.lockId.value, ); if (entity.errorCode!.codeIsSuccessful) { - showToast('删除成功', something: (){ - pageNo = 1; - getFaceListData(); + showToast('删除成功'.tr, something: (){ + getFaceListData(isRefresh: true); }); } } @@ -350,9 +359,8 @@ class FaceListLogic extends BaseGetXController { lockId: state.lockId.value, ); if (entity.errorCode!.codeIsSuccessful) { - showToast('重置成功', something: (){ - pageNo = 1; - getFaceListData(); + showToast('重置成功'.tr, something: (){ + getFaceListData(isRefresh: true); }); } } @@ -387,8 +395,7 @@ class FaceListLogic extends BaseGetXController { late StreamSubscription _teamEvent; void _initRefreshAction() { _teamEvent = eventBus.on().listen((OtherTypeRefreshListEvent event) { - pageNo = 1; - getFaceListData(); + getFaceListData(isRefresh: true); }); } diff --git a/lib/main/lockDetail/face/faceList/faceList_page.dart b/lib/main/lockDetail/face/faceList/faceList_page.dart index d1ad4ebf..0303ea41 100755 --- a/lib/main/lockDetail/face/faceList/faceList_page.dart +++ b/lib/main/lockDetail/face/faceList/faceList_page.dart @@ -31,10 +31,10 @@ class _FaceListPageState extends State with RouteAware { final FaceListLogic logic = Get.put(FaceListLogic()); final FaceListState state = Get.find().state; - Future getHttpData() async { + Future getHttpData({required bool isRefresh}) async { final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { - logic.getFaceListData().then((FingerprintListDataEntity value) { + logic.getFaceListData(isRefresh: isRefresh).then((FingerprintListDataEntity value) { if (mounted) { setState(() {}); } @@ -46,7 +46,7 @@ class _FaceListPageState extends State with RouteAware { void initState() { super.initState(); - getHttpData(); + getHttpData(isRefresh: true); } @override @@ -92,19 +92,17 @@ class _FaceListPageState extends State with RouteAware { ), body: EasyRefreshTool( onRefresh: () { - logic.pageNo = 1; - getHttpData(); + getHttpData(isRefresh: true); }, onLoad: () { - getHttpData(); + getHttpData(isRefresh: false); }, child: Column( children: [ KeySearchWidget( editingController: state.searchController, onSubmittedAction: () { - logic.pageNo = 1; - getHttpData(); + getHttpData(isRefresh: true); }, ), SizedBox( @@ -115,15 +113,12 @@ class _FaceListPageState extends State with RouteAware { btnName: '添加人脸'.tr, onClick: () async { - final data = await Get.toNamed(Routers.addFaceTypePage, - arguments: { + await Get.toNamed(Routers.addFaceTypePage, arguments: { 'lockId': state.lockId.value, 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - }); - if (data != null) { - logic.pageNo = 1; - getHttpData(); - } + })!.then((value) { + getHttpData(isRefresh: true); + }); }, ), SizedBox(height: 64.h) @@ -158,14 +153,10 @@ class _FaceListPageState extends State with RouteAware { getFaceItemData.faceName!, logic.getKeyType(getFaceItemData), logic.getKeyDateType(getFaceItemData), () async { - final data = await Get.toNamed(Routers.faceDetailPage, + await Get.toNamed(Routers.faceDetailPage, arguments: { 'faceItemData': getFaceItemData, - }); - if (data != null) { - logic.pageNo = 1; - getHttpData(); - } + })!.then((value) => getHttpData(isRefresh: true)); }), ); } diff --git a/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_logic.dart b/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_logic.dart index 178733e2..84237ed4 100755 --- a/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_logic.dart +++ b/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_logic.dart @@ -328,8 +328,7 @@ class FingerprintListLogic extends BaseGetXController { */ // 获取指纹列表 - Future getFingerprintsListData( - {required bool isRefresh}) async { + Future getFingerprintsListData({required bool isRefresh}) async { // 如果是下拉刷新,清空已有数据 if (isRefresh) { state.fingerprintItemListData.clear(); diff --git a/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart b/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart index 9e902e4b..9049dd12 100755 --- a/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart +++ b/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart @@ -113,14 +113,14 @@ class _FingerprintListPageState extends State btnName: '添加指纹'.tr, onClick: () async { - final data = await Get.toNamed(Routers.addFingerprintTypePage, + await Get.toNamed(Routers.addFingerprintTypePage, arguments: { 'lockId': state.lockId.value, 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - }); - if (data != null) { - getHttpData(isRefresh: true); - } + })!.then((value) => getHttpData(isRefresh: true)); + // if (data != null) { + // getHttpData(isRefresh: true); + // } }, ), SizedBox(height: 64.h) @@ -175,23 +175,21 @@ class _FingerprintListPageState extends State fingerprintItemData.fingerprintName!, logic.getKeyType(fingerprintItemData), logic.getKeyDateType(fingerprintItemData), () async { - final data = await Get.toNamed( - Routers.fingerprintDetailPage, - arguments: { + await Get.toNamed(Routers.fingerprintDetailPage, arguments: { 'fingerprintItemData': fingerprintItemData, - }); - if (data == 'deletScuess') { - state.fingerprintItemListData.removeWhere( - (FingerprintItemData item) => - item.fingerprintId == - fingerprintItemData.fingerprintId!); - setState(() {}); - } else if (data != null) { - logic - .refreshIndividualKeys( - fingerprintId: fingerprintItemData.fingerprintId!) - .then((dynamic value) => setState(() {})); - } + })!.then((value) { + getHttpData(isRefresh: true); + }); + // if (data == 'deletScuess') { + // // state.fingerprintItemListData.removeWhere((FingerprintItemData item) => item.fingerprintId == fingerprintItemData.fingerprintId!); + // // setState(() {}); + // getHttpData(isRefresh: true); + // } else if (data != null) { + // logic + // .refreshIndividualKeys( + // fingerprintId: fingerprintItemData.fingerprintId!) + // .then((dynamic value) => setState(() {})); + // } }), ); }, diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 5c51da64..ec5a7e81 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -1227,7 +1227,7 @@ class _LockDetailPageState extends State fit: BoxFit.fitWidth), ), ), - SizedBox(height: 10.w), + SizedBox(height: 5.w), Expanded( child: Text(name, style: TextStyle( @@ -1260,7 +1260,7 @@ class _LockDetailPageState extends State fit: BoxFit.fitWidth), ), ), - SizedBox(height: 20.h), + SizedBox(height: 5.h), Text( name, style: TextStyle( diff --git a/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_logic.dart b/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_logic.dart index 11be080d..23d80a44 100755 --- a/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_logic.dart +++ b/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_logic.dart @@ -108,13 +108,13 @@ class UploadElectricQuantityLogic extends BaseGetXController { // 电池剩余电量 final int battRemCap = reply.data[132]; - state.lockSetInfoData.value.lockBasicInfo!.electricQuantity = - battRemCap; + state.battRemCap.value = battRemCap>100?100:battRemCap; + state.lockSetInfoData.value.lockBasicInfo!.electricQuantity = state.battRemCap.value; // 备用电池剩余电量 final int battRemCapStandby = reply.data[133]; - state.lockSetInfoData.value.lockBasicInfo!.electricQuantityStandby = - battRemCapStandby; + state.battRemCapStandby.value = battRemCapStandby>100?100:battRemCapStandby; + state.lockSetInfoData.value.lockBasicInfo!.electricQuantityStandby = state.battRemCapStandby.value; uploadElectricQuantityRequest( battRemCap.toString(), battRemCapStandby.toString()); diff --git a/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart b/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart index 02096b54..1aea288a 100755 --- a/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart +++ b/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart @@ -57,23 +57,23 @@ class _UploadElectricQuantityPageState extends State children: [ Expanded( child: Text( - "${"电池1".tr}${TranslationLoader.lanKeys!.electricQuantity!.tr}:${state.lockBasicInfo.value.electricQuantity ?? ""}%", + "${"电池1".tr}${TranslationLoader.lanKeys!.electricQuantity!.tr}:${state.battRemCap.value}%", style: TextStyle(fontSize: 20.sp), )), ], )), Visibility( visible: (state.lockSetInfoData.value.lockFeature ?? LockFeature()).isSupportBackupBattery == 1, - child: Row( + child: Obx(() => Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( child: Text( - "${"电池2".tr}${TranslationLoader.lanKeys!.electricQuantity!.tr}:${state.lockBasicInfo.value.electricQuantityStandby ?? ""}%", + "${"电池2".tr}${TranslationLoader.lanKeys!.electricQuantity!.tr}:${state.battRemCapStandby.value}%", style: TextStyle(fontSize: 20.sp), )), ], - ), + )), ), SizedBox(height: 10.h), Obx(() => Row( diff --git a/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_state.dart b/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_state.dart index 2a49df8c..4898804f 100755 --- a/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_state.dart +++ b/lib/main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_state.dart @@ -12,12 +12,16 @@ class UploadElectricQuantityState {// 0普通状态可用 1不可用 if(lockSetInfoData.value.lockBasicInfo!=null){ lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!; uploadElectricQuantityDate.value = lockSetInfoData.value.lockBasicInfo!.electricQuantityDate!; + battRemCap.value = lockSetInfoData.value.lockBasicInfo!.electricQuantity ?? 0; + battRemCapStandby.value = lockSetInfoData.value.lockBasicInfo!.electricQuantityStandby ?? 0; } } } Rx lockSetInfoData = LockSetInfoData().obs; Rx lockBasicInfo = LockBasicInfo().obs; RxInt uploadElectricQuantityDate = 0.obs; + RxInt battRemCap = 0.obs; + RxInt battRemCapStandby = 0.obs; int differentialTime = 0; RxBool ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示 diff --git a/lib/main/lockDetail/palm/palmList/palmList_page.dart b/lib/main/lockDetail/palm/palmList/palmList_page.dart index 7cbc8872..190098eb 100755 --- a/lib/main/lockDetail/palm/palmList/palmList_page.dart +++ b/lib/main/lockDetail/palm/palmList/palmList_page.dart @@ -108,13 +108,13 @@ class _PalmListPageState extends State with RouteAware { AddBottomWhiteBtn( btnName: '添加掌静脉', onClick: () async { - final data = await Get.toNamed(Routers.addPalmTypePage, arguments: { + await Get.toNamed(Routers.addPalmTypePage, arguments: { 'lockId': state.lockId.value, 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - }); - if (data != null) { - getHttpData(isRefresh: true); - } + })!.then((value) => getHttpData(isRefresh: true)); + // if (data != null) { + // getHttpData(isRefresh: true); + // } }, ), SizedBox( @@ -171,13 +171,13 @@ class _PalmListPageState extends State with RouteAware { fingerprintItemData.palmVeinName!, logic.getKeyType(fingerprintItemData), logic.getKeyDateType(fingerprintItemData), () async { - final data = await Get.toNamed(Routers.palmDetailPage, + final data = await Get.toNamed(Routers.palmDetailPage, arguments: { 'fingerprintItemData': fingerprintItemData, - }); - if (data != null) { - getHttpData(isRefresh: true); - } + })!.then((value) => getHttpData(isRefresh: true)); + // if (data != null) { + // getHttpData(isRefresh: true); + // } }), ); }, diff --git a/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart b/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart index ac96dbb8..30d1cf37 100755 --- a/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart +++ b/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart @@ -112,12 +112,11 @@ class _PasswordKeyListPageState extends State ), AddBottomWhiteBtn( btnName: '获取密码'.tr, - onClick: () { - Navigator.pushNamed( - context, Routers.passwordKeyPerpetualPage, + onClick: () async { + await Get.toNamed(Routers.passwordKeyPerpetualPage, arguments: { 'keyInfo': state.keyInfo.value - }).then((Object? val) { + })!.then((Object? val) { if (val != null) { getHttpData(isRefresh: true); } @@ -179,25 +178,26 @@ class _PasswordKeyListPageState extends State ], ), child: _electronicKeyItem(index, 'images/icon_password.png', - passwordKeyListItem.keyboardPwdName!, useDateStr, () { - Navigator.pushNamed(context, Routers.passwordKeyDetailPage, + passwordKeyListItem.keyboardPwdName!, useDateStr, () async { + await Get.toNamed(Routers.passwordKeyDetailPage, arguments: { 'itemData': passwordKeyListItem - }).then((Object? val) { - if (val == 'deletScuess') { - state.itemDataList.removeWhere( - (PasswordKeyListItem item) => - item.keyboardPwdId == - passwordKeyListItem.keyboardPwdId!); - setState(() {}); - } else if (val != null) { - logic - .refreshIndividualKeys( - lockId: passwordKeyListItem.lockId!, - keyboardPwdId: - passwordKeyListItem.keyboardPwdId!) - .then((dynamic value) => setState(() {})); - } + })!.then((Object? val) { + getHttpData(isRefresh: true); + // if (val == 'deletScuess') { + // state.itemDataList.removeWhere( + // (PasswordKeyListItem item) => + // item.keyboardPwdId == + // passwordKeyListItem.keyboardPwdId!); + // setState(() {}); + // } else if (val != null) { + // logic + // .refreshIndividualKeys( + // lockId: passwordKeyListItem.lockId!, + // keyboardPwdId: + // passwordKeyListItem.keyboardPwdId!) + // .then((dynamic value) => setState(() {})); + // } }); }), ); diff --git a/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart b/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart index f217c93f..65819360 100755 --- a/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart +++ b/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart @@ -110,14 +110,14 @@ class _RemoteControlListPageState extends State with Rout btnName: '添加遥控', onClick: () async { - final data = await Get.toNamed(Routers.addRemoteControlTypePage, + await Get.toNamed(Routers.addRemoteControlTypePage, arguments: { 'lockId': state.lockId.value, 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - }); - if (data != null) { - getHttpData(isRefresh: true); - } + })!.then((value) => getHttpData(isRefresh: true)); + // if (data != null) { + // getHttpData(isRefresh: true); + // } }, ), SizedBox( @@ -172,13 +172,13 @@ class _RemoteControlListPageState extends State with Rout fingerprintItemData.remoteName!, logic.getKeyType(fingerprintItemData), logic.getKeyDateType(fingerprintItemData), () async { - final data = await Get.toNamed(Routers.remoteControlDetailPage, + await Get.toNamed(Routers.remoteControlDetailPage, arguments: { 'fingerprintItemData': fingerprintItemData, - }); - if (data != null) { + })!.then((data) { getHttpData(isRefresh: true); - } + }); + }), ); }, From a527b4337fa312fd7f60c779a6206a4a0e1a69d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Sat, 10 Aug 2024 10:38:00 +0800 Subject: [PATCH 08/15] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8D=E6=97=A0?= =?UTF-8?q?=E7=BD=91=E7=BB=9C=E6=83=85=E5=86=B5=E4=B8=8B=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=97=A0=E6=95=88=E5=BC=80=E9=94=81=E6=9D=83?= =?UTF-8?q?=E9=99=90bug=202=E3=80=81=E4=BF=AE=E5=A4=8D=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E7=AE=A1=E7=90=86=E5=91=98=E5=BF=85=E9=A1=BB?= =?UTF-8?q?=E8=A6=81=E8=BE=93=E5=85=A5=E5=A7=93=E5=90=8D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=203=E3=80=81=E4=BF=AE=E5=A4=8D=E6=97=A0=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E6=97=A0=E6=95=88=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E7=AE=A1=E7=90=86=E5=91=98=E7=82=B9=E5=87=BB=E4=BB=85?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=88=9B=E5=BB=BA=E7=94=A8=E6=88=B7=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../authorizedAdmin/authorizedAdmin_logic.dart | 8 ++++---- .../electronicKeyDetail/electronicKeyDetail_logic.dart | 5 +++++ .../electronicKeyDetail/electronicKeyDetail_page.dart | 10 ++++------ .../hideInvalidUnlockPermissions_page.dart | 5 ++--- pubspec.yaml | 4 +++- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_logic.dart b/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_logic.dart index 5fa6bac4..1719a67f 100755 --- a/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_logic.dart +++ b/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_logic.dart @@ -120,10 +120,10 @@ class AuthorizedAdminLogic extends BaseGetXController { showToast('请输入接收者账号'); return; } - if (state.keyNameController.text.isEmpty) { - showToast('请输入接收者姓名'); - return; - } + // if (state.keyNameController.text.isEmpty) { + // showToast('请输入接收者姓名'); + // return; + // } String startDate = '0'; String endDate = '0'; diff --git a/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart b/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart index bb24a222..5394afba 100755 --- a/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart +++ b/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart @@ -63,6 +63,11 @@ class ElectronicKeyDetailLogic extends BaseGetXController { state.onlyManageYouCreatesUser.value == true ? 1 : 0, remoteEnable: state.isRemoteUnlock.value == true ? 1 : 2); if (entity.errorCode!.codeIsSuccessful) { + if(updateType == 1){ + state.onlyManageYouCreatesUser.value = !state.onlyManageYouCreatesUser.value; + }else if(updateType == 2){ + state.isRemoteUnlock.value = !state.isRemoteUnlock.value; + } showToast('修改成功'.tr, something: () { eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(AuthorizedAdminPageRefreshUI()); diff --git a/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart b/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart index caa423e7..bde6db3b 100755 --- a/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart +++ b/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart @@ -217,7 +217,7 @@ class _ElectronicKeyDetailPageState extends State { isHaveRightWidget: true, isHaveLine: true, rightWidget: SizedBox( - width: 60.w, child: _onlyManageYouCreatesUserSwitch())), + width: 60.w, child: Obx(_onlyManageYouCreatesUserSwitch))), ), Obx( () => Visibility( @@ -334,7 +334,7 @@ class _ElectronicKeyDetailPageState extends State { thumbColor: CupertinoColors.white, value: state.isRemoteUnlock.value, onChanged: (bool value) { - state.isRemoteUnlock.value = !state.isRemoteUnlock.value; + // state.isRemoteUnlock.value = !state.isRemoteUnlock.value; logic.updateKeyDateRequest(2); }, ); @@ -347,11 +347,9 @@ class _ElectronicKeyDetailPageState extends State { thumbColor: CupertinoColors.white, value: state.onlyManageYouCreatesUser.value, onChanged: (bool value) { - setState(() { - state.onlyManageYouCreatesUser.value = - !state.onlyManageYouCreatesUser.value; + // setState(() { logic.updateKeyDateRequest(1); - }); + // }); }, ); } diff --git a/lib/mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart b/lib/mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart index 30ce4543..d80e2c0e 100755 --- a/lib/mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart +++ b/lib/mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart @@ -95,9 +95,7 @@ class _HideInvalidUnlockPermissionsPageState padding: EdgeInsets.only(top: 20.w, bottom: 20.w), onClick: () { _isFirst = false; - setState(() { - _isOn = !_isOn; - }); + _isOn = !_isOn; changeSettingsRequest(); }), ], @@ -110,6 +108,7 @@ class _HideInvalidUnlockPermissionsPageState ExpireLockListEntity entity = await ApiRepository.to.changeSettings(_isOn == true ? '1' : '2', '2'); if (entity.errorCode!.codeIsSuccessful) { + setState(() {}); EasyLoading.showToast("操作成功",duration: 2000.milliseconds); } } diff --git a/pubspec.yaml b/pubspec.yaml index d2cc8821..7dbfcc9c 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -83,8 +83,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.71+2024072902:xhj 线上环境,提交测试:回归 bug # 1.0.72+2024080501:xhj 预发布环境,提交测试:回归 bug # 1.0.73+2024080801:xhj 预发布环境,提交测试:回归 Tapd优2优及测试部门8月8号之前bug +# 1.0.74+2024080901:xhj 预发布环境,提交测试:回归 8月9号之前bug +# 1.0.75+2024081001:xhj 预发布环境,提交测试:回归 8月9号之前bug -version: 1.0.73+2024080801 +version: 1.0.74+2024080901 environment: sdk: '>=2.12.0 <3.0.0' From 85d7401ed240bed498ebe930d08af6ea18e16c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Sat, 10 Aug 2024 14:10:43 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=94=81=E6=97=B6=E4=BB=8E=E6=89=80=E6=9C=89=E9=94=81=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E5=BC=95=E8=B5=B7=E7=9A=84=E6=9D=83=E9=99=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addLock/nearbyLock/nearbyLock_logic.dart | 22 +++++++++---------- .../selectLockType/selectLockType_logic.dart | 19 ++++++++++++++++ .../selectLockType/selectLockType_page.dart | 3 ++- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/lib/mine/addLock/nearbyLock/nearbyLock_logic.dart b/lib/mine/addLock/nearbyLock/nearbyLock_logic.dart index f34fa137..61f35c3c 100755 --- a/lib/mine/addLock/nearbyLock/nearbyLock_logic.dart +++ b/lib/mine/addLock/nearbyLock/nearbyLock_logic.dart @@ -663,17 +663,17 @@ class NearbyLockLogic extends BaseGetXController { Future getNearByLimits() async { if (!Platform.isIOS) { - bool bluetoothRequest = false; - try { - bluetoothRequest = await PermissionDialog.requestBluetooth(); - AppLog.log('bluetoothRequest:$bluetoothRequest'); - if (!bluetoothRequest) { - return; - } - } catch (e) { - AppLog.log('bluetoothRequest:$e'); - } - + // bool bluetoothRequest = false; + // try { + // bluetoothRequest = await PermissionDialog.requestBluetooth(); + // AppLog.log('bluetoothRequest:$bluetoothRequest'); + // if (!bluetoothRequest) { + // return; + // } + // } catch (e) { + // AppLog.log('bluetoothRequest:$e'); + // } + final bool bluetoothRequest = await PermissionDialog.requestBluetooth(); final bool locationRequest = await PermissionDialog.request(Permission.location); AppLog.log('locationRequest:$locationRequest'); if (!bluetoothRequest || !locationRequest) { diff --git a/lib/mine/addLock/selectLockType/selectLockType_logic.dart b/lib/mine/addLock/selectLockType/selectLockType_logic.dart index 2e5d8186..2f74b71d 100755 --- a/lib/mine/addLock/selectLockType/selectLockType_logic.dart +++ b/lib/mine/addLock/selectLockType/selectLockType_logic.dart @@ -1,7 +1,13 @@ +import 'dart:io'; + +import 'package:get/get.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/commonDataManage.dart'; +import '../../../appRouters.dart'; import '../../../network/api_repository.dart'; +import '../../../widget/permission/permission_dialog.dart'; import 'selectLockType_state.dart'; class SelectLockTypeLogic extends BaseGetXController { @@ -13,6 +19,19 @@ class SelectLockTypeLogic extends BaseGetXController { } } + //跳转到附近的锁页面先判断权限 + Future getNearByLimits() async { + if (!Platform.isIOS) { + final bool locationRequest = await PermissionDialog.request(Permission.location); + final bool bluetoothRequest = await PermissionDialog.requestBluetooth(); + if (!bluetoothRequest || !locationRequest) { + return; + } + } + + Get.toNamed(Routers.nearbyLockPage); + } + @override void onInit() { super.onInit(); diff --git a/lib/mine/addLock/selectLockType/selectLockType_page.dart b/lib/mine/addLock/selectLockType/selectLockType_page.dart index c7646ac5..bbd8fff8 100755 --- a/lib/mine/addLock/selectLockType/selectLockType_page.dart +++ b/lib/mine/addLock/selectLockType/selectLockType_page.dart @@ -190,7 +190,8 @@ class _SelectLockTypePageState extends State with BaseWidget return GestureDetector( onTap: () { CommonDataManage().seletLockType = 0; - Get.toNamed(Routers.nearbyLockPage); + logic.getNearByLimits(); + // Get.toNamed(Routers.nearbyLockPage); }, child: view, ); From 43f969b6c2cd1f7ad0d8af5d0634f0ae38302ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Sat, 10 Aug 2024 14:14:26 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E9=94=81=E5=AE=9A=E7=89=88=E6=9C=AC1.0.7?= =?UTF-8?q?5+2024081001=EF=BC=8C=E4=B8=8A=E6=9E=B6=E5=95=86=E5=9F=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7dbfcc9c..dd6ff3d2 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -84,9 +84,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.72+2024080501:xhj 预发布环境,提交测试:回归 bug # 1.0.73+2024080801:xhj 预发布环境,提交测试:回归 Tapd优2优及测试部门8月8号之前bug # 1.0.74+2024080901:xhj 预发布环境,提交测试:回归 8月9号之前bug -# 1.0.75+2024081001:xhj 预发布环境,提交测试:回归 8月9号之前bug +# 1.0.75+2024081001:锁定版本,上架商城 -version: 1.0.74+2024080901 +version: 1.0.75+2024081001 environment: sdk: '>=2.12.0 <3.0.0' From 6e0a314a71b04e53057c0c13874afa613aa46c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Mon, 12 Aug 2024 10:04:40 +0800 Subject: [PATCH 11/15] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E6=89=93=E5=8C=85=E6=98=AFlite=E7=89=88=E6=9C=AC=202=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=81=E9=80=9A=E9=80=9A=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=BC=80=E9=94=81=E6=8C=89=E9=92=AE=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=8A=A8=E6=95=88=E9=97=AE=E9=A2=98=203=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=89=88=E6=9C=AC=E4=B8=8A=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockDetail/lockDetail_page.dart | 38 +++++++++---------- pre_build.sh | 4 +- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index ec5a7e81..e997e18b 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -89,18 +89,10 @@ class _LockDetailPageState extends State //鑫泓佳布局 Widget xhjWidget() { - final bool isShowTip = (state.keyInfos.value.keyType == - XSConstantMacro.keyTypeTime || - state.keyInfos.value.keyType == - XSConstantMacro.keyTypeLoop) && // 限时、循环 - (DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <= - 15 && - DateTool() - .compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >= - 0) && // 0到30天 - (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse || - state.keyInfos.value.keyStatus == - XSConstantMacro.keyStatusWaitReceive); + final bool isShowTip = + (state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) + && (DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <= 15 && DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >= 0) + && (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitReceive); return Scaffold( backgroundColor: Colors.white, body: Obx(() { @@ -1393,7 +1385,13 @@ class _LockDetailPageState extends State } //如果需要实名认证,需认证完成,方可开锁 - void isNeedRealNameAuthThenOpenLock() { + Future isNeedRealNameAuthThenOpenLock() async { + final bool isNetWork = await LockMainLogic.to()?.judgeTheNetwork() ?? false; + final bool isOpenLockNeedOnline = state.isOpenLockNeedOnline.value == 0; + if (!isOpenLockNeedOnline && !isNetWork) { + return; + } + state.nextAuthTime.value = state.keyInfos.value.nextFaceValidateTime ?? 0; if (state.keyInfos.value.faceAuthentication == 1 && state.nextAuthTime.value > 0 && @@ -1404,24 +1402,24 @@ class _LockDetailPageState extends State state.nextAuthTime.value = getNextAuthTime; if (isSuccess) { // 认证成功,去开锁 - startOpenLock(); + setState(startOpenLock); } }).initAliyunRealNameAuth(); } else { //无需认证,直接开锁 - startOpenLock(); + setState(startOpenLock); } } - Future startOpenLock() async { + void startOpenLock() { if (state.openLockBtnState.value == 1) { return; } - final bool isNetWork = await LockMainLogic.to()?.judgeTheNetwork() ?? false; + // final bool isNetWork = await LockMainLogic.to()?.judgeTheNetwork() ?? false; final bool isOpenLockNeedOnline = state.isOpenLockNeedOnline.value == 0; - if (!isOpenLockNeedOnline && !isNetWork) { - return; - } + // if (!isOpenLockNeedOnline && !isNetWork) { + // return; + // } state.iSOpenLock.value = true; state.openLockBtnState.value = 1; state.animationController!.forward(); diff --git a/pre_build.sh b/pre_build.sh index f996e68c..af1aadb1 100755 --- a/pre_build.sh +++ b/pre_build.sh @@ -25,11 +25,11 @@ case $environment in api_prefix='https://pre.lock.star-lock.cn' ;; sky) - main_file="lib/main_sky_full.dart" + main_file="lib/main_sky_lite.dart" api_prefix='https://lock.skychip.top' ;; xhj) - main_file="lib/main_xhj_full.dart" + main_file="lib/main_xhj_lite.dart" api_prefix='https://lock.xhjcn.ltd' ;; local) From d756d1cc0c6f0de88803dcb1e89ef890431d6c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Mon, 12 Aug 2024 10:05:14 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=8A=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index dd6ff3d2..e4bf33b5 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -86,7 +86,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.74+2024080901:xhj 预发布环境,提交测试:回归 8月9号之前bug # 1.0.75+2024081001:锁定版本,上架商城 -version: 1.0.75+2024081001 +version: 1.0.76+2024081201 environment: sdk: '>=2.12.0 <3.0.0' From 75ffd0a68f4a648d9f096473e63aabdca5d554b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDaisyWu=E2=80=9D?= <“18682150237@163.com”> Date: Mon, 12 Aug 2024 14:30:55 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E6=9C=80=E6=96=B0=E4=B8=8A=E6=9E=B6?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E5=A4=87=E6=B3=A81.0.76?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pubspec.yaml b/pubspec.yaml index e4bf33b5..1cce6c6f 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -85,6 +85,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.73+2024080801:xhj 预发布环境,提交测试:回归 Tapd优2优及测试部门8月8号之前bug # 1.0.74+2024080901:xhj 预发布环境,提交测试:回归 8月9号之前bug # 1.0.75+2024081001:锁定版本,上架商城 +# 1.0.76+2024081201:锁定版本,上架商城 version: 1.0.76+2024081201 From eeef2a773c4a0c84469505080db360744fa7722a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDaisyWu=E2=80=9D?= <“18682150237@163.com”> Date: Mon, 12 Aug 2024 14:31:32 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 1cce6c6f..b7e7a934 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -85,7 +85,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.73+2024080801:xhj 预发布环境,提交测试:回归 Tapd优2优及测试部门8月8号之前bug # 1.0.74+2024080901:xhj 预发布环境,提交测试:回归 8月9号之前bug # 1.0.75+2024081001:锁定版本,上架商城 -# 1.0.76+2024081201:锁定版本,上架商城 +# 1.0.76+2024081201:锁定版本,上架商城--最新版本 version: 1.0.76+2024081201 From f32f2b5a6c775495a15a8d6dea4ddbe40d9309af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Wed, 14 Aug 2024 13:37:02 +0800 Subject: [PATCH 15/15] =?UTF-8?q?shell=E8=84=9A=E6=9C=AC=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=89=93=E5=8C=85aab=E5=8C=85=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pre_build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pre_build.sh b/pre_build.sh index af1aadb1..9a2689a7 100755 --- a/pre_build.sh +++ b/pre_build.sh @@ -105,5 +105,6 @@ echo -e "\n* 没有发现废弃 API,开始编译" # 编译命令 #flutter clean && flutter pub get -flutter build apk --flavor $environment -t $main_file +#flutter build apk --flavor $environment -t $main_file #flutter build ios --flavor $environment -t $main_file +flutter build appbundle --flavor $environment -t $main_file