From 30864b5b2f9de11e28c7804caef3864e64303d54 Mon Sep 17 00:00:00 2001 From: liyi Date: Fri, 28 Feb 2025 14:52:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=B0=83=E6=95=B4=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E6=A8=A1=E7=89=88=E5=8F=AA=E6=9C=89=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=86=85=E5=AE=B9=E6=97=A0=E6=B3=95=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E5=AE=A1=E6=A0=B8=E5=AF=BC=E8=87=B4=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sendEmailNotification_logic.dart | 7 +++- .../sendEmailNotification_page.dart | 6 +-- .../newSMSTemplate_page.dart | 42 +++++++++++-------- 3 files changed, 34 insertions(+), 21 deletions(-) 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'),