fix:调整短信模版只有第二部分内容无法通过审核导致出现不存在的问题

This commit is contained in:
liyi 2025-02-28 14:52:04 +08:00
parent f23fdea62a
commit 30864b5b2f
3 changed files with 34 additions and 21 deletions

View File

@ -11,8 +11,13 @@ import 'package:url_launcher/url_launcher.dart';
class SendEmailNotificationLogic extends BaseGetXController { class SendEmailNotificationLogic extends BaseGetXController {
final SendEmailNotificationState state = SendEmailNotificationState(); final SendEmailNotificationState state = SendEmailNotificationState();
onInit() async {
super.onInit();
getKeyNoticeTemplate();
}
// 1 2 // 1 2
Future<void> getKeyNoticeTemplate() async { void getKeyNoticeTemplate() async {
final SendEmailNotificationEntity entity; final SendEmailNotificationEntity entity;
if (state.unlockType.value == 1) { if (state.unlockType.value == 1) {
entity = await ApiRepository.to.getKeyNoticeTemplate( entity = await ApiRepository.to.getKeyNoticeTemplate(

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
@ -33,10 +32,10 @@ class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
Get.find<SendEmailNotificationLogic>().state; Get.find<SendEmailNotificationLogic>().state;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
logic.getKeyNoticeTemplate();
} }
@override @override
@ -340,6 +339,7 @@ class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
Pickers.showSinglePicker(context, Pickers.showSinglePicker(context,
data: nameList, data: nameList,
selectData: state.currentNotifyItem.value.name,
pickerStyle: DefaultPickerStyle(), onConfirm: (p, int position) { pickerStyle: DefaultPickerStyle(), onConfirm: (p, int position) {
state.currentNotifyItem.value = state.emailTemplateList[position]; state.currentNotifyItem.value = state.emailTemplateList[position];
state.templateContentController.text = state.templateContentController.text =

View File

@ -129,23 +129,30 @@ class _NewSMSTemplatePageState extends State<NewSMSTemplatePage> {
height: 100, height: 100,
child: _buildContentTF(state.templateOneTf), child: _buildContentTF(state.templateOneTf),
), ),
Obx(() => Container( Obx(
width: 1.sw - 50.w, () => Container(
margin: EdgeInsets.only(left: 25.w, right: 25.w), width: 1.sw - 50.w,
padding: EdgeInsets.only(bottom: 20.h), margin: EdgeInsets.only(left: 25.w, right: 25.w),
child: _buildTemplateWithType(isPreview: false), 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: <Widget>[
_buildContentTF(state.templateTwoTf),
],
), ),
) ),
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: <Widget>[
_buildContentTF(state.templateTwoTf),
],
),
)
: SizedBox.shrink()
], ],
), ),
); );
@ -247,7 +254,8 @@ class _NewSMSTemplatePageState extends State<NewSMSTemplatePage> {
height: 65.h, height: 65.h,
width: 320.w, width: 320.w,
child: TextField( child: TextField(
controller: tfController, // controller: tfController,
//
maxLines: 3, maxLines: 3,
inputFormatters: <TextInputFormatter>[ inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),