1,新增自定义短信模版列表接口对接
2,新增获取默认短信模版接口对接及相应逻辑处理 3,新增电子钥匙、密码模版相关逻辑及布局处理 4,新增添加短信模版(电子钥匙、密码)接口对接 5,修复新建短信模版点击报错不能展示问题
This commit is contained in:
parent
6114044991
commit
caf62a7413
@ -861,5 +861,9 @@
|
||||
"四": "Thu",
|
||||
"五": "Fri",
|
||||
"六": "Sat",
|
||||
"日": "Sun"
|
||||
"日": "Sun",
|
||||
"新建短信模版":"New SMS template",
|
||||
"自定义短信模版":"Custom SMS template",
|
||||
"自定义邮件模版":"Custom email template",
|
||||
"名称":"Name"
|
||||
}
|
||||
|
||||
@ -893,5 +893,9 @@
|
||||
"四":"四",
|
||||
"五":"五",
|
||||
"六":"六",
|
||||
"日":"日"
|
||||
"日":"日",
|
||||
"新建短信模版":"新建短信模版",
|
||||
"自定义短信模版":"自定义短信模版",
|
||||
"自定义邮件模版":"自定义邮件模版",
|
||||
"名称":"名称"
|
||||
}
|
||||
|
||||
@ -334,8 +334,6 @@
|
||||
"emailBuyTip": "您可通过邮件将密码、电子钥匙信息发给接收人。",
|
||||
"currentRemainingQuantity": "当前剩余数量",
|
||||
"buy": "购买",
|
||||
"customSMSTemplate": "自定义短信模版",
|
||||
"customMailTemplate": "自定义邮件模版",
|
||||
"record": "记录",
|
||||
"buyRealNameTip": "给用户发送电子钥匙时,可以要求其开锁前先进行人脸识别,以保证是他本人在操作。人脸实名认证调用国家公安系统接口,为付费功能,请购买次数后再使用。",
|
||||
"buyRealNameSelectYouWantBuyTip": "请选择你希望的实名认证频次",
|
||||
@ -863,5 +861,9 @@
|
||||
"四": "四",
|
||||
"五": "五",
|
||||
"六": "六",
|
||||
"日": "日"
|
||||
"日": "日",
|
||||
"新建短信模版":"新建短信模版",
|
||||
"自定义短信模版":"自定义短信模版",
|
||||
"自定义邮件模版":"自定义邮件模版",
|
||||
"名称":"名称"
|
||||
}
|
||||
|
||||
@ -190,8 +190,8 @@ import 'mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedService
|
||||
import 'mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/valueAddedServicesAddSMSTemplate_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/valueAddedServicesListSMSTemplate_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/customSMSTemplateList_page.dart';
|
||||
import 'mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdministratorList_page.dart';
|
||||
import 'starLockApplication/starLockApplication.dart';
|
||||
import 'tools/seletKeyCyclicDate/seletKeyCyclicDate_page.dart';
|
||||
@ -208,19 +208,25 @@ abstract class Routers {
|
||||
static const String lockAddressGaoDePage = '/LockAddressGaoDePage'; // 锁地址-高德
|
||||
static const String saveLockPage = '/SaveLockPage'; // 保存锁
|
||||
static const String lockDetailMainPage = '/LockDetailMainPage'; // 锁详情
|
||||
static const String electronicKeyListPage = '/ElectronicKeyListPage'; // 电子钥匙列表
|
||||
static const String electronicKeyDetailPage = '/ElectronicKeyDetailPage'; // 电子钥匙详情
|
||||
static const String electronicKeyListPage =
|
||||
'/ElectronicKeyListPage'; // 电子钥匙列表
|
||||
static const String electronicKeyDetailPage =
|
||||
'/ElectronicKeyDetailPage'; // 电子钥匙详情
|
||||
static const String electronicKeyDetailChangeDate =
|
||||
'/ElectronicKeyDetailChangeDate'; // 修改有效期
|
||||
static const String sendElectronicKeyPage = '/SendElectronicKeyPage'; // 发送电子钥匙
|
||||
static const String sendElectronicKeyPage =
|
||||
'/SendElectronicKeyPage'; // 发送电子钥匙
|
||||
static const String massSendElectronicKeyManagePage =
|
||||
'/MassSendElectronicKeyManagePage'; // 群发钥匙
|
||||
static const String electronicKeyPeriodValidityPage =
|
||||
'/ElectronicKeyPeriodValidityPage'; // 电子钥匙有效期
|
||||
static const String sendEmailNotificationPage = '/SendEmailNotificationPage'; // 邮件通知
|
||||
static const String sendEmailNotificationPage =
|
||||
'/SendEmailNotificationPage'; // 邮件通知
|
||||
static const String passwordKeyListPage = '/PasswordKeyListPage'; // 密码钥匙列表
|
||||
static const String passwordKeyPerpetualPage = '/PasswordKeyPerpetualPage'; // 密码钥匙
|
||||
static const String passwordKeyDetailPage = '/PasswordKeyDetailPage'; // 密码钥匙详情
|
||||
static const String passwordKeyPerpetualPage =
|
||||
'/PasswordKeyPerpetualPage'; // 密码钥匙
|
||||
static const String passwordKeyDetailPage =
|
||||
'/PasswordKeyDetailPage'; // 密码钥匙详情
|
||||
// static const otherTypeKeyListPage = '/OtherTypeKeyListPage'; // 卡、指纹、遥控钥匙列表
|
||||
// static const otherTypeKeyDetailPage = '/OtherTypeKeyDetailPage'; // 卡、指纹、遥控钥匙详情
|
||||
// static const otherTypeKeyManagePage = '/OtherTypeKeyManagePage'; // 卡、指纹、遥控钥匙添加
|
||||
@ -229,35 +235,41 @@ abstract class Routers {
|
||||
static const String otherTypeKeyChangeValidityDatePage =
|
||||
'/OtherTypeKeyChangeValidityDatePage'; // 卡、指纹、遥控钥匙详情修改有效期
|
||||
|
||||
static const String addFingerprintTipPage = '/AddFingerprintTipPage'; // 添加指纹提示
|
||||
static const String addFingerprintTipPage =
|
||||
'/AddFingerprintTipPage'; // 添加指纹提示
|
||||
static const String addFingerprintPage = '/AddFingerprintPage'; // 添加指纹
|
||||
static const String addICCardPage = '/AddICCardPage'; // 添加卡
|
||||
|
||||
static const String authorizedAdminListPage = '/AuthorizedAdminListPage'; // 授权管理员列表
|
||||
static const String authorizedAdminListPage =
|
||||
'/AuthorizedAdminListPage'; // 授权管理员列表
|
||||
static const String authorizedAdminDetailPage =
|
||||
'/AuthorizedAdminDetailPage'; // 授权管理员详情
|
||||
static const String authorizedAdminPage = '/AuthorizedAdminPage'; // 授权管理员
|
||||
static const String volumeAuthorizationLockManagePage =
|
||||
'/VolumeAuthorizationLockManagePage'; // 批量授权锁
|
||||
static const String lockOperatingRecordPage = '/LockOperatingRecordPage'; // 操作记录
|
||||
static const String lockOperatingRecordPage =
|
||||
'/LockOperatingRecordPage'; // 操作记录
|
||||
static const String lockSetPage = '/LockSetPage'; // 锁设置
|
||||
static const String basicInformationPage = '/BasicInformationPage'; // 基本信息
|
||||
static const String uploadElectricQuantityPage =
|
||||
'/UploadElectricQuantityPage'; // 更新锁电量
|
||||
static const String editLockNamePage = '/EditLockNamePage'; // 修改锁名字
|
||||
static const String lockSelectGroupingPage = '/LockSelectGroupingPage'; // 锁选择分组
|
||||
static const String lockSelectGroupingPage =
|
||||
'/LockSelectGroupingPage'; // 锁选择分组
|
||||
static const String groupEditLockPage = '/GroupEditLockPage'; // 编辑锁分组里面的锁
|
||||
static const String adminOpenLockPasswordPage =
|
||||
'/AdminOpenLockPasswordPage'; // 管理员开锁密码
|
||||
static const String wirelessKeyboardPage = '/WirelessKeyboardPage'; // 蓝牙键盘
|
||||
static const String addWirelessKeyboardPage = '/AddWirelessKeyboardPage'; // 添加蓝牙键盘
|
||||
static const String addWirelessKeyboardPage =
|
||||
'/AddWirelessKeyboardPage'; // 添加蓝牙键盘
|
||||
static const String addWirelessKeyboardScreenNotLightOnPage =
|
||||
'/AddWirelessKeyboardScreenNotLightOnPage'; // 添加蓝牙键盘屏幕不亮时提示
|
||||
static const String selectWirelessKeyboardPage =
|
||||
'/SelectWirelessKeyboardPage'; // 选择蓝牙键盘
|
||||
static const String doorMagneticPage = '/DoorMagneticPage'; // 门磁列表
|
||||
static const String addDoorMagneticPage = '/AddDoorMagneticPage'; // 添加门磁
|
||||
static const String nearbyDoorMagneticPage = '/NearbyDoorMagneticPage'; // 附近的门磁
|
||||
static const String nearbyDoorMagneticPage =
|
||||
'/NearbyDoorMagneticPage'; // 附近的门磁
|
||||
static const String remoteUnlockingPage = '/RemoteUnlockingPage'; // 远程开锁
|
||||
static const String automaticBlockingPage = '/AutomaticBlockingPage'; // 自动闭锁
|
||||
static const String normallyOpenModePage = '/NormallyOpenModePage'; // 常开模式
|
||||
@ -270,21 +282,28 @@ abstract class Routers {
|
||||
static const String lockTimePage = '/LockTimePage'; // 锁时间
|
||||
static const String diagnosePage = '/DiagnosePage'; // 诊断
|
||||
static const String uploadDataPage = '/UploadDataPage'; // 上传数据
|
||||
static const String importOtherLockDataPage = '/ImportOtherLockDataPage'; // 导入其他锁数据
|
||||
static const String importOtherLockDataPage =
|
||||
'/ImportOtherLockDataPage'; // 导入其他锁数据
|
||||
static const String lockEscalationPage = '/LockEscalationPage'; // 锁升级
|
||||
static const String markedHouseStatePage = '/MarkedHouseStatePage'; // 标记房态
|
||||
static const String checkInCreatCompanyPage = '/CheckInCreatCompanyPage'; // 创建公司
|
||||
static const String checkInCreatCompanyPage =
|
||||
'/CheckInCreatCompanyPage'; // 创建公司
|
||||
static const String checkingInListPage = '/CheckingInListPage'; // 考勤
|
||||
static const String checkingInSetPage = '/CheckingInSetPage'; // 考勤设置
|
||||
static const String checkingInStaffManagePage = '/CheckingInStaffManagePage'; // 员工管理
|
||||
static const String checkingInAddStaffPage = '/CheckingInAddStaffPage'; // 添加员工
|
||||
static const String checkingInStaffDetailPage = '/CheckingInStaffDetailPage'; // 编辑员工
|
||||
static const String checkingInStaffManagePage =
|
||||
'/CheckingInStaffManagePage'; // 员工管理
|
||||
static const String checkingInAddStaffPage =
|
||||
'/CheckingInAddStaffPage'; // 添加员工
|
||||
static const String checkingInStaffDetailPage =
|
||||
'/CheckingInStaffDetailPage'; // 编辑员工
|
||||
static const String checkingInSetWorkTimePage =
|
||||
'/CheckingInSetWorkTimePage'; // 工作时间设置
|
||||
static const String checkingInSetWorkdaySet = '/CheckingInSetWorkdaySet'; // 工作日设置
|
||||
static const String checkingInSetWorkdaySet =
|
||||
'/CheckingInSetWorkdaySet'; // 工作日设置
|
||||
static const String checkingInSetHolidaysPage =
|
||||
'/CheckingInSetHolidaysPage'; // 节假日设置
|
||||
static const String checkingInAddHolidaysPage = '/CheckingInAddHolidaysPage'; // 添加假日
|
||||
static const String checkingInAddHolidaysPage =
|
||||
'/CheckingInAddHolidaysPage'; // 添加假日
|
||||
static const String checkingInDetailPage = '/CheckingInDetailPage'; // 考勤详情
|
||||
static const String checkingInDeletHolidaysPage =
|
||||
'/CheckingInDeletHolidaysPage'; // 删除考勤
|
||||
@ -306,13 +325,15 @@ abstract class Routers {
|
||||
'/MinePersonInfoSetSafetyProblemPage'; // 我的信息设置安全问题
|
||||
static const String minePersonInfoViewSafetyProblemPage =
|
||||
'/MinePersonInfoViewSafetyProblemPage'; // 查看我的安全问题
|
||||
static const String mineBindPhoneOrEmailPage = '/MineBindPhoneOrEmailPage'; //我的信息-邮箱
|
||||
static const String mineBindPhoneOrEmailPage =
|
||||
'/MineBindPhoneOrEmailPage'; //我的信息-邮箱
|
||||
|
||||
static const String gatewayListPage = '/GatewayListPage'; // 我的-网关
|
||||
static const String gatewayDetailPage = '/GatewayDetailPage'; // 我的-网关详情
|
||||
static const String gatewayConnectionLockPage =
|
||||
'/GatewayConnectionLockPage'; // 我的-网关网关链接的锁
|
||||
static const String selectGatewayTypePage = '/SelectGatewayTypePage'; // 我的-选择网关类型
|
||||
static const String selectGatewayTypePage =
|
||||
'/SelectGatewayTypePage'; // 我的-选择网关类型
|
||||
static const String selectGatewayTypeNextTipPage =
|
||||
'/SelectGatewayTypeNextTipPage'; // 我的-选择网关类型下一步
|
||||
static const String selectGatewayPage = '/SelectGatewayPage'; // 我的-选择网关
|
||||
@ -322,7 +343,8 @@ abstract class Routers {
|
||||
static const String messageListPage = '/MessageListPage'; // 我的-消息
|
||||
static const String messageDetailPage = '/MessageDetailPage'; // 我的-消息详情
|
||||
static const String supportStaffPage = '/SupportStaffPage'; // 我的-客服
|
||||
static const String valueAddedServicesPage = '/ValueAddedServicesPage'; // 我的-增值服务
|
||||
static const String valueAddedServicesPage =
|
||||
'/ValueAddedServicesPage'; // 我的-增值服务
|
||||
static const String aboutPage = '/AboutPage'; // 我的-关于
|
||||
|
||||
static const String valueAddedServicesNoteAndEmailDetailPage =
|
||||
@ -352,13 +374,15 @@ abstract class Routers {
|
||||
static const String hideInvalidUnlockPermissionsPage =
|
||||
'/HideInvalidUnlockPermissionsPage'; // 我的设置-隐藏无效开锁权限
|
||||
|
||||
static const String lockUserManageLisPage = '/LockUserManageLisPage'; //我的设置-锁用户管理
|
||||
static const String lockUserManageLisPage =
|
||||
'/LockUserManageLisPage'; //我的设置-锁用户管理
|
||||
static const String authorizedAdministratorListPage =
|
||||
'/AuthorizedAdministratorListPage'; //我的设置-授权管理员
|
||||
static const String lockGroupListPage = '/LockGroupListPage'; //我的设置-锁分组
|
||||
static const String lockItemListPage = '/LockItemListPage'; //锁分组-锁列表
|
||||
static const String transferSmartLockPage = '/transferSmartLockPage'; //转移智能锁
|
||||
static const String recipientInformationPage = '/recipientInformationPage'; //接受人信息
|
||||
static const String recipientInformationPage =
|
||||
'/recipientInformationPage'; //接受人信息
|
||||
static const String selectBranchPage = '/SelectBranchPage'; //选择分店
|
||||
static const String selectGetewayListPage = '/selectGetewayListPage'; //选择网关
|
||||
static const String addAuthorizedAdministratorPage =
|
||||
@ -369,24 +393,30 @@ abstract class Routers {
|
||||
static const String starLockRegisterPage = '/StarLockRegisterPage'; // 注册
|
||||
static const String starLockForgetPasswordPage =
|
||||
'/StarLockForgetPasswordPage'; // 忘记密码
|
||||
static const String selectCountryRegionPage = '/SelectCountryRegionPage'; // 选择国家和地区
|
||||
static const String safetyVerificationPage = '/SafetyVerificationPage'; // 安全验证
|
||||
static const String selectCountryRegionPage =
|
||||
'/SelectCountryRegionPage'; // 选择国家和地区
|
||||
static const String safetyVerificationPage =
|
||||
'/SafetyVerificationPage'; // 安全验证
|
||||
|
||||
static const String getDeviceListPage = '/getDeviceListPage'; //设备列表
|
||||
static const String getNameListPage = '/getNameListPage'; //姓名列表
|
||||
static const String authorityManagementPage = '/authorityManagementPage'; //批量授权
|
||||
static const String authorityManagementPage =
|
||||
'/authorityManagementPage'; //批量授权
|
||||
static const String massSendLockGroupListPage =
|
||||
'/massSendLockGroupListPage'; //群发锁分组列表
|
||||
static const massSendReceiverPage = '/massSendReceiverPage'; //群发接收人
|
||||
static const lockUserListPage = '/lockUserListPage'; //锁用户列表
|
||||
static const administratorDetailsPage = '/administratorDetailsPage'; //管理员详情
|
||||
static const expireLockManagePage = '/expireLockManagePage'; //即将到期
|
||||
static const expireKeyChangeDatePage = '/ExpireKeyChangeDatePage'; //即将到期卡、指纹、遥控钥匙详情修改日期
|
||||
static const adminDetailChangeDatePage = '/adminDetailChangeDatePage'; //管理员详情修改生效时间
|
||||
static const expireKeyChangeDatePage =
|
||||
'/ExpireKeyChangeDatePage'; //即将到期卡、指纹、遥控钥匙详情修改日期
|
||||
static const adminDetailChangeDatePage =
|
||||
'/adminDetailChangeDatePage'; //管理员详情修改生效时间
|
||||
static const String adminLockListPage = '/adminLockListPage'; //管理员详情的锁列表
|
||||
static const String safeVerifyPage = '/safeVerifyPage'; //删除账号安全验证
|
||||
static const String webviewShowPage = '/webviewShowPage'; //网页
|
||||
static const String demoModeLockDetailPage = '/DemoModeLockDetailPage'; // 演示模式锁详情页
|
||||
static const String demoModeLockDetailPage =
|
||||
'/DemoModeLockDetailPage'; // 演示模式锁详情页
|
||||
static const String demoModeLockSetPage = '/DemoModeLockSetPage'; // 演示模式锁设置页
|
||||
static const String addLockSelectCountryPage =
|
||||
'/AddLockSelectCountryPage'; // 演示模式锁设置页
|
||||
@ -404,8 +434,10 @@ abstract class Routers {
|
||||
static const String catEyeSetPage = '/catEyeSetPage'; //猫眼设置
|
||||
static const String coerceOpenDoorPage = '/coerceOpenDoorPage'; //胁迫开门
|
||||
static const String coerceFingerprintPage = '/coerceFingerprintPage'; //胁迫指纹
|
||||
static const String lowBatteryReminderPage = '/lowBatteryReminderPage'; //低电量提醒
|
||||
static const String coerceFingerprintListPage = '/coerceFingerprintListPage'; //指纹列表
|
||||
static const String lowBatteryReminderPage =
|
||||
'/lowBatteryReminderPage'; //低电量提醒
|
||||
static const String coerceFingerprintListPage =
|
||||
'/coerceFingerprintListPage'; //指纹列表
|
||||
static const String lockMonitoringPage = '/LockMonitoringPage'; //监控
|
||||
static const String monitoringRealTimeScreenPage =
|
||||
'/MonitoringRealTimeScreenPage'; //实时画面
|
||||
@ -422,7 +454,8 @@ abstract class Routers {
|
||||
static const String addCardPage = '/AddCardPage'; // 添加卡
|
||||
static const String cardDetailPage = '/CardDetailPage'; // 卡详情
|
||||
static const String fingerprintListPage = '/FingerprintListPage'; // 指纹列表
|
||||
static const String addFingerprintTypePage = '/AddFingerprintTypePage'; // 添加指纹
|
||||
static const String addFingerprintTypePage =
|
||||
'/AddFingerprintTypePage'; // 添加指纹
|
||||
static const String fingerprintDetailPage = '/FingerprintDetailPage'; // 指纹详情
|
||||
static const String faceListPage = '/FaceListPage'; // 人脸列表
|
||||
static const String addFaceTypePage = '/AddFaceTypePage'; // 添加人脸
|
||||
@ -447,7 +480,8 @@ abstract class Routers {
|
||||
static const String accessoriesListPage = '/accessoriesListPage'; //配件列表
|
||||
static const String seletKeyCyclicDatePage =
|
||||
'/SeletKeyCyclicDatePage'; // 电子钥匙、授权管理员、卡、指纹、遥控等添加添加循环日期公共界面
|
||||
static const String advancedFeaturesWebPage = '/advancedFeaturesWebPage'; // 高级功能
|
||||
static const String advancedFeaturesWebPage =
|
||||
'/advancedFeaturesWebPage'; // 高级功能
|
||||
static const String advancedFunctionRecordPage =
|
||||
'/advancedFunctionRecordPage'; //高级功能购买记录
|
||||
static const String administratorAssociationLockPage =
|
||||
@ -834,11 +868,11 @@ abstract class AppRouters {
|
||||
),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.valueAddedServicesListSMSTemplatePage,
|
||||
page: () => const ValueAddedServicesListSMSTemplatePage(),
|
||||
page: () => const CustomSMSTemplateListPage(),
|
||||
),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.valueAddedServicesAddSMSTemplatePage,
|
||||
page: () => const ValueAddedServicesAddSMSTemplatePage(),
|
||||
page: () => const NewSMSTemplatePage(),
|
||||
),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.valueAddedServicesListEmailTemplatePage,
|
||||
@ -902,7 +936,8 @@ abstract class AppRouters {
|
||||
name: Routers.ownedKeyListPage, page: () => const OwnedKeyListPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.getDeviceListPage, page: () => const GetDeviceListPage()),
|
||||
GetPage<dynamic>(name: Routers.getNameListPage, page: () => const GetNameListPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.getNameListPage, page: () => const GetNameListPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.authorityManagementPage,
|
||||
page: () => const AuthorityManagementPage()),
|
||||
@ -941,18 +976,21 @@ abstract class AppRouters {
|
||||
GetPage<dynamic>(
|
||||
name: Routers.otherTypeKeyChangeValidityDatePage,
|
||||
page: () => const OtherTypeKeyChangeValidityDatePage()),
|
||||
GetPage<dynamic>(name: Routers.addICCardPage, page: () => const AddICCardPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addICCardPage, page: () => const AddICCardPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.adminDetailChangeDatePage,
|
||||
page: () => const AdminDetailChangeDatePage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.lockAddressGaoDePage,
|
||||
page: () => const LockAddressGaoDePage()),
|
||||
GetPage<dynamic>(name: Routers.safeVerifyPage, page: () => const SafeVerifyPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.safeVerifyPage, page: () => const SafeVerifyPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.minePersonInfoViewSafetyProblemPage,
|
||||
page: () => const MinePersonInfoViewSafetyProblemPage()),
|
||||
GetPage<dynamic>(name: Routers.webviewShowPage, page: () => const WebviewShowPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.webviewShowPage, page: () => const WebviewShowPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.demoModeLockSetPage,
|
||||
page: () => const DemoModeLockSetPage()),
|
||||
@ -962,8 +1000,10 @@ abstract class AppRouters {
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addLockSelectCountryPage,
|
||||
page: () => const AddLockSelectCountryPage()),
|
||||
GetPage<dynamic>(name: Routers.faceUnlockPage, page: () => const FaceUnlockPage()),
|
||||
GetPage<dynamic>(name: Routers.motorPowerPage, page: () => const MotorPowerPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.faceUnlockPage, page: () => const FaceUnlockPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.motorPowerPage, page: () => const MotorPowerPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.openDoorDirectionPage,
|
||||
page: () => const OpenDoorDirectionPage()),
|
||||
@ -973,7 +1013,8 @@ abstract class AppRouters {
|
||||
GetPage<dynamic>(
|
||||
name: Routers.msgNotificationPage,
|
||||
page: () => const MsgNotificationPage()),
|
||||
GetPage<dynamic>(name: Routers.addFacePage, page: () => const AddFacePage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addFacePage, page: () => const AddFacePage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.nDaysUnopenedPage, page: () => const NDaysUnopenedPage()),
|
||||
GetPage<dynamic>(
|
||||
@ -982,9 +1023,12 @@ abstract class AppRouters {
|
||||
GetPage<dynamic>(
|
||||
name: Routers.openDoorNotifyPage,
|
||||
page: () => const OpenDoorNotifyPage()),
|
||||
GetPage<dynamic>(name: Routers.addFamilyPage, page: () => const AddFamilyPage()),
|
||||
GetPage<dynamic>(name: Routers.lockUserPage, page: () => const LockUserPage()),
|
||||
GetPage<dynamic>(name: Routers.catEyeSetPage, page: () => const CatEyeSetPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addFamilyPage, page: () => const AddFamilyPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.lockUserPage, page: () => const LockUserPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.catEyeSetPage, page: () => const CatEyeSetPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.coerceOpenDoorPage,
|
||||
page: () => const CoerceOpenDoorPage()),
|
||||
@ -1003,7 +1047,8 @@ abstract class AppRouters {
|
||||
GetPage<dynamic>(
|
||||
name: Routers.monitoringRealTimeScreenPage,
|
||||
page: () => const MonitoringRealTimeScreenPage()),
|
||||
GetPage<dynamic>(name: Routers.videoLogPage, page: () => const VideoLogPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.videoLogPage, page: () => const VideoLogPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.editVideoLogPage, page: () => const EditVideoLogPage()),
|
||||
GetPage<dynamic>(
|
||||
@ -1018,12 +1063,15 @@ abstract class AppRouters {
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addRemoteControlPage,
|
||||
page: () => const AddRemoteControlPage()),
|
||||
GetPage<dynamic>(name: Routers.cardListPage, page: () => const CardListPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.cardListPage, page: () => const CardListPage()),
|
||||
// GetPage<dynamic>(
|
||||
// name: Routers.addCardTypeManagePage,
|
||||
// page: () => const AddCardTypeManagePage()),
|
||||
GetPage<dynamic>(name: Routers.addCardPage, page: () => const AddCardPage()),
|
||||
GetPage<dynamic>(name: Routers.cardDetailPage, page: () => const CardDetailPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addCardPage, page: () => const AddCardPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.cardDetailPage, page: () => const CardDetailPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.fingerprintListPage,
|
||||
page: () => const FingerprintListPage()),
|
||||
@ -1033,41 +1081,51 @@ abstract class AppRouters {
|
||||
GetPage<dynamic>(
|
||||
name: Routers.fingerprintDetailPage,
|
||||
page: () => const FingerprintDetailPage()),
|
||||
GetPage<dynamic>(name: Routers.faceListPage, page: () => const FaceListPage()),
|
||||
GetPage<dynamic>(name: Routers.addFaceTypePage, page: () => const AddFaceTypePage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.faceListPage, page: () => const FaceListPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addFaceTypePage, page: () => const AddFaceTypePage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.passwordKeyDetailChangeDatePage,
|
||||
page: () => const PasswordKeyDetailChangeDatePage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.realTimePicturePage,
|
||||
page: () => const RealTimePicturePage()),
|
||||
GetPage<dynamic>(name: Routers.doorLockLogPage, page: () => const DoorLockLogPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.doorLockLogPage, page: () => const DoorLockLogPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.catEyeCustomModePage,
|
||||
page: () => const CatEyeCustomModePage()),
|
||||
GetPage<dynamic>(name: Routers.videoSlotPage, page: () => const VideoSlotPage()),
|
||||
GetPage<dynamic>(name: Routers.liveVideoPage, page: () => const LiveVideoPage()),
|
||||
GetPage<dynamic>(name: Routers.faceDetailPage, page: () => const FaceDetailPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.messageDetailPage,
|
||||
page: () => const MessageDetailPage()),
|
||||
name: Routers.videoSlotPage, page: () => const VideoSlotPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.liveVideoPage, page: () => const LiveVideoPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.faceDetailPage, page: () => const FaceDetailPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.messageDetailPage, page: () => const MessageDetailPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.accessoriesListPage,
|
||||
page: () => const AccessoriesListPage()),
|
||||
GetPage<dynamic>(name: Routers.wifiListPage, page: () => const WifiListPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.wifiListPage, page: () => const WifiListPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.seletKeyCyclicDatePage,
|
||||
page: () => const SeletKeyCyclicDatePage()),
|
||||
GetPage<dynamic>(name: Routers.irisListPage, page: () => const IrisListPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.irisListPage, page: () => const IrisListPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addIrisTypeManagePage,
|
||||
page: () => const AddIrisTypeManagePage()),
|
||||
GetPage<dynamic>(name: Routers.addIrisPage, page: () => const AddIrisPage()),
|
||||
GetPage<dynamic>(name: Routers.palmListPage, page: () => const PalmListPage()),
|
||||
page: () => const AddIrisTypeManagePage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addIrisPage, page: () => const AddIrisPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.palmListPage, page: () => const PalmListPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addPalmTypeManagePage,
|
||||
page: () => const AddPalmTypeManagePage()),
|
||||
GetPage<dynamic>(name: Routers.addPalmPage, page: () => const AddPalmPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.addPalmPage, page: () => const AddPalmPage()),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.advancedFeaturesWebPage,
|
||||
page: () => const AdvancedFeaturesWebPage()),
|
||||
|
||||
@ -131,7 +131,7 @@ class _ValueAddedServicesNoteAndEmailDetailPageState
|
||||
),
|
||||
Text(
|
||||
(type == 1)
|
||||
? TranslationLoader.lanKeys!.customSMSTemplate!.tr
|
||||
? '自定义短信模版'.tr
|
||||
: TranslationLoader.lanKeys!.customMailTemplate!.tr,
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
),
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
class NewSMSTemplateEntity {
|
||||
NewSMSTemplateEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.dataList});
|
||||
NewSMSTemplateEntity.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
if (json['data'] != null) {
|
||||
dataList = <SMSTemplateData>[];
|
||||
json['data'].forEach((v) {
|
||||
dataList!.add(SMSTemplateData.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
List<SMSTemplateData>? dataList;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
if (dataList != null) {
|
||||
data['data'] = dataList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class SMSTemplateData {
|
||||
SMSTemplateData({this.contentType, this.name, this.template, this.fixedKey});
|
||||
SMSTemplateData.fromJson(Map<String, dynamic> json) {
|
||||
contentType = json['content_type'];
|
||||
name = json['name'];
|
||||
template = json['template'];
|
||||
fixedKey = json['fixed_key'];
|
||||
}
|
||||
int? contentType;
|
||||
String? name;
|
||||
String? template;
|
||||
String? fixedKey;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['content_type'] = contentType;
|
||||
data['name'] = name;
|
||||
data['template'] = template;
|
||||
data['fixed_key'] = fixedKey;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,192 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_state.dart';
|
||||
import 'package:star_lock/tools/regularExpression.dart';
|
||||
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
|
||||
class NewSMSTemplateLogic extends BaseGetXController {
|
||||
NewSMSTemplateState state = NewSMSTemplateState();
|
||||
|
||||
//获取默认模板-- 1:电子钥匙 2:密码
|
||||
Future<void> getDefaultTemplate() async {
|
||||
final NewSMSTemplateEntity entity =
|
||||
await ApiRepository.to.getDefaultTemplate(type: 1);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.templateList.value = entity.dataList ?? <SMSTemplateData>[];
|
||||
if (state.templateList.isNotEmpty) {
|
||||
state.templateTypeText.value = state.templateList[0].name ?? '';
|
||||
state.currentTemplate.value = state.templateList.firstWhere(
|
||||
(SMSTemplateData element) =>
|
||||
element.name == state.templateTypeText.value,
|
||||
);
|
||||
state.templateTypeText.refresh();
|
||||
state.currentTemplate.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//获取默认模板-- 1:电子钥匙 2:密码
|
||||
Future<void> addSMSTemplate() async {
|
||||
if (state.templateNameTf.text.isEmpty) {
|
||||
showToast('请输入模板名称');
|
||||
return;
|
||||
}
|
||||
final LoginEntity entity = await ApiRepository.to.addSMSTemplate(
|
||||
type: 1,
|
||||
name: state.templateNameTf.text,
|
||||
fixedKey: state.currentTemplate.value.fixedKey ?? '',
|
||||
contentType: state.currentTemplate.value.contentType ?? 0,
|
||||
regards: state.templateOneTf.text,
|
||||
tips: state.templateTwoTf.text);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('添加成功');
|
||||
Get.back();
|
||||
}
|
||||
}
|
||||
|
||||
List<TextSpan> buildElectronicKeySpan({required bool isPreview}) {
|
||||
final List<TextSpan> textSpans = <TextSpan>[];
|
||||
|
||||
// 如果是预览模式,添加预览模板的文本
|
||||
if (isPreview) {
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: '${state.templateOneTf.text}\n',
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
}
|
||||
// 将模板分割为文本片段
|
||||
final List<String> textFragments = state.currentTemplate.value.template
|
||||
?.split(RegularExpression.urlRegExp) ??
|
||||
[];
|
||||
|
||||
// 添加链接文本和普通文本到文本片段列表
|
||||
for (int i = 0; i < textFragments.length; i++) {
|
||||
final String textFragment = textFragments[i];
|
||||
// 添加普通文本
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: textFragment,
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
// 如果不是最后一个文本片段,则添加换行符
|
||||
if (i < textFragments.length - 1) {
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: '\n',
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
// 添加链接文本
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: RegularExpression.urlRegExp
|
||||
.stringMatch(state.currentTemplate.value.template!) ??
|
||||
'',
|
||||
style: state.highStyle,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果是预览模式,添加预览模板的文本
|
||||
if (isPreview) {
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: '\n${state.templateTwoTf.text}',
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return textSpans;
|
||||
}
|
||||
|
||||
List<TextSpan> buildPasswordSpan({required bool isPreview}) {
|
||||
final List<TextSpan> textSpans = <TextSpan>[];
|
||||
|
||||
// 如果是预览模式,添加预览模板的文本
|
||||
if (isPreview) {
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: '${state.templateOneTf.text}\n',
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 定义匹配 ${} 包围的变量的正则表达式
|
||||
final RegExp variableRegExp = RegExp(r'\$\{([^}]+)\}');
|
||||
|
||||
final String template = state.currentTemplate.value.template ?? '';
|
||||
|
||||
// 对模板进行处理
|
||||
int startIndex = 0;
|
||||
for (final Match match in variableRegExp.allMatches(template)) {
|
||||
// 处理变量之前的文本
|
||||
final String nonVariableText =
|
||||
template.substring(startIndex, match.start);
|
||||
// 替换非变量文本中的字符
|
||||
final String replacedNonVariableText =
|
||||
nonVariableText.replaceAllMapped(RegExp(r',|。'), (Match match) {
|
||||
return '${match.group(0)}\n';
|
||||
});
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: replacedNonVariableText,
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
|
||||
// 处理变量
|
||||
final String variableText = match.group(0) ?? '';
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: variableText,
|
||||
style: state.highStyle,
|
||||
),
|
||||
);
|
||||
|
||||
// 更新起始索引
|
||||
startIndex = match.end;
|
||||
}
|
||||
|
||||
// 添加最后一个变量之后的文本
|
||||
final String remainingText = template.substring(startIndex);
|
||||
// 替换非变量文本中的字符
|
||||
final String replacedRemainingText =
|
||||
remainingText.replaceAllMapped(RegExp(r',|。'), (Match match) {
|
||||
return '${match.group(0)}\n';
|
||||
});
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: replacedRemainingText,
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
|
||||
// 在预览模式下,添加预览模板的文本
|
||||
if (isPreview) {
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: '\n${state.templateTwoTf.text}',
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return textSpans;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onReady() async {
|
||||
super.onReady();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,265 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_logic.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_state.dart';
|
||||
|
||||
import '../../../../tools/commonItem.dart';
|
||||
import '../../../../tools/showBottomSheetTool.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
import '../../../../translations/trans_lib.dart';
|
||||
|
||||
class NewSMSTemplatePage extends StatefulWidget {
|
||||
const NewSMSTemplatePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<NewSMSTemplatePage> createState() => _NewSMSTemplatePageState();
|
||||
}
|
||||
|
||||
class _NewSMSTemplatePageState extends State<NewSMSTemplatePage> {
|
||||
final NewSMSTemplateLogic logic = Get.put(NewSMSTemplateLogic());
|
||||
final NewSMSTemplateState state = Get.find<NewSMSTemplateLogic>().state;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
logic.getDefaultTemplate();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: '新建短信模版'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
_buildEditTopInfo(),
|
||||
SizedBox(height: 10.h),
|
||||
_buildEditTemplate(),
|
||||
SizedBox(height: 10.h),
|
||||
_buildPreView(),
|
||||
SizedBox(height: 42.h),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 20.w),
|
||||
child: SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.save!.tr,
|
||||
onClick: () {
|
||||
logic.addSMSTemplate();
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(height: 40.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildEditTopInfo() {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
CommonItem(
|
||||
leftTitel: '名称'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: getTFWidget(
|
||||
state.templateNameTf,
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.type!.tr,
|
||||
rightTitle: state.templateTypeText.value,
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: _showSelectTemplateType,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildEditTemplate() {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.all(25.w),
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.templateContent!.tr,
|
||||
style:
|
||||
TextStyle(fontSize: 20.sp, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 25.w, vertical: 25.h),
|
||||
height: 100,
|
||||
child: _buildTextField(state.templateOneTf),
|
||||
),
|
||||
Obx(() => _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>[
|
||||
_buildTextField(state.templateTwoTf),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildPreView() {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.only(bottom: 20.h),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 25.h, bottom: 25.h, left: 25.w),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.preview!.tr,
|
||||
style: TextStyle(fontSize: 20.sp, fontWeight: FontWeight.w600),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
),
|
||||
Obx(() => Container(
|
||||
margin: EdgeInsets.only(left: 25.w, right: 25.w),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF5F5F5),
|
||||
borderRadius: BorderRadius.circular(10.h),
|
||||
),
|
||||
child: _buildTemplateWithType(isPreview: true),
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 25.w,
|
||||
top: 25.h,
|
||||
bottom: 25.h,
|
||||
),
|
||||
child: Text(
|
||||
'预计产生短信条数:2',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 20.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTemplateWithType({required bool isPreview}) {
|
||||
// 检查当前模板是否为空
|
||||
if (state.currentTemplate.value.template == null ||
|
||||
state.currentTemplate.value.template!.isEmpty) {
|
||||
return const SizedBox.shrink(); // 如果为空,返回一个空的 SizedBox
|
||||
} else {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.w, vertical: 10.h),
|
||||
child: Obx(() => RichText(
|
||||
text: TextSpan(
|
||||
children: state.templateTypeText.value == '电子钥匙'
|
||||
? logic.buildElectronicKeySpan(isPreview: isPreview)
|
||||
: logic.buildPasswordSpan(isPreview: isPreview),
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildTextField(TextEditingController controller) {
|
||||
return TextField(
|
||||
maxLines: 8,
|
||||
textAlign: TextAlign.start,
|
||||
controller: controller,
|
||||
style: state.defaultStyle,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.all(20.w),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(20.h),
|
||||
borderSide: const BorderSide(color: Color(0xffB2B2B2), width: 0.5),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(20.h),
|
||||
borderSide: const BorderSide(color: Color(0xffB2B2B2), width: 1),
|
||||
),
|
||||
),
|
||||
onChanged: (String value) {
|
||||
controller.text = value;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget getTFWidget(TextEditingController tfController, String tfStr) {
|
||||
return SizedBox(
|
||||
height: 50.h,
|
||||
width: 300.w,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
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,
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
border: InputBorder.none,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showSelectTemplateType() {
|
||||
final List<String> titleList = state.templateList
|
||||
.map((SMSTemplateData template) => template.name ?? '')
|
||||
.toList();
|
||||
ShowBottomSheetTool().showSingleRowPicker(
|
||||
context,
|
||||
normalIndex: 0,
|
||||
title: TranslationLoader.lanKeys!.type!.tr,
|
||||
cancelTitle: TranslationLoader.lanKeys!.cancel!.tr,
|
||||
sureTitle: TranslationLoader.lanKeys!.sure!.tr,
|
||||
data: titleList,
|
||||
clickCallBack: (int index, Object str) {
|
||||
state.templateTypeText.value = str.toString();
|
||||
state.templateTypeText.refresh();
|
||||
state.currentTemplate.value = state.templateList[index];
|
||||
state.currentTemplate.refresh();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_entity.dart';
|
||||
|
||||
class NewSMSTemplateState {
|
||||
//高亮样式
|
||||
final TextStyle highStyle =
|
||||
TextStyle(color: const Color(0xFFEEDFA8), fontSize: 20.sp);
|
||||
|
||||
//默认样式
|
||||
final TextStyle defaultStyle =
|
||||
TextStyle(color: Colors.black, fontSize: 20.sp);
|
||||
|
||||
//预览样式封装-密码
|
||||
// late InlineSpan passwardSpan = TextSpan(children: <InlineSpan>[
|
||||
// TextSpan(
|
||||
// text:
|
||||
// '${TranslationLoader.lanKeys!.hello!.tr},\n${TranslationLoader.lanKeys!.yourRoomIs!.tr}:',
|
||||
// style: defaultStyle),
|
||||
// TextSpan(text: '201', style: highStyle),
|
||||
// TextSpan(
|
||||
// text: ' ${TranslationLoader.lanKeys!.theCodeToOpenTheDoorIs!.tr}: ',
|
||||
// style: defaultStyle),
|
||||
// TextSpan(text: '332211\n', style: highStyle),
|
||||
// TextSpan(
|
||||
// text: '${TranslationLoader.lanKeys!.periodValidity!.tr}: ',
|
||||
// style: defaultStyle),
|
||||
// TextSpan(text: '2021.12.11 12:00 - 2021.12.12 13:00。\n', style: highStyle),
|
||||
// TextSpan(
|
||||
// text: TranslationLoader.lanKeys!.templateTip1!.tr, style: defaultStyle),
|
||||
// ]);
|
||||
|
||||
//预览样式封装-电子钥匙
|
||||
// late InlineSpan electronicKeySpan = TextSpan(children: <InlineSpan>[
|
||||
// TextSpan(
|
||||
// text:
|
||||
// '${TranslationLoader.lanKeys!.hello!.tr},\n${TranslationLoader.lanKeys!.templateTip2!.tr}',
|
||||
// style: defaultStyle),
|
||||
// TextSpan(text: 'https://abc.com/bcd\n', style: highStyle),
|
||||
// TextSpan(
|
||||
// text: '${TranslationLoader.lanKeys!.templateTip3!.tr}\n',
|
||||
// style: defaultStyle),
|
||||
// TextSpan(text: 'https://abc.com/bcd', style: highStyle),
|
||||
// ]);
|
||||
|
||||
final TextEditingController templateOneTf = TextEditingController();
|
||||
final TextEditingController templateTwoTf = TextEditingController();
|
||||
final TextEditingController templateNameTf = TextEditingController();
|
||||
|
||||
RxBool isVip = false.obs;
|
||||
RxList<SMSTemplateData> templateList = <SMSTemplateData>[].obs;
|
||||
RxString templateTypeText = '电子钥匙'.tr.obs;
|
||||
RxString templateContentText = ''.obs; //模版内容
|
||||
Rx<SMSTemplateData> currentTemplate = SMSTemplateData().obs;
|
||||
RxBool isShowDate = false.obs;
|
||||
}
|
||||
@ -1,489 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/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);
|
||||
|
||||
//预览样式封装-密码
|
||||
late InlineSpan passwardSpan = TextSpan(children: [
|
||||
TextSpan(
|
||||
text:
|
||||
'${TranslationLoader.lanKeys!.hello!.tr},\n${TranslationLoader.lanKeys!.yourRoomIs!.tr}:',
|
||||
style: defaultStyle),
|
||||
TextSpan(text: '201', style: highStyle),
|
||||
TextSpan(
|
||||
text: ' ${TranslationLoader.lanKeys!.theCodeToOpenTheDoorIs!.tr}: ',
|
||||
style: defaultStyle),
|
||||
TextSpan(text: '332211\n', style: highStyle),
|
||||
TextSpan(
|
||||
text: '${TranslationLoader.lanKeys!.periodValidity!.tr}: ',
|
||||
style: defaultStyle),
|
||||
TextSpan(text: '2021.12.11 12:00 - 2021.12.12 13:00。\n', style: highStyle),
|
||||
TextSpan(
|
||||
text: TranslationLoader.lanKeys!.templateTip1!.tr, style: defaultStyle),
|
||||
]);
|
||||
|
||||
//预览样式封装-密码
|
||||
late InlineSpan electronicKeySpan = TextSpan(children: [
|
||||
TextSpan(
|
||||
text:
|
||||
'${TranslationLoader.lanKeys!.hello!.tr},\n${TranslationLoader.lanKeys!.templateTip2!.tr}',
|
||||
style: defaultStyle),
|
||||
TextSpan(text: 'https://abc.com/bcd\n', style: highStyle),
|
||||
TextSpan(
|
||||
text: '${TranslationLoader.lanKeys!.templateTip3!.tr}\n',
|
||||
style: defaultStyle),
|
||||
TextSpan(text: 'https://abc.com/bcd', style: highStyle),
|
||||
]);
|
||||
|
||||
class ValueAddedServicesAddSMSTemplatePage extends StatefulWidget {
|
||||
const ValueAddedServicesAddSMSTemplatePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ValueAddedServicesAddSMSTemplatePage> createState() =>
|
||||
_ValueAddedServicesAddSMSTemplatePageState();
|
||||
}
|
||||
|
||||
class _ValueAddedServicesAddSMSTemplatePageState
|
||||
extends State<ValueAddedServicesAddSMSTemplatePage> {
|
||||
final _templateOneTf = TextEditingController();
|
||||
final _templateTwoTf = TextEditingController();
|
||||
final _templateNameTf = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_templateOneTf.text = TranslationLoader.lanKeys!.hello!.tr;
|
||||
_templateTwoTf.text = TranslationLoader.lanKeys!.templateTip1!.tr;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.customSMSTemplate!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView(
|
||||
children: [
|
||||
_buildEditTopInfo(),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
_buildEditTemplate(),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
_buildpreview(),
|
||||
SizedBox(height: 42.h),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
child: 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);
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40.h,
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
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: 20.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: 20.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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.only(left: 25.w, top: 10.h, right: 25.w),
|
||||
child: RichText(
|
||||
text: TextSpan(children: [
|
||||
TextSpan(
|
||||
text:
|
||||
'${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),
|
||||
]))),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 25.w, top: 10.h),
|
||||
child: RichText(
|
||||
text: TextSpan(children: [
|
||||
TextSpan(
|
||||
text:
|
||||
'${TranslationLoader.lanKeys!.periodValidity!.tr}: ',
|
||||
style: defaultStyle),
|
||||
TextSpan(
|
||||
text:
|
||||
'{${TranslationLoader.lanKeys!.periodValidity!.tr}}',
|
||||
style: highStyle),
|
||||
]))),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_round_unSelect.png',
|
||||
width: 26.w,
|
||||
height: 26.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: false,
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.only(left: 25.w, top: 10.h, right: 25.w),
|
||||
child: RichText(
|
||||
text: TextSpan(children: [
|
||||
TextSpan(
|
||||
text:
|
||||
'${TranslationLoader.lanKeys!.templateTip2!.tr}\n',
|
||||
style: defaultStyle),
|
||||
TextSpan(
|
||||
text: 'https://abc.com/bcd\n',
|
||||
style: TextStyle(
|
||||
color: const Color(0xFFEEDFA8), fontSize: 20.sp)),
|
||||
TextSpan(
|
||||
text:
|
||||
'${TranslationLoader.lanKeys!.templateTip3!.tr}\n',
|
||||
style: defaultStyle),
|
||||
TextSpan(
|
||||
text: 'https://abc.com/bcd\n',
|
||||
style: TextStyle(
|
||||
color: const Color(0xFFEEDFA8), fontSize: 20.sp)),
|
||||
]))),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 25.w, right: 25.w, bottom: 25.h),
|
||||
height: 100,
|
||||
child: Stack(
|
||||
alignment: Alignment.bottomRight,
|
||||
children: [
|
||||
TextField(
|
||||
maxLines: 8,
|
||||
// maxLength:1000,
|
||||
textAlign: TextAlign.start,
|
||||
controller: _templateTwoTf,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 20.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,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
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, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 25.w, right: 25.w),
|
||||
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: passwardSpan)),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 25.w,
|
||||
top: 25.h,
|
||||
bottom: 25.h,
|
||||
),
|
||||
child: Text(
|
||||
'${TranslationLoader.lanKeys!.expectedNotoCount!.tr}:2',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 20.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
/*
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
// left: 25.w,
|
||||
top: 25.h,
|
||||
bottom: 25.h,
|
||||
),
|
||||
child: Text(
|
||||
'${TranslationLoader.lanKeys!.expectedNotoCount!.tr}:2',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 20.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
*/
|
||||
],
|
||||
),
|
||||
],
|
||||
))
|
||||
]);
|
||||
}
|
||||
|
||||
Widget getTFWidget(TextEditingController tfController, String tfStr) {
|
||||
return Container(
|
||||
height: 50.h,
|
||||
width: 300.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,
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
//不需要输入框下划线
|
||||
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) {});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,130 @@
|
||||
class CustomSMSTemplateListEntity {
|
||||
CustomSMSTemplateListEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
CustomSMSTemplateListEntity.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null
|
||||
? CustomSMSTemplateListData.fromJson(json['data'])
|
||||
: null;
|
||||
}
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
CustomSMSTemplateListData? data;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class CustomSMSTemplateListData {
|
||||
CustomSMSTemplateListData(
|
||||
{this.type,
|
||||
this.list,
|
||||
this.pageNo,
|
||||
this.pageSize,
|
||||
this.pages,
|
||||
this.total});
|
||||
|
||||
CustomSMSTemplateListData.fromJson(Map<String, dynamic> json) {
|
||||
type = json['type'];
|
||||
if (json['list'] != null) {
|
||||
list = <CustomSMSTemplateItem>[];
|
||||
json['list'].forEach((v) {
|
||||
list!.add(CustomSMSTemplateItem.fromJson(v));
|
||||
});
|
||||
}
|
||||
pageNo = json['pageNo'];
|
||||
pageSize = json['pageSize'];
|
||||
pages = json['pages'];
|
||||
total = json['total'];
|
||||
}
|
||||
int? type;
|
||||
List<CustomSMSTemplateItem>? list;
|
||||
int? pageNo;
|
||||
int? pageSize;
|
||||
int? pages;
|
||||
int? total;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['type'] = type;
|
||||
if (list != null) {
|
||||
data['list'] = list!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['pageNo'] = pageNo;
|
||||
data['pageSize'] = pageSize;
|
||||
data['pages'] = pages;
|
||||
data['total'] = total;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class CustomSMSTemplateItem {
|
||||
CustomSMSTemplateItem(
|
||||
{this.id,
|
||||
this.userId,
|
||||
this.type,
|
||||
this.contentType,
|
||||
this.name,
|
||||
this.regards,
|
||||
this.tips,
|
||||
this.fixedKey,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.template,
|
||||
this.fixedTemplate});
|
||||
CustomSMSTemplateItem.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userId = json['user_id'];
|
||||
type = json['type'];
|
||||
contentType = json['content_type'];
|
||||
name = json['name'];
|
||||
regards = json['regards'];
|
||||
tips = json['tips'];
|
||||
fixedKey = json['fixed_key'];
|
||||
createdAt = json['created_at'];
|
||||
updatedAt = json['updated_at'];
|
||||
template = json['template'];
|
||||
fixedTemplate = json['fixed_template'];
|
||||
}
|
||||
int? id;
|
||||
int? userId;
|
||||
int? type;
|
||||
int? contentType;
|
||||
String? name;
|
||||
String? regards;
|
||||
String? tips;
|
||||
String? fixedKey;
|
||||
String? createdAt;
|
||||
String? updatedAt;
|
||||
String? template;
|
||||
String? fixedTemplate;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['user_id'] = userId;
|
||||
data['type'] = type;
|
||||
data['content_type'] = contentType;
|
||||
data['name'] = name;
|
||||
data['regards'] = regards;
|
||||
data['tips'] = tips;
|
||||
data['fixed_key'] = fixedKey;
|
||||
data['created_at'] = createdAt;
|
||||
data['updated_at'] = updatedAt;
|
||||
data['template'] = template;
|
||||
data['fixed_template'] = fixedTemplate;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,155 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/customSMSTemplateList_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/customSMSTemplateList_state.dart';
|
||||
import 'package:star_lock/tools/regularExpression.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
|
||||
class CustomSMSTemplateListLogic extends BaseGetXController {
|
||||
CustomSMSTemplateListState state = CustomSMSTemplateListState();
|
||||
|
||||
//获取短信模板列表
|
||||
Future<void> getSMSTemplateListRequest() async {
|
||||
final CustomSMSTemplateListEntity entity = await ApiRepository.to
|
||||
.getSMSTemplateList(type: 1, pageNo: 1, pageSize: 20);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.smsTemplateList.value =
|
||||
entity.data?.list ?? <CustomSMSTemplateItem>[];
|
||||
state.smsTemplateList.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
List<TextSpan> buildElectronicKeySpan(
|
||||
{required CustomSMSTemplateItem templateData}) {
|
||||
final List<TextSpan> textSpans = <TextSpan>[];
|
||||
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: '${templateData.regards}\n',
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
// 将模板分割为文本片段
|
||||
final List<String> textFragments =
|
||||
templateData.template?.split(RegularExpression.urlRegExp) ?? [];
|
||||
|
||||
// 添加链接文本和普通文本到文本片段列表
|
||||
for (int i = 0; i < textFragments.length; i++) {
|
||||
final String textFragment = textFragments[i];
|
||||
// 添加普通文本
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: textFragment,
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
// 如果不是最后一个文本片段,则添加换行符
|
||||
if (i < textFragments.length - 1) {
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: '\n',
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
// 添加链接文本
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: RegularExpression.urlRegExp
|
||||
.stringMatch(templateData.template!) ??
|
||||
'',
|
||||
style: state.highStyle,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: '\n${templateData.tips}',
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
|
||||
return textSpans;
|
||||
}
|
||||
|
||||
List<TextSpan> buildPasswordSpan(
|
||||
{required CustomSMSTemplateItem templateData}) {
|
||||
final List<TextSpan> textSpans = <TextSpan>[];
|
||||
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: '${templateData.regards}\n',
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
|
||||
// 定义匹配 ${} 包围的变量的正则表达式
|
||||
final RegExp variableRegExp = RegExp(r'\$\{([^}]+)\}');
|
||||
|
||||
final String template = templateData.template ?? '';
|
||||
|
||||
// 对模板进行处理
|
||||
int startIndex = 0;
|
||||
for (final Match match in variableRegExp.allMatches(template)) {
|
||||
// 处理变量之前的文本
|
||||
final String nonVariableText =
|
||||
template.substring(startIndex, match.start);
|
||||
// 替换非变量文本中的字符
|
||||
final String replacedNonVariableText =
|
||||
nonVariableText.replaceAllMapped(RegExp(r',|。'), (Match match) {
|
||||
return '${match.group(0)}\n';
|
||||
});
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: replacedNonVariableText,
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
|
||||
// 处理变量
|
||||
final String variableText = match.group(0) ?? '';
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: variableText,
|
||||
style: state.highStyle,
|
||||
),
|
||||
);
|
||||
|
||||
// 更新起始索引
|
||||
startIndex = match.end;
|
||||
}
|
||||
|
||||
// 添加最后一个变量之后的文本
|
||||
final String remainingText = template.substring(startIndex);
|
||||
// 替换非变量文本中的字符
|
||||
final String replacedRemainingText =
|
||||
remainingText.replaceAllMapped(RegExp(r',|。'), (Match match) {
|
||||
return '${match.group(0)}\n';
|
||||
});
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: replacedRemainingText,
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
|
||||
textSpans.add(
|
||||
TextSpan(
|
||||
text: '\n${templateData.tips}',
|
||||
style: state.defaultStyle,
|
||||
),
|
||||
);
|
||||
|
||||
return textSpans;
|
||||
}
|
||||
|
||||
@override
|
||||
onReady() async {
|
||||
var isVip = await Storage.getBool(saveIsVip);
|
||||
state.isVip.value = isVip ?? false;
|
||||
}
|
||||
}
|
||||
@ -1,36 +1,52 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/customSMSTemplateList_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/customSMSTemplateList_logic.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/customSMSTemplateList_state.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
import '../../../../translations/trans_lib.dart';
|
||||
import '../valueAddedServicesAddSMSTemplate/valueAddedServicesAddSMSTemplate_page.dart';
|
||||
|
||||
class ValueAddedServicesListSMSTemplatePage extends StatefulWidget {
|
||||
const ValueAddedServicesListSMSTemplatePage({Key? key}) : super(key: key);
|
||||
class CustomSMSTemplateListPage extends StatefulWidget {
|
||||
const CustomSMSTemplateListPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ValueAddedServicesListSMSTemplatePage> createState() =>
|
||||
_ValueAddedServicesListSMSTemplatePageState();
|
||||
State<CustomSMSTemplateListPage> createState() =>
|
||||
_CustomSMSTemplateListPageState();
|
||||
}
|
||||
|
||||
class _ValueAddedServicesListSMSTemplatePageState
|
||||
extends State<ValueAddedServicesListSMSTemplatePage> {
|
||||
class _CustomSMSTemplateListPageState extends State<CustomSMSTemplateListPage> {
|
||||
final CustomSMSTemplateListLogic logic =
|
||||
Get.put(CustomSMSTemplateListLogic());
|
||||
final CustomSMSTemplateListState state =
|
||||
Get.find<CustomSMSTemplateListLogic>().state;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
logic.getSMSTemplateListRequest();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.customSMSTemplate!.tr,
|
||||
barTitle: '自定义短信模版'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
_topTipWidget(),
|
||||
Expanded(child: _buildMainUI()),
|
||||
children: <Widget>[
|
||||
Obx(() => Visibility(
|
||||
child: _topTipWidget(),
|
||||
visible: !state.isVip.value,
|
||||
)),
|
||||
Expanded(child: Obx(buildMainUI)),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.creatingANewTemplate!.tr,
|
||||
borderRadius: 20.w,
|
||||
@ -57,7 +73,7 @@ class _ValueAddedServicesListSMSTemplatePageState
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(5)),
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
TranslationLoader.lanKeys!.customTemplatesTip!.tr,
|
||||
style: TextStyle(
|
||||
@ -76,15 +92,15 @@ class _ValueAddedServicesListSMSTemplatePageState
|
||||
borderRadius: BorderRadius.circular(10.h)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
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: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
"${TranslationLoader.lanKeys!.currentState!.tr}:${TranslationLoader.lanKeys!.onTrial!.tr}",
|
||||
'${TranslationLoader.lanKeys!.currentState!.tr}:${TranslationLoader.lanKeys!.onTrial!.tr}',
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp, fontWeight: FontWeight.w600),
|
||||
),
|
||||
@ -119,21 +135,25 @@ class _ValueAddedServicesListSMSTemplatePageState
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildMainUI() {
|
||||
return ListView.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (c, index) {
|
||||
return _valueAddedServicesListSMSTemplateItem(
|
||||
'images/icon_lock.png', "张三", () {
|
||||
// Navigator.pushNamed(context, Routers.valueAddedServicesAddSMSTemplatePage);
|
||||
});
|
||||
});
|
||||
Widget buildMainUI() {
|
||||
return state.smsTemplateList.isNotEmpty
|
||||
? ListView.builder(
|
||||
itemCount: state.smsTemplateList.length,
|
||||
itemBuilder: (BuildContext c, int index) {
|
||||
final CustomSMSTemplateItem itemData =
|
||||
state.smsTemplateList[index];
|
||||
return _valueAddedServicesListSMSTemplateItem(itemData);
|
||||
})
|
||||
: NoData();
|
||||
}
|
||||
|
||||
Widget _valueAddedServicesListSMSTemplateItem(
|
||||
String title, String content, Function() action) {
|
||||
CustomSMSTemplateItem itemData) {
|
||||
return GestureDetector(
|
||||
onTap: action,
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context, Routers.valueAddedServicesAddSMSTemplatePage);
|
||||
},
|
||||
child: Container(
|
||||
// height: 100.h,
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
||||
@ -143,24 +163,31 @@ class _ValueAddedServicesListSMSTemplatePageState
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 30.h, top: 30.h, bottom: 20.h),
|
||||
child: Text(
|
||||
"101",
|
||||
itemData.name ?? '',
|
||||
style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1.sw - 20.w * 2 - 30.w * 2,
|
||||
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: electronicKeySpan)),
|
||||
padding: EdgeInsets.only(left: 20.w, top: 20.h, bottom: 20.h),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
children: itemData.contentType == 1
|
||||
? logic.buildElectronicKeySpan(templateData: itemData)
|
||||
: logic.buildPasswordSpan(templateData: itemData),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -0,0 +1,55 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class CustomSMSTemplateListState {
|
||||
//高亮样式
|
||||
final TextStyle highStyle =
|
||||
TextStyle(color: const Color(0xFFEEDFA8), fontSize: 20.sp);
|
||||
|
||||
//默认样式
|
||||
final TextStyle defaultStyle =
|
||||
TextStyle(color: Colors.black, fontSize: 20.sp);
|
||||
|
||||
// //预览样式封装-密码
|
||||
// late InlineSpan passwardSpan = TextSpan(children: <InlineSpan>[
|
||||
// TextSpan(
|
||||
// text:
|
||||
// '${TranslationLoader.lanKeys!.hello!.tr},\n${TranslationLoader.lanKeys!.yourRoomIs!.tr}:',
|
||||
// style: defaultStyle),
|
||||
// TextSpan(text: '201', style: highStyle),
|
||||
// TextSpan(
|
||||
// text: ' ${TranslationLoader.lanKeys!.theCodeToOpenTheDoorIs!.tr}: ',
|
||||
// style: defaultStyle),
|
||||
// TextSpan(text: '332211\n', style: highStyle),
|
||||
// TextSpan(
|
||||
// text: '${TranslationLoader.lanKeys!.periodValidity!.tr}: ',
|
||||
// style: defaultStyle),
|
||||
// TextSpan(text: '2021.12.11 12:00 - 2021.12.12 13:00。\n', style: highStyle),
|
||||
// TextSpan(
|
||||
// text: TranslationLoader.lanKeys!.templateTip1!.tr, style: defaultStyle),
|
||||
// ]);
|
||||
|
||||
// //预览样式封装-密码
|
||||
// late InlineSpan electronicKeySpan = TextSpan(children: <InlineSpan>[
|
||||
// TextSpan(
|
||||
// text:
|
||||
// '${TranslationLoader.lanKeys!.hello!.tr},\n${TranslationLoader.lanKeys!.templateTip2!.tr}',
|
||||
// style: defaultStyle),
|
||||
// TextSpan(text: 'https://abc.com/bcd\n', style: highStyle),
|
||||
// TextSpan(
|
||||
// text: '${TranslationLoader.lanKeys!.templateTip3!.tr}\n',
|
||||
// style: defaultStyle),
|
||||
// TextSpan(text: 'https://abc.com/bcd', style: highStyle),
|
||||
// ]);
|
||||
|
||||
// final TextEditingController templateOneTf = TextEditingController();
|
||||
// final TextEditingController templateTwoTf = TextEditingController();
|
||||
// final TextEditingController templateNameTf = TextEditingController();
|
||||
|
||||
RxBool isVip = false.obs;
|
||||
RxList smsTemplateList = [].obs;
|
||||
}
|
||||
@ -241,4 +241,10 @@ abstract class Api {
|
||||
final String getNoticeTemplateURL = '/key/getNoticeTemplate'; //获取短信或者邮箱模板
|
||||
final String appGetAppInfoURL = '/app/getAppInfo'; //获取APP基本信息
|
||||
final String appGetFwVersionURL = '/app/getFwVersion'; //获取固件信息
|
||||
final String smsTemplateListURL = '/v2/service/listSmsTemplate'; //获取短信模板列表
|
||||
final String emailTemplateListURL =
|
||||
'/v2/service/listEmailTemplate'; //获取邮件模板列表
|
||||
final String getDefaultTemplateURL =
|
||||
'/v2/service/getDefaultTemplate'; //获取默认模板
|
||||
final String addSMSTemplateURL = '/v2/service/addSmsTemplate'; //添加短信模板
|
||||
}
|
||||
|
||||
@ -2141,6 +2141,42 @@ class ApiProvider extends BaseProvider {
|
||||
}),
|
||||
isUnShowLoading: true,
|
||||
);
|
||||
|
||||
// 获取默认模板
|
||||
Future<Response<dynamic>> getDefaultTemplate(int type) => post(
|
||||
getDefaultTemplateURL.toUrl,
|
||||
jsonEncode(<String, dynamic>{'type': type}),
|
||||
isUnShowLoading: true,
|
||||
);
|
||||
|
||||
// 获取短信模板列表
|
||||
Future<Response<dynamic>> getSMSTemplateList(
|
||||
int type, int pageNo, int pageSize) =>
|
||||
post(
|
||||
smsTemplateListURL.toUrl,
|
||||
jsonEncode(<String, dynamic>{
|
||||
'type': type,
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize
|
||||
}),
|
||||
isUnShowLoading: true,
|
||||
);
|
||||
|
||||
// 添加短信模板
|
||||
Future<Response<dynamic>> addSMSTemplate(int type, String name,
|
||||
int contentType, String regards, String tips, String fixedKey) =>
|
||||
post(
|
||||
addSMSTemplateURL.toUrl,
|
||||
jsonEncode(<String, dynamic>{
|
||||
'type': type,
|
||||
'name': name,
|
||||
'content_type': contentType,
|
||||
'regards': regards,
|
||||
'tips': tips,
|
||||
'fixed_key': fixedKey
|
||||
}),
|
||||
isUnShowLoading: true,
|
||||
);
|
||||
}
|
||||
|
||||
extension ExtensionString on String {
|
||||
|
||||
@ -36,6 +36,8 @@ import 'package:star_lock/mine/valueAddedServices/valueAddedServicesHighFunction
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/face_authentication_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/buy_record_list_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/customSMSTemplateList_entity.dart';
|
||||
import 'package:star_lock/tools/aliyunRealNameAuth/realNameVertify_entity.dart';
|
||||
import 'package:star_lock/tools/aliyunRealNameAuth/serviceAuthResult_entity.dart';
|
||||
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
||||
@ -2168,4 +2170,31 @@ class ApiRepository {
|
||||
await apiProvider.getFwVersion(model, currentVersion);
|
||||
return FwVersionEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取默认模板
|
||||
Future<NewSMSTemplateEntity> getDefaultTemplate({required int type}) async {
|
||||
final Response<dynamic> res = await apiProvider.getDefaultTemplate(type);
|
||||
return NewSMSTemplateEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取短信模板列表
|
||||
Future<CustomSMSTemplateListEntity> getSMSTemplateList(
|
||||
{required int type, required int pageNo, required int pageSize}) async {
|
||||
final Response<dynamic> res =
|
||||
await apiProvider.getSMSTemplateList(type, pageNo, pageSize);
|
||||
return CustomSMSTemplateListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 添加短信模板
|
||||
Future<LoginEntity> addSMSTemplate(
|
||||
{required int type,
|
||||
required String name,
|
||||
required int contentType,
|
||||
required String regards,
|
||||
required String tips,
|
||||
required String fixedKey}) async {
|
||||
final Response<dynamic> res = await apiProvider.addSMSTemplate(
|
||||
type, name, contentType, regards, tips, fixedKey);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +176,8 @@ class DateTool {
|
||||
String dateToYMDString(String timestamp) {
|
||||
final int time = int.parse(timestamp);
|
||||
final DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time);
|
||||
final String appointmentDate = formatDate(nowDate, <String>[yyyy, '-', mm, '-', dd]);
|
||||
final String appointmentDate =
|
||||
formatDate(nowDate, <String>[yyyy, '-', mm, '-', dd]);
|
||||
return appointmentDate;
|
||||
}
|
||||
|
||||
|
||||
@ -11,4 +11,9 @@ class RegularExpression {
|
||||
RegExp(r'^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$');
|
||||
return emailRegExp.hasMatch(input);
|
||||
}
|
||||
|
||||
static RegExp urlRegExp = RegExp(
|
||||
r'https?:\/\/\S+',
|
||||
caseSensitive: false,
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user