电子钥匙、密码、授权管理员模块演示版本完善
This commit is contained in:
parent
169e28992c
commit
296e14b9d2
@ -7,6 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
@ -197,12 +198,17 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.send!.tr,
|
||||
onClick: () {
|
||||
//发送钥匙请求
|
||||
if (state.emailOrPhoneController.text.isNotEmpty &&
|
||||
state.keyNameController.value.text.isNotEmpty) {
|
||||
// logic.addUserConnectBlue();
|
||||
logic.sendElectronicKeyRequest(context);
|
||||
onClick: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
//发送钥匙请求
|
||||
if (state.emailOrPhoneController.text.isNotEmpty &&
|
||||
state.keyNameController.value.text.isNotEmpty) {
|
||||
// logic.addUserConnectBlue();
|
||||
logic.sendElectronicKeyRequest(context);
|
||||
}
|
||||
} else {
|
||||
Toast.show(msg: '演示模式');
|
||||
}
|
||||
}),
|
||||
Container(
|
||||
|
||||
@ -8,6 +8,7 @@ import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/electr
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
@ -56,8 +57,14 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
TranslationLoader.lanKeys!.reset!.tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () {
|
||||
_showDialog(context);
|
||||
onPressed: () async {
|
||||
// 获取是否是演示模式 演示模式不获取接口
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
_showDialog(context);
|
||||
} else {
|
||||
Toast.show(msg: '演示模式');
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@ -10,6 +10,7 @@ import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
@ -261,24 +262,30 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.send!.tr,
|
||||
onClick: () {
|
||||
//发送钥匙请求
|
||||
if (state.emailOrPhoneController.text.isNotEmpty &&
|
||||
state.keyNameController.text.isNotEmpty) {
|
||||
if (int.parse(widget.type) == 0) {
|
||||
//失效时间大于生效时间
|
||||
if (state.failureDateTime.value
|
||||
.compareTo(state.effectiveDateTime.value) ==
|
||||
1) {
|
||||
logic.sendElectronicKeyRequest(context);
|
||||
onClick: () async {
|
||||
// 获取是否是演示模式 演示模式不获取接口
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
//发送钥匙请求
|
||||
if (state.emailOrPhoneController.text.isNotEmpty &&
|
||||
state.keyNameController.text.isNotEmpty) {
|
||||
if (int.parse(widget.type) == 0) {
|
||||
//失效时间大于生效时间
|
||||
if (state.failureDateTime.value
|
||||
.compareTo(state.effectiveDateTime.value) ==
|
||||
1) {
|
||||
logic.sendElectronicKeyRequest(context);
|
||||
} else {
|
||||
Toast.show(msg: '失效时间需大于生效时间');
|
||||
}
|
||||
} else {
|
||||
Toast.show(msg: '失效时间需大于生效时间');
|
||||
logic.sendElectronicKeyRequest(context);
|
||||
}
|
||||
} else {
|
||||
logic.sendElectronicKeyRequest(context);
|
||||
Toast.show(msg: '请完善信息');
|
||||
}
|
||||
} else {
|
||||
Toast.show(msg: '请完善信息');
|
||||
Toast.show(msg: '演示模式');
|
||||
}
|
||||
}),
|
||||
Container(
|
||||
|
||||
@ -7,6 +7,7 @@ import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKe
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
@ -55,8 +56,13 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
||||
TranslationLoader.lanKeys!.reset!.tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () {
|
||||
_showDialog(context);
|
||||
onPressed: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
_showDialog(context);
|
||||
} else {
|
||||
Toast.show(msg: '演示模式');
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@ -12,6 +12,7 @@ import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/pass
|
||||
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
@ -362,7 +363,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.getPassword!.tr,
|
||||
onClick: () {
|
||||
onClick: () async {
|
||||
// logic.senderCustomPasswords();
|
||||
|
||||
/*
|
||||
@ -385,21 +386,26 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (_nameController.text.isNotEmpty) {
|
||||
logic.getStartDate(_effectiveDateTime);
|
||||
int passwordType = int.parse(widget.type);
|
||||
if (passwordType == 3) {
|
||||
if (_pwdController.text.isNotEmpty) {
|
||||
//自定义密码
|
||||
addKeyboardPwdRequest();
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
if (_nameController.text.isNotEmpty) {
|
||||
logic.getStartDate(_effectiveDateTime);
|
||||
int passwordType = int.parse(widget.type);
|
||||
if (passwordType == 3) {
|
||||
if (_pwdController.text.isNotEmpty) {
|
||||
//自定义密码
|
||||
addKeyboardPwdRequest();
|
||||
} else {
|
||||
Toast.show(msg: '请输入密码');
|
||||
}
|
||||
} else {
|
||||
Toast.show(msg: '请输入密码');
|
||||
getKeyboardPwdRequest();
|
||||
}
|
||||
} else {
|
||||
getKeyboardPwdRequest();
|
||||
Toast.show(msg: '请给密码命名');
|
||||
}
|
||||
} else {
|
||||
Toast.show(msg: '请给密码命名');
|
||||
Toast.show(msg: '演示模式');
|
||||
}
|
||||
}),
|
||||
],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user