1、修改获取私钥上传时间为UTC时间。2、修复群发钥匙问题。3、考勤员工问题
This commit is contained in:
parent
2610e4fea0
commit
c69295d432
@ -248,7 +248,7 @@ class _VolumeAuthorizationLockPageState
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
inputFormatters: <TextInputFormatter>[
|
inputFormatters: <TextInputFormatter>[
|
||||||
FilteringTextInputFormatter.deny('\n'),
|
FilteringTextInputFormatter.deny('\n'),
|
||||||
LengthLimitingTextInputFormatter(30),
|
LengthLimitingTextInputFormatter(50),
|
||||||
],
|
],
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
|
|||||||
@ -113,7 +113,7 @@ class CheckingInAddStaffLogic extends BaseGetXController {
|
|||||||
endDate: '0',
|
endDate: '0',
|
||||||
keyboardPwdName: state.staffNameController.text,
|
keyboardPwdName: state.staffNameController.text,
|
||||||
keyboardPwdType: 2.toString(),
|
keyboardPwdType: 2.toString(),
|
||||||
lockId: state.getKeyInfosData.value.lockId.toString(),
|
lockId: state.getKeyInfosData.value.lockId!,
|
||||||
startDate: '0',
|
startDate: '0',
|
||||||
startHours: 0,
|
startHours: 0,
|
||||||
endHours: 0,
|
endHours: 0,
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.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/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSelectKey_entity.dart';
|
import 'package:star_lock/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSelectKey_entity.dart';
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
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/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_state.dart';
|
||||||
|
|
||||||
import '../../../../../appRouters.dart';
|
import '../../../../../appRouters.dart';
|
||||||
import '../../../../../app_settings/app_colors.dart';
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
@ -18,35 +19,35 @@ class CheckingInStaffDetailPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _CheckingInStaffDetailPageState extends State<CheckingInStaffDetailPage> {
|
class _CheckingInStaffDetailPageState extends State<CheckingInStaffDetailPage> {
|
||||||
final logic = Get.put(CheckingInStaffDetailLogic());
|
final CheckingInStaffDetailLogic logic = Get.put(CheckingInStaffDetailLogic());
|
||||||
final state = Get.find<CheckingInStaffDetailLogic>().state;
|
final CheckingInStaffDetailState state = Get.find<CheckingInStaffDetailLogic>().state;
|
||||||
|
|
||||||
@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: "员工信息".tr,
|
barTitle: '员工信息'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: [
|
actionsList: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.edit!.tr,
|
TranslationLoader.lanKeys!.edit!.tr,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.toNamed(Routers.checkingInAddStaffPage, arguments: {
|
Get.toNamed(Routers.checkingInAddStaffPage, arguments: <String, Object>{
|
||||||
"getKeyInfosData": state.getKeyInfosData.value,
|
'getKeyInfosData': state.getKeyInfosData.value,
|
||||||
"companyId": state.companyId.value,
|
'companyId': state.companyId.value,
|
||||||
"staffListItem": state.staffListItemData.value,
|
'staffListItem': state.staffListItemData.value,
|
||||||
"isAdd": "2",
|
'isAdd': '2',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],),
|
],),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
||||||
rightTitle: state.staffListItemData.value.staffName,
|
rightTitle: state.staffListItemData.value.staffName,
|
||||||
@ -60,9 +61,9 @@ class _CheckingInStaffDetailPageState extends State<CheckingInStaffDetailPage> {
|
|||||||
// rightTitle: state.staffListItemData.value.attendanceWay,
|
// rightTitle: state.staffListItemData.value.attendanceWay,
|
||||||
// isHaveLine: true)),
|
// isHaveLine: true)),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.staffListItemData.value.cardStatus == 1 ? true : false,
|
visible: state.staffListItemData.value.cardStatus == 1,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
// height: 50.h,
|
// height: 50.h,
|
||||||
@ -73,14 +74,14 @@ class _CheckingInStaffDetailPageState extends State<CheckingInStaffDetailPage> {
|
|||||||
)),
|
)),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.attendanceRecord!.tr,
|
leftTitel: TranslationLoader.lanKeys!.attendanceRecord!.tr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: (){
|
action: (){
|
||||||
Get.toNamed(Routers.checkingInDetailPage, arguments: {
|
Get.toNamed(Routers.checkingInDetailPage, arguments: <String, Object?>{
|
||||||
// "getKeyInfosData": state.getKeyInfosData.value,
|
// "getKeyInfosData": state.getKeyInfosData.value,
|
||||||
"companyId": state.companyId.value,
|
'companyId': state.companyId.value,
|
||||||
"staffId": state.staffListItemData.value.staffId,
|
'staffId': state.staffListItemData.value.staffId,
|
||||||
"staffName": state.staffListItemData.value.staffName,
|
'staffName': state.staffListItemData.value.staffName,
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lockSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
import '../../../../../common/XSConstantMacro/XSConstantMacro.dart';
|
import '../../../../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
@ -22,19 +23,18 @@ class MassSendElectronicKeyLogic extends BaseGetXController {
|
|||||||
DateTool().dateToTimestamp(state.endTime.value, 1).toString();
|
DateTool().dateToTimestamp(state.endTime.value, 1).toString();
|
||||||
}
|
}
|
||||||
if (state.lockIdList.isEmpty) {
|
if (state.lockIdList.isEmpty) {
|
||||||
showToast("请选择锁".tr);
|
showToast('请选择锁'.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.receiverList.isEmpty) {
|
if (state.receiverList.isEmpty) {
|
||||||
showToast("请选择接收者".tr);
|
showToast('请选择接收者'.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var entity =
|
final KeyDetailEntity entity = await ApiRepository.to.canSendKey(getFailureDateTime, state.lockIdList);
|
||||||
await ApiRepository.to.canSendKey(getFailureDateTime, state.lockIdList);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
for (int i = 0; i < state.receiverList.length; i++) {
|
for (int i = 0; i < state.receiverList.length; i++) {
|
||||||
LockUserItemData data = state.receiverList[i];
|
final LockUserItemData data = state.receiverList[i];
|
||||||
batchSendElectronicKeyRequest(data.userid ?? '', data.nickname ?? '');
|
batchSendElectronicKeyRequest(data.userid ?? '', data.nickname ?? '');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -46,10 +46,10 @@ class MassSendElectronicKeyLogic extends BaseGetXController {
|
|||||||
Future<void> batchSendElectronicKeyRequest(
|
Future<void> batchSendElectronicKeyRequest(
|
||||||
String receiverUserID, String receiverUserName) async {
|
String receiverUserID, String receiverUserName) async {
|
||||||
//发送钥匙请求
|
//发送钥匙请求
|
||||||
var startDate = "0";
|
String startDate = '0';
|
||||||
var endDate = "0";
|
String endDate = '0';
|
||||||
var startTime = "0";
|
String startTime = '0';
|
||||||
var endTime = "0";
|
String endTime = '0';
|
||||||
int typeValue = int.parse(state.type.value);
|
int typeValue = int.parse(state.type.value);
|
||||||
switch (typeValue) {
|
switch (typeValue) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -59,15 +59,15 @@ class MassSendElectronicKeyLogic extends BaseGetXController {
|
|||||||
DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
|
DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
|
||||||
endDate =
|
endDate =
|
||||||
DateTool().dateToTimestamp(state.endTime.value, 1).toString();
|
DateTool().dateToTimestamp(state.endTime.value, 1).toString();
|
||||||
startTime = "0";
|
startTime = '0';
|
||||||
endTime = "0";
|
endTime = '0';
|
||||||
|
|
||||||
if (startDate.isEmpty) {
|
if (startDate.isEmpty) {
|
||||||
showToast("请选择开始时间".tr);
|
showToast('请选择开始时间'.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (endDate.isEmpty) {
|
if (endDate.isEmpty) {
|
||||||
showToast("请选择结束时间".tr);
|
showToast('请选择结束时间'.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
if (int.parse(startDate) >= int.parse(endDate)) {
|
if (int.parse(startDate) >= int.parse(endDate)) {
|
||||||
showToast("失效时间要大于生效时间".tr);
|
showToast('失效时间要大于生效时间'.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -88,10 +88,10 @@ class MassSendElectronicKeyLogic extends BaseGetXController {
|
|||||||
// case 2:
|
// case 2:
|
||||||
// typeValue = XSConstantMacro.keyTypeOnce;
|
// typeValue = XSConstantMacro.keyTypeOnce;
|
||||||
// break;
|
// break;
|
||||||
case 3:
|
case 2:
|
||||||
typeValue = XSConstantMacro.keyTypeLoop;
|
typeValue = XSConstantMacro.keyTypeLoop;
|
||||||
if (state.beginTime.value.isEmpty) {
|
if (state.beginTime.value.isEmpty) {
|
||||||
showToast("请选择有效期".tr);
|
showToast('请选择有效期'.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
startDate =
|
startDate =
|
||||||
@ -105,12 +105,12 @@ class MassSendElectronicKeyLogic extends BaseGetXController {
|
|||||||
.toString();
|
.toString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
typeValue = XSConstantMacro.keyTypeTime;
|
typeValue = XSConstantMacro.keyTypeLong;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// String getKeyType = typeValue.toString();
|
// String getKeyType = typeValue.toString();
|
||||||
|
|
||||||
var entity = await ApiRepository.to.batchSendKey(
|
final KeyDetailEntity entity = await ApiRepository.to.batchSendKey(
|
||||||
lockIds: state.lockIdList,
|
lockIds: state.lockIdList,
|
||||||
createUser: state.isCreateUser.value == true ? 1 : 0,
|
createUser: state.isCreateUser.value == true ? 1 : 0,
|
||||||
countryCode: state.countryCode.value,
|
countryCode: state.countryCode.value,
|
||||||
@ -138,14 +138,14 @@ class MassSendElectronicKeyLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void resetData() {
|
void resetData() {
|
||||||
if (state.type.value == "0") {
|
if (state.type.value == '0') {
|
||||||
state.beginTime.value = DateTool().dateToYMDHNString(
|
state.beginTime.value = DateTool().dateToYMDHNString(
|
||||||
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
||||||
state.endTime.value = DateTool().dateToYMDHNString(
|
state.endTime.value = DateTool().dateToYMDHNString(
|
||||||
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
||||||
} else {
|
} else {
|
||||||
state.beginTime.value = ""; //默认为当前时间
|
state.beginTime.value = ''; //默认为当前时间
|
||||||
state.endTime.value = ""; //默认为当前时间
|
state.endTime.value = ''; //默认为当前时间
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,8 @@ 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/app_settings/app_colors.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey/massSendElectronicKey_state.dart';
|
||||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
||||||
@ -16,10 +18,10 @@ import '../../../../../translations/trans_lib.dart';
|
|||||||
import 'massSendElectronicKey_logic.dart';
|
import 'massSendElectronicKey_logic.dart';
|
||||||
|
|
||||||
class MassSendElectronicKeyPage extends StatefulWidget {
|
class MassSendElectronicKeyPage extends StatefulWidget {
|
||||||
final String type;
|
|
||||||
|
|
||||||
const MassSendElectronicKeyPage({Key? key, required this.type})
|
const MassSendElectronicKeyPage({Key? key, required this.type})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
final String type;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MassSendElectronicKeyPage> createState() =>
|
State<MassSendElectronicKeyPage> createState() =>
|
||||||
@ -27,8 +29,8 @@ class MassSendElectronicKeyPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||||
final logic = Get.put(MassSendElectronicKeyLogic());
|
final MassSendElectronicKeyLogic logic = Get.put(MassSendElectronicKeyLogic());
|
||||||
final state = Get.find<MassSendElectronicKeyLogic>().state;
|
final MassSendElectronicKeyState state = Get.find<MassSendElectronicKeyLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
initState() {
|
initState() {
|
||||||
@ -50,7 +52,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: state.isDemoMode
|
child: state.isDemoMode
|
||||||
? indexChangeWidget()
|
? indexChangeWidget()
|
||||||
: Obx(() => indexChangeWidget()),
|
: Obx(indexChangeWidget),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +65,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
{
|
{
|
||||||
// 限时
|
// 限时
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
keyInfoWidget(),
|
keyInfoWidget(),
|
||||||
keyTimeWidget(),
|
keyTimeWidget(),
|
||||||
remoteUnlockingWidget(),
|
remoteUnlockingWidget(),
|
||||||
@ -75,7 +77,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
{
|
{
|
||||||
// 永久
|
// 永久
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
keyInfoWidget(),
|
keyInfoWidget(),
|
||||||
remoteUnlockingWidget(),
|
remoteUnlockingWidget(),
|
||||||
keyBottomWidget()
|
keyBottomWidget()
|
||||||
@ -86,7 +88,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
{
|
{
|
||||||
// 循环
|
// 循环
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
keyInfoWidget(),
|
keyInfoWidget(),
|
||||||
keyPeriodValidityWidget(),
|
keyPeriodValidityWidget(),
|
||||||
remoteUnlockingWidget(),
|
remoteUnlockingWidget(),
|
||||||
@ -103,13 +105,13 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
// 发送电子钥匙成功
|
// 发送电子钥匙成功
|
||||||
Widget sendElectronicKeySucceed() {
|
Widget sendElectronicKeySucceed() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
height: 250.h,
|
height: 250.h,
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30.h,
|
height: 30.h,
|
||||||
),
|
),
|
||||||
@ -123,7 +125,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
'发送成功'.tr,
|
'发送成功'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@ -152,7 +154,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
// 顶部钥匙信息widget
|
// 顶部钥匙信息widget
|
||||||
Widget keyInfoWidget() {
|
Widget keyInfoWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
||||||
rightTitle: state.receiverList.isEmpty
|
rightTitle: state.receiverList.isEmpty
|
||||||
@ -162,9 +164,9 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.massSendReceiverPage,
|
Navigator.pushNamed(context, Routers.massSendReceiverPage,
|
||||||
arguments: {
|
arguments: <String, List>{
|
||||||
'lockUserList': state.receiverList,
|
'lockUserList': state.receiverList,
|
||||||
}).then((value) {
|
}).then((Object? value) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
value as Map<String, dynamic>;
|
value as Map<String, dynamic>;
|
||||||
state.receiverList = value['lockUserList'];
|
state.receiverList = value['lockUserList'];
|
||||||
@ -187,7 +189,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||||
),
|
),
|
||||||
action: () async {
|
action: () async {
|
||||||
var result = await Navigator.pushNamed(
|
Object? result = await Navigator.pushNamed(
|
||||||
context, Routers.selectCountryRegionPage);
|
context, Routers.selectCountryRegionPage);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
result as Map<String, dynamic>;
|
result as Map<String, dynamic>;
|
||||||
@ -205,7 +207,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.massSendLockGroupListPage,
|
Navigator.pushNamed(context, Routers.massSendLockGroupListPage,
|
||||||
arguments: {
|
arguments: <String, String>{
|
||||||
'keyLimits': '2',
|
'keyLimits': '2',
|
||||||
}).then((Object? value) {
|
}).then((Object? value) {
|
||||||
//得到选中的锁ID列表
|
//得到选中的锁ID列表
|
||||||
@ -224,7 +226,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
// 生效失效时间
|
// 生效失效时间
|
||||||
Widget keyTimeWidget() {
|
Widget keyTimeWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||||
rightTitle: state.beginTime.value,
|
rightTitle: state.beginTime.value,
|
||||||
@ -234,7 +236,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
PDuration selectDate =
|
PDuration selectDate =
|
||||||
PDuration.parse(DateTime.tryParse(state.beginTime.value));
|
PDuration.parse(DateTime.tryParse(state.beginTime.value));
|
||||||
Pickers.showDatePicker(context,
|
Pickers.showDatePicker(context,
|
||||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (PDuration p) {
|
||||||
state.beginTime.value = DateTool().getYMDHNDateString(p, 1);
|
state.beginTime.value = DateTool().getYMDHNDateString(p, 1);
|
||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
@ -246,7 +248,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
PDuration selectDate =
|
PDuration selectDate =
|
||||||
PDuration.parse(DateTime.tryParse(state.endTime.value));
|
PDuration.parse(DateTime.tryParse(state.endTime.value));
|
||||||
Pickers.showDatePicker(context,
|
Pickers.showDatePicker(context,
|
||||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (PDuration p) {
|
||||||
state.endTime.value = DateTool().getYMDHNDateString(p, 1);
|
state.endTime.value = DateTool().getYMDHNDateString(p, 1);
|
||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
@ -258,7 +260,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
// 远程开锁
|
// 远程开锁
|
||||||
Widget remoteUnlockingWidget() {
|
Widget remoteUnlockingWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
@ -273,7 +275,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
// 有效期
|
// 有效期
|
||||||
Widget keyPeriodValidityWidget() {
|
Widget keyPeriodValidityWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle: '${state.beginTime.value}\n${state.endTime.value}',
|
rightTitle: '${state.beginTime.value}\n${state.endTime.value}',
|
||||||
@ -281,7 +283,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var result =
|
var result =
|
||||||
await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: {
|
await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||||
'validityValue': state.weekdaysList.value,
|
'validityValue': state.weekdaysList.value,
|
||||||
'starDate': state.beginTime.value,
|
'starDate': state.beginTime.value,
|
||||||
'endDate': state.endTime.value,
|
'endDate': state.endTime.value,
|
||||||
@ -294,6 +296,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
state.endTime.value = result['endDate'];
|
state.endTime.value = result['endDate'];
|
||||||
state.effectiveDateTime.value = result['starTime'];
|
state.effectiveDateTime.value = result['starTime'];
|
||||||
state.failureDateTime.value = result['endTime'];
|
state.failureDateTime.value = result['endTime'];
|
||||||
|
AppLog.log('111weekdaysList:${state.weekdaysList} beginTime:${state.beginTime} endTime:${state.endTime} effectiveDateTime:${state.effectiveDateTime} failureDateTime:${state.failureDateTime}');
|
||||||
}
|
}
|
||||||
})),
|
})),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
@ -305,7 +308,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||||
arguments: {
|
arguments: <String, Object>{
|
||||||
'validityValue': state.weekdaysList.value,
|
'validityValue': state.weekdaysList.value,
|
||||||
'starDate': state.beginTime.value,
|
'starDate': state.beginTime.value,
|
||||||
'endDate': state.endTime.value,
|
'endDate': state.endTime.value,
|
||||||
@ -330,7 +333,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
action: () async {
|
action: () async {
|
||||||
var result = await Get.toNamed(
|
var result = await Get.toNamed(
|
||||||
Routers.seletKeyCyclicDatePage,
|
Routers.seletKeyCyclicDatePage,
|
||||||
arguments: {
|
arguments: <String, Object>{
|
||||||
'validityValue': state.weekdaysList.value,
|
'validityValue': state.weekdaysList.value,
|
||||||
'starDate': state.beginTime.value,
|
'starDate': state.beginTime.value,
|
||||||
'endDate': state.endTime.value,
|
'endDate': state.endTime.value,
|
||||||
@ -354,7 +357,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
|
|
||||||
Widget keyBottomWidget() {
|
Widget keyBottomWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.send!.tr,
|
btnName: TranslationLoader.lanKeys!.send!.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
@ -370,7 +373,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: state.isRemoteUnlock.value,
|
value: state.isRemoteUnlock.value,
|
||||||
onChanged: (value) {
|
onChanged: (bool value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.isRemoteUnlock.value = !state.isRemoteUnlock.value;
|
state.isRemoteUnlock.value = !state.isRemoteUnlock.value;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -6,22 +6,22 @@ class MassSendElectronicKeyState{
|
|||||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||||
late Contact contact;
|
late Contact contact;
|
||||||
|
|
||||||
final isRemoteUnlock = false.obs; //是否允许远程开锁
|
final RxBool isRemoteUnlock = false.obs; //是否允许远程开锁
|
||||||
List receiverList = []; //接受者列表
|
List receiverList = []; //接受者列表
|
||||||
List lockIdList = []; //选中的锁ID列表
|
List lockIdList = []; //选中的锁ID列表
|
||||||
|
|
||||||
var beginTime = "".obs; //默认为当前时间 开始时间
|
RxString beginTime = ''.obs; //默认为当前时间 开始时间
|
||||||
var endTime = "".obs;//默认为当前时间 结束时间
|
RxString endTime = ''.obs;//默认为当前时间 结束时间
|
||||||
var effectiveDateTime = "".obs;// 生效时间
|
RxString effectiveDateTime = ''.obs;// 生效时间
|
||||||
var failureDateTime = "".obs;// 失效时间
|
RxString failureDateTime = ''.obs;// 失效时间
|
||||||
var weekdaysList = [].obs;
|
RxList weekdaysList = [].obs;
|
||||||
|
|
||||||
var type = ''.obs;// 限时、永久、单次、循环
|
RxString type = ''.obs;// 限时、永久、单次、循环
|
||||||
var isSendSuccess = false.obs;
|
RxBool isSendSuccess = false.obs;
|
||||||
var countryName = '中国'.tr.obs;
|
RxString countryName = '中国'.tr.obs;
|
||||||
var countryCode = '86'.obs;
|
RxString countryCode = '86'.obs;
|
||||||
var isCreateUser = false.obs; //用户未注册时传1 已注册传0
|
RxBool isCreateUser = false.obs; //用户未注册时传1 已注册传0
|
||||||
|
|
||||||
var isDemoMode = false;
|
bool isDemoMode = false;
|
||||||
final sendSucceedType = 0.obs;
|
final RxInt sendSucceedType = 0.obs;
|
||||||
}
|
}
|
||||||
@ -11,15 +11,15 @@ class EditLockNameLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//修改锁名称请求
|
//修改锁名称请求
|
||||||
Future<void> modifyKeyNameRequest() async {
|
Future<void> modifyKeyNameRequest() async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to.updateLockName(
|
final KeyOperationRecordEntity entity = await ApiRepository.to.updateLockName(
|
||||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
lockId: state.lockSetInfoData.value.lockId.toString(),
|
||||||
lockName: state.changeLockNameController.text);
|
lockName: state.changeLockNameController.text);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.lockBasicInfo.value.lockAlias = state.changeLockNameController.text;
|
state.lockBasicInfo.value.lockAlias = state.changeLockNameController.text;
|
||||||
showToast("修改成功".tr, something: () {
|
showToast('修改成功'.tr, something: () {
|
||||||
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(3, state.lockBasicInfo.value.lockAlias!));
|
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(3, state.lockBasicInfo.value.lockAlias!));
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
Get.back(result: {"lockBasicInfo": state.lockBasicInfo.value});
|
Get.back(result: {'lockBasicInfo': state.lockBasicInfo.value});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.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/lockSet/basicInformation/editLockName/editLockName_state.dart';
|
||||||
|
|
||||||
import '../../../../../app_settings/app_colors.dart';
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../../tools/tf_loginInput.dart';
|
import '../../../../../tools/tf_loginInput.dart';
|
||||||
@ -18,8 +19,8 @@ class EditLockNamePage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _EditLockNamePageState extends State<EditLockNamePage> {
|
class _EditLockNamePageState extends State<EditLockNamePage> {
|
||||||
final logic = Get.put(EditLockNameLogic());
|
final EditLockNameLogic logic = Get.put(EditLockNameLogic());
|
||||||
final state = Get.find<EditLockNameLogic>().state;
|
final EditLockNameState state = Get.find<EditLockNameLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -29,15 +30,13 @@ class _EditLockNamePageState extends State<EditLockNamePage> {
|
|||||||
barTitle: TranslationLoader.lanKeys!.changeName!.tr,
|
barTitle: TranslationLoader.lanKeys!.changeName!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: [
|
actionsList: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.save!.tr,
|
TranslationLoader.lanKeys!.save!.tr,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: logic.modifyKeyNameRequest,
|
||||||
logic.modifyKeyNameRequest();
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -46,10 +45,10 @@ class _EditLockNamePageState extends State<EditLockNamePage> {
|
|||||||
child: LoginInput(
|
child: LoginInput(
|
||||||
controller: state.changeLockNameController,
|
controller: state.changeLockNameController,
|
||||||
leftWidget: const SizedBox(),
|
leftWidget: const SizedBox(),
|
||||||
hintText: "请输入名称".tr,
|
hintText: '请输入名称'.tr,
|
||||||
isHaveLeftWidget: true,
|
isHaveLeftWidget: true,
|
||||||
isSuffixIcon: true,
|
isSuffixIcon: true,
|
||||||
inputFormatters: [
|
inputFormatters: <TextInputFormatter>[
|
||||||
LengthLimitingTextInputFormatter(50),
|
LengthLimitingTextInputFormatter(50),
|
||||||
]),
|
]),
|
||||||
));
|
));
|
||||||
|
|||||||
@ -5,14 +5,14 @@ import 'package:get/get.dart';
|
|||||||
import '../../lockSet/lockSetInfo_entity.dart';
|
import '../../lockSet/lockSetInfo_entity.dart';
|
||||||
|
|
||||||
class EditLockNameState {
|
class EditLockNameState {
|
||||||
var lockSetInfoData = LockSetInfoData().obs;
|
|
||||||
var lockBasicInfo = LockBasicInfo().obs;
|
|
||||||
final TextEditingController changeLockNameController = TextEditingController();
|
|
||||||
|
|
||||||
EditLockNameState() {
|
EditLockNameState() {
|
||||||
var map = Get.arguments;
|
var map = Get.arguments;
|
||||||
lockSetInfoData.value = map["lockSetInfoData"];
|
lockSetInfoData.value = map['lockSetInfoData'];
|
||||||
lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!;
|
lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!;
|
||||||
changeLockNameController.text = lockBasicInfo.value.lockAlias!;
|
changeLockNameController.text = lockBasicInfo.value.lockAlias!;
|
||||||
}
|
}
|
||||||
|
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
|
||||||
|
Rx<LockBasicInfo> lockBasicInfo = LockBasicInfo().obs;
|
||||||
|
final TextEditingController changeLockNameController = TextEditingController();
|
||||||
}
|
}
|
||||||
@ -1,8 +1,4 @@
|
|||||||
class PasswordKeyListEntity {
|
class PasswordKeyListEntity {
|
||||||
int? errorCode;
|
|
||||||
String? description;
|
|
||||||
String? errorMsg;
|
|
||||||
PasswordKeyListData? data;
|
|
||||||
|
|
||||||
PasswordKeyListEntity(
|
PasswordKeyListEntity(
|
||||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
@ -15,6 +11,10 @@ class PasswordKeyListEntity {
|
|||||||
? PasswordKeyListData.fromJson(json['data'])
|
? PasswordKeyListData.fromJson(json['data'])
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
PasswordKeyListData? data;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
@ -29,11 +29,6 @@ class PasswordKeyListEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PasswordKeyListData {
|
class PasswordKeyListData {
|
||||||
List<PasswordKeyListItem>? itemList;
|
|
||||||
int? pageNo;
|
|
||||||
int? pageSize;
|
|
||||||
int? pages;
|
|
||||||
int? total;
|
|
||||||
|
|
||||||
PasswordKeyListData(
|
PasswordKeyListData(
|
||||||
{this.itemList, this.pageNo, this.pageSize, this.pages, this.total});
|
{this.itemList, this.pageNo, this.pageSize, this.pages, this.total});
|
||||||
@ -50,6 +45,11 @@ class PasswordKeyListData {
|
|||||||
pages = json['pages'];
|
pages = json['pages'];
|
||||||
total = json['total'];
|
total = json['total'];
|
||||||
}
|
}
|
||||||
|
List<PasswordKeyListItem>? itemList;
|
||||||
|
int? pageNo;
|
||||||
|
int? pageSize;
|
||||||
|
int? pages;
|
||||||
|
int? total;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
@ -65,25 +65,6 @@ class PasswordKeyListData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PasswordKeyListItem {
|
class PasswordKeyListItem {
|
||||||
int? apiUserId;
|
|
||||||
int? lockId;
|
|
||||||
String? keyboardPwd;
|
|
||||||
String? keyboardPwdName;
|
|
||||||
int? keyboardPwdStatus; //1:正常 2:已过期
|
|
||||||
int? keyboardPwdType;
|
|
||||||
int? startDate;
|
|
||||||
int? endDate;
|
|
||||||
int? isCustom;
|
|
||||||
String? createdAt;
|
|
||||||
String? senderUsername;
|
|
||||||
int? keyboardPwdId;
|
|
||||||
int? sendDate;
|
|
||||||
String? validTimeStr;
|
|
||||||
int? isCoerced;
|
|
||||||
int? hoursStart;
|
|
||||||
int? hoursEnd;
|
|
||||||
int? pwdUserNo;
|
|
||||||
int? pwdRight;
|
|
||||||
|
|
||||||
PasswordKeyListItem(
|
PasswordKeyListItem(
|
||||||
{this.apiUserId,
|
{this.apiUserId,
|
||||||
@ -127,6 +108,25 @@ class PasswordKeyListItem {
|
|||||||
pwdUserNo = json['pwdUserNo'];
|
pwdUserNo = json['pwdUserNo'];
|
||||||
pwdRight = json['pwdRight'];
|
pwdRight = json['pwdRight'];
|
||||||
}
|
}
|
||||||
|
int? apiUserId;
|
||||||
|
int? lockId;
|
||||||
|
String? keyboardPwd;
|
||||||
|
String? keyboardPwdName;
|
||||||
|
int? keyboardPwdStatus; //1:正常 2:已过期
|
||||||
|
int? keyboardPwdType;
|
||||||
|
int? startDate;
|
||||||
|
int? endDate;
|
||||||
|
int? isCustom;
|
||||||
|
String? createdAt;
|
||||||
|
String? senderUsername;
|
||||||
|
int? keyboardPwdId;
|
||||||
|
int? sendDate;
|
||||||
|
String? validTimeStr;
|
||||||
|
int? isCoerced;
|
||||||
|
int? hoursStart;
|
||||||
|
int? hoursEnd;
|
||||||
|
int? pwdUserNo;
|
||||||
|
int? pwdRight;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
Future<void> getKeyboardPwdRequest() async {
|
Future<void> getKeyboardPwdRequest() async {
|
||||||
int startDate = DateTool().dateToTimestamp(state.beginTime.value, 1);
|
int startDate = DateTool().dateToTimestamp(state.beginTime.value, 1);
|
||||||
final int endDate = DateTool().dateToTimestamp(state.endTime.value, 1);
|
final int endDate = DateTool().dateToTimestamp(state.endTime.value, 1);
|
||||||
final String lockId = state.keyInfo.value.lockId.toString();
|
final int lockId = state.keyInfo.value.lockId!;
|
||||||
String getKeyType = '0';
|
String getKeyType = '0';
|
||||||
|
|
||||||
if (state.nameController.text.isEmpty) {
|
if (state.nameController.text.isEmpty) {
|
||||||
|
|||||||
@ -12,12 +12,6 @@ class AddLockLogic extends BaseGetXController {
|
|||||||
final AddLockState state = AddLockState();
|
final AddLockState state = AddLockState();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
void onClose() {
|
|
||||||
// TODO: implement onClose
|
|
||||||
}
|
|
||||||
|
|
||||||
//跳转到附近的锁页面先判断权限
|
//跳转到附近的锁页面先判断权限
|
||||||
Future<void> getNearByLimits() async {
|
Future<void> getNearByLimits() async {
|
||||||
if (!Platform.isIOS) {
|
if (!Platform.isIOS) {
|
||||||
|
|||||||
@ -1,15 +1,10 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
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:permission_handler/permission_handler.dart';
|
|
||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
import 'package:star_lock/mine/addLock/addLock/addLock_logic.dart';
|
import 'package:star_lock/mine/addLock/addLock/addLock_logic.dart';
|
||||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
|
||||||
import 'package:star_lock/tools/storage.dart';
|
|
||||||
|
|
||||||
import '../../../appRouters.dart';
|
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../baseWidget.dart';
|
import '../../../baseWidget.dart';
|
||||||
import '../../../tools/submitBtn.dart';
|
import '../../../tools/submitBtn.dart';
|
||||||
|
|||||||
@ -1,23 +1,21 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class AddLockState {
|
class AddLockState { //不同类型锁图片更换
|
||||||
var getLockType = 1.obs; //0-所有锁;1-门锁;2-NFC无源锁;3-挂锁;4-保险箱锁;5-车位锁;6-智能门禁;7-网关
|
|
||||||
var lockTypeImg = 'images/lockType/addLock_touchScreen.png'.obs; //不同类型锁图片更换
|
|
||||||
|
|
||||||
AddLockState() {
|
AddLockState() {
|
||||||
Map? map = Get.arguments;
|
final Map? map = Get.arguments;
|
||||||
if (map is Map && map.isNotEmpty) {
|
if (map is Map && map.isNotEmpty) {
|
||||||
if (map["getLockType"] != null) {
|
if (map['getLockType'] != null) {
|
||||||
getLockType.value = map["getLockType"];
|
getLockType.value = map['getLockType'];
|
||||||
//保险箱锁
|
//保险箱锁
|
||||||
if (getLockType.value == 4) {
|
if (getLockType.value == 4) {
|
||||||
lockTypeImg.value = "images/lockType/addLock_safeBg.png";
|
lockTypeImg.value = 'images/lockType/addLock_safeBg.png';
|
||||||
} else if (getLockType.value == 5) {
|
} else if (getLockType.value == 5) {
|
||||||
//车位锁
|
//车位锁
|
||||||
lockTypeImg.value = "images/lockType/addLock_parkingBg.png";
|
lockTypeImg.value = 'images/lockType/addLock_parkingBg.png';
|
||||||
} else if (getLockType.value == 6) {
|
} else if (getLockType.value == 6) {
|
||||||
//智能门禁
|
//智能门禁
|
||||||
lockTypeImg.value = "images/lockType/addLock_entranceGuardBg.png";
|
lockTypeImg.value = 'images/lockType/addLock_entranceGuardBg.png';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lockTypeImg.value = 'images/lockType/addLock_touchScreen.png';
|
lockTypeImg.value = 'images/lockType/addLock_touchScreen.png';
|
||||||
@ -26,4 +24,6 @@ class AddLockState {
|
|||||||
lockTypeImg.value = 'images/lockType/addLock_touchScreen.png';
|
lockTypeImg.value = 'images/lockType/addLock_touchScreen.png';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RxInt getLockType = 1.obs; //0-所有锁;1-门锁;2-NFC无源锁;3-挂锁;4-保险箱锁;5-车位锁;6-智能门禁;7-网关
|
||||||
|
RxString lockTypeImg = 'images/lockType/addLock_touchScreen.png'.obs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,7 +123,7 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
lockId: BlueManage().connectDeviceName,
|
lockId: BlueManage().connectDeviceName,
|
||||||
keyID: '1',
|
keyID: '1',
|
||||||
authUserID: await Storage.getUid(),
|
authUserID: await Storage.getUid(),
|
||||||
nowTime: DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
nowTime: getUTCTime(),
|
||||||
publicKeyData: publicKey,
|
publicKeyData: publicKey,
|
||||||
needAuthor: 1);
|
needAuthor: 1);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -1,17 +1,11 @@
|
|||||||
import 'dart:async';
|
|
||||||
import 'dart:math';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'dart:async';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_changeAdministratorPassword.dart';
|
|
||||||
import 'package:star_lock/blue/io_protocol/io_senderCustomPasswords.dart';
|
|
||||||
import 'package:star_lock/blue/io_type.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_logic.dart';
|
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_logic.dart';
|
||||||
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
|
||||||
import 'package:star_lock/mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
import 'package:star_lock/mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
||||||
import 'package:star_lock/tools/commonDataManage.dart';
|
|
||||||
|
|
||||||
import '../../../app_settings/app_settings.dart';
|
import '../../../app_settings/app_settings.dart';
|
||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
@ -22,8 +16,8 @@ import '../../../blue/io_tool/manager_event_bus.dart';
|
|||||||
import '../../../blue/sender_manage.dart';
|
import '../../../blue/sender_manage.dart';
|
||||||
import '../../../network/api_repository.dart';
|
import '../../../network/api_repository.dart';
|
||||||
import '../../../tools/baseGetXController.dart';
|
import '../../../tools/baseGetXController.dart';
|
||||||
|
import '../../../tools/commonDataManage.dart';
|
||||||
import '../../../tools/eventBusEventManage.dart';
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../tools/showTFView.dart';
|
|
||||||
import '../../../tools/storage.dart';
|
import '../../../tools/storage.dart';
|
||||||
import 'saveLock_state.dart';
|
import 'saveLock_state.dart';
|
||||||
|
|
||||||
@ -475,7 +469,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
void backAction() {
|
void backAction() {
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent(clearScanDevices: true));
|
eventBus.fire(RefreshLockListInfoDataEvent(clearScanDevices: true));
|
||||||
BlueManage().disconnect();
|
BlueManage().disconnect();
|
||||||
Get.close(state.isFromMap == 1 ? 5 : 6);
|
Get.close(state.isFromMap == 1 ? (CommonDataManage().seletLockType == 0 ? 4 : 5) : (CommonDataManage().seletLockType == 0 ? 5 : 6));
|
||||||
//刚刚配对完,需要对开锁页锁死 2 秒
|
//刚刚配对完,需要对开锁页锁死 2 秒
|
||||||
Future<void>.delayed(const Duration(milliseconds: 200), () {
|
Future<void>.delayed(const Duration(milliseconds: 200), () {
|
||||||
if (Get.isRegistered<LockDetailLogic>()) {
|
if (Get.isRegistered<LockDetailLogic>()) {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -32,8 +33,6 @@ class _SaveLockPageState extends State<SaveLockPage> with RouteAware {
|
|||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: Column(
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 80.h,
|
height: 80.h,
|
||||||
|
|||||||
@ -7,51 +7,51 @@ import 'package:get/get.dart';
|
|||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
|
|
||||||
class SaveLockState {
|
class SaveLockState {
|
||||||
var aliName = ''.obs;
|
|
||||||
var pwdTimestamp = 0.obs;
|
|
||||||
var addressInfo = {}.obs;
|
|
||||||
|
|
||||||
TextEditingController aliNameController = TextEditingController();
|
|
||||||
FocusNode focusNode = FocusNode();
|
|
||||||
|
|
||||||
var lockUserNo = 0;
|
|
||||||
var lockInfo = {};
|
|
||||||
var featureValue = '';
|
|
||||||
var featureSettingValue = '';
|
|
||||||
var featureSettingParams = [];
|
|
||||||
var isFromMap = 0; // 0:不是从地图界面进入 1:从地图界面进入
|
|
||||||
|
|
||||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
|
||||||
var sureBtnState = 0.obs; // 0可点击 1 不可点击
|
|
||||||
|
|
||||||
// 管理员密码
|
|
||||||
var adminPasswordTF = TextEditingController();
|
|
||||||
|
|
||||||
var adminPassword = '';
|
|
||||||
var lockId = 0;
|
|
||||||
|
|
||||||
SaveLockState() {
|
SaveLockState() {
|
||||||
aliName.value = BlueManage().connectDeviceName;
|
aliName.value = BlueManage().connectDeviceName;
|
||||||
aliNameController.text = aliName.value;
|
aliNameController.text = aliName.value;
|
||||||
adminPassword = getAdminPassword();
|
adminPassword = getAdminPassword();
|
||||||
|
|
||||||
Map map = Get.arguments;
|
final Map map = Get.arguments;
|
||||||
pwdTimestamp.value = map["pwdTimestamp"];
|
pwdTimestamp.value = map['pwdTimestamp'];
|
||||||
addressInfo.value = map["addressInfo"];
|
addressInfo.value = map['addressInfo'];
|
||||||
lockInfo = map["lockInfo"];
|
lockInfo = map['lockInfo'];
|
||||||
featureValue = map["featureValue"];
|
featureValue = map['featureValue'];
|
||||||
featureSettingValue = map["featureSettingValue"];
|
featureSettingValue = map['featureSettingValue'];
|
||||||
featureSettingParams = map["featureSettingParams"];
|
featureSettingParams = map['featureSettingParams'];
|
||||||
isFromMap = map["isFromMap"];
|
isFromMap = map['isFromMap'];
|
||||||
}
|
}
|
||||||
|
RxString aliName = ''.obs;
|
||||||
|
RxInt pwdTimestamp = 0.obs;
|
||||||
|
RxMap addressInfo = {}.obs;
|
||||||
|
|
||||||
|
TextEditingController aliNameController = TextEditingController();
|
||||||
|
FocusNode focusNode = FocusNode();
|
||||||
|
|
||||||
|
int lockUserNo = 0;
|
||||||
|
Map lockInfo = {};
|
||||||
|
String featureValue = '';
|
||||||
|
String featureSettingValue = '';
|
||||||
|
List featureSettingParams = [];
|
||||||
|
int isFromMap = 0; // 0:不是从地图界面进入 1:从地图界面进入
|
||||||
|
|
||||||
|
RxBool ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||||
|
RxInt sureBtnState = 0.obs; // 0可点击 1 不可点击
|
||||||
|
|
||||||
|
// 管理员密码
|
||||||
|
TextEditingController adminPasswordTF = TextEditingController();
|
||||||
|
|
||||||
|
String adminPassword = '';
|
||||||
|
int lockId = 0;
|
||||||
|
|
||||||
void onClose() {
|
void onClose() {
|
||||||
aliNameController.dispose();
|
aliNameController.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
String getAdminPassword(){
|
String getAdminPassword(){
|
||||||
var rng = Random();
|
final Random rng = Random();
|
||||||
var number = rng.nextInt(900000) + 100000; // 生成 100000 到 999999 之间的随机整数
|
final int number = rng.nextInt(900000) + 100000; // 生成 100000 到 999999 之间的随机整数
|
||||||
return number.toString();
|
return number.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,10 +2,12 @@ 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/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
|
import 'package:star_lock/mine/addLock/selectLockType/selectLockType_state.dart';
|
||||||
|
|
||||||
import '../../../appRouters.dart';
|
import '../../../appRouters.dart';
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../baseWidget.dart';
|
import '../../../baseWidget.dart';
|
||||||
|
import '../../../tools/commonDataManage.dart';
|
||||||
import '../../../tools/titleAppBar.dart';
|
import '../../../tools/titleAppBar.dart';
|
||||||
import '../../../translations/trans_lib.dart';
|
import '../../../translations/trans_lib.dart';
|
||||||
import 'selectLockType_logic.dart';
|
import 'selectLockType_logic.dart';
|
||||||
@ -17,10 +19,9 @@ class SelectLockTypePage extends StatefulWidget {
|
|||||||
State<SelectLockTypePage> createState() => _SelectLockTypePageState();
|
State<SelectLockTypePage> createState() => _SelectLockTypePageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SelectLockTypePageState extends State<SelectLockTypePage>
|
class _SelectLockTypePageState extends State<SelectLockTypePage> with BaseWidget {
|
||||||
with BaseWidget {
|
final SelectLockTypeLogic logic = Get.put(SelectLockTypeLogic());
|
||||||
final logic = Get.put(SelectLockTypeLogic());
|
final SelectLockTypeState state = Get.find<SelectLockTypeLogic>().state;
|
||||||
final state = Get.find<SelectLockTypeLogic>().state;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -41,7 +42,7 @@ class _SelectLockTypePageState extends State<SelectLockTypePage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
allLock(),
|
allLock(),
|
||||||
lockTypeList(),
|
lockTypeList(),
|
||||||
],
|
],
|
||||||
@ -51,7 +52,7 @@ class _SelectLockTypePageState extends State<SelectLockTypePage>
|
|||||||
|
|
||||||
//锁列表控件
|
//锁列表控件
|
||||||
Widget lockTypeList() {
|
Widget lockTypeList() {
|
||||||
Widget view = F.sw(
|
final Widget view = F.sw(
|
||||||
skyCall: () => GridView.count(
|
skyCall: () => GridView.count(
|
||||||
crossAxisCount: 2,
|
crossAxisCount: 2,
|
||||||
childAspectRatio: 2.83,
|
childAspectRatio: 2.83,
|
||||||
@ -76,36 +77,41 @@ class _SelectLockTypePageState extends State<SelectLockTypePage>
|
|||||||
|
|
||||||
//所有的锁类型匹配
|
//所有的锁类型匹配
|
||||||
List<Widget> getLockTypeList() {
|
List<Widget> getLockTypeList() {
|
||||||
return [
|
return <Widget>[
|
||||||
lockTypeItem('images/lockType/lockType_doorLock.png',
|
lockTypeItem('images/lockType/lockType_doorLock.png', TranslationLoader.lanKeys!.doorLock!.tr, () {
|
||||||
TranslationLoader.lanKeys!.doorLock!.tr, () {
|
CommonDataManage().seletLockType = 1;
|
||||||
Navigator.pushNamed(context, Routers.addLockPage,
|
Navigator.pushNamed(context, Routers.addLockPage,
|
||||||
arguments: {'getLockType': 1});
|
arguments: <String, int>{'getLockType': 1});
|
||||||
}),
|
}),
|
||||||
if (!F.isLite)
|
if (!F.isLite)
|
||||||
lockTypeItem('images/lockType/lockType_NFCLock.png',
|
lockTypeItem('images/lockType/lockType_NFCLock.png',
|
||||||
TranslationLoader.lanKeys!.NFCPassiveLock!.tr, () {
|
TranslationLoader.lanKeys!.NFCPassiveLock!.tr, () {
|
||||||
|
CommonDataManage().seletLockType = 2;
|
||||||
// Navigator.pushNamed(context, Routers.addLockPage);
|
// Navigator.pushNamed(context, Routers.addLockPage);
|
||||||
}),
|
}),
|
||||||
if (!F.isLite)
|
if (!F.isLite)
|
||||||
lockTypeItem('images/lockType/lockType_padlock.png',
|
lockTypeItem('images/lockType/lockType_padlock.png',
|
||||||
TranslationLoader.lanKeys!.padlock!.tr, () {
|
TranslationLoader.lanKeys!.padlock!.tr, () {
|
||||||
|
CommonDataManage().seletLockType = 3;
|
||||||
// Navigator.pushNamed(context, Routers.addLockPage);
|
// Navigator.pushNamed(context, Routers.addLockPage);
|
||||||
}),
|
}),
|
||||||
lockTypeItem('images/lockType/lockType_safeLock.png',
|
lockTypeItem('images/lockType/lockType_safeLock.png',
|
||||||
TranslationLoader.lanKeys!.safeLock!.tr, () {
|
TranslationLoader.lanKeys!.safeLock!.tr, () {
|
||||||
|
CommonDataManage().seletLockType = 4;
|
||||||
Navigator.pushNamed(context, Routers.addLockPage,
|
Navigator.pushNamed(context, Routers.addLockPage,
|
||||||
arguments: {'getLockType': 4});
|
arguments: <String, int>{'getLockType': 4});
|
||||||
}),
|
}),
|
||||||
lockTypeItem('images/lockType/lockType_parkingLock.png',
|
lockTypeItem('images/lockType/lockType_parkingLock.png',
|
||||||
TranslationLoader.lanKeys!.parkingLock!.tr, () {
|
TranslationLoader.lanKeys!.parkingLock!.tr, () {
|
||||||
|
CommonDataManage().seletLockType = 5;
|
||||||
Navigator.pushNamed(context, Routers.addLockPage,
|
Navigator.pushNamed(context, Routers.addLockPage,
|
||||||
arguments: {'getLockType': 5});
|
arguments: <String, int>{'getLockType': 5});
|
||||||
}),
|
}),
|
||||||
lockTypeItem('images/lockType/lockType_entranceGuardLock.png',
|
lockTypeItem('images/lockType/lockType_entranceGuardLock.png',
|
||||||
TranslationLoader.lanKeys!.itelligentAccessControl!.tr, () {
|
TranslationLoader.lanKeys!.itelligentAccessControl!.tr, () {
|
||||||
|
CommonDataManage().seletLockType = 6;
|
||||||
Navigator.pushNamed(context, Routers.addLockPage,
|
Navigator.pushNamed(context, Routers.addLockPage,
|
||||||
arguments: {'getLockType': 6});
|
arguments: <String, int>{'getLockType': 6});
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// lockTypeItem('images/lockType/lockType_bicycleLock.png',
|
// lockTypeItem('images/lockType/lockType_bicycleLock.png',
|
||||||
@ -115,10 +121,12 @@ class _SelectLockTypePageState extends State<SelectLockTypePage>
|
|||||||
if (!F.isLite)
|
if (!F.isLite)
|
||||||
lockTypeItem('images/lockType/lockType_gatewayLock.png',
|
lockTypeItem('images/lockType/lockType_gatewayLock.png',
|
||||||
TranslationLoader.lanKeys!.gateway!.tr, () {
|
TranslationLoader.lanKeys!.gateway!.tr, () {
|
||||||
|
CommonDataManage().seletLockType = 7;
|
||||||
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
||||||
}),
|
}),
|
||||||
if (!F.isLite)
|
if (!F.isLite)
|
||||||
lockTypeItem('images/lockType/lockType_camera.png', '网络摄像头'.tr, () {
|
lockTypeItem('images/lockType/lockType_camera.png', '网络摄像头'.tr, () {
|
||||||
|
CommonDataManage().seletLockType = 8;
|
||||||
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
@ -127,7 +135,7 @@ class _SelectLockTypePageState extends State<SelectLockTypePage>
|
|||||||
//搜索全部的按钮
|
//搜索全部的按钮
|
||||||
Widget allLock() {
|
Widget allLock() {
|
||||||
Widget view = Row(
|
Widget view = Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(width: 30.w),
|
SizedBox(width: 30.w),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/lockType/lockType_allLocks.png',
|
'images/lockType/lockType_allLocks.png',
|
||||||
@ -139,7 +147,7 @@ class _SelectLockTypePageState extends State<SelectLockTypePage>
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Text(TranslationLoader.lanKeys!.allLock!.tr,
|
Text(TranslationLoader.lanKeys!.allLock!.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.sp,
|
fontSize: 24.sp,
|
||||||
@ -181,8 +189,8 @@ class _SelectLockTypePageState extends State<SelectLockTypePage>
|
|||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(context, Routers.addLockPage,
|
CommonDataManage().seletLockType = 0;
|
||||||
arguments: {'getLockType': 0});
|
Get.toNamed(Routers.nearbyLockPage);
|
||||||
},
|
},
|
||||||
child: view,
|
child: view,
|
||||||
);
|
);
|
||||||
@ -203,7 +211,7 @@ class _SelectLockTypePageState extends State<SelectLockTypePage>
|
|||||||
borderRadius: BorderRadius.circular(20.r),
|
borderRadius: BorderRadius.circular(20.r),
|
||||||
)),
|
)),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(width: 30.w),
|
SizedBox(width: 30.w),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
lockTypeIcon,
|
lockTypeIcon,
|
||||||
@ -215,7 +223,7 @@ class _SelectLockTypePageState extends State<SelectLockTypePage>
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Text(lockTypeTitle,
|
Text(lockTypeTitle,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.sp, color: AppColors.blackColor)),
|
fontSize: 22.sp, color: AppColors.blackColor)),
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_
|
|||||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
import '../../../app_settings/app_settings.dart';
|
|
||||||
import '../../../tools/eventBusEventManage.dart';
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../tools/storage.dart';
|
import '../../../tools/storage.dart';
|
||||||
import 'minePersonGetUploadFileInfo_entity.dart';
|
import 'minePersonGetUploadFileInfo_entity.dart';
|
||||||
@ -41,7 +40,7 @@ class MinePersonInfoLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传头像
|
// 上传头像
|
||||||
void uploadFile(
|
Future<void> uploadFile(
|
||||||
MinePersonGetUploadFileInfoEntity
|
MinePersonGetUploadFileInfoEntity
|
||||||
minePersonGetUploadFileInfoEntity) async {
|
minePersonGetUploadFileInfoEntity) async {
|
||||||
// Map<String, dynamic> user = minePersonGetUploadFileInfoEntity.data!.formData!;
|
// Map<String, dynamic> user = minePersonGetUploadFileInfoEntity.data!.formData!;
|
||||||
|
|||||||
@ -168,7 +168,6 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: false)),
|
isHaveDirection: false)),
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class _AdministratorAssociationLockPageState
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//设备多层级列表
|
//设备多层级列表
|
||||||
Widget _buildLockExpandedList(context, index) {
|
Widget _buildLockExpandedList(context, index) {
|
||||||
final GroupListItemData itemData = state.itemLockList[index];
|
final GroupListItemData itemData = state.itemLockList[index];
|
||||||
final List lockItemList = itemData.lockList ?? [];
|
final List lockItemList = itemData.lockList ?? [];
|
||||||
@ -72,14 +72,18 @@ class _AdministratorAssociationLockPageState
|
|||||||
getItemData.groupType = itemData.groupType;
|
getItemData.groupType = itemData.groupType;
|
||||||
|
|
||||||
return ExpandedListTile(
|
return ExpandedListTile(
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
|
||||||
|
},
|
||||||
typeImgList: const [],
|
typeImgList: const [],
|
||||||
groupItem: getItemData,
|
groupItem: getItemData,
|
||||||
child: massSendLockGroupCell(index,
|
child: massSendLockGroupCell(index,
|
||||||
currentIndex: index,
|
currentIndex: index,
|
||||||
lockListByGroup: lockItemList,
|
lockListByGroup: lockItemList,
|
||||||
isVip: true,
|
isVip: true,
|
||||||
selectLockAction: (int selectIndex, String selectLockId) {}),
|
selectLockAction: (int selectIndex, String selectLockId) {
|
||||||
|
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,14 +33,15 @@ class AdminDetailChangeDateLogic extends BaseGetXController {
|
|||||||
endDate: endTimeTimestamp.toString(),
|
endDate: endTimeTimestamp.toString(),
|
||||||
startDate: beginTimeTimestamp.toString(),
|
startDate: beginTimeTimestamp.toString(),
|
||||||
keyName: '',
|
keyName: '',
|
||||||
isOnlyManageSelf:
|
isOnlyManageSelf: state.itemData.value.onlyManageYouCreatesUser = true ? 1 : 2,
|
||||||
state.itemData.value.onlyManageYouCreatesUser == true ? 1 : 2);
|
keyType: 2);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
EasyLoading.showToast('修改成功', duration: 2000.milliseconds);
|
showToast('修改成功'.tr, something: () {
|
||||||
eventBus.fire(MineAuthorizedAdminPageRefreshUI());
|
eventBus.fire(MineAuthorizedAdminPageRefreshUI());
|
||||||
Get.back(result: <String, int>{
|
Get.back(result: <String, int>{
|
||||||
'beginTimeTimestamp': beginTimeTimestamp,
|
'beginTimeTimestamp': beginTimeTimestamp,
|
||||||
'endTimeTimestamp': endTimeTimestamp,
|
'endTimeTimestamp': endTimeTimestamp,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,10 +25,10 @@ class AdminDetailChangeDateState {
|
|||||||
}
|
}
|
||||||
Rx<AuthorizedAdminListItem> itemData = AuthorizedAdminListItem().obs;
|
Rx<AuthorizedAdminListItem> itemData = AuthorizedAdminListItem().obs;
|
||||||
|
|
||||||
var beginTime = ''.obs; // 开始时间
|
RxString beginTime = ''.obs; // 开始时间
|
||||||
var endTime = ''.obs; // 结束时间
|
RxString endTime = ''.obs; // 结束时间
|
||||||
|
|
||||||
var keyId = 0.obs;
|
RxInt keyId = 0.obs;
|
||||||
var lockId = 0.obs;
|
RxInt lockId = 0.obs;
|
||||||
var isOnlyManageSelf = 0.obs;
|
RxInt isOnlyManageSelf = 0.obs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,7 @@
|
|||||||
|
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||||
|
|
||||||
class AdministratorDetailEntity {
|
class AdministratorDetailEntity {
|
||||||
int? errorCode;
|
|
||||||
String? description;
|
|
||||||
String? errorMsg;
|
|
||||||
Data? data;
|
|
||||||
|
|
||||||
AdministratorDetailEntity(
|
AdministratorDetailEntity(
|
||||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
@ -15,6 +12,10 @@ class AdministratorDetailEntity {
|
|||||||
errorMsg = json['errorMsg'];
|
errorMsg = json['errorMsg'];
|
||||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||||
}
|
}
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
@ -29,16 +30,6 @@ class AdministratorDetailEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Data {
|
class Data {
|
||||||
int? uid;
|
|
||||||
int? keyStatus;
|
|
||||||
int? lockNum;
|
|
||||||
int? endDate;
|
|
||||||
int? startDate;
|
|
||||||
int? isRemoteUnlock;
|
|
||||||
int? isOnlyManageSelf;
|
|
||||||
String? name;
|
|
||||||
String? userid;
|
|
||||||
List<LockListItem>? lockList;
|
|
||||||
|
|
||||||
Data(
|
Data(
|
||||||
{this.uid,
|
{this.uid,
|
||||||
@ -69,6 +60,16 @@ class Data {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int? uid;
|
||||||
|
int? keyStatus;
|
||||||
|
int? lockNum;
|
||||||
|
int? endDate;
|
||||||
|
int? startDate;
|
||||||
|
int? isRemoteUnlock;
|
||||||
|
int? isOnlyManageSelf;
|
||||||
|
String? name;
|
||||||
|
String? userid;
|
||||||
|
List<LockListItem>? lockList;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
@ -89,29 +90,6 @@ class Data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class LockItem {
|
class LockItem {
|
||||||
int? id;
|
|
||||||
String? clientId;
|
|
||||||
int? lockOwnerId;
|
|
||||||
int? apiUserId;
|
|
||||||
int? lockId;
|
|
||||||
int? senderUserId;
|
|
||||||
String? keyName;
|
|
||||||
int? keyType;
|
|
||||||
int? startDate;
|
|
||||||
int? endDate;
|
|
||||||
List? weekDays;
|
|
||||||
String? remarks;
|
|
||||||
int? remoteEnable;
|
|
||||||
int? isCameraEnable;
|
|
||||||
int? faceAuthentication;
|
|
||||||
int? keyRight;
|
|
||||||
int? userType;
|
|
||||||
int? keyStatus;
|
|
||||||
int? groupId;
|
|
||||||
int? lockUserNo;
|
|
||||||
int? date;
|
|
||||||
String? createdAt;
|
|
||||||
String? updatedAt;
|
|
||||||
|
|
||||||
LockItem(
|
LockItem(
|
||||||
{this.id,
|
{this.id,
|
||||||
@ -168,6 +146,29 @@ class LockItem {
|
|||||||
createdAt = json['created_at'];
|
createdAt = json['created_at'];
|
||||||
updatedAt = json['updated_at'];
|
updatedAt = json['updated_at'];
|
||||||
}
|
}
|
||||||
|
int? id;
|
||||||
|
String? clientId;
|
||||||
|
int? lockOwnerId;
|
||||||
|
int? apiUserId;
|
||||||
|
int? lockId;
|
||||||
|
int? senderUserId;
|
||||||
|
String? keyName;
|
||||||
|
int? keyType;
|
||||||
|
int? startDate;
|
||||||
|
int? endDate;
|
||||||
|
List? weekDays;
|
||||||
|
String? remarks;
|
||||||
|
int? remoteEnable;
|
||||||
|
int? isCameraEnable;
|
||||||
|
int? faceAuthentication;
|
||||||
|
int? keyRight;
|
||||||
|
int? userType;
|
||||||
|
int? keyStatus;
|
||||||
|
int? groupId;
|
||||||
|
int? lockUserNo;
|
||||||
|
int? date;
|
||||||
|
String? createdAt;
|
||||||
|
String? updatedAt;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
|||||||
@ -40,7 +40,8 @@ class AdministratorDetailsLogic extends BaseGetXController {
|
|||||||
startDate: '',
|
startDate: '',
|
||||||
isOnlyManageSelf: isChangeName
|
isOnlyManageSelf: isChangeName
|
||||||
? state.itemData.value.onlyManageYouCreatesUser ?? 0
|
? state.itemData.value.onlyManageYouCreatesUser ?? 0
|
||||||
: isManageCreateUser);
|
: isManageCreateUser,
|
||||||
|
keyType: state.itemData.value.keyType ?? 0);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
if (!isChangeName) {
|
if (!isChangeName) {
|
||||||
state.onlyManageYouCreatesUser.value =
|
state.onlyManageYouCreatesUser.value =
|
||||||
|
|||||||
@ -465,7 +465,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
String endDate,
|
String endDate,
|
||||||
String keyboardPwdName,
|
String keyboardPwdName,
|
||||||
String keyboardPwdType,
|
String keyboardPwdType,
|
||||||
String lockId,
|
int lockId,
|
||||||
String startDate,
|
String startDate,
|
||||||
int startHours,
|
int startHours,
|
||||||
int endHours,
|
int endHours,
|
||||||
@ -619,7 +619,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
jsonEncode({'uid': uid, 'includeUnderlings': includeUnderlings}));
|
jsonEncode({'uid': uid, 'includeUnderlings': includeUnderlings}));
|
||||||
|
|
||||||
Future<Response> updateAdministrator(String uid, String keyName,
|
Future<Response> updateAdministrator(String uid, String keyName,
|
||||||
String endDate, String startDate, int isOnlyManageSelf) =>
|
String endDate, String startDate, int isOnlyManageSelf, int keyType) =>
|
||||||
post(
|
post(
|
||||||
updateAdministratorURL.toUrl,
|
updateAdministratorURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -627,7 +627,8 @@ class ApiProvider extends BaseProvider {
|
|||||||
'keyName': keyName,
|
'keyName': keyName,
|
||||||
'endDate': endDate,
|
'endDate': endDate,
|
||||||
'startDate': startDate,
|
'startDate': startDate,
|
||||||
'isOnlyManageSelf': isOnlyManageSelf
|
'isOnlyManageSelf': isOnlyManageSelf,
|
||||||
|
'keyType': keyType,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 设置授权管理员
|
// 设置授权管理员
|
||||||
|
|||||||
@ -489,7 +489,7 @@ class ApiRepository {
|
|||||||
{required String endDate,
|
{required String endDate,
|
||||||
required String keyboardPwdName,
|
required String keyboardPwdName,
|
||||||
required String keyboardPwdType,
|
required String keyboardPwdType,
|
||||||
required String lockId,
|
required int lockId,
|
||||||
required String startDate,
|
required String startDate,
|
||||||
required int startHours,
|
required int startHours,
|
||||||
required int endHours,
|
required int endHours,
|
||||||
@ -650,9 +650,11 @@ class ApiRepository {
|
|||||||
required String keyName,
|
required String keyName,
|
||||||
required String endDate,
|
required String endDate,
|
||||||
required String startDate,
|
required String startDate,
|
||||||
required int isOnlyManageSelf}) async {
|
required int isOnlyManageSelf,
|
||||||
|
required int keyType,
|
||||||
|
}) async {
|
||||||
final res = await apiProvider.updateAdministrator(
|
final res = await apiProvider.updateAdministrator(
|
||||||
uid, keyName, endDate, startDate, isOnlyManageSelf);
|
uid, keyName, endDate, startDate, isOnlyManageSelf, keyType);
|
||||||
return AdministratorDetailEntity.fromJson(res.body);
|
return AdministratorDetailEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,20 +6,20 @@ import '../main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
|||||||
import '../main/lockMian/entity/lockListInfo_entity.dart';
|
import '../main/lockMian/entity/lockListInfo_entity.dart';
|
||||||
|
|
||||||
class CommonDataManage {
|
class CommonDataManage {
|
||||||
static CommonDataManage? _manager;
|
|
||||||
|
factory CommonDataManage() => shareManager()!;
|
||||||
CommonDataManage._init();
|
CommonDataManage._init();
|
||||||
|
static CommonDataManage? _manager;
|
||||||
|
|
||||||
static CommonDataManage? shareManager() {
|
static CommonDataManage? shareManager() {
|
||||||
_manager ??= CommonDataManage._init();
|
_manager ??= CommonDataManage._init();
|
||||||
// _manager!._initBlue();
|
// _manager!._initBlue();
|
||||||
return _manager;
|
return _manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
factory CommonDataManage() => shareManager()!;
|
|
||||||
CommonDataManage? get manager => shareManager();
|
CommonDataManage? get manager => shareManager();
|
||||||
|
|
||||||
// 首页列表锁长度
|
// 首页列表锁长度
|
||||||
final _mainLockCount = 0.obs;
|
final RxInt _mainLockCount = 0.obs;
|
||||||
set setMainLockCount(int v) => _mainLockCount.value = v;
|
set setMainLockCount(int v) => _mainLockCount.value = v;
|
||||||
get getMainLockCount => _mainLockCount;
|
get getMainLockCount => _mainLockCount;
|
||||||
|
|
||||||
@ -34,6 +34,9 @@ class CommonDataManage {
|
|||||||
LockSetInfoData currentLockSetInfoData = LockSetInfoData();
|
LockSetInfoData currentLockSetInfoData = LockSetInfoData();
|
||||||
|
|
||||||
int dayLatestTime = (86400-1)*1000;
|
int dayLatestTime = (86400-1)*1000;
|
||||||
|
|
||||||
|
// 选择的锁类型 0-所有锁;1-门锁;2-NFC无源锁;3-挂锁;4-保险箱锁;5-车位锁;6-智能门禁;7-网关 8-智能门锁
|
||||||
|
int seletLockType = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user