部分细节修改
This commit is contained in:
parent
5b8524bfaa
commit
6d73934327
@ -13,22 +13,20 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//发送钥匙请求
|
//发送钥匙请求
|
||||||
Future<void> sendElectronicKeyRequest(BuildContext widgetContext) async {
|
Future<void> sendElectronicKeyRequest(BuildContext widgetContext) async {
|
||||||
String getFailureDateTime = '0';
|
|
||||||
String getEffectiveDateTime = '0';
|
|
||||||
String lockID = state.keyInfo.value.lockId.toString();
|
String lockID = state.keyInfo.value.lockId.toString();
|
||||||
String getKeyType = (int.parse(state.type.value) + 1).toString();
|
String getKeyType = (int.parse(state.type.value) + 1).toString();
|
||||||
if (state.type.value == '0') {
|
if (state.type.value == '0') {
|
||||||
getFailureDateTime =
|
state.failureTimestamp.value =
|
||||||
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
state.failureDateTime.value.millisecondsSinceEpoch;
|
||||||
getEffectiveDateTime =
|
state.effectiveTimestamp.value =
|
||||||
state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
state.effectiveDateTime.value.millisecondsSinceEpoch;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entity = await ApiRepository.to.sendElectronicKey(
|
var entity = await ApiRepository.to.sendElectronicKey(
|
||||||
createUser: state.isCreateUser.value ? "1" : "0",
|
createUser: state.isCreateUser.value ? "1" : "0",
|
||||||
countryCode: state.countryCode.value,
|
countryCode: state.countryCode.value,
|
||||||
usernameType: '1',
|
usernameType: '1',
|
||||||
endDate: getFailureDateTime,
|
endDate: state.failureTimestamp.value.toString(),
|
||||||
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
||||||
isCameraEnable: '2',
|
isCameraEnable: '2',
|
||||||
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
||||||
@ -39,7 +37,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
|||||||
operatorUid: '',
|
operatorUid: '',
|
||||||
receiverUsername: state.emailOrPhoneController.text,
|
receiverUsername: state.emailOrPhoneController.text,
|
||||||
remarks: '',
|
remarks: '',
|
||||||
startDate: getEffectiveDateTime,
|
startDate: state.effectiveTimestamp.value.toString(),
|
||||||
weekDays: state.weekdaysList);
|
weekDays: state.weekdaysList);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print('发送电子钥匙成功');
|
print('发送电子钥匙成功');
|
||||||
|
|||||||
@ -214,9 +214,13 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
Widget keyPeriodValidityWidget() {
|
Widget keyPeriodValidityWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle: "",
|
rightTitle: state.weekdaysList.isEmpty
|
||||||
|
? ''
|
||||||
|
: state.weekdaysList
|
||||||
|
.reduce((value, element) => value + ',' + element)
|
||||||
|
.toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var result = await Navigator.pushNamed(
|
var result = await Navigator.pushNamed(
|
||||||
@ -224,10 +228,12 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
if (result != null) {
|
if (result != null) {
|
||||||
result as Map<String, dynamic>;
|
result as Map<String, dynamic>;
|
||||||
state.weekdaysList.value = result['validityValue'];
|
state.weekdaysList.value = result['validityValue'];
|
||||||
state.effectiveDateTime.value = result['starDate'];
|
state.effectiveTimestamp.value =
|
||||||
state.failureDateTime.value = result['endDate'];
|
result['starDate'].millisecondsSinceEpoch;
|
||||||
|
state.failureTimestamp.value =
|
||||||
|
result['endDate'].millisecondsSinceEpoch;
|
||||||
}
|
}
|
||||||
}),
|
})),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -18,6 +18,8 @@ class SendElectronicKeyState {
|
|||||||
DateTime dateTime = DateTime.now();
|
DateTime dateTime = DateTime.now();
|
||||||
final effectiveDateTime = DateTime.now().obs;
|
final effectiveDateTime = DateTime.now().obs;
|
||||||
final failureDateTime = DateTime.now().obs;
|
final failureDateTime = DateTime.now().obs;
|
||||||
|
final effectiveTimestamp = 0.obs;
|
||||||
|
final failureTimestamp = 0.obs;
|
||||||
|
|
||||||
var selectEffectiveDate =
|
var selectEffectiveDate =
|
||||||
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}'
|
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}'
|
||||||
|
|||||||
@ -70,7 +70,7 @@ class _AuthorizedAdministratorListPageState
|
|||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
_searchWidget(),
|
// _searchWidget(),
|
||||||
Expanded(child: _buildMainUI(itemList)),
|
Expanded(child: _buildMainUI(itemList)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@ -20,6 +20,7 @@ class LockUserManageListPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
||||||
List<LockUserData> dataList = [];
|
List<LockUserData> dataList = [];
|
||||||
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -94,8 +95,11 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
|||||||
child: TextField(
|
child: TextField(
|
||||||
//输入框一行
|
//输入框一行
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
// controller: _controller,
|
controller: searchController,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
onSubmitted: (value) {
|
||||||
|
lockUserListRequest();
|
||||||
|
},
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
//输入里面输入文字内边距设置
|
||||||
contentPadding: const EdgeInsets.only(
|
contentPadding: const EdgeInsets.only(
|
||||||
@ -140,7 +144,7 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
|||||||
//请求锁用户列表
|
//请求锁用户列表
|
||||||
Future<List<LockUserData>> lockUserListRequest() async {
|
Future<List<LockUserData>> lockUserListRequest() async {
|
||||||
LockUserListEntity entity =
|
LockUserListEntity entity =
|
||||||
await ApiRepository.to.lockUserList('1', '20', '');
|
await ApiRepository.to.lockUserList('1', '20', searchController.text);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
setState(() {
|
setState(() {
|
||||||
dataList = entity.data!;
|
dataList = entity.data!;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user