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