From 5d689749d197aa2e4b386bf730b78db1c3dc3cba Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Tue, 4 Jun 2024 14:57:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=EF=BC=8C=E5=B9=B6=E4=B8=94=E4=BF=AE=E5=A4=8D=E5=8F=91?= =?UTF-8?q?=E9=80=81=E9=92=A5=E5=8C=99=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 8196 -> 8196 bytes .../view/sendElectronicKeyView_logic.dart | 17 ++++++--- .../view/sendElectronicKeyView_page.dart | 36 +++++++++--------- pubspec.yaml | 4 +- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/.DS_Store b/.DS_Store index fdfcd7d0d25a05b4ccfcfeffa86d37533538e7af..ed4e320f2ee064343447de46bd628e2ced192c0d 100755 GIT binary patch delta 25 gcmZp1XmQvuOPIsL&{#*o#LQ%JhLHW{hr-G{0B2GMmH+?% delta 25 gcmZp1XmQvuOPIsZ(o9Fe$jEqdhLHW{hr-G{0B1S}lK=n! diff --git a/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_logic.dart b/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_logic.dart index f50161ed..249fce41 100755 --- a/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_logic.dart +++ b/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_logic.dart @@ -20,13 +20,16 @@ import 'package:star_lock/tools/storage.dart'; class SendElectronicKeyViewLogic extends BaseGetXController { SendElectronicKeyViewLogic(this.type); + String type; final SendElectronicKeyViewState state = SendElectronicKeyViewState(); int? keyId; - + String? emailOrPhone; List get weekDayStr { - return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList(); + return state.weekdaysList + .map((e) => TimeUtils.translateWeekday(e)) + .toList(); } @override @@ -178,6 +181,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController { ? state.idCardController.text : ''); if (entity.errorCode!.codeIsSuccessful) { + emailOrPhone = state.emailOrPhoneController.text; state.createUser.value = 0; state.isSendSuccess = true; keyId = entity.data!.keyId; @@ -185,6 +189,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController { update(); eventBus.fire(ElectronicKeyListRefreshUI()); } else { + emailOrPhone = null; if (entity.errorCode == 425) { //用户未注册 update(); @@ -249,12 +254,12 @@ class SendElectronicKeyViewLogic extends BaseGetXController { } final NoticeTemplateEntity entity = await ApiRepository.to .getNoticeTemplate( - lockId: CommonDataManage().currentKeyInfo.lockId!, - keyId: keyId!, - channelType: isPhone ? 1 : 2); + lockId: CommonDataManage().currentKeyInfo.lockId!, + keyId: keyId!, + channelType: isPhone ? 1 : 2); if (entity.errorCode!.codeIsSuccessful) { final List list = - entity.data!.list!.where((Item item) => item.isUse == 0).toList(); + entity.data!.list!.where((Item item) => item.isUse == 0).toList(); if (list.isNotEmpty) { final Item item = list.first!; final String template = item.template ?? ''; diff --git a/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_page.dart b/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_page.dart index e9af69b4..33f1b2ac 100755 --- a/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_page.dart +++ b/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_page.dart @@ -422,27 +422,27 @@ class _SendElectronicKeyViewState extends State // _openModalBottomSheet(); // }, // ), - OutLineBtn( - btnName: - logic.state.emailOrPhoneController.text.contains('@') ? '邮件通知' : '短信通知', - onClick: () { - if (logic.state.emailOrPhoneController.text.contains('@')) { - Get.toNamed(Routers.sendEmailNotificationPage); - } else { - logic.sendMsg(isPhone: true); - } - }, - ), + if (logic.emailOrPhone != null) + OutLineBtn( + btnName: logic.emailOrPhone!.contains('@') ? '邮件通知' : '短信通知', + onClick: () { + if (logic.emailOrPhone!.contains('@')) { + Get.toNamed(Routers.sendEmailNotificationPage); + } else { + logic.sendMsg(isPhone: true); + } + }, + ), SizedBox( height: 10.h, ), - OutLineBtn( - btnName: '微信通知', - onClick: () { - logic.sendMsg( - isPhone: logic.state.emailOrPhoneController.text.contains('@')); - }, - ), + if (logic.emailOrPhone != null) + OutLineBtn( + btnName: '微信通知', + onClick: () { + logic.sendMsg(isPhone: logic.emailOrPhone!.contains('@')); + }, + ), ], ); } diff --git a/pubspec.yaml b/pubspec.yaml index 38c73add..5f669045 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,9 +62,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.53+2024052803:xhj 线上环境,提审 sky 线上环境提审 # 1.0.53+2024052804:xhj 线上环境,提审 修改鑫锁名字为星星锁 # 1.0.54+2024053001:xhj 线上环境,对外发布,提交测试 -# 1.0.56+202406401:xhj 线上环境,对外发布,提交测试 +# 1.0.56+2024060401:xhj 线上环境,对外发布,提交测试 -version: 1.0.56+202406401 +version: 1.0.56+2024060401 environment: sdk: '>=2.12.0 <3.0.0'