diff --git a/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_logic.dart b/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_logic.dart index 74cb3546..a0c026a8 100644 --- a/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_logic.dart +++ b/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_logic.dart @@ -11,8 +11,13 @@ import 'package:url_launcher/url_launcher.dart'; class SendEmailNotificationLogic extends BaseGetXController { final SendEmailNotificationState state = SendEmailNotificationState(); + onInit() async { + super.onInit(); + getKeyNoticeTemplate(); + } + //获取电子钥匙通知模板 渠道:1短信 2邮箱 - Future getKeyNoticeTemplate() async { + void getKeyNoticeTemplate() async { final SendEmailNotificationEntity entity; if (state.unlockType.value == 1) { entity = await ApiRepository.to.getKeyNoticeTemplate( diff --git a/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart b/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart index a398986a..90e4c33e 100755 --- a/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart +++ b/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; @@ -33,10 +32,10 @@ class _SendEmailNotificationPageState extends State { Get.find().state; @override - void initState() { + void initState() { super.initState(); - logic.getKeyNoticeTemplate(); + } @override @@ -340,6 +339,7 @@ class _SendEmailNotificationPageState extends State { Pickers.showSinglePicker(context, data: nameList, + selectData: state.currentNotifyItem.value.name, pickerStyle: DefaultPickerStyle(), onConfirm: (p, int position) { state.currentNotifyItem.value = state.emailTemplateList[position]; state.templateContentController.text = diff --git a/lib/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_page.dart b/lib/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_page.dart index 09f3b20a..31ceef52 100755 --- a/lib/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_page.dart +++ b/lib/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_page.dart @@ -129,23 +129,30 @@ class _NewSMSTemplatePageState extends State { height: 100, child: _buildContentTF(state.templateOneTf), ), - Obx(() => Container( - width: 1.sw - 50.w, - margin: EdgeInsets.only(left: 25.w, right: 25.w), - padding: EdgeInsets.only(bottom: 20.h), - child: _buildTemplateWithType(isPreview: false), - )), - SizedBox(height: 10.h), - Container( - margin: EdgeInsets.symmetric(horizontal: 25.w, vertical: 25.h), - height: 100, - child: Stack( - alignment: Alignment.bottomRight, - children: [ - _buildContentTF(state.templateTwoTf), - ], + Obx( + () => Container( + width: 1.sw - 50.w, + margin: EdgeInsets.only(left: 25.w, right: 25.w), + padding: EdgeInsets.only(bottom: 20.h), + child: _buildTemplateWithType(isPreview: false), ), - ) + ), + state.channelType.value == 1 + ? SizedBox(height: 10.h) + : SizedBox.shrink(), + state.channelType.value == 1 + ? Container( + margin: + EdgeInsets.symmetric(horizontal: 25.w, vertical: 25.h), + height: 100, + child: Stack( + alignment: Alignment.bottomRight, + children: [ + _buildContentTF(state.templateTwoTf), + ], + ), + ) + : SizedBox.shrink() ], ), ); @@ -247,7 +254,8 @@ class _NewSMSTemplatePageState extends State { height: 65.h, width: 320.w, child: TextField( - controller: tfController, //输入框一行 + controller: tfController, + //输入框一行 maxLines: 3, inputFormatters: [ FilteringTextInputFormatter.deny('\n'),