From 3de600acda96c868ca22b87feabe50699d7d862a Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Mon, 24 Jun 2024 17:38:34 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=20=E6=97=A0=E7=BD=91?= =?UTF-8?q?=E7=BB=9C=E7=8A=B6=E6=80=81=E5=8F=AF=E4=BB=A5=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=88=A0=E9=99=A4=EF=BC=8C=E5=8D=A1/?= =?UTF-8?q?=E5=AF=86=E7=A0=81/=E6=8C=87=E7=BA=B9=E7=AD=89=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../starLock_forgetPassword_page.dart | 40 +- .../starLock_forgetPassword_xhj_page.dart | 25 +- lib/main.dart | 6 +- .../card/cardList/cardList_page.dart | 6 + .../electronicKeyList_page.dart | 6 + .../face/faceList/faceList_page.dart | 6 + .../fingerprintList/fingerprintList_page.dart | 6 + .../iris/irisList/irisList_page.dart | 6 + .../lockSet/lockSet/lockSet_page.dart | 408 +++++++++--------- .../wirelessKeyboard_page.dart | 7 + .../palm/palmList/palmList_page.dart | 6 + .../passwordKeyList/passwordKeyList_page.dart | 11 +- .../remoteControlList_page.dart | 6 + .../lockMian/lockMain/lockMain_logic.dart | 19 +- 14 files changed, 318 insertions(+), 240 deletions(-) diff --git a/lib/login/forgetPassword/starLock_forgetPassword_page.dart b/lib/login/forgetPassword/starLock_forgetPassword_page.dart index 3569619a..27e22275 100755 --- a/lib/login/forgetPassword/starLock_forgetPassword_page.dart +++ b/lib/login/forgetPassword/starLock_forgetPassword_page.dart @@ -7,6 +7,7 @@ import 'package:get/get.dart'; import 'package:star_lock/app_settings/app_settings.dart'; import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_logic.dart'; import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_state.dart'; +import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart'; import '../../appRouters.dart'; import '../../app_settings/app_colors.dart'; @@ -23,9 +24,12 @@ class StarLockForgetPasswordPage extends StatefulWidget { _StarLockForgetPasswordPageState(); } -class _StarLockForgetPasswordPageState extends State { - final StarLockForgetPasswordLogic logic = Get.put(StarLockForgetPasswordLogic()); - final StarLockForgetPasswordState state = Get.find().state; +class _StarLockForgetPasswordPageState + extends State { + final StarLockForgetPasswordLogic logic = + Get.put(StarLockForgetPasswordLogic()); + final StarLockForgetPasswordState state = + Get.find().state; @override Widget build(BuildContext context) { @@ -57,7 +61,8 @@ class _StarLockForgetPasswordPageState extends State children: [ SizedBox(width: 5.w), Expanded( - child: Text(TranslationLoader.lanKeys!.countryAndRegion!.tr, + child: Text( + TranslationLoader.lanKeys!.countryAndRegion!.tr, style: TextStyle( fontSize: 26.sp, color: AppColors.blackColor))), SizedBox(width: 20.w), @@ -65,14 +70,14 @@ class _StarLockForgetPasswordPageState extends State mainAxisAlignment: MainAxisAlignment.end, children: [ Obx(() => Text( - '${state.countryName} +${state.countryCode}', - // state.isIphoneType.value - // ? '${state.countryName} +${state.countryCode}' - // : "${state.countryName}", - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 26.sp, color: AppColors.blackColor), - )) + '${state.countryName} +${state.countryCode}', + // state.isIphoneType.value + // ? '${state.countryName} +${state.countryCode}' + // : "${state.countryName}", + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 26.sp, color: AppColors.blackColor), + )) ], ), SizedBox(width: 5.w), @@ -95,14 +100,16 @@ class _StarLockForgetPasswordPageState extends State logic.checkNext(state.phoneController); }, leftWidget: Padding( - padding: EdgeInsets.only(top: 30.w, bottom: 20.w, right: 5.w, left: 5.w), + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 5.w, left: 5.w), child: Image.asset( 'images/icon_login_account.png', width: 36.w, height: 36.w, ), ), - hintText:TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, + hintText: + TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, keyboardType: TextInputType.number, inputFormatters: [ LengthLimitingTextInputFormatter(30), @@ -232,6 +239,11 @@ class _StarLockForgetPasswordPageState extends State isDisabled: state.canSub.value, onClick: state.canSub.value ? () { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } logic.resetPassword(); } : null); diff --git a/lib/login/forgetPassword/starLock_forgetPassword_xhj_page.dart b/lib/login/forgetPassword/starLock_forgetPassword_xhj_page.dart index 0fe04748..ae08975b 100755 --- a/lib/login/forgetPassword/starLock_forgetPassword_xhj_page.dart +++ b/lib/login/forgetPassword/starLock_forgetPassword_xhj_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -7,6 +6,7 @@ import 'package:star_lock/appRouters.dart'; import 'package:star_lock/app_settings/app_colors.dart'; import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_logic.dart'; import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_state.dart'; +import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart'; import 'package:star_lock/tools/submitBtn.dart'; import 'package:star_lock/tools/tf_loginInput.dart'; import 'package:star_lock/tools/titleAppBar.dart'; @@ -22,8 +22,10 @@ class StarLockForgetPasswordXHJPage extends StatefulWidget { class _StarLockForgetPasswordPageState extends State { - final StarLockForgetPasswordLogic logic = Get.put(StarLockForgetPasswordLogic()); - final StarLockForgetPasswordState state = Get.find().state; + final StarLockForgetPasswordLogic logic = + Get.put(StarLockForgetPasswordLogic()); + final StarLockForgetPasswordState state = + Get.find().state; @override Widget build(BuildContext context) { @@ -102,7 +104,7 @@ class _StarLockForgetPasswordPageState padding: EdgeInsets.only(top: 30.w, bottom: 20.w, left: 5.w), ), label: - '${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}', + '${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}', inputFormatters: [ LengthLimitingTextInputFormatter(20), ]), @@ -122,7 +124,7 @@ class _StarLockForgetPasswordPageState padding: EdgeInsets.only(top: 30.w, bottom: 20.w, left: 5.w), ), label: - '${TranslationLoader.lanKeys!.sure!.tr}${TranslationLoader.lanKeys!.password!.tr}', + '${TranslationLoader.lanKeys!.sure!.tr}${TranslationLoader.lanKeys!.password!.tr}', inputFormatters: [ LengthLimitingTextInputFormatter(20), ]), @@ -136,7 +138,7 @@ class _StarLockForgetPasswordPageState }, leftWidget: SizedBox(), hintText: - '${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}', + '${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}', inputFormatters: [ LengthLimitingTextInputFormatter(20), ]), @@ -179,14 +181,21 @@ class _StarLockForgetPasswordPageState Obx(() { return SubmitBtn( btnName: - '${TranslationLoader.lanKeys!.reset!.tr}${TranslationLoader.lanKeys!.password!.tr}', + '${TranslationLoader.lanKeys!.reset!.tr}${TranslationLoader.lanKeys!.password!.tr}', // backgroundColorList: state.canSub.value ? [AppColors.mainColor] :[Colors.grey], fontSize: 30.sp, borderRadius: 20.w, padding: EdgeInsets.only(top: 25.w, bottom: 25.w), isDisabled: state.canSub.value, onClick: state.canSub.value - ? logic.resetPassword + ? () { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } + logic.resetPassword(); + } : null); }), ], diff --git a/lib/main.dart b/lib/main.dart index d68c857f..38ebdf90 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -33,10 +33,12 @@ FutureOr main() async { final bool isLogin = await getLoginStatus(); if (isLogin) { await privacySDKInitialization(); - Future.delayed(const Duration(milliseconds: 500), () async{ + Future.delayed(const Duration(milliseconds: 500), () async { final GetAppInfo entity = await ApiRepository.to.getAppInfo(); CustomerTool.init(entity.data?.wechatServiceUrl ?? ''); - WxPayTool.setAssociationUrl(entity.data!.appSiteUrl!); + if (entity.data?.appSiteUrl != null) { + WxPayTool.setAssociationUrl(entity.data!.appSiteUrl!); + } }); } diff --git a/lib/main/lockDetail/card/cardList/cardList_page.dart b/lib/main/lockDetail/card/cardList/cardList_page.dart index e7e7a4c2..7e201210 100755 --- a/lib/main/lockDetail/card/cardList/cardList_page.dart +++ b/lib/main/lockDetail/card/cardList/cardList_page.dart @@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/card/cardList/cardList_state.dart'; +import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart'; import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; @@ -68,6 +69,11 @@ class _CardListPageState extends State with RouteAware { onPressed: () async { final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } ShowTipView().showIosTipWithContentDialog( '重置后,该锁的卡都将被删除哦,确认要重置吗?'.tr, () async { state.isDeletAll = true; diff --git a/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart b/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart index be44eeee..df183855 100755 --- a/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart +++ b/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart @@ -6,6 +6,7 @@ import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_logic.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_state.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; +import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart'; import 'package:star_lock/tools/noData.dart'; import 'package:star_lock/tools/storage.dart'; @@ -67,6 +68,11 @@ class _ElectronicKeyListPageState extends State { final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } ShowTipView().showIosTipWithContentDialog( '该锁的电子钥匙都将被删除'.tr, logic.resetElectronicKeyListRequest); } else { diff --git a/lib/main/lockDetail/face/faceList/faceList_page.dart b/lib/main/lockDetail/face/faceList/faceList_page.dart index 947627e9..6b1ec731 100755 --- a/lib/main/lockDetail/face/faceList/faceList_page.dart +++ b/lib/main/lockDetail/face/faceList/faceList_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/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.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 'package:star_lock/tools/showTipView.dart'; @@ -63,6 +64,11 @@ class _FaceListPageState extends State with RouteAware { onPressed: () async { var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } // showDeletAlertDialog(context); ShowTipView().showIosTipWithContentDialog( "重置后,该锁的人脸都将被删除哦,确认要重置吗?", () async { diff --git a/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart b/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart index 09c5759e..c654e693 100755 --- a/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart +++ b/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart @@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintList_state.dart'; +import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart'; import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; @@ -69,6 +70,11 @@ class _FingerprintListPageState extends State onPressed: () async { final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } ShowTipView().showIosTipWithContentDialog( '重置后,该锁的指纹都将被删除哦,确认要重置吗?'.tr, () async { state.isDeletAll = true; diff --git a/lib/main/lockDetail/iris/irisList/irisList_page.dart b/lib/main/lockDetail/iris/irisList/irisList_page.dart index 6a12c535..bc4f4fe8 100755 --- a/lib/main/lockDetail/iris/irisList/irisList_page.dart +++ b/lib/main/lockDetail/iris/irisList/irisList_page.dart @@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart'; import 'package:star_lock/main/lockDetail/iris/irisList/irisList_logic.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'; @@ -44,6 +45,11 @@ class _IrisListPageState extends State { onPressed: () async { final isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } showDeletAlertDialog(context); } else { // Get.toNamed(Routers.selectLockTypePage); diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart index c15dfa29..411ce532 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart @@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/lockSet/lockSet/checkingInInfoData_entity.dart'; import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSet_state.dart'; +import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart'; import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; @@ -28,9 +29,7 @@ class LockSetPage extends StatefulWidget { class _LockSetPageState extends State with RouteAware { final LockSetLogic logic = Get.put(LockSetLogic()); - final LockSetState state = Get - .find() - .state; + final LockSetState state = Get.find().state; Future getHttpData() async { logic.getLockSettingInfoData().then((LockSetInfoEntity value) { @@ -65,8 +64,7 @@ class _LockSetPageState extends State with RouteAware { child: Column( children: [ Expanded( - child: Obx(() => - ListView( + child: Obx(() => ListView( children: getListWidget(), )), ), @@ -104,47 +102,43 @@ class _LockSetPageState extends State with RouteAware { }), SizedBox(height: 10.h), // 自动闭锁 - Obx(() => - Visibility( - visible: state.lockFeature.value.autoLock == 1, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr, - rightTitle: (state.lockSettingInfo.value.autoLock ?? 0) > 0 - ? '${state.lockSetInfoData.value.lockSettingInfo! - .autoLockSecond ?? 0}s' - : TranslationLoader.lanKeys!.closed!.tr, - isHaveLine: true, - isHaveDirection: true, - // isHaveRightWidget: true, - // rightWidget: rightText((state.lockSetInfoData.value.lockSetting!.autoLock ?? 0) > 0 - // ? "${state.lockSetInfoData.value.lockSetting!.autoLockSecond ?? 0}s" - // : TranslationLoader.lanKeys!.closed!.tr), - action: () { - Get.toNamed(Routers.automaticBlockingPage, - arguments: { - 'lockSetInfoData': state.lockSetInfoData.value, - // 'lockBasicInfo': state.lockBasicInfo.value - }); - }))), + Obx(() => Visibility( + visible: state.lockFeature.value.autoLock == 1, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr, + rightTitle: (state.lockSettingInfo.value.autoLock ?? 0) > 0 + ? '${state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond ?? 0}s' + : TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + // isHaveRightWidget: true, + // rightWidget: rightText((state.lockSetInfoData.value.lockSetting!.autoLock ?? 0) > 0 + // ? "${state.lockSetInfoData.value.lockSetting!.autoLockSecond ?? 0}s" + // : TranslationLoader.lanKeys!.closed!.tr), + action: () { + Get.toNamed(Routers.automaticBlockingPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value, + // 'lockBasicInfo': state.lockBasicInfo.value + }); + }))), // 常开模式 - Obx(() => - Visibility( - visible: state.lockFeature.value.passageMode == 1, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr, - rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == - 1 - ? TranslationLoader.lanKeys!.opened!.tr - : TranslationLoader.lanKeys!.closed!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.normallyOpenModePage, - arguments: { - 'lockSetInfoData': state.lockSetInfoData.value, - 'lockBasicInfo': state.lockBasicInfo.value - }); - }))), + Obx(() => Visibility( + visible: state.lockFeature.value.passageMode == 1, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr, + rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1 + ? TranslationLoader.lanKeys!.opened!.tr + : TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.normallyOpenModePage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value, + 'lockBasicInfo': state.lockBasicInfo.value + }); + }))), Visibility( visible: true, child: CommonItem( @@ -153,10 +147,10 @@ class _LockSetPageState extends State with RouteAware { isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed( - Routers.lockTimePage, arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); + Get.toNamed(Routers.lockTimePage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); })), SizedBox(height: 30.h), Container( @@ -166,10 +160,14 @@ class _LockSetPageState extends State with RouteAware { isDelete: true, onClick: () { // logic.deletUserAction(); - // logic.deletLockInfoData(); // showDeletAlertDialog(context); // showDeletPasswordAlertDialog(context); + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } logic.deleyLockLogicOfRoles(); }), ), @@ -242,27 +240,25 @@ class _LockSetPageState extends State with RouteAware { // })), // SizedBox(height: 10.h), // 自动闭锁 - Obx(() => - Visibility( - visible: state.lockFeature.value.autoLock == 1, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr, - rightTitle: state.lockSettingInfo.value.autoLock! > 0 - ? '${state.lockSetInfoData.value.lockSettingInfo! - .autoLockSecond}s' - : TranslationLoader.lanKeys!.closed!.tr, - isHaveLine: true, - isHaveDirection: true, - // isHaveRightWidget: true, - // rightWidget: rightText((state.lockSetInfoData.value.lockSetting!.autoLock ?? 0) > 0 - // ? "${state.lockSetInfoData.value.lockSetting!.autoLockSecond ?? 0}s" - // : TranslationLoader.lanKeys!.closed!.tr), - action: () { - Get.toNamed(Routers.automaticBlockingPage, - arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); - }))), + Obx(() => Visibility( + visible: state.lockFeature.value.autoLock == 1, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr, + rightTitle: state.lockSettingInfo.value.autoLock! > 0 + ? '${state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond}s' + : TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + // isHaveRightWidget: true, + // rightWidget: rightText((state.lockSetInfoData.value.lockSetting!.autoLock ?? 0) > 0 + // ? "${state.lockSetInfoData.value.lockSetting!.autoLockSecond ?? 0}s" + // : TranslationLoader.lanKeys!.closed!.tr), + action: () { + Get.toNamed(Routers.automaticBlockingPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); + }))), // 锁声音 Obx(() { String titleStr = ''; @@ -302,80 +298,72 @@ class _LockSetPageState extends State with RouteAware { })); }), // 防撬报警 - Obx(() => - Visibility( - visible: state.lockFeature.value.antiPrySwitch == 1, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr, - rightTitle: (state.lockSettingInfo.value.antiPrySwitch ?? - 0) == 1 - ? TranslationLoader.lanKeys!.opened!.tr - : TranslationLoader.lanKeys!.closed!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.burglarAlarmPage, - arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); - }))), + Obx(() => Visibility( + visible: state.lockFeature.value.antiPrySwitch == 1, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr, + rightTitle: (state.lockSettingInfo.value.antiPrySwitch ?? 0) == 1 + ? TranslationLoader.lanKeys!.opened!.tr + : TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.burglarAlarmPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); + }))), SizedBox(height: 10.h), // 常开模式 - Obx(() => - Visibility( - visible: state.lockFeature.value.passageMode == 1, - // visible: true, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr, - rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == - 1 - ? TranslationLoader.lanKeys!.opened!.tr - : TranslationLoader.lanKeys!.closed!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.normallyOpenModePage, - arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); - }))), + Obx(() => Visibility( + visible: state.lockFeature.value.passageMode == 1, + // visible: true, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr, + rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1 + ? TranslationLoader.lanKeys!.opened!.tr + : TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.normallyOpenModePage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); + }))), // 远程开锁 - Obx(() => - Visibility( - visible: state.lockFeature.value.remoteUnlock == 1, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr, - rightTitle: (state.lockSettingInfo.value.remoteUnlock ?? 0) == - 1 - ? TranslationLoader.lanKeys!.opened!.tr - : TranslationLoader.lanKeys!.closed!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.remoteUnlockingPage, - arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); - }))), + Obx(() => Visibility( + visible: state.lockFeature.value.remoteUnlock == 1, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr, + rightTitle: (state.lockSettingInfo.value.remoteUnlock ?? 0) == 1 + ? TranslationLoader.lanKeys!.opened!.tr + : TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.remoteUnlockingPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); + }))), // 重置键 - Obx(() => - Visibility( - visible: state.lockBasicInfo.value.isLockOwner == 1 && - state.lockFeature.value.resetSwitch == 1, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.resetButton!.tr, - rightTitle: (state.lockSettingInfo.value.resetSwitch ?? 0) == - 1 - ? TranslationLoader.lanKeys!.opened!.tr - : TranslationLoader.lanKeys!.closed!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.resetButtonPage, - arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); - }))), + Obx(() => Visibility( + visible: state.lockBasicInfo.value.isLockOwner == 1 && + state.lockFeature.value.resetSwitch == 1, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.resetButton!.tr, + rightTitle: (state.lockSettingInfo.value.resetSwitch ?? 0) == 1 + ? TranslationLoader.lanKeys!.opened!.tr + : TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.resetButtonPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); + }))), SizedBox(height: 10.h), //---田总新增展示 // Obx(() => @@ -409,20 +397,19 @@ class _LockSetPageState extends State with RouteAware { }); })), //猫眼设置 - Obx(() => - Visibility( - visible: state.lockFeature.value.isSupportCatEye == 1, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.catEyeSet!.tr, - rightTitle: '', - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.catEyeSetPage, - arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); - }))), + Obx(() => Visibility( + visible: state.lockFeature.value.isSupportCatEye == 1, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.catEyeSet!.tr, + rightTitle: '', + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.catEyeSetPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); + }))), // Obx(() => //自动亮屏已包括至面容开锁模块 // Visibility( @@ -477,7 +464,7 @@ class _LockSetPageState extends State with RouteAware { // 蓝牙广播(关闭则不能使用蓝牙主动开锁) /* 2024-01-12 会议确定去掉“蓝牙广播” by DaisyWu Obx(() => Visibility( - visible: true, + visible: true, child: CommonItem( leftTitel: TranslationLoader.lanKeys!.bluetoothBroadcast!.tr, rightTitle: "", @@ -511,66 +498,62 @@ class _LockSetPageState extends State with RouteAware { // }), // 考勤 Obx( - () => - Visibility( - visible: state.lockBasicInfo.value.isLockOwner == 1 && - state.lockFeature.value.attendance == 1, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr, - rightTitle: '', - isHaveLine: true, - isHaveRightWidget: true, - rightWidget: _openCheckInSwitch())), + () => Visibility( + visible: state.lockBasicInfo.value.isLockOwner == 1 && + state.lockFeature.value.attendance == 1, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr, + rightTitle: '', + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: _openCheckInSwitch())), ), // 开锁提醒 Obx( - () => - Visibility( - visible: state.lockBasicInfo.value.isLockOwner == 1 && - state.lockFeature.value.unlockReminder == 1, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr, - rightTitle: '', - isHaveLine: true, - isHaveRightWidget: true, - rightWidget: _lockRemindSwitch())), + () => Visibility( + visible: state.lockBasicInfo.value.isLockOwner == 1 && + state.lockFeature.value.unlockReminder == 1, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr, + rightTitle: '', + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: _lockRemindSwitch())), ), // APP开锁时是否需联网 Obx( - () => - Visibility( - visible: state.lockBasicInfo.value.isLockOwner == 1 && - state.lockFeature.value.appUnlockOnline == 1, - child: CommonItem( - leftTitel: TranslationLoader - .lanKeys!.whetherInternetRequiredWhenUnlocking!.tr, - rightTitle: '', - isHaveLine: false, - isHaveRightWidget: true, - rightWidget: _openLockNeedOnlineSwitch()), - ), + () => Visibility( + visible: state.lockBasicInfo.value.isLockOwner == 1 && + state.lockFeature.value.appUnlockOnline == 1, + child: CommonItem( + leftTitel: TranslationLoader + .lanKeys!.whetherInternetRequiredWhenUnlocking!.tr, + rightTitle: '', + isHaveLine: false, + isHaveRightWidget: true, + rightWidget: _openLockNeedOnlineSwitch()), + ), ), SizedBox(height: 10.h), // wifi配网 Obx( - () => - Visibility( - visible: state.lockFeature.value.wifi == 1, - child: CommonItem( - leftTitel: + () => Visibility( + visible: state.lockFeature.value.wifi == 1, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.wifiDistributionNetwork!.tr, - rightTitle: '', - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.wifiListPage, - arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); - // Get.toNamed(Routers.configuringWifiPage, arguments: { - // 'lockSetInfoData': state.lockSetInfoData.value - // }); - })), + rightTitle: '', + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.wifiListPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); + // Get.toNamed(Routers.configuringWifiPage, arguments: { + // 'lockSetInfoData': state.lockSetInfoData.value + // }); + })), ), // Obx(() => // 锁时间 @@ -582,10 +565,10 @@ class _LockSetPageState extends State with RouteAware { isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed( - Routers.lockTimePage, arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); + Get.toNamed(Routers.lockTimePage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); })), // ), // Obx(() => @@ -676,12 +659,11 @@ class _LockSetPageState extends State with RouteAware { thumbColor: CupertinoColors.white, value: state.isAttendance.value == 1, onChanged: (bool value) { - logic.openCheckingInData(( - CheckingInInfoDataEntity checkingInInfoDataEntity) { + logic.openCheckingInData( + (CheckingInInfoDataEntity checkingInInfoDataEntity) { if (checkingInInfoDataEntity.data!.companyId == 0) { // logic.showCupertinoAlertDialog(context); - ShowTipView().showIosTipWithContentDialog( - '创建公司后,考勤功能才能使用'.tr, () { + ShowTipView().showIosTipWithContentDialog('创建公司后,考勤功能才能使用'.tr, () { // 删除锁 Get.toNamed(Routers.checkInCreatCompanyPage, arguments: { diff --git a/lib/main/lockDetail/lockSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart b/lib/main/lockDetail/lockSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart index b04eca44..ca725531 100755 --- a/lib/main/lockDetail/lockSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart +++ b/lib/main/lockDetail/lockSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart'; import 'package:star_lock/tools/noData.dart'; import '../../../../../appRouters.dart'; @@ -19,6 +20,7 @@ class WirelessKeyboardPage extends StatefulWidget { class _WirelessKeyboardPageState extends State { List dataList = []; + @override Widget build(BuildContext context) { return Scaffold( @@ -34,6 +36,11 @@ class _WirelessKeyboardPageState extends State { style: TextStyle(color: Colors.white, fontSize: 24.sp), ), onPressed: () { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } _showDialog(context); }, ), diff --git a/lib/main/lockDetail/palm/palmList/palmList_page.dart b/lib/main/lockDetail/palm/palmList/palmList_page.dart index 38d70903..18e153a0 100755 --- a/lib/main/lockDetail/palm/palmList/palmList_page.dart +++ b/lib/main/lockDetail/palm/palmList/palmList_page.dart @@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart'; import 'package:star_lock/main/lockDetail/palm/palmList/palmList_logic.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'; @@ -44,6 +45,11 @@ class _PalmListPageState extends State { onPressed: () async { var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } showDeletAlertDialog(context); } else { // Get.toNamed(Routers.selectLockTypePage); diff --git a/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart b/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart index 2f206d13..7403cf35 100755 --- a/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart +++ b/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart @@ -6,6 +6,7 @@ import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKe import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart'; import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_state.dart'; import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart'; +import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart'; import 'package:star_lock/tools/noData.dart'; import 'package:star_lock/tools/storage.dart'; import '../../../../appRouters.dart'; @@ -67,6 +68,11 @@ class _PasswordKeyListPageState extends State final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } if (state.itemDataList.isEmpty) { logic.showToast('暂无密码,无需重置'.tr); return; @@ -227,7 +233,8 @@ class _PasswordKeyListPageState extends State Row( children: [ SizedBox( - width: passwordKeyListItem.keyboardPwdStatus == 2 || passwordKeyListItem.keyboardPwdStatus == 3 + width: passwordKeyListItem.keyboardPwdStatus == 2 || + passwordKeyListItem.keyboardPwdStatus == 3 ? 1.sw - 110.w - 100.w : 1.sw - 110.w - 50.w, child: Row(children: [ @@ -247,7 +254,7 @@ class _PasswordKeyListPageState extends State '已过期'.tr, style: TextStyle(color: Colors.red, fontSize: 20.sp), ) - else if (passwordKeyListItem.keyboardPwdStatus == 3) + else if (passwordKeyListItem.keyboardPwdStatus == 3) Text( '未生效'.tr, style: TextStyle(color: Colors.red, fontSize: 20.sp), diff --git a/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart b/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart index b5527846..5f193cd1 100755 --- a/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart +++ b/lib/main/lockDetail/remoteControl/remoteControlList/remoteControlList_page.dart @@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart'; import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; @@ -44,6 +45,11 @@ class _RemoteControlListPageState extends State { onPressed: () async { var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { + final bool isNetWork = + LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } showDeletAlertDialog(context); } else { // Get.toNamed(Routers.selectLockTypePage); diff --git a/lib/main/lockMian/lockMain/lockMain_logic.dart b/lib/main/lockMian/lockMain/lockMain_logic.dart index 2fa7974c..ae2daf05 100755 --- a/lib/main/lockMian/lockMain/lockMain_logic.dart +++ b/lib/main/lockMian/lockMain/lockMain_logic.dart @@ -109,11 +109,20 @@ class LockMainLogic extends BaseGetXController { result != ConnectivityResult.none) { // 从无网络到有网络 state.networkConnectionStatus.value = 1; - getStarLockInfo(); + getStarLockInfo(isUnShowLoading: true); } }); } + /// 判断是否有网络 + bool judgeTheNetwork() { + final bool isNetwork = state.networkConnectionStatus.value == 1; + if (!isNetwork) { + EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr); + } + return isNetwork; + } + /// 检测推送是否开启 Future checkWhetherPushIsEnabled() async { bool notificationEnabled = false; @@ -261,6 +270,7 @@ class LockMainLogic extends BaseGetXController { super.onInit(); checkWhetherPushIsEnabled(); _initSubscription(); + connectListener(); } @override @@ -270,4 +280,11 @@ class LockMainLogic extends BaseGetXController { }); super.onClose(); } + + static LockMainLogic? to() { + if (Get.isRegistered()) { + return Get.find(); + } + return null; + } } From e56685be9cb50ce3241cb17c9f2291c5b733139c Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Mon, 24 Jun 2024 18:02:56 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=20=E4=BA=BA=E8=84=B8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A7=93=E5=90=8D=E5=90=8E=E5=9B=9E=E9=80=80?= =?UTF-8?q?=E5=88=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- images/lan/lan_en.json | 3 +- images/lan/lan_keys.json | 3 +- images/lan/lan_zh.json | 3 +- .../face/faceDetail/faceDetail_logic.dart | 2 + .../face/faceDetail/faceDetail_page.dart | 38 +++++++------ ...eleteAdministratorIsHaveAllDataWidget.dart | 54 +++++++++++-------- 6 files changed, 63 insertions(+), 40 deletions(-) diff --git a/images/lan/lan_en.json b/images/lan/lan_en.json index 5f66a7a8..d0c782b8 100755 --- a/images/lan/lan_en.json +++ b/images/lan/lan_en.json @@ -924,5 +924,6 @@ "导出成功":"Export success", "发送钥匙": "Send key", "进度": "Progress", - "失败": "Failure" + "失败": "Failure", + "人脸详情": "Face details" } diff --git a/images/lan/lan_keys.json b/images/lan/lan_keys.json index c60eaf12..2d798848 100755 --- a/images/lan/lan_keys.json +++ b/images/lan/lan_keys.json @@ -956,5 +956,6 @@ "导出成功":"导出成功", "发送钥匙": "发送钥匙", "进度": "进度", - "失败": "失败" + "失败": "失败", + "人脸详情": "人脸详情" } diff --git a/images/lan/lan_zh.json b/images/lan/lan_zh.json index 59861ed2..b788524f 100755 --- a/images/lan/lan_zh.json +++ b/images/lan/lan_zh.json @@ -921,6 +921,7 @@ "导出成功":"导出成功", "发送钥匙": "发送钥匙", "进度": "进度", - "失败": "失败" + "失败": "失败", + "人脸详情": "人脸详情" } diff --git a/lib/main/lockDetail/face/faceDetail/faceDetail_logic.dart b/lib/main/lockDetail/face/faceDetail/faceDetail_logic.dart index 5ac27227..b4f75049 100755 --- a/lib/main/lockDetail/face/faceDetail/faceDetail_logic.dart +++ b/lib/main/lockDetail/face/faceDetail/faceDetail_logic.dart @@ -174,6 +174,8 @@ class FaceDetailLogic extends BaseGetXController { showToast('修改成功', something: () { Get.back(result: 'addScuess'); }); + }else{ + Get.back(); } } diff --git a/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart b/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart index b32f3225..54bf087f 100755 --- a/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart +++ b/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart @@ -33,7 +33,7 @@ class _FaceDetailPageState extends State with RouteAware { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: '人脸详情', + barTitle: '人脸详情'.tr, haveBack: true, backgroundColor: AppColors.mainColor, ), @@ -44,7 +44,9 @@ class _FaceDetailPageState extends State with RouteAware { rightTitle: state.typeNumber.value, isHaveDirection: false, isHaveLine: true)), - Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr, state.typeName.value, () { + Obx(() => lockDataListItem( + TranslationLoader.lanKeys!.name!.tr, state.typeName.value, + () { // showCupertinoAlertDialog(context); ShowTipView().showTFViewAlertDialog( state.changeNameController, @@ -54,7 +56,6 @@ class _FaceDetailPageState extends State with RouteAware { logic.showToast('请输入姓名'.tr); return; } - Get.back(); state.typeName.value = state.changeNameController.text; logic.updateFaceNameData(); }, inputFormatters: [ @@ -64,8 +65,8 @@ class _FaceDetailPageState extends State with RouteAware { })), Obx(() => Visibility( visible: state.keyType.value == 4 || - state.keyType.value == 2 || - state.keyType.value == 1, + state.keyType.value == 2 || + state.keyType.value == 1, child: CommonItem( leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, allHeight: 70.h, @@ -187,11 +188,12 @@ class _FaceDetailPageState extends State with RouteAware { rightTitle: '', isHaveDirection: true, action: () { - Get.toNamed(Routers.lockOperatingRecordPage, arguments: { - 'type': 4, - 'id': state.faceItemData.value.faceId.toString(), - 'recordName': state.faceItemData.value.faceName - }); + Get.toNamed(Routers.lockOperatingRecordPage, + arguments: { + 'type': 4, + 'id': state.faceItemData.value.faceId.toString(), + 'recordName': state.faceItemData.value.faceName + }); }), // SizedBox(height: 40.h), // addControlsBtn(type), @@ -215,12 +217,14 @@ class _FaceDetailPageState extends State with RouteAware { ); } - Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){ + Widget lockDataListItem( + String leftTitle, String conentStr, Function()? action) { return GestureDetector( onTap: action, child: Container( // height: 70.h, - padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), + padding: + EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), decoration: BoxDecoration( color: Colors.white, border: Border( @@ -228,15 +232,17 @@ class _FaceDetailPageState extends State with RouteAware { color: AppColors.greyLineColor, // 设置边框颜色 width: 2.0.h, // 设置边框宽度 ), - ) - ), + )), child: Row( children: [ Text(leftTitle, style: TextStyle(fontSize: 22.sp)), SizedBox(width: 10.w), Expanded( - child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, )) - ), + child: Text(conentStr, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 22.sp, + ))), SizedBox(width: 10.w), Image.asset( 'images/icon_right_grey.png', diff --git a/lib/tools/showDeleteAdministratorIsHaveAllDataWidget.dart b/lib/tools/showDeleteAdministratorIsHaveAllDataWidget.dart index b5cda199..cdf0dec0 100755 --- a/lib/tools/showDeleteAdministratorIsHaveAllDataWidget.dart +++ b/lib/tools/showDeleteAdministratorIsHaveAllDataWidget.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -8,34 +7,47 @@ class ShowDeleteAdministratorIsHaveAllDataWidget extends StatefulWidget { BlockIsHaveAllDataCallback? blockIsHaveAllDataCallback; String? contentStr; - ShowDeleteAdministratorIsHaveAllDataWidget({Key? key, this.contentStr, this.blockIsHaveAllDataCallback}) : super(key: key); + ShowDeleteAdministratorIsHaveAllDataWidget( + {Key? key, this.contentStr, this.blockIsHaveAllDataCallback}) + : super(key: key); @override - State createState() => _ShowDeleteAdministratorIsHaveAllDataWidgetState(); + State createState() => + _ShowDeleteAdministratorIsHaveAllDataWidgetState(); } -class _ShowDeleteAdministratorIsHaveAllDataWidgetState extends State { +class _ShowDeleteAdministratorIsHaveAllDataWidgetState + extends State { bool selet = false; @override Widget build(BuildContext context) { - return Row( - children: [ - GestureDetector( - onTap: () { - setState(() { - selet = !selet; - widget.blockIsHaveAllDataCallback!(selet); - }); - }, - child: Image.asset( - selet ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', - width: 30.w, - height: 30.w, - )), - SizedBox(width: 15.w,), - Expanded(child: Text(widget.contentStr!, maxLines: 2, textAlign: TextAlign.start, style: TextStyle(fontSize: 24.sp))), - ], + return GestureDetector( + onTap: () { + setState(() { + selet = !selet; + widget.blockIsHaveAllDataCallback!(selet); + }); + }, + child: Row( + children: [ + Image.asset( + selet + ? 'images/icon_round_select.png' + : 'images/icon_round_unSelect.png', + width: 30.w, + height: 30.w, + ), + SizedBox( + width: 15.w, + ), + Expanded( + child: Text(widget.contentStr!, + maxLines: 2, + textAlign: TextAlign.start, + style: TextStyle(fontSize: 24.sp))), + ], + ), ); } } From 90e7742c2e2d4f4dc7ac0da59c4688f1029413e9 Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Mon, 24 Jun 2024 18:31:37 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E6=A3=80=E6=B5=8B=E8=84=9A=E6=9C=AC=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=89=88=E6=9C=AC=E5=8F=B7=E6=8E=A7=E5=88=B6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/network/api.dart | 2 +- pre_build.sh | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/network/api.dart b/lib/network/api.dart index da15ded9..0d7f2d05 100755 --- a/lib/network/api.dart +++ b/lib/network/api.dart @@ -75,7 +75,7 @@ abstract class Api { final String openCheckingInURL = '/attendanceCompany/isExistenceCompany'; // 开启考勤获取是否有公司 final String setCheckInCreateCompanyURL = - '/attendanceCompany/add'; // 设置考勤时创建公司 + '/v2/attendanceCompany/add'; // 设置考勤时创建公司 final String deleteCompanyURL = '/attendanceCompany/delete'; // 删除公司 final String getAttendanceRecordListByDateURL = diff --git a/pre_build.sh b/pre_build.sh index dd78490c..5f7ccc57 100644 --- a/pre_build.sh +++ b/pre_build.sh @@ -10,7 +10,7 @@ # 设置 environment="xhj" main_file="lib/main_xhj_full.dart" -version_string="1.0.52" +version_string="1.0.66" file_path="lib/network/api.dart" ############################################################### @@ -38,7 +38,17 @@ esac echo "API 前缀为: $api_prefix" -urls=$(curl -s -X POST -d "version=$version_string" "$environment/api/app/getDeprecatedApiList" | jq -r '.data[].url') +response=$(curl -s -X POST -d "version=$version_string" "$api_prefix/api/app/checkAppBuildVersion") +error_code=$(echo $response | jq '.errorCode') + +# 判断是否成功 +if [ "$error_code" != "0" ]; then + error_msg=$(echo $response | jq -r '.errorMsg') + echo "失败:$error_msg" + exit 1 +fi + +urls=$(curl -s -X POST -d "version=$version_string" "$api_prefix/api/app/getDeprecatedApiList" | jq -r '.data[].url') echo "* 成功获取废弃 api 数据" # 解析 api 文件数据 From 79b387b3909250fdcb96ea8fb8d5a3e62f0ec436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Tue, 25 Jun 2024 10:02:32 +0800 Subject: [PATCH 4/4] =?UTF-8?q?1=E3=80=81=20=E5=9C=A8=E9=94=81=E7=AB=AF?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E2=80=9C=E5=88=86=E7=BB=84=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E2=80=9D=E5=90=8E=EF=BC=8C=E4=B8=8D=E7=AE=A1=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=82=A3=E4=B8=AA=E5=88=86=E7=BB=84=E3=80=82App=20=E9=83=BD?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=88=A0=E9=99=A4=E6=89=80=E6=9C=89=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=BA=94=E8=AF=A5=E5=8C=BA=E5=88=86=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=9E=8B=202=E3=80=81=E5=BC=80=E9=94=81?= =?UTF-8?q?=E4=B8=8D=E5=9C=A8=E5=90=8C=E6=AD=A5=E6=93=8D=E4=BD=9C=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E5=9C=A8=E6=93=8D=E4=BD=9C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E5=90=8C=E6=AD=A5=EF=BC=88=E6=9B=B9=E6=80=BB=E6=8F=90?= =?UTF-8?q?=E5=87=BA=EF=BC=89=203=E3=80=81=20=E9=94=81=E5=AE=9A=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E9=94=81=E5=AE=9A,App=E6=93=8D=E4=BD=9C=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=98=BE=E7=A4=BA=E2=80=9C=E6=89=8B=E6=9C=BA=E7=94=A8?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8A=A5=E8=AD=A6=E2=80=9D=EF=BC=8C=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E7=9B=B4=E6=8E=A5=E6=98=BE=E7=A4=BA=E2=80=9C=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=8A=A5=E8=AD=A6=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/blue/io_protocol/io_addFace.dart | 34 +++++++++---------- lib/blue/io_protocol/io_addFaceCancel.dart | 2 +- .../massSendElectronicKey_page.dart | 2 +- .../lockDetail/lockDetail_logic.dart | 2 +- .../lockSet/lockSet/lockSet_logic.dart | 2 +- .../passwordKeyDetail_logic.dart | 4 +-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/blue/io_protocol/io_addFace.dart b/lib/blue/io_protocol/io_addFace.dart index f77668bd..9383071c 100755 --- a/lib/blue/io_protocol/io_addFace.dart +++ b/lib/blue/io_protocol/io_addFace.dart @@ -1,14 +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:添加人脸 /* @@ -70,7 +70,7 @@ class SenderAddFaceCommand extends SenderProtocol { @override List messageDetail() { - List data = []; + final List data = []; List subData = []; List ebcData = []; @@ -82,13 +82,13 @@ class SenderAddFaceCommand extends SenderProtocol { data.add(81); // keyID 40 - int keyIDLength = utf8.encode(keyID!).length; + final int keyIDLength = utf8.encode(keyID!).length; subData.addAll(utf8.encode(keyID!)); subData = getFixedLengthList(subData, 40 - keyIDLength); // AppLog.log("keyID:$keyID utf8.encode(keyID!):${utf8.encode(keyID!)}"); //userID 20 - int userIDLength = utf8.encode(userID!).length; + final int userIDLength = utf8.encode(userID!).length; subData.addAll(utf8.encode(userID!)); subData = getFixedLengthList(subData, 20 - userIDLength); // AppLog.log("userID:$userID utf8.encode(userID!):${utf8.encode(userID!)}"); @@ -129,28 +129,28 @@ class SenderAddFaceCommand extends SenderProtocol { subData.add((startDate! & 0xff000000) >> 24); subData.add((startDate! & 0xff0000) >> 16); subData.add((startDate! & 0xff00) >> 8); - subData.add((startDate! & 0xff)); + subData.add(startDate! & 0xff); // endDate 4 subData.add((endDate! & 0xff000000) >> 24); subData.add((endDate! & 0xff0000) >> 16); subData.add((endDate! & 0xff00) >> 8); - subData.add((endDate! & 0xff)); + subData.add(endDate! & 0xff); // AppLog.log("addFingerprint startDate:${DateTool().dateToYMDHNString(startDate.toString())} endDate:${DateTool().dateToYMDHNString(endDate.toString())}"); // startTime 4 - List startTimeList = [0,0,0,0]; - if(startTime!.contains(":")){ - List getStartTimeList = startTime!.split(":"); + final List startTimeList = [0,0,0,0]; + if(startTime!.contains(':')){ + final List getStartTimeList = startTime!.split(':'); startTimeList[2] = int.parse(getStartTimeList[0]); startTimeList[3] = int.parse(getStartTimeList[1]); } subData.addAll(startTimeList); // endTime 4 - List endTimeList = [0,0,0,0]; - if(endTime!.contains(":")){ - List getendTimeList = endTime!.split(":"); + final List endTimeList = [0,0,0,0]; + if(endTime!.contains(':')){ + final List getendTimeList = endTime!.split(':'); endTimeList[2] = int.parse(getendTimeList[0]); endTimeList[3] = int.parse(getendTimeList[1]); } @@ -160,7 +160,7 @@ class SenderAddFaceCommand extends SenderProtocol { //AuthCodeLen 1 subData.add(0); } else { - List authCodeData = []; + final List authCodeData = []; //KeyID authCodeData.addAll(utf8.encode(keyID!)); @@ -173,7 +173,7 @@ class SenderAddFaceCommand extends SenderProtocol { authCodeData.addAll(signKey!); // 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode - var authCode = crypto.md5.convert(authCodeData); + final authCode = crypto.md5.convert(authCodeData); subData.add(authCode.bytes.length); subData.addAll(authCode.bytes); @@ -183,7 +183,7 @@ class SenderAddFaceCommand extends SenderProtocol { data.addAll(subData); 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); } diff --git a/lib/blue/io_protocol/io_addFaceCancel.dart b/lib/blue/io_protocol/io_addFaceCancel.dart index 60d0b417..a89c2ac0 100755 --- a/lib/blue/io_protocol/io_addFaceCancel.dart +++ b/lib/blue/io_protocol/io_addFaceCancel.dart @@ -80,7 +80,7 @@ class SenderCancelAddFaceCommand extends SenderProtocol { data.addAll(subData); if ((data.length % 16) != 0) { - int add = (16 - data.length % 16); + int add = 16 - data.length % 16; for (int i = 0; i < add; i++) { data.add(0); } diff --git a/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_page.dart b/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_page.dart index b806b4b1..9986ff1e 100755 --- a/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_page.dart +++ b/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_page.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/app_settings/app_colors.dart'; -import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_state.dart'; import 'package:star_lock/tools/pickers/pickers.dart'; import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart'; import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart'; @@ -16,6 +15,7 @@ import '../../../../../tools/dateTool.dart'; import '../../../../../tools/storage.dart'; import '../../../../../translations/trans_lib.dart'; import 'massSendElectronicKey_logic.dart'; +import 'massSendElectronicKey_state.dart'; class MassSendElectronicKeyPage extends StatefulWidget { const MassSendElectronicKeyPage({required this.type, Key? key}) : super(key: key); diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index b0728bf9..268bb6d9 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -90,7 +90,7 @@ class LockDetailLogic extends BaseGetXController { // 更新电量 uploadElectricQuantityRequest(); //锁数据更新 - getLockRecordLastUploadDataTime(); + // getLockRecordLastUploadDataTime(); resetOpenDoorState(); state.animationController!.stop(); break; diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart index 4ac123e7..83849fc0 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart @@ -525,7 +525,7 @@ class LockSetLogic extends BaseGetXController { } /// 以下为删除逻辑 - deleyLockLogicOfRoles() { + void deleyLockLogicOfRoles() { if (state.lockBasicInfo.value.isLockOwner == 1) { // 超级管理员必须通过连接蓝牙删除 ShowTipView().showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, diff --git a/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart b/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart index c4c759cc..924077f6 100755 --- a/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart +++ b/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart @@ -57,7 +57,7 @@ class PasswordKeyDetailLogic extends BaseGetXController { pwdNo: state.itemData.value.pwdUserNo!, pwd: state.inputPwdController.text, useCountLimit: 0xffff, - operate: state.isDeletPasswordKey.value == true ? 2 : 1, + operate: state.itemData.value.isCustom == 1 ? (state.isDeletPasswordKey.value == true ? 2 : 1) : 3, isAdmin: state.isAdministrator.value == true ? 1 : 0, startTime:state.itemData.value.startDate! ~/ 1000, endTime:state.itemData.value.endDate! ~/ 1000, @@ -147,7 +147,7 @@ class PasswordKeyDetailLogic extends BaseGetXController { pwdNo: state.itemData.value.pwdUserNo!, pwd: state.inputPwdController.text, useCountLimit: 0xffff, - operate: state.itemData.value.isCustom == 1 ? state.isDeletPasswordKey.value == true ? 2 : 1 : 3, + operate: state.itemData.value.isCustom == 1 ? (state.isDeletPasswordKey.value == true ? 2 : 1) : 3, isAdmin: state.isAdministrator.value == true ? 1 : 0, startTime:state.itemData.value.startDate! ~/ 1000, endTime:state.itemData.value.endDate! ~/ 1000,