From 001cff8bc52692316890c1faeb3e78060d019d3f 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, 19 Aug 2024 18:22:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E7=94=B5?= =?UTF-8?q?=E5=AD=90=E9=92=A5=E5=8C=99=E8=AF=A6=E6=83=85=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=85=E7=AE=A1=E7=90=86=E8=87=AA=E5=B7=B1=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E6=88=B7=E3=80=81=E8=BF=9C=E7=A8=8B=E5=BC=80?= =?UTF-8?q?=E9=94=81=E4=B8=8D=E6=88=90=E5=8A=9F=E9=97=AE=E9=A2=98=202?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E5=90=8C=E4=B8=80=E6=8A=8A=E9=94=81?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E4=B9=8B=E5=90=8E=E9=87=8D=E6=96=B0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B9=8B=E5=90=8E=E8=AF=A6=E6=83=85=E4=B8=8D=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../electronicKeyDetail_logic.dart | 5 ---- .../electronicKeyDetail_page.dart | 24 ++++++++++++------- .../lockMian/lockMain/lockMain_logic.dart | 23 ++++++++++++++---- pubspec.yaml | 3 ++- 4 files changed, 37 insertions(+), 18 deletions(-) diff --git a/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart b/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart index 5394afba..bb24a222 100755 --- a/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart +++ b/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart @@ -63,11 +63,6 @@ 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 bde6db3b..8b4d1fac 100755 --- a/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart +++ b/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart @@ -16,6 +16,7 @@ import '../../../../../tools/dateTool.dart'; import '../../../../../tools/showTFView.dart'; import '../../../../../tools/submitBtn.dart'; import '../../../../../tools/titleAppBar.dart'; +import '../../../../lockMian/lockMain/lockMain_logic.dart'; enum ShowAlertEnum { name, realName, idCardNumber } @@ -209,7 +210,7 @@ class _ElectronicKeyDetailPageState extends State { rightTitle: DateTool() .dateToYMDHNString(state.itemData.value.sendDate.toString())), Container(height: 10.h), - Visibility( + Obx(() => Visibility( visible: state.itemData.value.keyRight == 1 ? true : false, child: CommonItem( leftTitel: '仅管理自己创建的用户'.tr, @@ -218,7 +219,7 @@ class _ElectronicKeyDetailPageState extends State { isHaveLine: true, rightWidget: SizedBox( width: 60.w, child: Obx(_onlyManageYouCreatesUserSwitch))), - ), + )), Obx( () => Visibility( // (state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false @@ -333,8 +334,12 @@ class _ElectronicKeyDetailPageState extends State { trackColor: CupertinoColors.systemGrey5, thumbColor: CupertinoColors.white, value: state.isRemoteUnlock.value, - onChanged: (bool value) { - // state.isRemoteUnlock.value = !state.isRemoteUnlock.value; + onChanged: (bool value) async { + final bool isNetWork = await LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } + state.isRemoteUnlock.value = !state.isRemoteUnlock.value; logic.updateKeyDateRequest(2); }, ); @@ -346,10 +351,13 @@ class _ElectronicKeyDetailPageState extends State { trackColor: CupertinoColors.systemGrey5, thumbColor: CupertinoColors.white, value: state.onlyManageYouCreatesUser.value, - onChanged: (bool value) { - // setState(() { - logic.updateKeyDateRequest(1); - // }); + onChanged: (bool value) async { + final bool isNetWork = await LockMainLogic.to()?.judgeTheNetwork() ?? false; + if (!isNetWork) { + return; + } + state.onlyManageYouCreatesUser.value = !state.onlyManageYouCreatesUser.value; + logic.updateKeyDateRequest(1); }, ); } diff --git a/lib/main/lockMian/lockMain/lockMain_logic.dart b/lib/main/lockMian/lockMain/lockMain_logic.dart index 295f121d..f99d8bac 100755 --- a/lib/main/lockMian/lockMain/lockMain_logic.dart +++ b/lib/main/lockMian/lockMain/lockMain_logic.dart @@ -29,10 +29,8 @@ class LockMainLogic extends BaseGetXController { final List> _subscriptions = >[]; - Future getStarLockInfo( - {bool isUnShowLoading = false}) async { - final LockListInfoEntity entity = - await ApiRepository.to.getStarLockListInfo( + Future getStarLockInfo({bool isUnShowLoading = false}) async { + final LockListInfoEntity entity = await ApiRepository.to.getStarLockListInfo( pageNo: pageNo, pageSize: 50, isUnShowLoading: isUnShowLoading, @@ -89,6 +87,23 @@ class LockMainLogic extends BaseGetXController { } }); } + + if(state.dataLength.value == 1){ + if (Get.isRegistered()) { + //设置控制器数据并刷新 + // AppLog.log('检测控制器是否存 调用了 setLockListInfoGroupEntity'); + Get.find().loadData(lockListInfoItemEntity: entity.groupList![0].lockList![0], isOnlyOneData: true); + } else { + //延迟加载 + Future.delayed(200.milliseconds, () { + if (Get.isRegistered()) { + //设置控制器数据并刷新 + // AppLog.log('检测控制器是否存 延迟调用了 setLockListInfoGroupEntity'); + Get.find().loadData(lockListInfoItemEntity: entity.groupList![0].lockList![0], isOnlyOneData: true); + } + }); + } + } await Storage.saveMainListData(entity); } diff --git a/pubspec.yaml b/pubspec.yaml index b7e7a934..c3322a7a 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -86,8 +86,9 @@ 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:锁定版本,上架商城 # 1.0.76+2024081201:锁定版本,上架商城--最新版本 +# 1.0.77+2024081901:锁定版本,上架商城 -version: 1.0.76+2024081201 +version: 1.0.77+2024081201 environment: sdk: '>=2.12.0 <3.0.0' From fd095031c731e525a4ac87aecdbcfee08b3f0b7a 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, 20 Aug 2024 11:01:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC1.0.76?= =?UTF-8?q?=E4=B8=8A=E6=9E=B6=E9=94=81=E9=80=9A=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pre_build.sh | 4 ++-- pubspec.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pre_build.sh b/pre_build.sh index 9a2689a7..532145a0 100755 --- a/pre_build.sh +++ b/pre_build.sh @@ -105,6 +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 +#flutter build appbundle --flavor $environment -t $main_file diff --git a/pubspec.yaml b/pubspec.yaml index c3322a7a..6945a62b 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -85,10 +85,10 @@ 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.77+2024081901:锁定版本,上架商城 +# 1.0.76+2024081201:锁定版本,上架商城--最新版本(SKY上架苹果) +# 1.0.76+2024082001:锁定版本,上架商城(SKY上架国内应用商城) -version: 1.0.77+2024081201 +version: 1.0.76+2024082001 environment: sdk: '>=2.12.0 <3.0.0'