diff --git a/.DS_Store b/.DS_Store index fdfcd7d0..ed4e320f 100755 Binary files a/.DS_Store and b/.DS_Store differ 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'