Merge branch 'release' of https://gitee.com/starlock-cn/app-starlock into release

This commit is contained in:
魏少阳 2024-06-05 09:30:09 +08:00
commit 54db74b4ba
42 changed files with 1592 additions and 818 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -10,14 +10,14 @@ import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.GeneratedPluginRegistrant import io.flutter.plugins.GeneratedPluginRegistrant
import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothAdapter;
class MainActivity: FlutterActivity() { class MainActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(flutterEngine!!) GeneratedPluginRegistrant.registerWith(flutterEngine!!)
MethodChannel(flutterEngine?.dartExecutor!!.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { call, result -> MethodChannel(flutterEngine?.dartExecutor!!.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { call, result ->
if (call.method == "loadNativeShare") { if (call.method == "loadNativeShare") {
var map = call.arguments as Map<String, String> var map = call.arguments as Map<String, String>
shareText(map["shareText"], "分享") shareText(map["shareText"] , "分享")
} else if (call.method == "sendGetBlueStatus") { } else if (call.method == "sendGetBlueStatus") {
// 蓝牙是否开启 // 蓝牙是否开启
// println("收到原生的信息了 methodmethodmethod: ${call.method}") // println("收到原生的信息了 methodmethodmethod: ${call.method}")
@ -58,8 +58,7 @@ class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) { override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine); GeneratedPluginRegistrant.registerWith(flutterEngine);
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { call, result ->
call, result ->
println("methodmethodmethod: ${call.method}") println("methodmethodmethod: ${call.method}")
// 在这里处理从 Flutter 发送过来的方法调用 // 在这里处理从 Flutter 发送过来的方法调用
if (call.method == "loadNativeShare") { if (call.method == "loadNativeShare") {

View File

@ -862,5 +862,9 @@
"五": "Fri", "五": "Fri",
"六": "Sat", "六": "Sat",
"日": "Sun", "日": "Sun",
"新建短信模版":"New SMS template",
"自定义短信模版":"Custom SMS template",
"自定义邮件模版":"Custom email template",
"名称":"Name",
"星星锁": "Star lock" "星星锁": "Star lock"
} }

View File

@ -894,5 +894,9 @@
"五":"五", "五":"五",
"六":"六", "六":"六",
"日":"日", "日":"日",
"新建短信模版":"新建短信模版",
"自定义短信模版":"自定义短信模版",
"自定义邮件模版":"自定义邮件模版",
"名称":"名称",
"星星锁": "星星锁" "星星锁": "星星锁"
} }

View File

@ -334,8 +334,6 @@
"emailBuyTip": "您可通过邮件将密码、电子钥匙信息发给接收人。", "emailBuyTip": "您可通过邮件将密码、电子钥匙信息发给接收人。",
"currentRemainingQuantity": "当前剩余数量", "currentRemainingQuantity": "当前剩余数量",
"buy": "购买", "buy": "购买",
"customSMSTemplate": "自定义短信模版",
"customMailTemplate": "自定义邮件模版",
"record": "记录", "record": "记录",
"buyRealNameTip": "给用户发送电子钥匙时,可以要求其开锁前先进行人脸识别,以保证是他本人在操作。人脸实名认证调用国家公安系统接口,为付费功能,请购买次数后再使用。", "buyRealNameTip": "给用户发送电子钥匙时,可以要求其开锁前先进行人脸识别,以保证是他本人在操作。人脸实名认证调用国家公安系统接口,为付费功能,请购买次数后再使用。",
"buyRealNameSelectYouWantBuyTip": "请选择你希望的实名认证频次", "buyRealNameSelectYouWantBuyTip": "请选择你希望的实名认证频次",
@ -864,5 +862,9 @@
"五": "五", "五": "五",
"六": "六", "六": "六",
"日": "日", "日": "日",
"新建短信模版":"新建短信模版",
"自定义短信模版":"自定义短信模版",
"自定义邮件模版":"自定义邮件模版",
"名称":"名称",
"星星锁": "星星锁" "星星锁": "星星锁"
} }

View File

@ -153,6 +153,8 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
0420903B2C0EEAA50073E654 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
0420903C2C0EEAA60073E654 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
04BFC4482BCFE05100688FCA /* RunnerRelease-xhj.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerRelease-xhj.entitlements"; sourceTree = "<group>"; }; 04BFC4482BCFE05100688FCA /* RunnerRelease-xhj.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerRelease-xhj.entitlements"; sourceTree = "<group>"; };
0BEB3ADCCEC961E2916B9004 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; 0BEB3ADCCEC961E2916B9004 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
0D02C18E16914A687A4A1AC2 /* devDebug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = devDebug.xcconfig; path = Flutter/devDebug.xcconfig; sourceTree = "<group>"; }; 0D02C18E16914A687A4A1AC2 /* devDebug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = devDebug.xcconfig; path = Flutter/devDebug.xcconfig; sourceTree = "<group>"; };
@ -619,11 +621,12 @@
}; };
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 9.3"; compatibilityVersion = "Xcode 9.3";
developmentRegion = en; developmentRegion = "zh-Hans";
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
en, en,
Base, Base,
"zh-Hans",
); );
mainGroup = 97C146E51CF9000F007C117D; mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */; productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
@ -830,6 +833,7 @@
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
97C146FB1CF9000F007C117D /* Base */, 97C146FB1CF9000F007C117D /* Base */,
0420903B2C0EEAA50073E654 /* zh-Hans */,
); );
name = Main.storyboard; name = Main.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
@ -838,6 +842,7 @@
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
97C147001CF9000F007C117D /* Base */, 97C147001CF9000F007C117D /* Base */,
0420903C2C0EEAA60073E654 /* zh-Hans */,
); );
name = LaunchScreen.storyboard; name = LaunchScreen.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
@ -1034,6 +1039,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -1101,6 +1107,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -1298,6 +1305,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -1367,6 +1375,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -1436,6 +1445,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -1510,6 +1520,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -1579,6 +1590,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -1648,6 +1660,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -1720,6 +1733,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -1776,6 +1790,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -2118,6 +2133,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -2187,6 +2203,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -2261,6 +2278,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -2330,6 +2348,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -2399,6 +2418,7 @@
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon"; ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSET_PREFIX)AppIcon";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";

View File

@ -28,14 +28,14 @@
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>None</string> <string>None</string>
<key>CFBundleURLIconFile</key> <key>CFBundleURLIconFile</key>
<string/> <string></string>
<key>CFBundleURLName</key> <key>CFBundleURLName</key>
<string>com.sky.skysmartlock</string> <string>com.sky.skysmartlock</string>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array>
<string>skysmartlock</string> <string>skysmartlock</string>
<string/> <string></string>
<string/> <string></string>
</array> </array>
</dict> </dict>
<dict> <dict>

View File

@ -14,6 +14,7 @@
@property(nonatomic,strong) FlutterMethodChannel* methodChannel; @property(nonatomic,strong) FlutterMethodChannel* methodChannel;
@property (nonatomic, copy) NSString *textToShare; @property (nonatomic, copy) NSString *textToShare;
@property (nonatomic, copy) NSString *urlToShare;
@end @end
@ -24,7 +25,8 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.textToShare = [[NSString alloc] init]; self.textToShare = [[NSString alloc] init];
self.textToShare = [[NSString alloc] init];
[self methodChannelFunction]; [self methodChannelFunction];
} }
- (void)methodChannelFunction { - (void)methodChannelFunction {
@ -44,10 +46,12 @@
NSDictionary *paramDic = (NSDictionary *)params; NSDictionary *paramDic = (NSDictionary *)params;
// //
self.textToShare = paramDic[@"shareText"]; self.textToShare = paramDic[@"shareText"];
self.urlToShare = paramDic[@"urlToShare"];
} }
//url //url
NSURL *urlToShare = [NSURL URLWithString:@"https://pre.lock.star-lock.cn:8093/login"]; NSURL *urlToShare = [NSURL URLWithString:self.urlToShare];
// NSURL *urlToShare = [NSURL URLWithString:@"https://pre.lock.star-lock.cn:8093/login"];
// //
NSArray *activityItems = @[self.textToShare,urlToShare]; NSArray *activityItems = @[self.textToShare,urlToShare];

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -190,8 +190,8 @@ import 'mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedService
import 'mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart'; import 'mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart';
import 'mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_page.dart'; import 'mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_page.dart';
import 'mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_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/valueAddedServicesAddSMSTemplate/newSMSTemplate_page.dart';
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/valueAddedServicesListSMSTemplate_page.dart'; import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/customSMSTemplateList_page.dart';
import 'mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdministratorList_page.dart'; import 'mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdministratorList_page.dart';
import 'starLockApplication/starLockApplication.dart'; import 'starLockApplication/starLockApplication.dart';
import 'tools/seletKeyCyclicDate/seletKeyCyclicDate_page.dart'; import 'tools/seletKeyCyclicDate/seletKeyCyclicDate_page.dart';
@ -208,19 +208,25 @@ abstract class Routers {
static const String lockAddressGaoDePage = '/LockAddressGaoDePage'; // - static const String lockAddressGaoDePage = '/LockAddressGaoDePage'; // -
static const String saveLockPage = '/SaveLockPage'; // static const String saveLockPage = '/SaveLockPage'; //
static const String lockDetailMainPage = '/LockDetailMainPage'; // static const String lockDetailMainPage = '/LockDetailMainPage'; //
static const String electronicKeyListPage = '/ElectronicKeyListPage'; // static const String electronicKeyListPage =
static const String electronicKeyDetailPage = '/ElectronicKeyDetailPage'; // '/ElectronicKeyListPage'; //
static const String electronicKeyDetailPage =
'/ElectronicKeyDetailPage'; //
static const String electronicKeyDetailChangeDate = static const String electronicKeyDetailChangeDate =
'/ElectronicKeyDetailChangeDate'; // '/ElectronicKeyDetailChangeDate'; //
static const String sendElectronicKeyPage = '/SendElectronicKeyPage'; // static const String sendElectronicKeyPage =
'/SendElectronicKeyPage'; //
static const String massSendElectronicKeyManagePage = static const String massSendElectronicKeyManagePage =
'/MassSendElectronicKeyManagePage'; // '/MassSendElectronicKeyManagePage'; //
static const String electronicKeyPeriodValidityPage = static const String electronicKeyPeriodValidityPage =
'/ElectronicKeyPeriodValidityPage'; // '/ElectronicKeyPeriodValidityPage'; //
static const String sendEmailNotificationPage = '/SendEmailNotificationPage'; // static const String sendEmailNotificationPage =
'/SendEmailNotificationPage'; //
static const String passwordKeyListPage = '/PasswordKeyListPage'; // static const String passwordKeyListPage = '/PasswordKeyListPage'; //
static const String passwordKeyPerpetualPage = '/PasswordKeyPerpetualPage'; // static const String passwordKeyPerpetualPage =
static const String passwordKeyDetailPage = '/PasswordKeyDetailPage'; // '/PasswordKeyPerpetualPage'; //
static const String passwordKeyDetailPage =
'/PasswordKeyDetailPage'; //
// static const otherTypeKeyListPage = '/OtherTypeKeyListPage'; // // static const otherTypeKeyListPage = '/OtherTypeKeyListPage'; //
// static const otherTypeKeyDetailPage = '/OtherTypeKeyDetailPage'; // // static const otherTypeKeyDetailPage = '/OtherTypeKeyDetailPage'; //
// static const otherTypeKeyManagePage = '/OtherTypeKeyManagePage'; // // static const otherTypeKeyManagePage = '/OtherTypeKeyManagePage'; //
@ -229,35 +235,41 @@ abstract class Routers {
static const String otherTypeKeyChangeValidityDatePage = static const String otherTypeKeyChangeValidityDatePage =
'/OtherTypeKeyChangeValidityDatePage'; // '/OtherTypeKeyChangeValidityDatePage'; //
static const String addFingerprintTipPage = '/AddFingerprintTipPage'; // static const String addFingerprintTipPage =
'/AddFingerprintTipPage'; //
static const String addFingerprintPage = '/AddFingerprintPage'; // static const String addFingerprintPage = '/AddFingerprintPage'; //
static const String addICCardPage = '/AddICCardPage'; // static const String addICCardPage = '/AddICCardPage'; //
static const String authorizedAdminListPage = '/AuthorizedAdminListPage'; // static const String authorizedAdminListPage =
'/AuthorizedAdminListPage'; //
static const String authorizedAdminDetailPage = static const String authorizedAdminDetailPage =
'/AuthorizedAdminDetailPage'; // '/AuthorizedAdminDetailPage'; //
static const String authorizedAdminPage = '/AuthorizedAdminPage'; // static const String authorizedAdminPage = '/AuthorizedAdminPage'; //
static const String volumeAuthorizationLockManagePage = static const String volumeAuthorizationLockManagePage =
'/VolumeAuthorizationLockManagePage'; // '/VolumeAuthorizationLockManagePage'; //
static const String lockOperatingRecordPage = '/LockOperatingRecordPage'; // static const String lockOperatingRecordPage =
'/LockOperatingRecordPage'; //
static const String lockSetPage = '/LockSetPage'; // static const String lockSetPage = '/LockSetPage'; //
static const String basicInformationPage = '/BasicInformationPage'; // static const String basicInformationPage = '/BasicInformationPage'; //
static const String uploadElectricQuantityPage = static const String uploadElectricQuantityPage =
'/UploadElectricQuantityPage'; // '/UploadElectricQuantityPage'; //
static const String editLockNamePage = '/EditLockNamePage'; // static const String editLockNamePage = '/EditLockNamePage'; //
static const String lockSelectGroupingPage = '/LockSelectGroupingPage'; // static const String lockSelectGroupingPage =
'/LockSelectGroupingPage'; //
static const String groupEditLockPage = '/GroupEditLockPage'; // static const String groupEditLockPage = '/GroupEditLockPage'; //
static const String adminOpenLockPasswordPage = static const String adminOpenLockPasswordPage =
'/AdminOpenLockPasswordPage'; // '/AdminOpenLockPasswordPage'; //
static const String wirelessKeyboardPage = '/WirelessKeyboardPage'; // static const String wirelessKeyboardPage = '/WirelessKeyboardPage'; //
static const String addWirelessKeyboardPage = '/AddWirelessKeyboardPage'; // static const String addWirelessKeyboardPage =
'/AddWirelessKeyboardPage'; //
static const String addWirelessKeyboardScreenNotLightOnPage = static const String addWirelessKeyboardScreenNotLightOnPage =
'/AddWirelessKeyboardScreenNotLightOnPage'; // '/AddWirelessKeyboardScreenNotLightOnPage'; //
static const String selectWirelessKeyboardPage = static const String selectWirelessKeyboardPage =
'/SelectWirelessKeyboardPage'; // '/SelectWirelessKeyboardPage'; //
static const String doorMagneticPage = '/DoorMagneticPage'; // static const String doorMagneticPage = '/DoorMagneticPage'; //
static const String addDoorMagneticPage = '/AddDoorMagneticPage'; // static const String addDoorMagneticPage = '/AddDoorMagneticPage'; //
static const String nearbyDoorMagneticPage = '/NearbyDoorMagneticPage'; // static const String nearbyDoorMagneticPage =
'/NearbyDoorMagneticPage'; //
static const String remoteUnlockingPage = '/RemoteUnlockingPage'; // static const String remoteUnlockingPage = '/RemoteUnlockingPage'; //
static const String automaticBlockingPage = '/AutomaticBlockingPage'; // static const String automaticBlockingPage = '/AutomaticBlockingPage'; //
static const String normallyOpenModePage = '/NormallyOpenModePage'; // static const String normallyOpenModePage = '/NormallyOpenModePage'; //
@ -270,21 +282,28 @@ abstract class Routers {
static const String lockTimePage = '/LockTimePage'; // static const String lockTimePage = '/LockTimePage'; //
static const String diagnosePage = '/DiagnosePage'; // static const String diagnosePage = '/DiagnosePage'; //
static const String uploadDataPage = '/UploadDataPage'; // static const String uploadDataPage = '/UploadDataPage'; //
static const String importOtherLockDataPage = '/ImportOtherLockDataPage'; // static const String importOtherLockDataPage =
'/ImportOtherLockDataPage'; //
static const String lockEscalationPage = '/LockEscalationPage'; // static const String lockEscalationPage = '/LockEscalationPage'; //
static const String markedHouseStatePage = '/MarkedHouseStatePage'; // static const String markedHouseStatePage = '/MarkedHouseStatePage'; //
static const String checkInCreatCompanyPage = '/CheckInCreatCompanyPage'; // static const String checkInCreatCompanyPage =
'/CheckInCreatCompanyPage'; //
static const String checkingInListPage = '/CheckingInListPage'; // static const String checkingInListPage = '/CheckingInListPage'; //
static const String checkingInSetPage = '/CheckingInSetPage'; // static const String checkingInSetPage = '/CheckingInSetPage'; //
static const String checkingInStaffManagePage = '/CheckingInStaffManagePage'; // static const String checkingInStaffManagePage =
static const String checkingInAddStaffPage = '/CheckingInAddStaffPage'; // '/CheckingInStaffManagePage'; //
static const String checkingInStaffDetailPage = '/CheckingInStaffDetailPage'; // static const String checkingInAddStaffPage =
'/CheckingInAddStaffPage'; //
static const String checkingInStaffDetailPage =
'/CheckingInStaffDetailPage'; //
static const String checkingInSetWorkTimePage = static const String checkingInSetWorkTimePage =
'/CheckingInSetWorkTimePage'; // '/CheckingInSetWorkTimePage'; //
static const String checkingInSetWorkdaySet = '/CheckingInSetWorkdaySet'; // static const String checkingInSetWorkdaySet =
'/CheckingInSetWorkdaySet'; //
static const String checkingInSetHolidaysPage = static const String checkingInSetHolidaysPage =
'/CheckingInSetHolidaysPage'; // '/CheckingInSetHolidaysPage'; //
static const String checkingInAddHolidaysPage = '/CheckingInAddHolidaysPage'; // static const String checkingInAddHolidaysPage =
'/CheckingInAddHolidaysPage'; //
static const String checkingInDetailPage = '/CheckingInDetailPage'; // static const String checkingInDetailPage = '/CheckingInDetailPage'; //
static const String checkingInDeletHolidaysPage = static const String checkingInDeletHolidaysPage =
'/CheckingInDeletHolidaysPage'; // '/CheckingInDeletHolidaysPage'; //
@ -306,13 +325,15 @@ abstract class Routers {
'/MinePersonInfoSetSafetyProblemPage'; // '/MinePersonInfoSetSafetyProblemPage'; //
static const String minePersonInfoViewSafetyProblemPage = static const String minePersonInfoViewSafetyProblemPage =
'/MinePersonInfoViewSafetyProblemPage'; // '/MinePersonInfoViewSafetyProblemPage'; //
static const String mineBindPhoneOrEmailPage = '/MineBindPhoneOrEmailPage'; //- static const String mineBindPhoneOrEmailPage =
'/MineBindPhoneOrEmailPage'; //-
static const String gatewayListPage = '/GatewayListPage'; // - static const String gatewayListPage = '/GatewayListPage'; // -
static const String gatewayDetailPage = '/GatewayDetailPage'; // - static const String gatewayDetailPage = '/GatewayDetailPage'; // -
static const String gatewayConnectionLockPage = static const String gatewayConnectionLockPage =
'/GatewayConnectionLockPage'; // - '/GatewayConnectionLockPage'; // -
static const String selectGatewayTypePage = '/SelectGatewayTypePage'; // - static const String selectGatewayTypePage =
'/SelectGatewayTypePage'; // -
static const String selectGatewayTypeNextTipPage = static const String selectGatewayTypeNextTipPage =
'/SelectGatewayTypeNextTipPage'; // - '/SelectGatewayTypeNextTipPage'; // -
static const String selectGatewayPage = '/SelectGatewayPage'; // - static const String selectGatewayPage = '/SelectGatewayPage'; // -
@ -322,7 +343,8 @@ abstract class Routers {
static const String messageListPage = '/MessageListPage'; // - static const String messageListPage = '/MessageListPage'; // -
static const String messageDetailPage = '/MessageDetailPage'; // - static const String messageDetailPage = '/MessageDetailPage'; // -
static const String supportStaffPage = '/SupportStaffPage'; // - static const String supportStaffPage = '/SupportStaffPage'; // -
static const String valueAddedServicesPage = '/ValueAddedServicesPage'; // - static const String valueAddedServicesPage =
'/ValueAddedServicesPage'; // -
static const String aboutPage = '/AboutPage'; // - static const String aboutPage = '/AboutPage'; // -
static const String valueAddedServicesNoteAndEmailDetailPage = static const String valueAddedServicesNoteAndEmailDetailPage =
@ -335,10 +357,10 @@ abstract class Routers {
'/ValueAddedServicesHighFunctionPage'; // - '/ValueAddedServicesHighFunctionPage'; // -
static const String valueAddedServicesBuyPage = static const String valueAddedServicesBuyPage =
'/ValueAddedServicesBuyPage'; // - '/ValueAddedServicesBuyPage'; // -
static const String valueAddedServicesListSMSTemplatePage = static const String customSMSTemplateListPage =
'/ValueAddedServicesListSMSTemplatePage'; // - '/CustomSMSTemplateListPage'; // -
static const String valueAddedServicesAddSMSTemplatePage = static const String newSMSTemplatePage =
'/valueAddedServicesAddSMSTemplatePage'; // - '/NewSMSTemplatePage'; // -
static const String valueAddedServicesListEmailTemplatePage = static const String valueAddedServicesListEmailTemplatePage =
'/ValueAddedServicesListEmailTemplatePage'; // - '/ValueAddedServicesListEmailTemplatePage'; // -
static const String valueAddedServicesAddEmailTemplatePage = static const String valueAddedServicesAddEmailTemplatePage =
@ -352,13 +374,15 @@ abstract class Routers {
static const String hideInvalidUnlockPermissionsPage = static const String hideInvalidUnlockPermissionsPage =
'/HideInvalidUnlockPermissionsPage'; // - '/HideInvalidUnlockPermissionsPage'; // -
static const String lockUserManageLisPage = '/LockUserManageLisPage'; //- static const String lockUserManageLisPage =
'/LockUserManageLisPage'; //-
static const String authorizedAdministratorListPage = static const String authorizedAdministratorListPage =
'/AuthorizedAdministratorListPage'; //- '/AuthorizedAdministratorListPage'; //-
static const String lockGroupListPage = '/LockGroupListPage'; //- static const String lockGroupListPage = '/LockGroupListPage'; //-
static const String lockItemListPage = '/LockItemListPage'; //- static const String lockItemListPage = '/LockItemListPage'; //-
static const String transferSmartLockPage = '/transferSmartLockPage'; // static const String transferSmartLockPage = '/transferSmartLockPage'; //
static const String recipientInformationPage = '/recipientInformationPage'; // static const String recipientInformationPage =
'/recipientInformationPage'; //
static const String selectBranchPage = '/SelectBranchPage'; // static const String selectBranchPage = '/SelectBranchPage'; //
static const String selectGetewayListPage = '/selectGetewayListPage'; // static const String selectGetewayListPage = '/selectGetewayListPage'; //
static const String addAuthorizedAdministratorPage = static const String addAuthorizedAdministratorPage =
@ -369,24 +393,30 @@ abstract class Routers {
static const String starLockRegisterPage = '/StarLockRegisterPage'; // static const String starLockRegisterPage = '/StarLockRegisterPage'; //
static const String starLockForgetPasswordPage = static const String starLockForgetPasswordPage =
'/StarLockForgetPasswordPage'; // '/StarLockForgetPasswordPage'; //
static const String selectCountryRegionPage = '/SelectCountryRegionPage'; // static const String selectCountryRegionPage =
static const String safetyVerificationPage = '/SafetyVerificationPage'; // '/SelectCountryRegionPage'; //
static const String safetyVerificationPage =
'/SafetyVerificationPage'; //
static const String getDeviceListPage = '/getDeviceListPage'; // static const String getDeviceListPage = '/getDeviceListPage'; //
static const String getNameListPage = '/getNameListPage'; // static const String getNameListPage = '/getNameListPage'; //
static const String authorityManagementPage = '/authorityManagementPage'; // static const String authorityManagementPage =
'/authorityManagementPage'; //
static const String massSendLockGroupListPage = static const String massSendLockGroupListPage =
'/massSendLockGroupListPage'; // '/massSendLockGroupListPage'; //
static const massSendReceiverPage = '/massSendReceiverPage'; // static const massSendReceiverPage = '/massSendReceiverPage'; //
static const lockUserListPage = '/lockUserListPage'; // static const lockUserListPage = '/lockUserListPage'; //
static const administratorDetailsPage = '/administratorDetailsPage'; // static const administratorDetailsPage = '/administratorDetailsPage'; //
static const expireLockManagePage = '/expireLockManagePage'; // static const expireLockManagePage = '/expireLockManagePage'; //
static const expireKeyChangeDatePage = '/ExpireKeyChangeDatePage'; // static const expireKeyChangeDatePage =
static const adminDetailChangeDatePage = '/adminDetailChangeDatePage'; // '/ExpireKeyChangeDatePage'; //
static const adminDetailChangeDatePage =
'/adminDetailChangeDatePage'; //
static const String adminLockListPage = '/adminLockListPage'; // static const String adminLockListPage = '/adminLockListPage'; //
static const String safeVerifyPage = '/safeVerifyPage'; // static const String safeVerifyPage = '/safeVerifyPage'; //
static const String webviewShowPage = '/webviewShowPage'; // static const String webviewShowPage = '/webviewShowPage'; //
static const String demoModeLockDetailPage = '/DemoModeLockDetailPage'; // static const String demoModeLockDetailPage =
'/DemoModeLockDetailPage'; //
static const String demoModeLockSetPage = '/DemoModeLockSetPage'; // static const String demoModeLockSetPage = '/DemoModeLockSetPage'; //
static const String addLockSelectCountryPage = static const String addLockSelectCountryPage =
'/AddLockSelectCountryPage'; // '/AddLockSelectCountryPage'; //
@ -404,8 +434,10 @@ abstract class Routers {
static const String catEyeSetPage = '/catEyeSetPage'; // static const String catEyeSetPage = '/catEyeSetPage'; //
static const String coerceOpenDoorPage = '/coerceOpenDoorPage'; // static const String coerceOpenDoorPage = '/coerceOpenDoorPage'; //
static const String coerceFingerprintPage = '/coerceFingerprintPage'; // static const String coerceFingerprintPage = '/coerceFingerprintPage'; //
static const String lowBatteryReminderPage = '/lowBatteryReminderPage'; // static const String lowBatteryReminderPage =
static const String coerceFingerprintListPage = '/coerceFingerprintListPage'; // '/lowBatteryReminderPage'; //
static const String coerceFingerprintListPage =
'/coerceFingerprintListPage'; //
static const String lockMonitoringPage = '/LockMonitoringPage'; // static const String lockMonitoringPage = '/LockMonitoringPage'; //
static const String monitoringRealTimeScreenPage = static const String monitoringRealTimeScreenPage =
'/MonitoringRealTimeScreenPage'; // '/MonitoringRealTimeScreenPage'; //
@ -422,7 +454,8 @@ abstract class Routers {
static const String addCardPage = '/AddCardPage'; // static const String addCardPage = '/AddCardPage'; //
static const String cardDetailPage = '/CardDetailPage'; // static const String cardDetailPage = '/CardDetailPage'; //
static const String fingerprintListPage = '/FingerprintListPage'; // static const String fingerprintListPage = '/FingerprintListPage'; //
static const String addFingerprintTypePage = '/AddFingerprintTypePage'; // static const String addFingerprintTypePage =
'/AddFingerprintTypePage'; //
static const String fingerprintDetailPage = '/FingerprintDetailPage'; // static const String fingerprintDetailPage = '/FingerprintDetailPage'; //
static const String faceListPage = '/FaceListPage'; // static const String faceListPage = '/FaceListPage'; //
static const String addFaceTypePage = '/AddFaceTypePage'; // static const String addFaceTypePage = '/AddFaceTypePage'; //
@ -447,7 +480,8 @@ abstract class Routers {
static const String accessoriesListPage = '/accessoriesListPage'; // static const String accessoriesListPage = '/accessoriesListPage'; //
static const String seletKeyCyclicDatePage = static const String seletKeyCyclicDatePage =
'/SeletKeyCyclicDatePage'; // '/SeletKeyCyclicDatePage'; //
static const String advancedFeaturesWebPage = '/advancedFeaturesWebPage'; // static const String advancedFeaturesWebPage =
'/advancedFeaturesWebPage'; //
static const String advancedFunctionRecordPage = static const String advancedFunctionRecordPage =
'/advancedFunctionRecordPage'; // '/advancedFunctionRecordPage'; //
static const String administratorAssociationLockPage = static const String administratorAssociationLockPage =
@ -833,12 +867,12 @@ abstract class AppRouters {
page: () => const ValueAddedServicesHighFunctionPage(), page: () => const ValueAddedServicesHighFunctionPage(),
), ),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.valueAddedServicesListSMSTemplatePage, name: Routers.customSMSTemplateListPage,
page: () => const ValueAddedServicesListSMSTemplatePage(), page: () => const CustomSMSTemplateListPage(),
), ),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.valueAddedServicesAddSMSTemplatePage, name: Routers.newSMSTemplatePage,
page: () => const ValueAddedServicesAddSMSTemplatePage(), page: () => const NewSMSTemplatePage(),
), ),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.valueAddedServicesListEmailTemplatePage, name: Routers.valueAddedServicesListEmailTemplatePage,
@ -902,7 +936,8 @@ abstract class AppRouters {
name: Routers.ownedKeyListPage, page: () => const OwnedKeyListPage()), name: Routers.ownedKeyListPage, page: () => const OwnedKeyListPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.getDeviceListPage, page: () => const GetDeviceListPage()), name: Routers.getDeviceListPage, page: () => const GetDeviceListPage()),
GetPage<dynamic>(name: Routers.getNameListPage, page: () => const GetNameListPage()), GetPage<dynamic>(
name: Routers.getNameListPage, page: () => const GetNameListPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.authorityManagementPage, name: Routers.authorityManagementPage,
page: () => const AuthorityManagementPage()), page: () => const AuthorityManagementPage()),
@ -941,18 +976,21 @@ abstract class AppRouters {
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.otherTypeKeyChangeValidityDatePage, name: Routers.otherTypeKeyChangeValidityDatePage,
page: () => const OtherTypeKeyChangeValidityDatePage()), page: () => const OtherTypeKeyChangeValidityDatePage()),
GetPage<dynamic>(name: Routers.addICCardPage, page: () => const AddICCardPage()), GetPage<dynamic>(
name: Routers.addICCardPage, page: () => const AddICCardPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.adminDetailChangeDatePage, name: Routers.adminDetailChangeDatePage,
page: () => const AdminDetailChangeDatePage()), page: () => const AdminDetailChangeDatePage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.lockAddressGaoDePage, name: Routers.lockAddressGaoDePage,
page: () => const LockAddressGaoDePage()), page: () => const LockAddressGaoDePage()),
GetPage<dynamic>(name: Routers.safeVerifyPage, page: () => const SafeVerifyPage()), GetPage<dynamic>(
name: Routers.safeVerifyPage, page: () => const SafeVerifyPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.minePersonInfoViewSafetyProblemPage, name: Routers.minePersonInfoViewSafetyProblemPage,
page: () => const MinePersonInfoViewSafetyProblemPage()), page: () => const MinePersonInfoViewSafetyProblemPage()),
GetPage<dynamic>(name: Routers.webviewShowPage, page: () => const WebviewShowPage()), GetPage<dynamic>(
name: Routers.webviewShowPage, page: () => const WebviewShowPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.demoModeLockSetPage, name: Routers.demoModeLockSetPage,
page: () => const DemoModeLockSetPage()), page: () => const DemoModeLockSetPage()),
@ -962,8 +1000,10 @@ abstract class AppRouters {
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.addLockSelectCountryPage, name: Routers.addLockSelectCountryPage,
page: () => const AddLockSelectCountryPage()), page: () => const AddLockSelectCountryPage()),
GetPage<dynamic>(name: Routers.faceUnlockPage, page: () => const FaceUnlockPage()), GetPage<dynamic>(
GetPage<dynamic>(name: Routers.motorPowerPage, page: () => const MotorPowerPage()), name: Routers.faceUnlockPage, page: () => const FaceUnlockPage()),
GetPage<dynamic>(
name: Routers.motorPowerPage, page: () => const MotorPowerPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.openDoorDirectionPage, name: Routers.openDoorDirectionPage,
page: () => const OpenDoorDirectionPage()), page: () => const OpenDoorDirectionPage()),
@ -973,7 +1013,8 @@ abstract class AppRouters {
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.msgNotificationPage, name: Routers.msgNotificationPage,
page: () => const MsgNotificationPage()), page: () => const MsgNotificationPage()),
GetPage<dynamic>(name: Routers.addFacePage, page: () => const AddFacePage()), GetPage<dynamic>(
name: Routers.addFacePage, page: () => const AddFacePage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.nDaysUnopenedPage, page: () => const NDaysUnopenedPage()), name: Routers.nDaysUnopenedPage, page: () => const NDaysUnopenedPage()),
GetPage<dynamic>( GetPage<dynamic>(
@ -982,9 +1023,12 @@ abstract class AppRouters {
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.openDoorNotifyPage, name: Routers.openDoorNotifyPage,
page: () => const OpenDoorNotifyPage()), page: () => const OpenDoorNotifyPage()),
GetPage<dynamic>(name: Routers.addFamilyPage, page: () => const AddFamilyPage()), GetPage<dynamic>(
GetPage<dynamic>(name: Routers.lockUserPage, page: () => const LockUserPage()), name: Routers.addFamilyPage, page: () => const AddFamilyPage()),
GetPage<dynamic>(name: Routers.catEyeSetPage, page: () => const CatEyeSetPage()), GetPage<dynamic>(
name: Routers.lockUserPage, page: () => const LockUserPage()),
GetPage<dynamic>(
name: Routers.catEyeSetPage, page: () => const CatEyeSetPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.coerceOpenDoorPage, name: Routers.coerceOpenDoorPage,
page: () => const CoerceOpenDoorPage()), page: () => const CoerceOpenDoorPage()),
@ -1003,7 +1047,8 @@ abstract class AppRouters {
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.monitoringRealTimeScreenPage, name: Routers.monitoringRealTimeScreenPage,
page: () => const MonitoringRealTimeScreenPage()), page: () => const MonitoringRealTimeScreenPage()),
GetPage<dynamic>(name: Routers.videoLogPage, page: () => const VideoLogPage()), GetPage<dynamic>(
name: Routers.videoLogPage, page: () => const VideoLogPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.editVideoLogPage, page: () => const EditVideoLogPage()), name: Routers.editVideoLogPage, page: () => const EditVideoLogPage()),
GetPage<dynamic>( GetPage<dynamic>(
@ -1018,12 +1063,15 @@ abstract class AppRouters {
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.addRemoteControlPage, name: Routers.addRemoteControlPage,
page: () => const AddRemoteControlPage()), page: () => const AddRemoteControlPage()),
GetPage<dynamic>(name: Routers.cardListPage, page: () => const CardListPage()), GetPage<dynamic>(
name: Routers.cardListPage, page: () => const CardListPage()),
// GetPage<dynamic>( // GetPage<dynamic>(
// name: Routers.addCardTypeManagePage, // name: Routers.addCardTypeManagePage,
// page: () => const AddCardTypeManagePage()), // page: () => const AddCardTypeManagePage()),
GetPage<dynamic>(name: Routers.addCardPage, page: () => const AddCardPage()), GetPage<dynamic>(
GetPage<dynamic>(name: Routers.cardDetailPage, page: () => const CardDetailPage()), name: Routers.addCardPage, page: () => const AddCardPage()),
GetPage<dynamic>(
name: Routers.cardDetailPage, page: () => const CardDetailPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.fingerprintListPage, name: Routers.fingerprintListPage,
page: () => const FingerprintListPage()), page: () => const FingerprintListPage()),
@ -1033,41 +1081,51 @@ abstract class AppRouters {
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.fingerprintDetailPage, name: Routers.fingerprintDetailPage,
page: () => const FingerprintDetailPage()), page: () => const FingerprintDetailPage()),
GetPage<dynamic>(name: Routers.faceListPage, page: () => const FaceListPage()), GetPage<dynamic>(
GetPage<dynamic>(name: Routers.addFaceTypePage, page: () => const AddFaceTypePage()), name: Routers.faceListPage, page: () => const FaceListPage()),
GetPage<dynamic>(
name: Routers.addFaceTypePage, page: () => const AddFaceTypePage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.passwordKeyDetailChangeDatePage, name: Routers.passwordKeyDetailChangeDatePage,
page: () => const PasswordKeyDetailChangeDatePage()), page: () => const PasswordKeyDetailChangeDatePage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.realTimePicturePage, name: Routers.realTimePicturePage,
page: () => const RealTimePicturePage()), page: () => const RealTimePicturePage()),
GetPage<dynamic>(name: Routers.doorLockLogPage, page: () => const DoorLockLogPage()), GetPage<dynamic>(
name: Routers.doorLockLogPage, page: () => const DoorLockLogPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.catEyeCustomModePage, name: Routers.catEyeCustomModePage,
page: () => const 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>( GetPage<dynamic>(
name: Routers.messageDetailPage, name: Routers.videoSlotPage, page: () => const VideoSlotPage()),
page: () => const MessageDetailPage()), 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>( GetPage<dynamic>(
name: Routers.accessoriesListPage, name: Routers.accessoriesListPage,
page: () => const AccessoriesListPage()), page: () => const AccessoriesListPage()),
GetPage<dynamic>(name: Routers.wifiListPage, page: () => const WifiListPage()), GetPage<dynamic>(
name: Routers.wifiListPage, page: () => const WifiListPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.seletKeyCyclicDatePage, name: Routers.seletKeyCyclicDatePage,
page: () => const SeletKeyCyclicDatePage()), page: () => const SeletKeyCyclicDatePage()),
GetPage<dynamic>(name: Routers.irisListPage, page: () => const IrisListPage()), GetPage<dynamic>(
name: Routers.irisListPage, page: () => const IrisListPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.addIrisTypeManagePage, name: Routers.addIrisTypeManagePage,
page: () => const AddIrisTypeManagePage()), page: () => const AddIrisTypeManagePage()),
GetPage<dynamic>(name: Routers.addIrisPage, page: () => const AddIrisPage()), GetPage<dynamic>(
GetPage<dynamic>(name: Routers.palmListPage, page: () => const PalmListPage()), name: Routers.addIrisPage, page: () => const AddIrisPage()),
GetPage<dynamic>(
name: Routers.palmListPage, page: () => const PalmListPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.addPalmTypeManagePage, name: Routers.addPalmTypeManagePage,
page: () => const AddPalmTypeManagePage()), page: () => const AddPalmTypeManagePage()),
GetPage<dynamic>(name: Routers.addPalmPage, page: () => const AddPalmPage()), GetPage<dynamic>(
name: Routers.addPalmPage, page: () => const AddPalmPage()),
GetPage<dynamic>( GetPage<dynamic>(
name: Routers.advancedFeaturesWebPage, name: Routers.advancedFeaturesWebPage,
page: () => const AdvancedFeaturesWebPage()), page: () => const AdvancedFeaturesWebPage()),

View File

@ -2,11 +2,16 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/app_settings/app_settings.dart'; import 'package:star_lock/app_settings/app_settings.dart';
import 'package:star_lock/blue/blue_manage.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart'; import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart'; import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
import 'package:star_lock/tools/eventBusEventManage.dart';
import 'package:star_lock/tools/storage.dart';
import 'package:star_lock/tools/xs_jPhush.dart';
import '../../network/api_repository.dart'; import '../../network/api_repository.dart';
import '../../tools/baseGetXController.dart'; import '../../tools/baseGetXController.dart';
@ -49,12 +54,13 @@ class StarLockRegisterLogic extends BaseGetXController {
verificationCode: state.verificationCode.value, verificationCode: state.verificationCode.value,
deviceInfo: state.deviceInfoMap.value); deviceInfo: state.deviceInfoMap.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('注册成功'.tr); Storage.saveLoginData(entity.data);
Storage.setBool(saveIsVip, entity.data!.isVip == 1);
Get.back(result: <String, String>{ eventBus.fire(MineInfoChangeRefreshUI());
'phoneOrEmailStr': state.phoneOrEmailStr.value, XSJPushProvider().bindDeviceID();
'pwd': state.pwd.value XSJPushProvider().initLocalNotification(isCancelLocalPush: false);
}); Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
BlueManage().scanDevices.clear(); //
} }
} }

View File

@ -151,7 +151,13 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
arguments: <String, ElectronicKeyListItem>{ arguments: <String, ElectronicKeyListItem>{
'itemData': indexEntity, 'itemData': indexEntity,
}).then((Object? val) { }).then((Object? val) {
if (val != null) { if (val == 'deletScuess') {
state.itemDataList.removeWhere(
( ElectronicKeyListItem item) =>
item.keyId ==
indexEntity.keyId!);
setState(() {});
} else if (val != null) {
logic logic
.refreshIndividualKeys( .refreshIndividualKeys(
lockId: indexEntity.lockId!, lockId: indexEntity.lockId!,

View File

@ -182,7 +182,13 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
arguments: <String, ElectronicKeyListItem>{ arguments: <String, ElectronicKeyListItem>{
'itemData': indexEntity, 'itemData': indexEntity,
}).then((Object? val) { }).then((Object? val) {
if (val != null) { if (val == 'deletScuess') {
state.itemDataList.removeWhere(
( ElectronicKeyListItem item) =>
item.keyId ==
indexEntity.keyId!);
setState(() {});
} else if (val != null) {
logic logic
.refreshIndividualKeys( .refreshIndividualKeys(
lockId: indexEntity.lockId!, lockId: indexEntity.lockId!,

View File

@ -3,9 +3,11 @@ import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart'; import 'package:star_lock/appRouters.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_entity.dart'; import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_entity.dart';
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/notice_template_entity.dart';
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.dart'; import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.dart';
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart'; import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/NativeInteractionTool.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/commonDataManage.dart'; import 'package:star_lock/tools/commonDataManage.dart';
import 'package:star_lock/tools/dateTool.dart'; import 'package:star_lock/tools/dateTool.dart';
@ -18,11 +20,16 @@ import 'package:star_lock/tools/storage.dart';
class SendElectronicKeyViewLogic extends BaseGetXController { class SendElectronicKeyViewLogic extends BaseGetXController {
SendElectronicKeyViewLogic(this.type); SendElectronicKeyViewLogic(this.type);
String type; String type;
final SendElectronicKeyViewState state = SendElectronicKeyViewState(); final SendElectronicKeyViewState state = SendElectronicKeyViewState();
int? keyId;
String? emailOrPhone;
List<dynamic> get weekDayStr { List<dynamic> get weekDayStr {
return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList(); return state.weekdaysList
.map((e) => TimeUtils.translateWeekday(e))
.toList();
} }
@override @override
@ -174,12 +181,15 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
? state.idCardController.text ? state.idCardController.text
: ''); : '');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
emailOrPhone = state.emailOrPhoneController.text;
state.createUser.value = 0; state.createUser.value = 0;
state.isSendSuccess = true; state.isSendSuccess = true;
keyId = entity.data!.keyId;
resetData(); resetData();
update(); update();
eventBus.fire(ElectronicKeyListRefreshUI()); eventBus.fire(ElectronicKeyListRefreshUI());
} else { } else {
emailOrPhone = null;
if (entity.errorCode == 425) { if (entity.errorCode == 425) {
// //
update(); update();
@ -237,6 +247,31 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
return currentController; return currentController;
} }
//
Future<void> sendMsg({required bool isPhone}) async {
if (keyId == null) {
return;
}
final NoticeTemplateEntity entity = await ApiRepository.to
.getNoticeTemplate(
lockId: CommonDataManage().currentKeyInfo.lockId!,
keyId: keyId!,
channelType: isPhone ? 1 : 2);
if (entity.errorCode!.codeIsSuccessful) {
final List<Item?> list =
entity.data!.list!.where((Item item) => item.isUse == 0).toList();
if (list.isNotEmpty) {
final Item item = list.first!;
final String template = item.template ?? '';
NativeInteractionTool().loadNativeShare(shareText: template);
} else {
showToast('获取模板失败 0x02');
}
} else {
showToast('获取模板失败 0x01');
}
}
void resetData() { void resetData() {
state.emailOrPhoneController.text = ''; state.emailOrPhoneController.text = '';
state.keyNameController.text = ''; state.keyNameController.text = '';

View File

@ -416,15 +416,33 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
SizedBox( SizedBox(
height: 10.h, height: 10.h,
), ),
OutLineBtn( // OutLineBtn(
btnName: '分享'.tr, // btnName: '分享'.tr,
onClick: () { // onClick: () {
_openModalBottomSheet(); // _openModalBottomSheet();
}, // },
), // ),
if (logic.emailOrPhone != null)
OutLineBtn(
btnName: logic.emailOrPhone!.contains('@') ? '邮件通知' : '短信通知',
onClick: () {
if (logic.emailOrPhone!.contains('@')) {
Get.toNamed(Routers.sendEmailNotificationPage);
} else {
logic.sendMsg(isPhone: true);
}
},
),
SizedBox( SizedBox(
height: 10.h, height: 10.h,
), ),
if (logic.emailOrPhone != null)
OutLineBtn(
btnName: '微信通知',
onClick: () {
logic.sendMsg(isPhone: logic.emailOrPhone!.contains('@'));
},
),
], ],
); );
} }

View File

@ -154,7 +154,7 @@ class FingerprintDetailLogic extends BaseGetXController{
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
showToast('删除成功'.tr, something: (){ showToast('删除成功'.tr, something: (){
Get.back(result: 'addScuess'); Get.back(result: 'deletScuess');
}); });
} }
} }

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -69,7 +68,8 @@ class _FingerprintListPageState extends State<FingerprintListPage>
onPressed: () async { onPressed: () async {
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
ShowTipView().showIosTipWithContentDialog('重置后,该锁的指纹都将被删除哦,确认要重置吗?'.tr, () async { ShowTipView().showIosTipWithContentDialog(
'重置后,该锁的指纹都将被删除哦,确认要重置吗?'.tr, () async {
state.isDeletAll = true; state.isDeletAll = true;
state.deletKeyID = '1'; state.deletKeyID = '1';
state.deletFingerNo = 0; state.deletFingerNo = 0;
@ -161,11 +161,18 @@ class _FingerprintListPageState extends State<FingerprintListPage>
fingerprintItemData.fingerprintName!, fingerprintItemData.fingerprintName!,
logic.getKeyType(fingerprintItemData), logic.getKeyType(fingerprintItemData),
logic.getKeyDateType(fingerprintItemData), () async { logic.getKeyDateType(fingerprintItemData), () async {
final data = await Get.toNamed(Routers.fingerprintDetailPage, final data = await Get.toNamed(
Routers.fingerprintDetailPage,
arguments: <String, FingerprintItemData>{ arguments: <String, FingerprintItemData>{
'fingerprintItemData': fingerprintItemData, 'fingerprintItemData': fingerprintItemData,
}); });
if (data != null) { if (data == 'deletScuess') {
state.fingerprintItemListData.removeWhere(
(FingerprintItemData item) =>
item.fingerprintId ==
fingerprintItemData.fingerprintId!);
setState(() {});
} else if (data != null) {
logic logic
.refreshIndividualKeys( .refreshIndividualKeys(
fingerprintId: fingerprintItemData.fingerprintId!) fingerprintId: fingerprintItemData.fingerprintId!)

View File

@ -187,6 +187,10 @@ class AutomaticBlockingLogic extends BaseGetXController {
} else { } else {
state.canNext.value = false; state.canNext.value = false;
} }
if (!openLock && (state.autoLockTime.value.isEmpty || state.autoLockTime.value == '0')) {
state.autoLockTime.value = '5';
}
} }
@override @override

View File

@ -509,6 +509,7 @@ class LockSetLogic extends BaseGetXController {
// //
StreamSubscription? _passCurrentLockInformationEvent; StreamSubscription? _passCurrentLockInformationEvent;
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) { void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
// eventBus // eventBus
_passCurrentLockInformationEvent = eventBus _passCurrentLockInformationEvent = eventBus
@ -567,18 +568,19 @@ class LockSetLogic extends BaseGetXController {
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
BlueManage().connectDeviceMacAddress = ''; BlueManage().connectDeviceMacAddress = '';
final bool isXHJ = F.isXHJ;
final bool isOnlyOneData = state.isOnlyOneData.value == true;
await Future<dynamic>.delayed(const Duration(milliseconds: 200))
.then((e) {
if (isXHJ) {
Get.close(3);
} else {
Get.close(isOnlyOneData ? 1 : 2);
}
});
SchedulerBinding.instance.addPostFrameCallback((_) { SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
}); });
if (state.isOnlyOneData.value == true) {
Future<dynamic>.delayed(const Duration(milliseconds: 200)).then((e) {
Get.close(1);
});
} else {
Future<dynamic>.delayed(const Duration(milliseconds: 200)).then((e) {
Get.close(2);
});
}
} }
} }
@ -591,12 +593,10 @@ class LockSetLogic extends BaseGetXController {
state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0); state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
BlueManage().connectDeviceMacAddress = ''; BlueManage().connectDeviceMacAddress = '';
SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent());
});
final bool isXHJ = F.isXHJ; final bool isXHJ = F.isXHJ;
final bool isOnlyOneData = state.isOnlyOneData.value == true; final bool isOnlyOneData = state.isOnlyOneData.value == true;
Future<dynamic>.delayed(const Duration(milliseconds: 200)).then((e) { await Future<dynamic>.delayed(const Duration(milliseconds: 200)).then((e) {
if (isXHJ) { if (isXHJ) {
Get.close(3); Get.close(3);
} else { } else {
@ -604,6 +604,9 @@ class LockSetLogic extends BaseGetXController {
Get.close(onlyOneDataInt); Get.close(onlyOneDataInt);
} }
}); });
SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent());
});
} }
} }

View File

@ -25,6 +25,7 @@ class PasswordKeyListLogic extends BaseGetXController {
// //
late StreamSubscription<Reply> _replySubscription; late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() { void _initReplySubscription() {
_replySubscription = _replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) { EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
@ -70,7 +71,8 @@ class PasswordKeyListLogic extends BaseGetXController {
keyID: '0', keyID: '0',
userID: (await Storage.getUid())!, userID: (await Storage.getUid())!,
pwdNo: state.itemData.isCustom == 1 ? state.pwdNo : 0, pwdNo: state.itemData.isCustom == 1 ? state.pwdNo : 0,
pwd: state.pwd, //state.deletPWD, pwd: state.pwd,
//state.deletPWD,
operate: state.itemData.isCustom == 1 ? 2 : 3, operate: state.itemData.isCustom == 1 ? 2 : 3,
isAdmin: 0, isAdmin: 0,
useCountLimit: 0xffff, useCountLimit: 0xffff,
@ -157,7 +159,8 @@ class PasswordKeyListLogic extends BaseGetXController {
keyID: '0', keyID: '0',
userID: (await Storage.getUid())!, userID: (await Storage.getUid())!,
pwdNo: state.itemData.isCustom == 1 ? state.pwdNo : 0, pwdNo: state.itemData.isCustom == 1 ? state.pwdNo : 0,
pwd: state.pwd, //state.deletPWD, pwd: state.pwd,
//state.deletPWD,
operate: state.itemData.isCustom == 1 ? 2 : 3, operate: state.itemData.isCustom == 1 ? 2 : 3,
isAdmin: 0, isAdmin: 0,
useCountLimit: 0xffff, useCountLimit: 0xffff,
@ -228,28 +231,28 @@ class PasswordKeyListLogic extends BaseGetXController {
} }
/** /**
* // * //
void mockNetworkDataRequest({required bool isRefresh}) async { void mockNetworkDataRequest({required bool isRefresh}) async {
// //
if (isRefresh) { if (isRefresh) {
state.lockLogItemList.clear(); state.lockLogItemList.clear();
pageNo = 1; pageNo = 1;
} }
DoorLockLogEntity entity = await ApiRepository.to.lockEventList( DoorLockLogEntity entity = await ApiRepository.to.lockEventList(
lockId: state.keyInfos.value.lockId!, lockId: state.keyInfos.value.lockId!,
lockEventType: state.dropdownValue.value, lockEventType: state.dropdownValue.value,
pageNo: pageNo, pageNo: pageNo,
pageSize: int.parse(pageSize), pageSize: int.parse(pageSize),
startDate: state.startDate.value, startDate: state.startDate.value,
endDate: state.endDate.value); endDate: state.endDate.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
// //
state.lockLogItemList.addAll(entity.data!.itemList!); state.lockLogItemList.addAll(entity.data!.itemList!);
// //
pageNo++; pageNo++;
} }
} }
*/ */
// //
Future<PasswordKeyListEntity> mockNetworkDataRequest( Future<PasswordKeyListEntity> mockNetworkDataRequest(
@ -396,10 +399,10 @@ class PasswordKeyListLogic extends BaseGetXController {
Future<void> refreshIndividualKeys( Future<void> refreshIndividualKeys(
{required int lockId, required int keyboardPwdId}) async { {required int lockId, required int keyboardPwdId}) async {
final PasswordKeyEntity entity = final PasswordKeyEntity entity =
await ApiRepository.to.passwordKey(lockId, keyboardPwdId); await ApiRepository.to.passwordKey(lockId, keyboardPwdId);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
final int index = state.itemDataList final int index = state.itemDataList.indexWhere(
.indexWhere((PasswordKeyListItem item) => item.keyboardPwdId == keyboardPwdId); (PasswordKeyListItem item) => item.keyboardPwdId == keyboardPwdId);
state.itemDataList.removeAt(index); state.itemDataList.removeAt(index);
state.itemDataList.insert(index, entity.data!); state.itemDataList.insert(index, entity.data!);
} }
@ -407,6 +410,7 @@ class PasswordKeyListLogic extends BaseGetXController {
/// ///
StreamSubscription? _getPasswordListRefreshUIEvent; StreamSubscription? _getPasswordListRefreshUIEvent;
void _getPasswordListRefreshUIAction() { void _getPasswordListRefreshUIAction() {
// eventBus // eventBus
_getPasswordListRefreshUIEvent = eventBus _getPasswordListRefreshUIEvent = eventBus

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_slidable/flutter_slidable.dart';
@ -64,13 +63,15 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
style: TextStyle(color: Colors.white, fontSize: 24.sp), style: TextStyle(color: Colors.white, fontSize: 24.sp),
), ),
onPressed: () async { onPressed: () async {
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); final bool? isDemoMode =
await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
if (state.itemDataList.isEmpty) { if (state.itemDataList.isEmpty) {
logic.showToast('暂无密码,无需重置'.tr); logic.showToast('暂无密码,无需重置'.tr);
return; return;
} }
ShowTipView().showIosTipWithContentDialog('该锁的密码都将被删除'.tr, logic.getUserInfoRequest); ShowTipView().showIosTipWithContentDialog(
'该锁的密码都将被删除'.tr, logic.getUserInfoRequest);
} else { } else {
logic.showToast('演示模式'.tr); logic.showToast('演示模式'.tr);
} }
@ -105,9 +106,10 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
btnName: TranslationLoader.lanKeys!.getPassword!.tr, btnName: TranslationLoader.lanKeys!.getPassword!.tr,
onClick: () { onClick: () {
Navigator.pushNamed( Navigator.pushNamed(
context, Routers.passwordKeyPerpetualPage, context, Routers.passwordKeyPerpetualPage,
arguments: <String, LockListInfoItemEntity>{'keyInfo': state.keyInfo.value}) arguments: <String, LockListInfoItemEntity>{
.then((Object? val) { 'keyInfo': state.keyInfo.value
}).then((Object? val) {
if (val != null) { if (val != null) {
getHttpData(isRefresh: true); getHttpData(isRefresh: true);
} }
@ -146,7 +148,8 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
children: <Widget>[ children: <Widget>[
SlidableAction( SlidableAction(
onPressed: (BuildContext context) { onPressed: (BuildContext context) {
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, () async { ShowTipView().showIosTipWithContentDialog(
'确定要删除吗?'.tr, () async {
state.itemData = passwordKeyListItem; state.itemData = passwordKeyListItem;
state.pwdNo = passwordKeyListItem.pwdUserNo!; state.pwdNo = passwordKeyListItem.pwdUserNo!;
state.pwd = passwordKeyListItem.keyboardPwd!; state.pwd = passwordKeyListItem.keyboardPwd!;
@ -162,10 +165,23 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
), ),
child: _electronicKeyItem(index, 'images/icon_password.png', child: _electronicKeyItem(index, 'images/icon_password.png',
passwordKeyListItem.keyboardPwdName!, useDateStr, () { passwordKeyListItem.keyboardPwdName!, useDateStr, () {
Navigator.pushNamed(context, Routers.passwordKeyDetailPage, arguments: <String, PasswordKeyListItem>{'itemData': passwordKeyListItem}) Navigator.pushNamed(context, Routers.passwordKeyDetailPage,
.then((Object? val) { arguments: <String, PasswordKeyListItem>{
if (val != null) { 'itemData': passwordKeyListItem
// getHttpData(isRefresh: true); }).then((Object? val) {
if (val == 'deletScuess') {
state.itemDataList.removeWhere(
(PasswordKeyListItem item) =>
item.keyboardPwdId ==
passwordKeyListItem.keyboardPwdId!);
setState(() {});
} else if (val != null) {
logic
.refreshIndividualKeys(
lockId: passwordKeyListItem.lockId!,
keyboardPwdId:
passwordKeyListItem.keyboardPwdId!)
.then((dynamic value) => setState(() {}));
} }
}); });
}), }),
@ -181,8 +197,10 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
)); ));
} }
Widget _electronicKeyItem(int itemIndex, String lockTypeIcon, String lockTypeTitle, String useDateStr, Function()? action) { Widget _electronicKeyItem(int itemIndex, String lockTypeIcon,
final PasswordKeyListItem passwordKeyListItem = state.itemDataList[itemIndex]; String lockTypeTitle, String useDateStr, Function()? action) {
final PasswordKeyListItem passwordKeyListItem =
state.itemDataList[itemIndex];
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
@ -223,11 +241,13 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
]), ]),
), ),
SizedBox(width: 10.w), SizedBox(width: 10.w),
if (passwordKeyListItem.keyboardPwdStatus == 2) Text( if (passwordKeyListItem.keyboardPwdStatus == 2)
'已过期'.tr, Text(
style: '已过期'.tr,
TextStyle(color: Colors.red, fontSize: 20.sp), style: TextStyle(color: Colors.red, fontSize: 20.sp),
) else Container(), )
else
Container(),
// SizedBox(width: 15.w) // SizedBox(width: 15.w)
], ],
), ),

View File

@ -230,25 +230,20 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
Widget _xhjLockInfoListItem( Widget _xhjLockInfoListItem(
LockListInfoItemEntity keyInfo, bool isLast, Function() action) { LockListInfoItemEntity keyInfo, bool isLast, Function() action) {
String lockAlias = keyInfo.lockAlias!; final String lockAlias = keyInfo.lockAlias!;
final TextStyle lockAliasTextStyle = TextStyle( final TextStyle lockAliasTextStyle = TextStyle(
fontSize: 24.sp, fontSize: 25.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: keyInfo.passageMode == 1 color: keyInfo.passageMode == 1
? AppColors.openPassageModeColor ? AppColors.openPassageModeColor
: AppColors.darkGrayTextColor, : AppColors.darkGrayTextColor,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
); );
final TextPainter textPainter = TextPainter( final List<String> useKeyTypeListStr = logic.getUseKeyTypeListStr(
text: TextSpan(text: lockAlias, style: lockAliasTextStyle), keyInfo.startDate, keyInfo.endDate, keyInfo.keyType);
maxLines: 1, final bool isThree = useKeyTypeListStr.length == 3;
textDirection: TextDirection.ltr) final bool isOne = useKeyTypeListStr.length == 1;
..layout(minWidth: 0, maxWidth: double.infinity);
final double textSizeWidth = textPainter.size.width; //
if (textSizeWidth > Get.width * .6) {
lockAlias = '${lockAlias.substring(0, 14)}...';
}
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
@ -270,6 +265,7 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'images/icon_lock_circle.png', 'images/icon_lock_circle.png',
@ -277,50 +273,86 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
height: 48.r, height: 48.r,
color: AppColors.mainColor, color: AppColors.mainColor,
), ),
const Spacer(),
Column(
children: <Widget>[
Row(
children: <Widget>[
Image.asset(
logic.showElectricIcon(keyInfo.electricQuantity!),
width: 30.w,
height: 24.w,
),
SizedBox(width: 2.w),
Text(
'${keyInfo.electricQuantity!}%',
style: TextStyle(
fontSize: 16.sp,
color: AppColors.darkGrayTextColor),
),
],
),
Text(
keyInfo.isLockOwner == 1
? '超级管理员'.tr
: (keyInfo.keyRight == 1 ? '授权管理员'.tr : '普通用户'.tr),
style: TextStyle(
fontSize: 16.sp,
color: AppColors.darkGrayTextColor),
)
],
),
], ],
), ),
SizedBox( SizedBox(
height: 10.h, height: 8.h,
), ),
FittedBox( Text(
fit: BoxFit.scaleDown, lockAlias,
child: Text(lockAlias, style: lockAliasTextStyle, maxLines: 1), style: lockAliasTextStyle,
maxLines: 2,
), ),
Visibility( Row(
visible: keyInfo.passageMode == 1, children: <Widget>[
child: Padding( Visibility(
padding: EdgeInsets.only(top: 5.h), visible: keyInfo.passageMode == 1,
child: Row( child: Container(
children: <Widget>[ padding:
Container( EdgeInsets.only(top: 2.h, right: 3.w, left: 3.w,bottom: 1.h),
padding: EdgeInsets.only(right: 5.w, left: 5.w), decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(5.w),
borderRadius: BorderRadius.circular(5.w), color: AppColors.openPassageModeColor,
color: AppColors.openPassageModeColor, ),
), child: Text('常开模式开启'.tr,
child: Text('常开模式开启'.tr, style: TextStyle(
fontSize: 18.sp,
color: AppColors.appBarIconColor)),
)),
if (keyInfo.passageMode == 1)
SizedBox(
width: 5.w,
),
Visibility(
visible: keyInfo.lockSetting!.remoteUnlock == 1,
child: Row(
children: <Widget>[
Container(
padding: EdgeInsets.only(
top: 2.h, right: 3.w, left: 3.w,bottom: 1.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.w),
color: AppColors.mainColor,
),
child: Text(
'远程开锁'.tr,
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp, color: Colors.white),
color: AppColors.appBarIconColor)), ),
), ),
], ],
), )),
)), ],
Visibility( ),
visible: keyInfo.lockSetting!.remoteUnlock == 1,
child: Padding(
padding: EdgeInsets.only(top: 5.h),
child: Row(
children: <Widget>[
Text(
'远程开锁'.tr,
style: TextStyle(
fontSize: 18.sp,
color: AppColors.darkGrayTextColor),
),
],
),
)),
Visibility( Visibility(
visible: (keyInfo.keyType == XSConstantMacro.keyTypeTime || visible: (keyInfo.keyType == XSConstantMacro.keyTypeTime ||
keyInfo.keyType == XSConstantMacro.keyTypeLoop) && keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
@ -331,7 +363,7 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
keyInfo.keyStatus == keyInfo.keyStatus ==
XSConstantMacro.keyStatusExpired), XSConstantMacro.keyStatusExpired),
child: Padding( child: Padding(
padding: EdgeInsets.only(top: 20.h), padding: EdgeInsets.only(top: 5.h),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Container( Container(
@ -353,37 +385,40 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
), ),
)), )),
SizedBox(height: 5.h), SizedBox(height: 5.h),
Row( if (isThree)
children: <Widget>[ Column(
Expanded( crossAxisAlignment: CrossAxisAlignment.start,
child: Text( children: <Widget>[
keyInfo.isLockOwner == 1 Text(
? '超级管理员'.tr Characters(useKeyTypeListStr[0]).join('\u{200B}'),
: (keyInfo.keyRight == 1 ? '授权管理员'.tr : '普通用户'.tr),
style: TextStyle( style: TextStyle(
fontSize: 16.sp, color: AppColors.darkGrayTextColor), fontSize: 16.sp, color: AppColors.darkGrayTextColor),
), ),
), Row(
Image.asset( children: <Widget>[
logic.showElectricIcon(keyInfo.electricQuantity!), Text(
width: 30.w, Characters(useKeyTypeListStr[1]).join('\u{200B}'),
height: 24.w, style: TextStyle(
), fontSize: 16.sp,
SizedBox(width: 2.w), color: AppColors.darkGrayTextColor),
Text( ),
'${keyInfo.electricQuantity!}%', SizedBox(width: 5.w),
style: TextStyle( Text(
fontSize: 16.sp, color: AppColors.darkGrayTextColor), useKeyTypeListStr[2],
), style: TextStyle(
], fontSize: 16.sp,
), color: AppColors.darkGrayTextColor),
Text( ),
Characters(logic.getUseKeyTypeStr( ],
keyInfo.startDate, keyInfo.endDate, keyInfo.keyType)) ),
.join('\u{200B}'), ],
style: TextStyle( )
fontSize: 16.sp, color: AppColors.darkGrayTextColor), else if (isOne)
) Text(
useKeyTypeListStr[0],
style: TextStyle(
fontSize: 16.sp, color: AppColors.darkGrayTextColor),
),
], ],
), ),
), ),

View File

@ -24,7 +24,7 @@ class _ValueAddedServicesListEmailTemplatePageState
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.customMailTemplate!.tr, barTitle: '自定义邮件模版'.tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(

View File

@ -112,8 +112,8 @@ class _ValueAddedServicesNoteAndEmailDetailPageState
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (type == 1) { if (type == 1) {
Navigator.pushNamed(context, Navigator.pushNamed(
Routers.valueAddedServicesListSMSTemplatePage); context, Routers.customSMSTemplateListPage);
} else { } else {
Navigator.pushNamed(context, Navigator.pushNamed(context,
Routers.valueAddedServicesListEmailTemplatePage); Routers.valueAddedServicesListEmailTemplatePage);
@ -130,9 +130,7 @@ class _ValueAddedServicesNoteAndEmailDetailPageState
height: 36.w, height: 36.w,
), ),
Text( Text(
(type == 1) (type == 1) ? '自定义短信模版'.tr : '自定义邮件模版'.tr,
? TranslationLoader.lanKeys!.customSMSTemplate!.tr
: TranslationLoader.lanKeys!.customMailTemplate!.tr,
style: TextStyle(fontSize: 24.sp), style: TextStyle(fontSize: 24.sp),
), ),
], ],

View File

@ -0,0 +1,58 @@
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.typeName, this.template, this.fixedKey});
SMSTemplateData.fromJson(Map<String, dynamic> json) {
contentType = json['content_type'];
typeName = json['typeName'];
template = json['template'];
fixedKey = json['fixed_key'];
}
int? contentType;
String? typeName;
String? template;
String? fixedKey;
String? regards = '';
String? tips = '';
int? id;
String? name;
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['content_type'] = contentType;
data['typeName'] = typeName;
data['template'] = template;
data['fixed_key'] = fixedKey;
return data;
}
}

View File

@ -0,0 +1,207 @@
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.templateList[0].name,
);
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(result: true);
}
}
Future<void> updateTemplateInfo() async {
final LoginEntity entity = await ApiRepository.to.updateTemplateInfo(
id: state.currentTemplate.value.id ?? 0,
name: state.templateNameTf.text,
regards: state.templateOneTf.text,
tips: state.templateTwoTf.text);
if (entity.errorCode!.codeIsSuccessful) {
showToast('修改成功');
Get.back(result: true);
}
}
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();
if (state.isUpdate.value == false) {
getDefaultTemplate();
}
}
}

View File

@ -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
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: () {
if (state.isUpdate.value == true) {
logic.updateTemplateInfo();
} else {
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.currentTemplate.value.typeName ?? '',
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.currentTemplate.value.typeName == '电子钥匙'
? 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) {
setState(() {
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,
style: TextStyle(fontSize: 22.sp),
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.typeName ?? '')
.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.currentTemplate.value = state.templateList[index];
state.currentTemplate.value.typeName = str.toString();
state.currentTemplate.refresh();
},
);
}
}

View File

@ -0,0 +1,38 @@
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 {
NewSMSTemplateState() {
if (Get.arguments != null) {
final Map map = Get.arguments;
currentTemplate.value = map['currentTemplate'];
currentTemplate.refresh();
isUpdate.value = true;
templateNameTf.text = currentTemplate.value.name ?? '';
templateOneTf.text = currentTemplate.value.regards ?? '';
templateTwoTf.text = currentTemplate.value.tips ?? '';
}
}
//
final TextStyle highStyle =
TextStyle(color: const Color(0xFFEEDFA8), fontSize: 20.sp);
//
final TextStyle defaultStyle =
TextStyle(color: Colors.black, fontSize: 20.sp);
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;
RxBool isUpdate = false.obs;
}

View File

@ -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) {});
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -1,45 +1,64 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.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/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 '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
import '../valueAddedServicesAddSMSTemplate/valueAddedServicesAddSMSTemplate_page.dart';
class ValueAddedServicesListSMSTemplatePage extends StatefulWidget { class CustomSMSTemplateListPage extends StatefulWidget {
const ValueAddedServicesListSMSTemplatePage({Key? key}) : super(key: key); const CustomSMSTemplateListPage({Key? key}) : super(key: key);
@override @override
State<ValueAddedServicesListSMSTemplatePage> createState() => State<CustomSMSTemplateListPage> createState() =>
_ValueAddedServicesListSMSTemplatePageState(); _CustomSMSTemplateListPageState();
} }
class _ValueAddedServicesListSMSTemplatePageState class _CustomSMSTemplateListPageState extends State<CustomSMSTemplateListPage> {
extends State<ValueAddedServicesListSMSTemplatePage> { final CustomSMSTemplateListLogic logic =
Get.put(CustomSMSTemplateListLogic());
final CustomSMSTemplateListState state =
Get.find<CustomSMSTemplateListLogic>().state;
@override
void initState() {
super.initState();
logic.getSMSTemplateListRequest();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.customSMSTemplate!.tr, barTitle: '自定义短信模版'.tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
children: [ children: <Widget>[
_topTipWidget(), Obx(() => Visibility(
Expanded(child: _buildMainUI()), child: _topTipWidget(),
visible: !state.isVip.value,
)),
Expanded(child: Obx(buildMainUI)),
SubmitBtn( SubmitBtn(
btnName: TranslationLoader.lanKeys!.creatingANewTemplate!.tr, btnName: TranslationLoader.lanKeys!.creatingANewTemplate!.tr,
borderRadius: 20.w, borderRadius: 20.w,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () { onClick: () async {
Navigator.pushNamed( final result = await Get.toNamed(Routers.newSMSTemplatePage);
context, Routers.valueAddedServicesAddSMSTemplatePage); if (result != null) {
logic.getSMSTemplateListRequest();
}
}), }),
SizedBox( SizedBox(
height: 40.h, height: 40.h,
@ -57,7 +76,7 @@ class _ValueAddedServicesListSMSTemplatePageState
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(5)), color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Column( child: Column(
children: [ children: <Widget>[
Text( Text(
TranslationLoader.lanKeys!.customTemplatesTip!.tr, TranslationLoader.lanKeys!.customTemplatesTip!.tr,
style: TextStyle( style: TextStyle(
@ -76,15 +95,14 @@ class _ValueAddedServicesListSMSTemplatePageState
borderRadius: BorderRadius.circular(10.h)), borderRadius: BorderRadius.circular(10.h)),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: <Widget>[
Container( SizedBox(
width: 1.sw - 15.w * 2 - 40.w * 2 - 140.w, 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( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: <Widget>[
Text( Text(
"${TranslationLoader.lanKeys!.currentState!.tr}${TranslationLoader.lanKeys!.onTrial!.tr}", '${TranslationLoader.lanKeys!.currentState!.tr}${TranslationLoader.lanKeys!.onTrial!.tr}',
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontWeight: FontWeight.w600), fontSize: 20.sp, fontWeight: FontWeight.w600),
), ),
@ -119,23 +137,39 @@ class _ValueAddedServicesListSMSTemplatePageState
)); ));
} }
Widget _buildMainUI() { Widget buildMainUI() {
return ListView.builder( return state.smsTemplateList.isNotEmpty
itemCount: 10, ? ListView.builder(
itemBuilder: (c, index) { itemCount: state.smsTemplateList.length,
return _valueAddedServicesListSMSTemplateItem( itemBuilder: (BuildContext c, int index) {
'images/icon_lock.png', "张三", () { final CustomSMSTemplateItem itemData =
// Navigator.pushNamed(context, Routers.valueAddedServicesAddSMSTemplatePage); state.smsTemplateList[index];
}); return _valueAddedServicesListSMSTemplateItem(itemData);
}); })
: NoData();
} }
Widget _valueAddedServicesListSMSTemplateItem( Widget _valueAddedServicesListSMSTemplateItem(
String title, String content, Function() action) { CustomSMSTemplateItem itemData) {
return GestureDetector( return GestureDetector(
onTap: action, onTap: () async {
final SMSTemplateData templateData = SMSTemplateData();
templateData.name = itemData.name;
templateData.regards = itemData.regards;
templateData.tips = itemData.tips;
templateData.id = itemData.id;
templateData.template = itemData.template;
templateData.contentType = itemData.contentType;
templateData.typeName = templateData.contentType == 1 ? '电子钥匙' : '密码';
final result = await Get.toNamed(Routers.newSMSTemplatePage,
arguments: <String, SMSTemplateData>{
'currentTemplate': templateData
});
if (result != null) {
logic.getSMSTemplateListRequest();
}
},
child: Container( child: Container(
// height: 100.h,
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -143,24 +177,31 @@ class _ValueAddedServicesListSMSTemplatePageState
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(left: 30.h, top: 30.h, bottom: 20.h), padding: EdgeInsets.only(left: 30.h, top: 30.h, bottom: 20.h),
child: Text( child: Text(
"101", itemData.name ?? '',
style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600), style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600),
), ),
), ),
Container( Container(
width: 1.sw - 20.w * 2 - 30.w * 2,
margin: EdgeInsets.only(left: 25.w, right: 25.w, bottom: 25.h), margin: EdgeInsets.only(left: 25.w, right: 25.w, bottom: 25.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color(0xFFF5F5F5), color: const Color(0xFFF5F5F5),
borderRadius: BorderRadius.circular(10.h), borderRadius: BorderRadius.circular(10.h),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 20.w, top: 20.h, bottom: 20.h),
left: 20.w, top: 20.h, right: 20.w, bottom: 20.h), child: RichText(
child: RichText(text: electronicKeySpan)), text: TextSpan(
children: itemData.contentType == 1
? logic.buildElectronicKeySpan(templateData: itemData)
: logic.buildPasswordSpan(templateData: itemData),
),
),
),
), ),
], ],
), ),

View File

@ -0,0 +1,17 @@
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';
class CustomSMSTemplateListState {
//
final TextStyle highStyle =
TextStyle(color: const Color(0xFFEEDFA8), fontSize: 20.sp);
//
final TextStyle defaultStyle =
TextStyle(color: Colors.black, fontSize: 20.sp);
RxBool isVip = false.obs;
RxList<CustomSMSTemplateItem> smsTemplateList = <CustomSMSTemplateItem>[].obs;
}

View File

@ -102,8 +102,7 @@ abstract class Api {
final String editCheckInSetInfoURL = '/attendanceCompany/update'; // final String editCheckInSetInfoURL = '/attendanceCompany/update'; //
final String getFingerprintListURL = '/fingerprint/list'; // final String getFingerprintListURL = '/fingerprint/list'; //
final String getFingerprintDetailURL = final String getFingerprintDetailURL = '/fingerprint/detail'; //
'/fingerprint/detail'; //
final String addFingerprintURL = '/fingerprint/add'; // final String addFingerprintURL = '/fingerprint/add'; //
final String editFingerprintURL = '/fingerprint/changePeriod'; // final String editFingerprintURL = '/fingerprint/changePeriod'; //
final String deleteFingerprintURL = '/fingerprint/delete'; // final String deleteFingerprintURL = '/fingerprint/delete'; //
@ -244,5 +243,12 @@ abstract class Api {
final String getNoticeTemplateURL = '/key/getNoticeTemplate'; // final String getNoticeTemplateURL = '/key/getNoticeTemplate'; //
final String appGetAppInfoURL = '/app/getAppInfo'; //APP基本信息 final String appGetAppInfoURL = '/app/getAppInfo'; //APP基本信息
final String appGetFwVersionURL = '/app/getFwVersion'; // 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'; //
final String keydetail = ' /key/detail'; // final String keydetail = ' /key/detail'; //
final String updateTemplateInfoURL = '/v2/service/update'; //
} }

View File

@ -126,15 +126,12 @@ class ApiProvider extends BaseProvider {
'searchStr': searchStr 'searchStr': searchStr
})); }));
Future<Response> electronicKey( Future<Response> electronicKey(int lockId, int keyId) => post(
int lockId, int keyId keydetail.toUrl,
) => jsonEncode({
post( 'lockId': lockId.toString(),
keydetail.toUrl, 'keyId': keyId.toString(),
jsonEncode({ }));
'lockId': lockId.toString(),
'keyId': keyId.toString(),
}));
Future<Response> sendElectronicKey( Future<Response> sendElectronicKey(
int createUser, int createUser,
@ -449,13 +446,12 @@ class ApiProvider extends BaseProvider {
'searchStr': searchStr 'searchStr': searchStr
})); }));
Future<Response> passwordKey(int lockId, int keyboardPwdId,) => Future<Response> passwordKey(
post( int lockId,
passwordKeyDetailURL.toUrl, int keyboardPwdId,
jsonEncode({ ) =>
'lockId': lockId, post(passwordKeyDetailURL.toUrl,
'keyboardPwdId': keyboardPwdId jsonEncode({'lockId': lockId, 'keyboardPwdId': keyboardPwdId}));
}));
Future<Response> resetPasswordKey(String lockId, String operatorUid) => post( Future<Response> resetPasswordKey(String lockId, String operatorUid) => post(
resetPasswordURL.toUrl, resetPasswordURL.toUrl,
@ -1117,17 +1113,15 @@ class ApiProvider extends BaseProvider {
})); }));
// //
Future<Response> getFingerprintsData( Future<Response> getFingerprintsData(int fingerprintId) => post(
int fingerprintId) => getFingerprintDetailURL.toUrl,
post( jsonEncode({
getFingerprintDetailURL.toUrl, 'fingerprintId': fingerprintId,
jsonEncode({ }));
'fingerprintId': fingerprintId,
}));
// //
Future<Response> getFingerprintsListData( Future<Response> getFingerprintsListData(
String lockId, String pageNo, String pageSize, String searchStr) => String lockId, String pageNo, String pageSize, String searchStr) =>
post( post(
getFingerprintListURL.toUrl, getFingerprintListURL.toUrl,
jsonEncode({ jsonEncode({
@ -2169,6 +2163,55 @@ class ApiProvider extends BaseProvider {
}), }),
isUnShowLoading: true, 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,
);
Future<Response<dynamic>> updateTemplateInfo(
int id, String name, String regards, String tips) =>
post(
updateTemplateInfoURL.toUrl,
jsonEncode(<String, dynamic>{
'id': id,
'name': name,
'regards': regards,
'tips': tips,
}),
isUnShowLoading: true,
);
} }
extension ExtensionString on String { extension ExtensionString on String {

View File

@ -38,6 +38,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/valueAddedServicesRealName/face_authentication_entity.dart';
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/buy_record_list_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/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/realNameVertify_entity.dart';
import 'package:star_lock/tools/aliyunRealNameAuth/serviceAuthResult_entity.dart'; import 'package:star_lock/tools/aliyunRealNameAuth/serviceAuthResult_entity.dart';
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart'; import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
@ -172,10 +174,9 @@ class ApiRepository {
} }
// //
Future<ElectronicKeyEntity> electronicKey({ Future<ElectronicKeyEntity> electronicKey(
required int lockId,required int keyId {required int lockId, required int keyId}) async {
}) async { final res = await apiProvider.electronicKey(lockId, keyId);
final res = await apiProvider.electronicKey(lockId,keyId);
return ElectronicKeyEntity.fromJson(res.body); return ElectronicKeyEntity.fromJson(res.body);
} }
@ -423,13 +424,11 @@ class ApiRepository {
} }
// //
Future<PasswordKeyEntity> passwordKey( int lockId,int keyboardPwdId) async { Future<PasswordKeyEntity> passwordKey(int lockId, int keyboardPwdId) async {
final res = await apiProvider.passwordKey( final res = await apiProvider.passwordKey(lockId, keyboardPwdId);
lockId, keyboardPwdId);
return PasswordKeyEntity.fromJson(res.body); return PasswordKeyEntity.fromJson(res.body);
} }
// //
Future<PasswordKeyListEntity> resetPasswordKey( Future<PasswordKeyListEntity> resetPasswordKey(
String lockId, String operatorUid) async { String lockId, String operatorUid) async {
@ -2194,4 +2193,42 @@ class ApiRepository {
await apiProvider.getFwVersion(model, currentVersion); await apiProvider.getFwVersion(model, currentVersion);
return FwVersionEntity.fromJson(res.body); 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);
}
//
Future<LoginEntity> updateTemplateInfo(
{required int id,
required String name,
required String regards,
required String tips}) async {
final Response<dynamic> res =
await apiProvider.updateTemplateInfo(id, name, regards, tips);
return LoginEntity.fromJson(res.body);
}
} }

View File

@ -1,4 +1,5 @@
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:star_lock/flavors.dart';
import '../app_settings/app_settings.dart'; import '../app_settings/app_settings.dart';
@ -19,8 +20,9 @@ class NativeInteractionTool {
/// ///
void loadNativeShare({required String shareText}) { void loadNativeShare({required String shareText}) {
final String urlToShare = '${F.apiPrefix}/apps';
sendChannel.invokeMethod( sendChannel.invokeMethod(
'loadNativeShare', <String, String>{'shareText': shareText}); 'loadNativeShare', <String, String>{'shareText': shareText,'urlToShare':urlToShare});
} }
/// ///

View File

@ -21,7 +21,7 @@ class BaseGetXController extends GetxController {
bool currentPage = true; bool currentPage = true;
var pageNo = 1; var pageNo = 1;
var pageSize = "20"; var pageSize = '20';
@override @override
void onReady() { void onReady() {
@ -93,7 +93,7 @@ class BaseGetXController extends GetxController {
} }
void showBlueConnetctToast() { void showBlueConnetctToast() {
bool isContains = BlueManage().connectDeviceName.contains("T9A"); bool isContains = BlueManage().connectDeviceName.contains('T9A');
showToast( showToast(
"${'操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。'.tr}${isContains == true ? "如果是全自动锁,请使屏幕变亮" : ""}"); "${'操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。'.tr}${isContains == true ? "如果是全自动锁,请使屏幕变亮" : ""}");
} }
@ -123,10 +123,10 @@ class BaseGetXController extends GetxController {
} }
void showOperationSuccessful({String? status, Function? something}) => void showOperationSuccessful({String? status, Function? something}) =>
showSuccess(status ?? "成功", something: something); showSuccess(status ?? '成功', something: something);
void showOperationFailed({String? status, Function? something}) => void showOperationFailed({String? status, Function? something}) =>
showError(status ?? "失败", something: something); showError(status ?? '失败', something: something);
void logOff() async { void logOff() async {
await ClientManager().logOff(); await ClientManager().logOff();
@ -136,11 +136,11 @@ class BaseGetXController extends GetxController {
void checkBlueIsOpen(void Function() action) { void checkBlueIsOpen(void Function() action) {
NativeInteractionTool().sendGetBlueStatus(); NativeInteractionTool().sendGetBlueStatus();
NativeInteractionTool().receiveChannelBlueIsOnEvent((String status) { NativeInteractionTool().receiveChannelBlueIsOnEvent((String status) {
if (status == "1") { if (status == '1') {
// //
AppLog.log('蓝牙已打开'); AppLog.log('蓝牙已打开');
action(); action();
} else if (status == "0") { } else if (status == '0') {
// //
AppLog.log('蓝牙未打开'); AppLog.log('蓝牙未打开');
showIosTipViewDialog(); showIosTipViewDialog();
@ -148,7 +148,7 @@ class BaseGetXController extends GetxController {
} else { } else {
// //
AppLog.log('设备不支持蓝牙'); AppLog.log('设备不支持蓝牙');
showToast("设备不支持蓝牙"); showToast('设备不支持蓝牙');
return; return;
} }
}); });
@ -159,8 +159,8 @@ class BaseGetXController extends GetxController {
context: Get.context!, context: Get.context!,
builder: (BuildContext context) { builder: (BuildContext context) {
return ShowIosTipView( return ShowIosTipView(
title: "提示", title: '提示',
tipTitle: "蓝牙未打开,请到设置里面打开蓝牙", tipTitle: '蓝牙未打开,请到设置里面打开蓝牙',
sureClick: () { sureClick: () {
Get.back(); Get.back();
if (Platform.isIOS) { if (Platform.isIOS) {
@ -184,23 +184,45 @@ class BaseGetXController extends GetxController {
"${DateTool().dateToYMDHNString(startDate.toString())}-${DateTool().dateToYMDHNString(endDate.toString())} ${"限时".tr}"; "${DateTool().dateToYMDHNString(startDate.toString())}-${DateTool().dateToYMDHNString(endDate.toString())} ${"限时".tr}";
} else if (keyType == XSConstantMacro.keyTypeLong) { } else if (keyType == XSConstantMacro.keyTypeLong) {
// //
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)}\n永久';
useDateStr = '永久'.tr; useDateStr = '永久'.tr;
} else if (keyType == XSConstantMacro.keyTypeOnce) { } else if (keyType == XSConstantMacro.keyTypeOnce) {
// //
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} \n单次';
useDateStr = '单次'.tr; useDateStr = '单次'.tr;
} else if (keyType == XSConstantMacro.keyTypeLoop) { } else if (keyType == XSConstantMacro.keyTypeLoop) {
// //
useDateStr = useDateStr =
"${DateTool().dateToYMDString(startDate.toString())}-${DateTool().dateToYMDString(endDate.toString())} ${"循环".tr}"; "${DateTool().dateToYMDString(startDate.toString())}-${DateTool().dateToYMDString(endDate.toString())} ${"循环".tr}";
} }
return useDateStr; return useDateStr;
} }
List<String> getUseKeyTypeListStr(
int? startDate, int? endDate, int? keyType) {
final List<String> useDateListStr = <String>[];
if (keyType == XSConstantMacro.keyTypeTime) {
//
useDateListStr.addAll(<String>[
DateTool().dateToYMDHNString(startDate.toString()),
DateTool().dateToYMDHNString(endDate.toString()),
'限时'.tr,
]);
} else if (keyType == XSConstantMacro.keyTypeLong) {
//
useDateListStr.add('永久'.tr);
} else if (keyType == XSConstantMacro.keyTypeOnce) {
//
useDateListStr.add('单次'.tr);
} else if (keyType == XSConstantMacro.keyTypeLoop) {
//
useDateListStr.addAll(<String>[
DateTool().dateToYMDString(startDate.toString()),
DateTool().dateToYMDString(endDate.toString()),
'循环'.tr,
]);
}
return useDateListStr;
}
static List splitList(List list, int len) { static List splitList(List list, int len) {
if (len <= 1) { if (len <= 1) {
return [list]; return [list];

View File

@ -210,7 +210,8 @@ class DateTool {
String dateToYMDString(String timestamp) { String dateToYMDString(String timestamp) {
final int time = int.parse(timestamp); final int time = int.parse(timestamp);
final DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time); 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; return appointmentDate;
} }

View File

@ -11,4 +11,9 @@ class RegularExpression {
RegExp(r'^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$'); RegExp(r'^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$');
return emailRegExp.hasMatch(input); return emailRegExp.hasMatch(input);
} }
static RegExp urlRegExp = RegExp(
r'https?:\/\/\S+',
caseSensitive: false,
);
} }

View File

@ -62,8 +62,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 1.0.53+2024052803xhj 线上环境,提审 sky 线上环境提审 # 1.0.53+2024052803xhj 线上环境,提审 sky 线上环境提审
# 1.0.53+2024052804xhj 线上环境,提审 修改鑫锁名字为星星锁 # 1.0.53+2024052804xhj 线上环境,提审 修改鑫锁名字为星星锁
# 1.0.54+2024053001xhj 线上环境,对外发布,提交测试 # 1.0.54+2024053001xhj 线上环境,对外发布,提交测试
# 1.0.56+2024060401xhj 线上环境,对外发布,提交测试
version: 1.0.54+2024053001 version: 1.0.56+2024060401
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'