1,预计产生短信条数,短信和邮件差异化处理

2,模板内容没有对应的,已参考通通锁修改
3,列表和点开详情,只有自己输入的内容已修改
This commit is contained in:
“DaisyWu” 2024-07-02 17:42:26 +08:00
parent d4437f0ed9
commit 30d8e8d525
8 changed files with 136 additions and 544 deletions

View File

@ -186,8 +186,6 @@ import 'mine/mineSet/lockUserManage/lockUserManageList/lockUserManageList_page.d
import 'mine/mineSet/lockUserManage/ownedKeyList/ownedKeyList_page.dart';
import 'mine/supportStaff/supportStaff_page.dart';
import 'mine/valueAddedServices/valueAddedServicesBuy/valueAddedServicesBuy_page.dart';
import 'mine/valueAddedServices/valueAddedServicesEmailTemplate/valueAddedServicesAddEmailTemplate/valueAddedServicesAddEmailTemplate_page.dart';
import 'mine/valueAddedServices/valueAddedServicesEmailTemplate/valueAddedServicesListEmailTemplate/valueAddedServicesListEmailTemplate_page.dart';
import 'mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart';
import 'mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart';
import 'mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_page.dart';
@ -364,8 +362,6 @@ abstract class Routers {
'/NewSMSTemplatePage'; // -
static const String valueAddedServicesListEmailTemplatePage =
'/ValueAddedServicesListEmailTemplatePage'; // -
static const String valueAddedServicesAddEmailTemplatePage =
'/ValueAddedServicesAddEmailTemplatePage'; // -
static const String valueAddedServicesBuyAndUseRecordManagePage =
'/ValueAddedServicesBuyAndUseRecordManagePage'; // -使
@ -886,14 +882,6 @@ abstract class AppRouters {
name: Routers.newSMSTemplatePage,
page: () => const NewSMSTemplatePage(),
),
GetPage<dynamic>(
name: Routers.valueAddedServicesListEmailTemplatePage,
page: () => const ValueAddedServicesListEmailTemplatePage(),
),
GetPage<dynamic>(
name: Routers.valueAddedServicesAddEmailTemplatePage,
page: () => const ValueAddedServicesAddEmailTemplatePage(),
),
GetPage<dynamic>(
name: Routers.lockScreenPage,
page: () => const LockScreenPage(),

View File

@ -1,329 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/commonItem.dart';
import '../../../../tools/showBottomSheetTool.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
//
final TextStyle highStyle =
TextStyle(color: const Color(0xFFEEDFA8), fontSize: 20.sp);
//
final TextStyle defaultStyle = TextStyle(color: Colors.black, fontSize: 20.sp);
//-
InlineSpan emailPasswardSpan = TextSpan(children: [
TextSpan(
text:
'${TranslationLoader.lanKeys!.hello!.tr}${TranslationLoader.lanKeys!.yourRoomIs!.tr}',
style: defaultStyle),
TextSpan(
text: '{${TranslationLoader.lanKeys!.roomName!.tr}', style: highStyle),
TextSpan(
text: '${TranslationLoader.lanKeys!.theCodeToOpenTheDoorIs!.tr}',
style: defaultStyle),
TextSpan(
text: '{${TranslationLoader.lanKeys!.password!.tr}}', style: highStyle),
TextSpan(
text: '${TranslationLoader.lanKeys!.periodValidity!.tr}',
style: defaultStyle),
TextSpan(
text: '{${TranslationLoader.lanKeys!.periodValidity!.tr}}',
style: highStyle),
TextSpan(
text: '${TranslationLoader.lanKeys!.templateTip1!.tr}',
style: defaultStyle),
]);
//-
InlineSpan emailPasswardTipSpan = TextSpan(children: [
TextSpan(
text: TranslationLoader.lanKeys!.templateTip4!.tr, style: defaultStyle),
TextSpan(
text: '{${TranslationLoader.lanKeys!.roomName!.tr}}', style: highStyle),
TextSpan(text: '', style: defaultStyle),
TextSpan(
text: '{${TranslationLoader.lanKeys!.password!.tr}}', style: highStyle),
TextSpan(text: TranslationLoader.lanKeys!.and!.tr, style: defaultStyle),
TextSpan(
text: '{${TranslationLoader.lanKeys!.periodValidity!.tr}}',
style: highStyle),
TextSpan(
text: TranslationLoader.lanKeys!.willBeReplacedWithTheActualValue!.tr,
style: defaultStyle),
]);
String emaiPasswardStr =
"${TranslationLoader.lanKeys!.hello!.tr}${TranslationLoader.lanKeys!.yourRoomIs!.tr}{${TranslationLoader.lanKeys!.roomName!.tr}}${TranslationLoader.lanKeys!.theCodeToOpenTheDoorIs!.tr}{${TranslationLoader.lanKeys!.password!.tr}}。${TranslationLoader.lanKeys!.periodValidity!.tr}{${TranslationLoader.lanKeys!.periodValidity!.tr}}。${TranslationLoader.lanKeys!.templateTip1!.tr}";
//-
InlineSpan emailElectronicKeySpan = TextSpan(children: [
TextSpan(
text: TranslationLoader.lanKeys!.templateTip2!.tr, style: defaultStyle),
TextSpan(text: 'https://abc.com/bcd', style: highStyle)
]);
//-
InlineSpan emailElectronicKeyTipSpan = TextSpan(children: [
TextSpan(
text: TranslationLoader.lanKeys!.templateTip4!.tr, style: defaultStyle),
TextSpan(
text: '{${TranslationLoader.lanKeys!.downloadLink!.tr}',
style: highStyle),
TextSpan(
text: TranslationLoader.lanKeys!.willBeReplacedWithTheActualValue!.tr,
style: defaultStyle),
]);
String emailElectronicKeyStr =
"${TranslationLoader.lanKeys!.templateTip2!.tr}\n{${TranslationLoader.lanKeys!.downloadLink!.tr}}";
class ValueAddedServicesAddEmailTemplatePage extends StatefulWidget {
const ValueAddedServicesAddEmailTemplatePage({Key? key}) : super(key: key);
@override
State<ValueAddedServicesAddEmailTemplatePage> createState() =>
_ValueAddedServicesAddEmailTemplatePageState();
}
class _ValueAddedServicesAddEmailTemplatePageState
extends State<ValueAddedServicesAddEmailTemplatePage> {
final _templateOneTf = TextEditingController();
final _templateNameTf = TextEditingController();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
_templateOneTf.text = emailElectronicKeyStr;
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.customMailTemplate!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: ListView(
children: [
_buildEditTopInfo(),
SizedBox(
height: 10.h,
),
_buildEditTemplate(),
SizedBox(
height: 10.h,
),
_buildpreview(),
SizedBox(height: 42.h),
SubmitBtn(
btnName: TranslationLoader.lanKeys!.save!.tr,
borderRadius: 10.w,
margin: EdgeInsets.only(
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {
// Navigator.pushNamed(context, Routers.sendElectronicKeyManagePage);
}),
],
));
}
Widget _buildEditTopInfo() {
return Column(
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: getTFWidget(
_templateNameTf, TranslationLoader.lanKeys!.pleaseEnter!.tr)),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.type!.tr,
rightTitle: TranslationLoader.lanKeys!.password!.tr,
isHaveLine: false,
action: () {
_showSelectTemplateType();
}),
],
);
}
Widget _buildEditTemplate() {
return Container(
color: Colors.white,
child: Column(
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(
left: 25.w, top: 25.h, bottom: 25.h, right: 25.w),
child: Text(
TranslationLoader.lanKeys!.templateContent!.tr,
style:
TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w600),
),
),
],
),
Container(
margin: EdgeInsets.only(left: 25.w, right: 25.w, bottom: 25.h),
height: 100,
child: TextField(
maxLines: 8,
// maxLength:1000,
textAlign: TextAlign.start,
controller: _templateOneTf,
style: TextStyle(
color: Colors.black,
fontSize: 28.sp,
),
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
top: 20.h, left: 20.w, right: 20.w, bottom: 20.h),
border: OutlineInputBorder(
///
borderRadius: BorderRadius.all(Radius.circular(20.h)),
///
borderSide: const BorderSide(
///
color: Color(0xffB2B2B2),
///
width: 0.5,
),
),
///
focusedBorder: OutlineInputBorder(
///
borderRadius: BorderRadius.all(Radius.circular(20.h)),
///
borderSide: const BorderSide(
///
color: Color(0xffB2B2B2),
///
width: 1,
),
),
),
),
),
Container(
padding: EdgeInsets.only(
top: 20.h, left: 20.w, right: 20.w, bottom: 20.h),
margin: EdgeInsets.only(left: 15.w, right: 15.w, bottom: 15.h),
decoration: BoxDecoration(
color: const Color(0xFFFbF9EC),
borderRadius: BorderRadius.circular(10.h)),
child: RichText(text: emailElectronicKeyTipSpan),
)
],
),
);
}
Widget _buildpreview() {
return Column(
// mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
color: Colors.white,
margin: EdgeInsets.only(bottom: 20.h),
child: Column(
children: [
Column(
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(
left: 25.w,
top: 25.h,
bottom: 25.h,
right: 25.w),
child: Text(
TranslationLoader.lanKeys!.preview!.tr,
style: TextStyle(fontSize: 20.sp),
),
),
],
),
Container(
margin: EdgeInsets.only(
left: 25.w, right: 25.w, bottom: 20.h),
padding: EdgeInsets.only(
left: 20.w, top: 20.h, right: 20.w, bottom: 20.h),
decoration: BoxDecoration(
color: const Color(0xFFF5F5F5),
borderRadius: BorderRadius.circular(10.h),
),
child: RichText(text: emailElectronicKeySpan),
)
],
),
],
))
]);
}
Widget getTFWidget(TextEditingController tfController, String tfStr) {
return Container(
height: 50.h,
width: 500.w,
child: Row(
children: [
Expanded(
child: TextField(
//
maxLines: 1,
controller: tfController,
autofocus: false,
textAlign: TextAlign.end,
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
hintText: tfStr,
//线
border: InputBorder.none,
),
),
),
],
),
);
}
void _showSelectTemplateType() {
var list = [
TranslationLoader.lanKeys!.electronicKey!.tr,
TranslationLoader.lanKeys!.password!.tr
];
ShowBottomSheetTool().showSingleRowPicker(
//
context,
//
normalIndex: 0,
title: TranslationLoader.lanKeys!.type!.tr,
cancelTitle: TranslationLoader.lanKeys!.cancel!.tr,
sureTitle: TranslationLoader.lanKeys!.sure!.tr,
//
//
//adapter: PickerAdapter(),
data: list,
//
clickCallBack: (int index, var str) {});
}
}

View File

@ -1,164 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
import '../valueAddedServicesAddEmailTemplate/valueAddedServicesAddEmailTemplate_page.dart';
class ValueAddedServicesListEmailTemplatePage extends StatefulWidget {
const ValueAddedServicesListEmailTemplatePage({Key? key}) : super(key: key);
@override
State<ValueAddedServicesListEmailTemplatePage> createState() =>
_ValueAddedServicesListEmailTemplatePageState();
}
class _ValueAddedServicesListEmailTemplatePageState
extends State<ValueAddedServicesListEmailTemplatePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: '自定义邮件模版'.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Column(
children: [
_topTipWidget(),
Expanded(child: _buildMainUI()),
SubmitBtn(
btnName: TranslationLoader.lanKeys!.creatingANewTemplate!.tr,
borderRadius: 20.w,
margin: EdgeInsets.only(
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {
Navigator.pushNamed(
context, Routers.valueAddedServicesAddEmailTemplatePage);
}),
SizedBox(
height: 64.h,
)
],
),
);
}
Widget _topTipWidget() {
return Container(
margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w),
padding:
EdgeInsets.only(top: 20.h, left: 20.w, right: 20.w, bottom: 20.h),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Column(
children: [
Text(TranslationLoader.lanKeys!.customTemplatesTip!.tr),
SizedBox(
height: 15.h,
),
Container(
padding: EdgeInsets.only(
top: 15.h, left: 15.w, right: 15.w, bottom: 15.h),
decoration: BoxDecoration(
color: const Color(0xFFFbF9EC),
borderRadius: BorderRadius.circular(10.h)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 1.sw - 15.w * 2 - 40.w * 2 - 140.w,
// margin: EdgeInsets.only(top:15.h, left: 15.w, right: 15.w, bottom: 15.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${TranslationLoader.lanKeys!.currentState!.tr}${TranslationLoader.lanKeys!.onTrial!.tr}",
style: TextStyle(
fontSize: 20.sp, fontWeight: FontWeight.w600),
),
Text(TranslationLoader.lanKeys!.unHaveOpenedTip2!.tr,
style: TextStyle(
fontSize: 20.sp, fontWeight: FontWeight.w600))
],
),
),
GestureDetector(
onTap: () {
Navigator.pushNamed(
context, Routers.valueAddedServicesHighFunctionPage);
},
child: Container(
width: 100.w,
height: 50.h,
decoration: BoxDecoration(
color: const Color(0xFFCAB68D),
borderRadius: BorderRadius.circular(35.h)),
child: Center(
child: Text(
TranslationLoader.lanKeys!.goToTheOpen!.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white, fontSize: 20.sp)))),
),
],
),
)
],
));
}
Widget _buildMainUI() {
return ListView.builder(
itemCount: 10,
itemBuilder: (c, index) {
return _valueAddedServicesListSMSTemplateItem(
'images/icon_lock.png', "张三", () {
// Navigator.pushNamed(context, Routers.valueAddedServicesAddSMSTemplatePage);
});
});
}
Widget _valueAddedServicesListSMSTemplateItem(
String title, String content, Function() action) {
return GestureDetector(
onTap: action,
child: Container(
// height: 100.h,
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10.w),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 30.h, top: 30.h, bottom: 20.h),
child: Text(
"101",
style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500),
),
),
Container(
margin: EdgeInsets.only(left: 25.w, right: 25.w, bottom: 25.h),
decoration: BoxDecoration(
color: const Color(0xFFF5F5F5),
borderRadius: BorderRadius.circular(10.h),
),
child: Padding(
padding: EdgeInsets.only(
left: 20.w, top: 20.h, right: 20.w, bottom: 20.h),
child: RichText(text: emailElectronicKeySpan)),
),
],
),
),
);
}
}

View File

@ -1,6 +1,13 @@
import 'dart:convert';
class NewSMSTemplateEntity {
NewSMSTemplateEntity(
{this.errorCode, this.description, this.errorMsg, this.dataList});
NewSMSTemplateEntity({
this.errorCode,
this.description,
this.errorMsg,
this.dataList,
});
NewSMSTemplateEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
@ -12,6 +19,7 @@ class NewSMSTemplateEntity {
});
}
}
int? errorCode;
String? description;
String? errorMsg;
@ -30,18 +38,29 @@ class NewSMSTemplateEntity {
}
class SMSTemplateData {
SMSTemplateData(
{this.contentType, this.typeName, this.template, this.fixedKey});
SMSTemplateData({
this.contentType,
this.typeName,
this.template,
this.fixedKey,
this.templatePreviewCode,
});
SMSTemplateData.fromJson(Map<String, dynamic> json) {
contentType = json['content_type'];
typeName = json['typeName'];
template = json['template'];
fixedKey = json['fixed_key'];
templatePreviewCode = json['template_preview_code'] != null
? jsonEncode(json['template_preview_code'])
: null;
}
int? contentType;
String? typeName;
String? template;
String? fixedKey;
String? templatePreviewCode; // Changed to String
String? regards = '';
String? tips = '';
int? id;
@ -55,6 +74,28 @@ class SMSTemplateData {
data['typeName'] = typeName;
data['template'] = template;
data['fixed_key'] = fixedKey;
if (templatePreviewCode != null) {
data['template_preview_code'] = jsonDecode(templatePreviewCode!);
}
return data;
}
// New method to replace template variables with values from templatePreviewCode
String generatePreview() {
if (template == null || templatePreviewCode == null) {
return '';
}
// Decode the templatePreviewCode string back to a map
final Map<String, String> previewCodeMap =
Map<String, String>.from(jsonDecode(templatePreviewCode!));
String previewTemplate = template!;
previewCodeMap.forEach((String key, String value) {
previewTemplate = previewTemplate.replaceAll(
key, value + (value.length > 2 ? '\n' : ''));
});
return previewTemplate;
}
}

View File

@ -94,6 +94,27 @@ class NewSMSTemplateLogic extends BaseGetXController {
),
);
}
if (isPreview) {
if (state.currentTemplate.value.generatePreview().isNotEmpty) {
textSpans.add(
TextSpan(
text: state.currentTemplate.value.generatePreview(),
style: state.defaultStyle,
),
);
} else {
textSpans.addAll(_buildDefaultTemplate(isPreview));
}
} else {
textSpans.addAll(_buildDefaultTemplate(isPreview));
}
return textSpans;
}
List<TextSpan> _buildDefaultTemplate(bool isPreview) {
final List<TextSpan> textSpans = <TextSpan>[];
//
final List<String> textFragments = state.currentTemplate.value.template
?.split(RegularExpression.urlRegExp) ??
@ -129,7 +150,6 @@ class NewSMSTemplateLogic extends BaseGetXController {
}
}
//
if (isPreview) {
textSpans.add(
TextSpan(
@ -209,10 +229,30 @@ class NewSMSTemplateLogic extends BaseGetXController {
),
);
}
//
if (state.templateType == 1 ||
(state.templateType == 2 && isPreview == false)) {
if ((state.templateType.value == 1) ||
(state.templateType.value == 2 && isPreview == false)) {
if (isPreview) {
if (state.currentTemplate.value.generatePreview().isNotEmpty) {
textSpans.add(
TextSpan(
text: state.currentTemplate.value.generatePreview(),
style: state.defaultStyle,
),
);
//
if (isPreview) {
textSpans.add(
TextSpan(
text: '\n${state.templateTwoTf.text}',
style: state.defaultStyle,
),
);
}
}
return textSpans;
}
// ${}
final RegExp variableRegExp = RegExp(r'\$\{([^}]+)\}');
@ -281,8 +321,8 @@ class NewSMSTemplateLogic extends BaseGetXController {
Future<void> onReady() async {
super.onReady();
if (state.currentTemplate.value.isUpdate == false) {
getDefaultTemplate();
}
// if (state.currentTemplate.value.isUpdate == false) {
getDefaultTemplate();
// }
}
}

View File

@ -29,7 +29,13 @@ class _NewSMSTemplatePageState extends State<NewSMSTemplatePage> {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: state.templateType.value == 1 ? '新建短信模版'.tr : '新建邮件模版'.tr,
barTitle: state.isUpdate.value == false
? state.templateType.value == 1
? '新建短信模版'.tr
: '新建邮件模版'.tr
: state.templateType.value == 1
? '编辑短信模版'.tr
: '编辑邮件模版'.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
@ -75,15 +81,15 @@ class _NewSMSTemplatePageState extends State<NewSMSTemplatePage> {
TranslationLoader.lanKeys!.pleaseEnter!.tr,
),
),
Obx(
() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.type!.tr,
rightTitle: state.currentTemplate.value.typeName ?? '',
isHaveLine: false,
isHaveDirection: true,
action: _showSelectTemplateType,
),
),
Obx(() => state.isUpdate.value == false
? CommonItem(
leftTitel: TranslationLoader.lanKeys!.type!.tr,
rightTitle: state.currentTemplate.value.typeName ?? '',
isHaveLine: false,
isHaveDirection: true,
action: _showSelectTemplateType,
)
: Container()),
],
);
}
@ -113,6 +119,7 @@ class _NewSMSTemplatePageState extends State<NewSMSTemplatePage> {
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),
@ -152,6 +159,8 @@ class _NewSMSTemplatePageState extends State<NewSMSTemplatePage> {
),
Obx(() => Container(
width: 1.sw - 50.w,
// margin: EdgeInsets.only(left: 25.w, right: 25.w, bottom: 20.h),
// padding: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 20.h),
margin: EdgeInsets.only(left: 25.w, right: 25.w),
padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 10.h),
decoration: BoxDecoration(
@ -160,20 +169,25 @@ class _NewSMSTemplatePageState extends State<NewSMSTemplatePage> {
),
child: _buildTemplateWithType(isPreview: true),
)),
Padding(
padding: EdgeInsets.only(
left: 25.w,
top: 25.h,
bottom: 25.h,
),
child: Text(
'预计产生短信条数:${state.smsCost.value}',
style: TextStyle(
color: Colors.grey,
fontSize: 20.sp,
if (state.templateType.value == 1)
Padding(
padding: EdgeInsets.only(
left: 25.w,
top: 25.h,
bottom: 25.h,
),
),
),
child: Text(
'预计产生短信条数:${state.smsCost.value}',
style: TextStyle(
color: Colors.grey,
fontSize: 20.sp,
),
),
)
else
SizedBox(
height: 20.h,
)
],
),
);

View File

@ -13,6 +13,7 @@ class NewSMSTemplateState {
templateOneTf.text = currentTemplate.value.regards ?? '';
templateTwoTf.text = currentTemplate.value.tips ?? '';
templateType.value = currentTemplate.value.type ?? 0;
isUpdate.value = map['isUpdate'];
}
}
@ -34,4 +35,6 @@ class NewSMSTemplateState {
RxBool isShowDate = false.obs; //
RxInt templateType = 0.obs; //1 2
RxInt smsCost = 0.obs; //
RxString preContent = ''.obs; //
RxBool isUpdate = false.obs; //
}

View File

@ -72,8 +72,9 @@ class _CustomSMSTemplateListPageState extends State<CustomSMSTemplateListPage> {
templateData.typeName =
templateData.contentType == 1 ? '电子钥匙' : '密码';
final result = await Get.toNamed(Routers.newSMSTemplatePage,
arguments: <String, SMSTemplateData>{
'currentTemplate': templateData
arguments: {
'currentTemplate': templateData,
'isUpdate': false
});
if (result != null) {
logic.getSMSTemplateListRequest(isRefresh: true);
@ -207,9 +208,7 @@ class _CustomSMSTemplateListPageState extends State<CustomSMSTemplateListPage> {
templateData.type = itemData.type;
templateData.isUpdate = true;
final result = await Get.toNamed(Routers.newSMSTemplatePage,
arguments: <String, SMSTemplateData>{
'currentTemplate': templateData
});
arguments: {'currentTemplate': templateData, 'isUpdate': true});
if (result != null) {
logic.getSMSTemplateListRequest(isRefresh: true);
}