1,新增获取密码接口及逻辑处理
This commit is contained in:
parent
b80262cfcc
commit
43d79320a5
@ -373,14 +373,14 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = 7NLFRKNVY3;
|
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.starLock456;
|
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
@ -501,14 +501,14 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = 7NLFRKNVY3;
|
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.starLock456;
|
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
@ -522,14 +522,14 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = 7NLFRKNVY3;
|
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.starLock456;
|
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,13 +2,10 @@ 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/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
import '../../../../appRouters.dart';
|
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/submitBtn.dart';
|
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
|
||||||
|
|||||||
@ -33,12 +33,10 @@ class _ElectronicKeyPeriodValidityPageState
|
|||||||
];
|
];
|
||||||
List validityDataList = []; //自定义数据块
|
List validityDataList = []; //自定义数据块
|
||||||
List selectIndexList = []; //选中的有效期数组
|
List selectIndexList = []; //选中的有效期数组
|
||||||
String _effectiveTime = '';
|
String _selectEffectiveDate = ''; //生效时间
|
||||||
String _failureTime = '';
|
String _selectFailureDate = ''; //失效时间
|
||||||
|
late DateTime _effectiveDateTime;
|
||||||
String _effectiveDate = '';
|
late DateTime _failureDateTime;
|
||||||
String _failureDate = '';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
@ -149,58 +147,59 @@ class _ElectronicKeyPeriodValidityPageState
|
|||||||
Widget bottomWidget() {
|
Widget bottomWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
// CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
// leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||||
rightTitle: _effectiveTime,
|
// rightTitle: _effectiveTime,
|
||||||
isHaveDirection: true,
|
// isHaveDirection: true,
|
||||||
isHaveLine: true,
|
// isHaveLine: true,
|
||||||
action: () {
|
// action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.HM,
|
// Pickers.showDatePicker(context, mode: DateMode.HM,
|
||||||
onConfirm: (p) {
|
// onConfirm: (p) {
|
||||||
_effectiveTime = '${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
// _effectiveTime = '${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||||
|
|
||||||
setState(() {});
|
// setState(() {});
|
||||||
});
|
// });
|
||||||
}),
|
// }),
|
||||||
CommonItem(
|
// CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
// leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||||
rightTitle: _failureTime,
|
// rightTitle: _failureTime,
|
||||||
isHaveDirection: true,
|
// isHaveDirection: true,
|
||||||
action: () {
|
// action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.HM,
|
// Pickers.showDatePicker(context, mode: DateMode.HM,
|
||||||
onConfirm: (p) {
|
// onConfirm: (p) {
|
||||||
_failureTime = '${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
// _failureTime = '${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||||
|
|
||||||
setState(() {});
|
// setState(() {});
|
||||||
});
|
// });
|
||||||
}),
|
// }),
|
||||||
Container(height: 10.h),
|
// Container(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveDate!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveDate!.tr,
|
||||||
rightTitle: _effectiveDate,
|
rightTitle: _selectEffectiveDate,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () {
|
action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.YMD,
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
onConfirm: (p) {
|
onConfirm: (p) {
|
||||||
DateTime getPTime = DateTime.parse(
|
_effectiveDateTime = DateTime.parse(
|
||||||
'${intToStr(p.year!)}-${intToStr(p.month!)}-${intToStr(p.day!)}');
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}');
|
||||||
_effectiveDate = formatDate(getPTime, [yyyy, '-', mm, '-', dd]);
|
_selectEffectiveDate = formatDate(_effectiveDateTime,
|
||||||
|
[yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]);
|
||||||
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.failureDate!.tr,
|
leftTitel: TranslationLoader.lanKeys!.failureDate!.tr,
|
||||||
rightTitle: _failureDate,
|
rightTitle: _selectFailureDate,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.YMD,
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
onConfirm: (p) {
|
onConfirm: (p) {
|
||||||
DateTime getPTime = DateTime.parse(
|
_failureDateTime = DateTime.parse(
|
||||||
'${intToStr(p.year!)}-${intToStr(p.month!)}-${intToStr(p.day!)}');
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}');
|
||||||
_failureDate = formatDate(getPTime, [yyyy, '-', mm, '-', dd]);
|
_selectFailureDate = formatDate(_failureDateTime,
|
||||||
|
[yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@ -213,6 +212,8 @@ class _ElectronicKeyPeriodValidityPageState
|
|||||||
onClick: () {
|
onClick: () {
|
||||||
Map<String, dynamic> resultMap = {};
|
Map<String, dynamic> resultMap = {};
|
||||||
resultMap['validityValue'] = selectIndexList;
|
resultMap['validityValue'] = selectIndexList;
|
||||||
|
resultMap['starDate'] = _effectiveDateTime;
|
||||||
|
resultMap['endDate'] = _failureDateTime;
|
||||||
Navigator.pop(context, resultMap);
|
Navigator.pop(context, resultMap);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -35,15 +35,17 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
bool _isRemoteUnlock = false; //是否允许远程开锁
|
bool _isRemoteUnlock = false; //是否允许远程开锁
|
||||||
bool _isAuthentication = false; //是否可以实名认证
|
bool _isAuthentication = false; //是否可以实名认证
|
||||||
String _selectEffectiveDate = ''; //生效时间
|
String _selectEffectiveDate = ''; //生效时间
|
||||||
|
String _selectFailureDate = ''; //失效时间
|
||||||
late DateTime _effectiveDateTime;
|
late DateTime _effectiveDateTime;
|
||||||
late DateTime _failureDateTime;
|
late DateTime _failureDateTime;
|
||||||
String _selectFailureDate = ''; //失效时间
|
|
||||||
TextEditingController emailOrPhoneController =
|
TextEditingController emailOrPhoneController =
|
||||||
TextEditingController(); //邮箱/手机号输入框
|
TextEditingController(); //邮箱/手机号输入框
|
||||||
TextEditingController keyNameController = TextEditingController(); //钥匙名输入框
|
TextEditingController keyNameController = TextEditingController(); //钥匙名输入框
|
||||||
late bool _isSendSuccess;
|
late bool _isSendSuccess;
|
||||||
String countryName = '中国';
|
String countryName = '中国';
|
||||||
String countryCode = '86';
|
String countryCode = '86';
|
||||||
|
List weekdaysList = [];
|
||||||
|
bool _isCreateUser = false; //用户未注册时传1 已注册传0
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -239,9 +241,15 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () async {
|
||||||
Navigator.pushNamed(
|
var result = await Navigator.pushNamed(
|
||||||
context, Routers.electronicKeyPeriodValidityPage);
|
context, Routers.electronicKeyPeriodValidityPage);
|
||||||
|
result as Map<String, dynamic>;
|
||||||
|
weekdaysList = result['validityValue'];
|
||||||
|
_effectiveDateTime = result['starDate'];
|
||||||
|
_failureDateTime = result['endDate'];
|
||||||
|
print(
|
||||||
|
'得到的有效期数据:$weekdaysList $_effectiveDateTime $_failureDateTime');
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
@ -274,11 +282,15 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
//发送钥匙请求
|
//发送钥匙请求
|
||||||
if (emailOrPhoneController.text.isNotEmpty &&
|
if (emailOrPhoneController.text.isNotEmpty &&
|
||||||
keyNameController.text.isNotEmpty) {
|
keyNameController.text.isNotEmpty) {
|
||||||
//失效时间大于生效时间
|
if (int.parse(widget.type) == 0) {
|
||||||
if (_failureDateTime.compareTo(_effectiveDateTime) == 1) {
|
//失效时间大于生效时间
|
||||||
sendElectronicKeyRequest();
|
if (_failureDateTime.compareTo(_effectiveDateTime) == 1) {
|
||||||
|
sendElectronicKeyRequest();
|
||||||
|
} else {
|
||||||
|
Toast.show(msg: '失效时间需大于生效时间');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.show(msg: '失效时间需大于生效时间');
|
sendElectronicKeyRequest();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.show(msg: '请完善信息');
|
Toast.show(msg: '请完善信息');
|
||||||
@ -321,7 +333,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
var entity = await ApiRepository.to.sendElectronicKey(
|
var entity = await ApiRepository.to.sendElectronicKey(
|
||||||
'0',
|
_isCreateUser ? "1" : "0",
|
||||||
countryCode,
|
countryCode,
|
||||||
'1',
|
'1',
|
||||||
getFailureDateTime,
|
getFailureDateTime,
|
||||||
@ -335,13 +347,18 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
'小吴副号',
|
'小吴副号',
|
||||||
emailOrPhoneController.text,
|
emailOrPhoneController.text,
|
||||||
'0',
|
'0',
|
||||||
getEffectiveDateTime, []);
|
getEffectiveDateTime,
|
||||||
|
weekdaysList);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print('发送电子钥匙成功');
|
print('发送电子钥匙成功');
|
||||||
_isSendSuccess = true;
|
_isSendSuccess = true;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} else {
|
} else {
|
||||||
Toast.show(msg: '${entity.errorMsg}');
|
Toast.show(msg: '${entity.errorMsg}');
|
||||||
|
if (entity.errorCode == 425) {
|
||||||
|
//用户未注册
|
||||||
|
_isCreateUser = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -210,8 +210,15 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
|||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
||||||
} else if (indexEntity.keyboardPwdType == 4) {
|
} else if (indexEntity.keyboardPwdType == 4) {
|
||||||
|
//删除
|
||||||
|
DateTime dateStr =
|
||||||
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
|
||||||
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 清空码';
|
||||||
|
} else {
|
||||||
//循环
|
//循环
|
||||||
useDateStr = '循环';
|
DateTime dateStr =
|
||||||
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
|
||||||
|
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 循环';
|
||||||
}
|
}
|
||||||
|
|
||||||
return useDateStr;
|
return useDateStr;
|
||||||
|
|||||||
@ -0,0 +1,46 @@
|
|||||||
|
class PasswordKeyEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
PasswordKeyData? data;
|
||||||
|
|
||||||
|
PasswordKeyEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
PasswordKeyEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
data = json['data'] != null ? PasswordKeyData.fromJson(json['data']) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 PasswordKeyData {
|
||||||
|
String? keyboardPwd;
|
||||||
|
int? keyboardPwdId;
|
||||||
|
|
||||||
|
PasswordKeyData({this.keyboardPwd, this.keyboardPwdId});
|
||||||
|
|
||||||
|
PasswordKeyData.fromJson(Map<String, dynamic> json) {
|
||||||
|
keyboardPwd = json['keyboardPwd'];
|
||||||
|
keyboardPwdId = json['keyboardPwdId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['keyboardPwd'] = keyboardPwd;
|
||||||
|
data['keyboardPwdId'] = keyboardPwdId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,10 +1,15 @@
|
|||||||
|
import 'package:date_format/date_format.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_pickers/pickers.dart';
|
||||||
|
import 'package:flutter_pickers/time_picker/model/date_mode.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/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/toast.dart';
|
||||||
|
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
|
||||||
import '../../../../tools/commonItem.dart';
|
import '../../../../tools/commonItem.dart';
|
||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
@ -21,6 +26,12 @@ class PasswordKeyPerpetualPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
||||||
final TextEditingController _controller = TextEditingController();
|
final TextEditingController _controller = TextEditingController();
|
||||||
|
late bool _isSendSuccess;
|
||||||
|
late String _getPwdStr;
|
||||||
|
String _selectEffectiveDate = ''; //生效时间
|
||||||
|
String _selectFailureDate = ''; //失效时间
|
||||||
|
late DateTime _effectiveDateTime;
|
||||||
|
late DateTime _failureDateTime;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -29,98 +40,109 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
|
_isSendSuccess = false;
|
||||||
|
DateTime dateTime = DateTime.now();
|
||||||
|
_effectiveDateTime = dateTime;
|
||||||
|
_failureDateTime = dateTime;
|
||||||
|
_selectEffectiveDate = formatDate(
|
||||||
|
dateTime, [yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]); //默认为当前时间
|
||||||
|
_selectFailureDate = formatDate(
|
||||||
|
dateTime, [yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]); //默认为当前时间
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget indexChangeWidget() {
|
Widget indexChangeWidget() {
|
||||||
switch (int.parse(widget.type)) {
|
if (_isSendSuccess) {
|
||||||
case 0:
|
return sendElectronicKeySucceed();
|
||||||
{
|
} else {
|
||||||
// 永久
|
switch (int.parse(widget.type)) {
|
||||||
// return sendElectronicKeySucceed();
|
case 0:
|
||||||
return Column(
|
{
|
||||||
children: [
|
// 永久
|
||||||
perpetualKeyWidget(
|
return Column(
|
||||||
TranslationLoader.lanKeys!.name!.tr,
|
children: [
|
||||||
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
perpetualKeyWidget(
|
||||||
_controller),
|
TranslationLoader.lanKeys!.name!.tr,
|
||||||
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip1!.tr)
|
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
||||||
],
|
_controller),
|
||||||
);
|
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip1!.tr)
|
||||||
}
|
],
|
||||||
case 1:
|
);
|
||||||
{
|
}
|
||||||
// 限时
|
case 1:
|
||||||
return Column(
|
{
|
||||||
children: [
|
// 限时
|
||||||
keyTimeLimitWidget(),
|
return Column(
|
||||||
perpetualKeyWidget(
|
children: [
|
||||||
TranslationLoader.lanKeys!.name!.tr,
|
keyTimeLimitWidget(),
|
||||||
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
perpetualKeyWidget(
|
||||||
_controller),
|
TranslationLoader.lanKeys!.name!.tr,
|
||||||
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip2!.tr)
|
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
||||||
],
|
_controller),
|
||||||
);
|
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip2!.tr)
|
||||||
}
|
],
|
||||||
case 2:
|
);
|
||||||
{
|
}
|
||||||
// 单次
|
case 2:
|
||||||
return Column(
|
{
|
||||||
children: [
|
// 单次
|
||||||
perpetualKeyWidget(
|
return Column(
|
||||||
TranslationLoader.lanKeys!.name!.tr,
|
children: [
|
||||||
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
perpetualKeyWidget(
|
||||||
_controller),
|
TranslationLoader.lanKeys!.name!.tr,
|
||||||
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip3!.tr)
|
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
||||||
],
|
_controller),
|
||||||
);
|
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip3!.tr)
|
||||||
}
|
],
|
||||||
case 3:
|
);
|
||||||
{
|
}
|
||||||
// 自定义
|
case 3:
|
||||||
return Column(
|
{
|
||||||
children: [
|
// 自定义
|
||||||
keyIfPerpetualWidget(),
|
return Column(
|
||||||
perpetualKeyWidget(
|
children: [
|
||||||
TranslationLoader.lanKeys!.name!.tr,
|
keyIfPerpetualWidget(),
|
||||||
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
perpetualKeyWidget(
|
||||||
_controller),
|
TranslationLoader.lanKeys!.name!.tr,
|
||||||
perpetualKeyWidget(TranslationLoader.lanKeys!.password!.tr,
|
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
||||||
"请输入6-9位数字", _controller),
|
_controller),
|
||||||
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip4!.tr)
|
perpetualKeyWidget(TranslationLoader.lanKeys!.password!.tr,
|
||||||
],
|
"请输入6-9位数字", _controller),
|
||||||
);
|
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip4!.tr)
|
||||||
}
|
],
|
||||||
case 4:
|
);
|
||||||
{
|
}
|
||||||
// 循环
|
case 4:
|
||||||
return Column(
|
{
|
||||||
children: [
|
// 循环
|
||||||
keyCirculationWidget(),
|
return Column(
|
||||||
perpetualKeyWidget(
|
children: [
|
||||||
TranslationLoader.lanKeys!.name!.tr,
|
keyCirculationWidget(),
|
||||||
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
perpetualKeyWidget(
|
||||||
_controller),
|
TranslationLoader.lanKeys!.name!.tr,
|
||||||
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip5!.tr)
|
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
||||||
],
|
_controller),
|
||||||
);
|
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip5!.tr)
|
||||||
}
|
],
|
||||||
case 5:
|
);
|
||||||
{
|
}
|
||||||
// 清空
|
case 5:
|
||||||
return Column(
|
{
|
||||||
children: [
|
// 清空
|
||||||
perpetualKeyWidget(
|
return Column(
|
||||||
TranslationLoader.lanKeys!.name!.tr,
|
children: [
|
||||||
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
perpetualKeyWidget(
|
||||||
_controller),
|
TranslationLoader.lanKeys!.name!.tr,
|
||||||
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip6!.tr)
|
TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr,
|
||||||
],
|
_controller),
|
||||||
);
|
keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip6!.tr)
|
||||||
}
|
],
|
||||||
default:
|
);
|
||||||
return Container();
|
}
|
||||||
|
default:
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,18 +173,34 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||||
rightTitle: "2020.06.20 11:49",
|
rightTitle: _selectEffectiveDate,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
// _showDatePicker();
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
_effectiveDateTime = DateTime.parse(
|
||||||
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}');
|
||||||
|
_selectEffectiveDate = formatDate(_effectiveDateTime,
|
||||||
|
[yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]);
|
||||||
|
});
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||||
rightTitle: "2020.06.20 11:49",
|
rightTitle: _selectFailureDate,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
// _showDatePicker();
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
_failureDateTime = DateTime.parse(
|
||||||
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}');
|
||||||
|
_selectFailureDate = formatDate(_failureDateTime,
|
||||||
|
[yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]);
|
||||||
|
});
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
],
|
],
|
||||||
@ -239,17 +277,89 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
),
|
),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.getPassword!.tr,
|
btnName: TranslationLoader.lanKeys!.getPassword!.tr,
|
||||||
onClick: () {}),
|
onClick: () {
|
||||||
|
getKeyboardPwdRequest();
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
单次 1 只能在开始时间后6小时内使用一次
|
||||||
|
永久 2 从开始时间开始永久有效,必需在开始时间24小时内使用一次,否则将失效
|
||||||
|
限期 3 在开始和结束时间内有效,必需在开始时间24小时内使用一次,否则将失效
|
||||||
|
删除 4 在锁上使用后会删除之前在锁上使用过的密码
|
||||||
|
周未循环 5 在周未开始和结束时间指定时间段内有效
|
||||||
|
每日循环 6 每天开始和结束时间指定时间段内有效
|
||||||
|
工作日循环 7 工作日开始和结束时间指定的时间段内有效
|
||||||
|
周一循环 8 每周一开始和结束时间指定时间段内有效
|
||||||
|
周二循环 9 每周二开始和结束时间指定时间段内有效
|
||||||
|
周三循环 10 每周三开始和结束时间指定时间段内有效
|
||||||
|
周四循环 11 每周四开始和结束时间指定时间段内有效
|
||||||
|
周五循环 12 每周五开始和结束时间指定时间段内有效
|
||||||
|
周六循环 13 每周六开始和结束时间指定时间段内有效
|
||||||
|
周天循环 14 每周日开始和结束时间指定时间段内有效
|
||||||
|
*/
|
||||||
|
//获取密码请求
|
||||||
|
Future<void> getKeyboardPwdRequest() async {
|
||||||
|
String getFailureDateTime = '0';
|
||||||
|
String getEffectiveDateTime = '0';
|
||||||
|
String lockId = '28';
|
||||||
|
int passwordType = int.parse(widget.type);
|
||||||
|
String getKeyType = passwordType.toString();
|
||||||
|
if (passwordType == 0) {
|
||||||
|
//永久
|
||||||
|
getKeyType = '2';
|
||||||
|
} else if (passwordType == 1) {
|
||||||
|
//限时
|
||||||
|
getKeyType = '3';
|
||||||
|
} else if (passwordType == 2) {
|
||||||
|
//单次
|
||||||
|
getKeyType = '1';
|
||||||
|
} else if (passwordType == 3) {
|
||||||
|
//自定义
|
||||||
|
} else if (passwordType == 4) {
|
||||||
|
//循环
|
||||||
|
getKeyType = '6';
|
||||||
|
} else if (passwordType == 5) {
|
||||||
|
//清空码
|
||||||
|
getKeyType = '4';
|
||||||
|
}
|
||||||
|
if (widget.type == '0') {
|
||||||
|
getFailureDateTime =
|
||||||
|
DateTime.parse(_selectFailureDate).millisecondsSinceEpoch.toString();
|
||||||
|
getEffectiveDateTime = DateTime.parse(_selectEffectiveDate)
|
||||||
|
.millisecondsSinceEpoch
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
var entity = await ApiRepository.to.getPasswordKey(
|
||||||
|
getFailureDateTime,
|
||||||
|
'0',
|
||||||
|
_controller.text,
|
||||||
|
getKeyType,
|
||||||
|
'0',
|
||||||
|
lockId,
|
||||||
|
'0',
|
||||||
|
getEffectiveDateTime,
|
||||||
|
'0');
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
print('获取密码成功');
|
||||||
|
_isSendSuccess = true;
|
||||||
|
if (entity.data != null) {
|
||||||
|
_getPwdStr = entity.data!.keyboardPwd!;
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.show(msg: '${entity.errorMsg}');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 发送电子钥匙成功
|
// 发送电子钥匙成功
|
||||||
Widget sendElectronicKeySucceed() {
|
Widget sendElectronicKeySucceed() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
height: 300.h,
|
height: 270.h,
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -258,30 +368,26 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
height: 30.h,
|
height: 30.h,
|
||||||
),
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/main/icon_main_addLock.png',
|
'images/icon_send_success.png',
|
||||||
width: 150.w,
|
width: 100.w,
|
||||||
height: 150.w,
|
height: 100.w,
|
||||||
color: AppColors.mainColor,
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"操作成功,密码为",
|
"操作成功,密码为",
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 22.sp, color: Colors.black),
|
||||||
fontSize: 32.sp,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w500),
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"62689876",
|
_getPwdStr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 60.sp,
|
fontSize: 40.sp,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontWeight: FontWeight.w500),
|
fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -291,34 +397,32 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
),
|
),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: '完成',
|
btnName: '完成',
|
||||||
fontSize: 28.sp,
|
|
||||||
borderRadius: 20.w,
|
|
||||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
|
||||||
onClick: () {}),
|
|
||||||
SubmitBtn(
|
|
||||||
btnName: '分享',
|
|
||||||
fontSize: 28.sp,
|
|
||||||
borderRadius: 20.w,
|
|
||||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
|
||||||
onClick: () {
|
onClick: () {
|
||||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
Navigator.pop(context);
|
||||||
}),
|
}),
|
||||||
SubmitBtn(
|
SizedBox(
|
||||||
btnName: '标记为:已入住',
|
height: 10.h,
|
||||||
fontSize: 28.sp,
|
),
|
||||||
borderRadius: 20.w,
|
OutLineBtn(
|
||||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
btnName: '分享',
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
onClick: () {
|
||||||
onClick: () {}),
|
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
OutLineBtn(
|
||||||
|
btnName: '标记为:已入住',
|
||||||
|
onClick: () {},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 接受者信息输入框
|
// 接受者信息输入框
|
||||||
Widget getTFWidget(String tfStr) {
|
Widget getTFWidget(String tfStr) {
|
||||||
return Container(
|
return SizedBox(
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
width: 300.w,
|
width: 300.w,
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -327,7 +431,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
child: TextField(
|
child: TextField(
|
||||||
//输入框一行
|
//输入框一行
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
// controller: _controller,
|
controller: _controller,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@ -362,4 +466,8 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String intToStr(int v) {
|
||||||
|
return (v < 10) ? "0$v" : "$v";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,4 +25,5 @@ abstract class Api {
|
|||||||
'/key/modifyKeyNameForAdmin'; //编辑电子钥匙名字
|
'/key/modifyKeyNameForAdmin'; //编辑电子钥匙名字
|
||||||
final String passwordKeyListURL = '/keyboardPwd/listSendRecords'; //密码钥匙列表
|
final String passwordKeyListURL = '/keyboardPwd/listSendRecords'; //密码钥匙列表
|
||||||
final String passwordKeyResetURL = '/keyboardPwd/reset'; //密码钥匙重置
|
final String passwordKeyResetURL = '/keyboardPwd/reset'; //密码钥匙重置
|
||||||
|
final String passwordKeyGetURL = '/keyboardPwd/get'; //获取密码
|
||||||
}
|
}
|
||||||
|
|||||||
@ -264,8 +264,33 @@ class ApiProvider extends BaseProvider {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
Future<Response> resetPasswordKey(String lockId, String operatorUid) => post(
|
Future<Response> resetPasswordKey(String lockId, String operatorUid) => post(
|
||||||
resetElectronicKeyURL.toUrl,
|
resetPasswordURL.toUrl,
|
||||||
jsonEncode({'lockId': lockId, 'operatorUid': operatorUid}));
|
jsonEncode({'lockId': lockId, 'operatorUid': operatorUid}));
|
||||||
|
|
||||||
|
Future<Response> getKeyboardPwd(
|
||||||
|
String endDate,
|
||||||
|
String isExclusive,
|
||||||
|
String keyboardPwdName,
|
||||||
|
String keyboardPwdType,
|
||||||
|
String keyboardPwdVersion,
|
||||||
|
String lockId,
|
||||||
|
String operatorUid,
|
||||||
|
String startDate,
|
||||||
|
String timezoneRawOffSet,
|
||||||
|
) =>
|
||||||
|
post(
|
||||||
|
passwordKeyGetURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'endDate': endDate,
|
||||||
|
'isExclusive': isExclusive,
|
||||||
|
'keyboardPwdName': keyboardPwdName,
|
||||||
|
'keyboardPwdType': keyboardPwdType,
|
||||||
|
'keyboardPwdVersion': keyboardPwdVersion,
|
||||||
|
'lockId': lockId,
|
||||||
|
'operatorUid': operatorUid,
|
||||||
|
'startDate': startDate,
|
||||||
|
'timezoneRawOffSet': timezoneRawOffSet
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:star_lock/login/seletCountryRegion/common/countryRegionEntity.da
|
|||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||||
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
||||||
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
||||||
import '../login/login/entity/LoginEntity.dart';
|
import '../login/login/entity/LoginEntity.dart';
|
||||||
@ -174,22 +175,16 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 绑定蓝牙管理员
|
// 绑定蓝牙管理员
|
||||||
Future<SaveLockEntity> bindingBlueAdmin({
|
Future<SaveLockEntity> bindingBlueAdmin(
|
||||||
required String bindingDate,
|
{required String bindingDate,
|
||||||
required String hotelMode,
|
required String hotelMode,
|
||||||
required String lockAlias,
|
required String lockAlias,
|
||||||
required String lockData,
|
required String lockData,
|
||||||
required String nbInitSuccess,
|
required String nbInitSuccess,
|
||||||
required String position,
|
required String position,
|
||||||
required String deviceNo}) async {
|
required String deviceNo}) async {
|
||||||
final res = await apiProvider.bindingBlueAdmin(
|
final res = await apiProvider.bindingBlueAdmin(bindingDate, hotelMode,
|
||||||
bindingDate,
|
lockAlias, lockData, nbInitSuccess, position, deviceNo);
|
||||||
hotelMode,
|
|
||||||
lockAlias,
|
|
||||||
lockData,
|
|
||||||
nbInitSuccess,
|
|
||||||
position,
|
|
||||||
deviceNo);
|
|
||||||
return SaveLockEntity.fromJson(res.body);
|
return SaveLockEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,4 +238,29 @@ class ApiRepository {
|
|||||||
final res = await apiProvider.resetPasswordKey(lockId, operatorUid);
|
final res = await apiProvider.resetPasswordKey(lockId, operatorUid);
|
||||||
return PasswordKeyListEntity.fromJson(res.body);
|
return PasswordKeyListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取密码
|
||||||
|
Future<PasswordKeyEntity> getPasswordKey(
|
||||||
|
String endDate,
|
||||||
|
String isExclusive,
|
||||||
|
String keyboardPwdName,
|
||||||
|
String keyboardPwdType,
|
||||||
|
String keyboardPwdVersion,
|
||||||
|
String lockId,
|
||||||
|
String operatorUid,
|
||||||
|
String startDate,
|
||||||
|
String timezoneRawOffSet,
|
||||||
|
) async {
|
||||||
|
final res = await apiProvider.getKeyboardPwd(
|
||||||
|
endDate,
|
||||||
|
isExclusive,
|
||||||
|
keyboardPwdName,
|
||||||
|
keyboardPwdType,
|
||||||
|
keyboardPwdVersion,
|
||||||
|
lockId,
|
||||||
|
operatorUid,
|
||||||
|
startDate,
|
||||||
|
timezoneRawOffSet);
|
||||||
|
return PasswordKeyEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user