添加指纹、卡、人脸、密码,删除/重置之前校验是否有网络功能
This commit is contained in:
parent
e18fa5c7e5
commit
2384d326ea
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
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_type.dart';
|
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
|
|||||||
@ -197,6 +197,8 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
|
logic.checkNetworkSituation();
|
||||||
|
|
||||||
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, () async {
|
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, () async {
|
||||||
state.isDeletCard.value = true;
|
state.isDeletCard.value = true;
|
||||||
logic.senderAddICCard();
|
logic.senderAddICCard();
|
||||||
|
|||||||
@ -1,15 +1,13 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
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_type.dart';
|
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||||
import '../../../../blue/io_protocol/io_checkingCardStatus.dart';
|
|
||||||
import '../../../../blue/io_protocol/io_checkingUserInfoCount.dart';
|
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/card/cardList/cardList_state.dart';
|
import 'package:star_lock/main/lockDetail/card/cardList/cardList_state.dart';
|
||||||
import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart';
|
|
||||||
|
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
@ -69,11 +69,8 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
final bool isNetWork =
|
logic.checkNetworkSituation();
|
||||||
LockMainLogic.to()?.judgeTheNetwork() ?? false;
|
|
||||||
if (!isNetWork) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ShowTipView().showIosTipWithContentDialog(
|
ShowTipView().showIosTipWithContentDialog(
|
||||||
'重置后,该锁的卡都将被删除哦,确认要重置吗?'.tr, () async {
|
'重置后,该锁的卡都将被删除哦,确认要重置吗?'.tr, () async {
|
||||||
state.isDeletAll = true;
|
state.isDeletAll = true;
|
||||||
@ -145,6 +142,8 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
onPressed: (BuildContext context) {
|
onPressed: (BuildContext context) {
|
||||||
|
logic.checkNetworkSituation();
|
||||||
|
|
||||||
ShowTipView().showIosTipWithContentDialog(
|
ShowTipView().showIosTipWithContentDialog(
|
||||||
'确定要删除吗?'.tr, () async {
|
'确定要删除吗?'.tr, () async {
|
||||||
state.isDeletAll = false;
|
state.isDeletAll = false;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@ -77,7 +78,7 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
action: () async {
|
action: () async {
|
||||||
if (state.keyType.value == 2 || state.keyType.value == 1) {
|
if (state.keyType.value == 2 || state.keyType.value == 1) {
|
||||||
// 限时
|
// 限时
|
||||||
var data = await Get.toNamed(
|
final data = await Get.toNamed(
|
||||||
Routers.otherTypeKeyChangeDatePage,
|
Routers.otherTypeKeyChangeDatePage,
|
||||||
arguments: <String, Object>{
|
arguments: <String, Object>{
|
||||||
'pushType': 3,
|
'pushType': 3,
|
||||||
@ -92,7 +93,7 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
}
|
}
|
||||||
} else if (state.keyType.value == 4) {
|
} else if (state.keyType.value == 4) {
|
||||||
// 循环
|
// 循环
|
||||||
var data = await Get.toNamed(
|
final data = await Get.toNamed(
|
||||||
Routers.otherTypeKeyChangeValidityDatePage,
|
Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
arguments: <String, Object>{
|
arguments: <String, Object>{
|
||||||
'pushType': 3,
|
'pushType': 3,
|
||||||
@ -117,7 +118,7 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var data = await Get.toNamed(
|
final data = await Get.toNamed(
|
||||||
Routers.otherTypeKeyChangeValidityDatePage,
|
Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
arguments: <String, Object>{
|
arguments: <String, Object>{
|
||||||
'pushType': 3,
|
'pushType': 3,
|
||||||
@ -141,7 +142,7 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
'${DateTool().dateToHNString(state.startTime.value)}-${DateTool().dateToHNString(state.endTime.value)}',
|
'${DateTool().dateToHNString(state.startTime.value)}-${DateTool().dateToHNString(state.endTime.value)}',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var data = await Get.toNamed(
|
final data = await Get.toNamed(
|
||||||
Routers.otherTypeKeyChangeValidityDatePage,
|
Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
arguments: <String, Object>{
|
arguments: <String, Object>{
|
||||||
'pushType': 3,
|
'pushType': 3,
|
||||||
@ -206,6 +207,8 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
|
logic.checkNetworkSituation();
|
||||||
|
|
||||||
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr,
|
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr,
|
||||||
() async {
|
() async {
|
||||||
state.isDeletFace.value = true;
|
state.isDeletFace.value = true;
|
||||||
|
|||||||
@ -4,13 +4,10 @@ import 'dart:async';
|
|||||||
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_addFace.dart';
|
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_queryingFaceStatus.dart';
|
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/face/faceList/faceList_state.dart';
|
import 'package:star_lock/main/lockDetail/face/faceList/faceList_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import '../../../../app_settings/app_settings.dart';
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_protocol/io_checkingUserInfoCount.dart';
|
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
@ -342,7 +339,7 @@ class FaceListLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 重置所有的人脸
|
// 重置所有的人脸
|
||||||
void clearAllFacesData() async {
|
Future<void> clearAllFacesData() async {
|
||||||
String faceId = '';
|
String faceId = '';
|
||||||
String type = '1';
|
String type = '1';
|
||||||
if (state.isDeletAll == false) {
|
if (state.isDeletAll == false) {
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.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/face/faceList/faceList_state.dart';
|
||||||
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
||||||
import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart';
|
|
||||||
import 'package:star_lock/tools/keySearchWidget.dart';
|
import 'package:star_lock/tools/keySearchWidget.dart';
|
||||||
import 'package:star_lock/tools/left_slide/left_slide_actions.dart';
|
import 'package:star_lock/tools/left_slide/left_slide_actions.dart';
|
||||||
import 'package:star_lock/tools/showTipView.dart';
|
import 'package:star_lock/tools/showTipView.dart';
|
||||||
@ -27,14 +28,16 @@ class FaceListPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
||||||
final logic = Get.put(FaceListLogic());
|
final FaceListLogic logic = Get.put(FaceListLogic());
|
||||||
final state = Get.find<FaceListLogic>().state;
|
final FaceListState state = Get.find<FaceListLogic>().state;
|
||||||
|
|
||||||
Future<void> getHttpData() async {
|
Future<void> getHttpData() async {
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
logic.getFaceListData().then((FingerprintListDataEntity value) {
|
logic.getFaceListData().then((FingerprintListDataEntity value) {
|
||||||
if (mounted) setState(() {});
|
if (mounted) {
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,32 +58,29 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
barTitle: TranslationLoader.lanKeys!.face!.tr,
|
barTitle: TranslationLoader.lanKeys!.face!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: [
|
actionsList: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.reset!.tr,
|
TranslationLoader.lanKeys!.reset!.tr,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
final bool isNetWork =
|
logic.checkNetworkSituation();
|
||||||
LockMainLogic.to()?.judgeTheNetwork() ?? false;
|
|
||||||
if (!isNetWork) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// showDeletAlertDialog(context);
|
// showDeletAlertDialog(context);
|
||||||
ShowTipView().showIosTipWithContentDialog(
|
ShowTipView().showIosTipWithContentDialog(
|
||||||
"重置后,该锁的人脸都将被删除哦,确认要重置吗?", () async {
|
'重置后,该锁的人脸都将被删除哦,确认要重置吗?', () async {
|
||||||
state.isDeletAll = true;
|
state.isDeletAll = true;
|
||||||
state.deletKeyID = "1";
|
state.deletKeyID = '1';
|
||||||
state.deletFaceNo = 0;
|
state.deletFaceNo = 0;
|
||||||
|
|
||||||
logic.senderAddFace();
|
logic.senderAddFace();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Get.toNamed(Routers.selectLockTypePage);
|
// Get.toNamed(Routers.selectLockTypePage);
|
||||||
logic.showToast("演示模式");
|
logic.showToast('演示模式');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -95,7 +95,7 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
getHttpData();
|
getHttpData();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
KeySearchWidget(
|
KeySearchWidget(
|
||||||
editingController: state.searchController,
|
editingController: state.searchController,
|
||||||
onSubmittedAction: () {
|
onSubmittedAction: () {
|
||||||
@ -111,10 +111,10 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
btnName:
|
btnName:
|
||||||
'${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}',
|
'${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}',
|
||||||
onClick: () async {
|
onClick: () async {
|
||||||
var data =
|
final data =
|
||||||
await Get.toNamed(Routers.addFaceTypePage, arguments: {
|
await Get.toNamed(Routers.addFaceTypePage, arguments: <String, int>{
|
||||||
"lockId": state.lockId.value,
|
'lockId': state.lockId.value,
|
||||||
"fromType": 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||||
});
|
});
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
@ -134,8 +134,8 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
return Obx(() => state.faceItemListData.value.isNotEmpty
|
return Obx(() => state.faceItemListData.value.isNotEmpty
|
||||||
? ListView.separated(
|
? ListView.separated(
|
||||||
itemCount: state.faceItemListData.value.length,
|
itemCount: state.faceItemListData.value.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (BuildContext c, int index) {
|
||||||
FingerprintItemData getFaceItemData =
|
final FingerprintItemData getFaceItemData =
|
||||||
state.faceItemListData.value[index];
|
state.faceItemListData.value[index];
|
||||||
// 人脸
|
// 人脸
|
||||||
if (index < state.faceItemListData.value.length) {
|
if (index < state.faceItemListData.value.length) {
|
||||||
@ -143,7 +143,7 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
tag: getFaceItemData.faceName!,
|
tag: getFaceItemData.faceName!,
|
||||||
key: Key(getFaceItemData.faceName!),
|
key: Key(getFaceItemData.faceName!),
|
||||||
actionsWidth: 60,
|
actionsWidth: 60,
|
||||||
actions: [
|
actions: <Widget>[
|
||||||
_buildDeleteBtn(getFaceItemData),
|
_buildDeleteBtn(getFaceItemData),
|
||||||
],
|
],
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
@ -154,9 +154,9 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
getFaceItemData.faceName!,
|
getFaceItemData.faceName!,
|
||||||
logic.getKeyType(getFaceItemData),
|
logic.getKeyType(getFaceItemData),
|
||||||
logic.getKeyDateType(getFaceItemData), () async {
|
logic.getKeyDateType(getFaceItemData), () async {
|
||||||
var data =
|
final data =
|
||||||
await Get.toNamed(Routers.faceDetailPage, arguments: {
|
await Get.toNamed(Routers.faceDetailPage, arguments: <String, FingerprintItemData>{
|
||||||
"faceItemData": getFaceItemData,
|
'faceItemData': getFaceItemData,
|
||||||
});
|
});
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
@ -182,7 +182,7 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// 省略: 弹出是否删除的确认对话框。
|
// 省略: 弹出是否删除的确认对话框。
|
||||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, () async {
|
||||||
state.isDeletAll = false;
|
state.isDeletAll = false;
|
||||||
state.deletKeyID = faceItemData.faceId.toString();
|
state.deletKeyID = faceItemData.faceId.toString();
|
||||||
state.deletFaceNo = int.parse(faceItemData.faceNumber!);
|
state.deletFaceNo = int.parse(faceItemData.faceNumber!);
|
||||||
@ -243,21 +243,21 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
// // borderRadius: BorderRadius.circular(10.w),
|
// // borderRadius: BorderRadius.circular(10.w),
|
||||||
// ),
|
// ),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(width: 30.w),
|
SizedBox(width: 30.w),
|
||||||
Image.asset(lockTypeIcon, width: 60.w, height: 60.w),
|
Image.asset(lockTypeIcon, width: 60.w, height: 60.w),
|
||||||
SizedBox(width: 20.w),
|
SizedBox(width: 20.w),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 1.sw - 110.w - 100.w,
|
width: 1.sw - 110.w - 100.w,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(lockTypeTitle,
|
child: Text(lockTypeTitle,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
@ -277,7 +277,7 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
SizedBox(height: 5.h),
|
SizedBox(height: 5.h),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(showTime,
|
child: Text(showTime,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
@ -301,7 +301,6 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
// TODO: implement didChangeDependencies
|
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
|
|
||||||
/// 路由订阅
|
/// 路由订阅
|
||||||
@ -310,7 +309,6 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
// TODO: implement dispose
|
|
||||||
/// 取消路由订阅
|
/// 取消路由订阅
|
||||||
AppRouteObserver().routeObserver.unsubscribe(this);
|
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
@ -328,7 +326,9 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
void didPop() {
|
void didPop() {
|
||||||
super.didPop();
|
super.didPop();
|
||||||
logic.cancelBlueConnetctToastTimer();
|
logic.cancelBlueConnetctToastTimer();
|
||||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
if (EasyLoading.isShow) {
|
||||||
|
EasyLoading.dismiss(animation: true);
|
||||||
|
}
|
||||||
state.ifCurrentScreen.value = false;
|
state.ifCurrentScreen.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +344,9 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
void didPushNext() {
|
void didPushNext() {
|
||||||
super.didPushNext();
|
super.didPushNext();
|
||||||
logic.cancelBlueConnetctToastTimer();
|
logic.cancelBlueConnetctToastTimer();
|
||||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
if (EasyLoading.isShow) {
|
||||||
|
EasyLoading.dismiss(animation: true);
|
||||||
|
}
|
||||||
state.ifCurrentScreen.value = false;
|
state.ifCurrentScreen.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,21 +2,21 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
||||||
|
|
||||||
class FaceListState {
|
class FaceListState { // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||||
final TextEditingController searchController = TextEditingController();
|
|
||||||
final lockId = 0.obs;
|
|
||||||
|
|
||||||
// 因为删除跟添加人脸用的同一个协议 所以这里用做判断
|
|
||||||
var isDeletAll = false;
|
|
||||||
var deletKeyID = "";
|
|
||||||
var deletFaceNo = 0;
|
|
||||||
|
|
||||||
final faceItemListData = <FingerprintItemData>[].obs;
|
|
||||||
|
|
||||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
|
||||||
|
|
||||||
FaceListState() {
|
FaceListState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
lockId.value = map["lockId"];
|
lockId.value = map['lockId'];
|
||||||
}
|
}
|
||||||
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
final RxInt lockId = 0.obs;
|
||||||
|
|
||||||
|
// 因为删除跟添加人脸用的同一个协议 所以这里用做判断
|
||||||
|
bool isDeletAll = false;
|
||||||
|
String deletKeyID = '';
|
||||||
|
int deletFaceNo = 0;
|
||||||
|
|
||||||
|
final RxList<FingerprintItemData> faceItemListData = <FingerprintItemData>[].obs;
|
||||||
|
|
||||||
|
RxBool ifCurrentScreen = true.obs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -211,6 +211,8 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
|||||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
|
logic.checkNetworkSituation();
|
||||||
|
|
||||||
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr,
|
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr,
|
||||||
() async {
|
() async {
|
||||||
state.isDeletFingerprint.value = true;
|
state.isDeletFingerprint.value = true;
|
||||||
|
|||||||
@ -70,11 +70,8 @@ class _FingerprintListPageState extends State<FingerprintListPage>
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
final bool isNetWork =
|
logic.checkNetworkSituation();
|
||||||
LockMainLogic.to()?.judgeTheNetwork() ?? false;
|
|
||||||
if (!isNetWork) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ShowTipView().showIosTipWithContentDialog(
|
ShowTipView().showIosTipWithContentDialog(
|
||||||
'重置后,该锁的指纹都将被删除哦,确认要重置吗?'.tr, () async {
|
'重置后,该锁的指纹都将被删除哦,确认要重置吗?'.tr, () async {
|
||||||
state.isDeletAll = true;
|
state.isDeletAll = true;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.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/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart';
|
||||||
@ -243,6 +243,8 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
|
|||||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
|
logic.checkNetworkSituation();
|
||||||
|
|
||||||
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, () {
|
ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, () {
|
||||||
state.isDeletPasswordKey.value = true;
|
state.isDeletPasswordKey.value = true;
|
||||||
logic.senderCustomPasswords();
|
logic.senderCustomPasswords();
|
||||||
|
|||||||
@ -307,12 +307,12 @@ class PasswordKeyListLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户信息此处用作判断网络是否能获取成功
|
// 获取用户信息此处用作判断网络是否能获取成功
|
||||||
Future<void> getUserInfoRequest() async {
|
// Future<void> getUserInfoRequest() async {
|
||||||
final MinePersonInfoEntity entity = await ApiRepository.to.getUserInfo();
|
// final MinePersonInfoEntity entity = await ApiRepository.to.getUserInfo();
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
// if (entity.errorCode!.codeIsSuccessful) {
|
||||||
senderResetPasswords();
|
// senderResetPasswords();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
//使用期限
|
//使用期限
|
||||||
String getUseDateStr(PasswordKeyListItem indexEntity) {
|
String getUseDateStr(PasswordKeyListItem indexEntity) {
|
||||||
|
|||||||
@ -78,7 +78,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ShowTipView().showIosTipWithContentDialog(
|
ShowTipView().showIosTipWithContentDialog(
|
||||||
'该锁的密码都将被删除'.tr, logic.getUserInfoRequest);
|
'该锁的密码都将被删除'.tr, logic.senderResetPasswords);
|
||||||
} else {
|
} else {
|
||||||
logic.showToast('演示模式'.tr);
|
logic.showToast('演示模式'.tr);
|
||||||
}
|
}
|
||||||
@ -155,6 +155,8 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
onPressed: (BuildContext context) {
|
onPressed: (BuildContext context) {
|
||||||
|
logic.checkNetworkSituation();
|
||||||
|
|
||||||
ShowTipView().showIosTipWithContentDialog(
|
ShowTipView().showIosTipWithContentDialog(
|
||||||
'确定要删除吗?'.tr, () async {
|
'确定要删除吗?'.tr, () async {
|
||||||
state.itemData = passwordKeyListItem;
|
state.itemData = passwordKeyListItem;
|
||||||
|
|||||||
@ -110,6 +110,8 @@ class LockMainLogic extends BaseGetXController {
|
|||||||
// 从无网络到有网络
|
// 从无网络到有网络
|
||||||
state.networkConnectionStatus.value = 1;
|
state.networkConnectionStatus.value = 1;
|
||||||
getStarLockInfo(isUnShowLoading: true);
|
getStarLockInfo(isUnShowLoading: true);
|
||||||
|
}else if(result == ConnectivityResult.none){
|
||||||
|
state.networkConnectionStatus.value = 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import 'package:system_settings/system_settings.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../common/XSConstantMacro/XSConstantMacro.dart';
|
import '../common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
|
import '../main/lockMian/lockMain/lockMain_logic.dart';
|
||||||
import 'NativeInteractionTool.dart';
|
import 'NativeInteractionTool.dart';
|
||||||
import 'dateTool.dart';
|
import 'dateTool.dart';
|
||||||
import 'manager/client_manager.dart';
|
import 'manager/client_manager.dart';
|
||||||
@ -176,6 +177,13 @@ class BaseGetXController extends GetxController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void checkNetworkSituation (){
|
||||||
|
final bool isNetWork = LockMainLogic.to()?.judgeTheNetwork() ?? false;
|
||||||
|
if (!isNetWork) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String getUseKeyTypeStr(int? startDate, int? endDate, int? keyType) {
|
String getUseKeyTypeStr(int? startDate, int? endDate, int? keyType) {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
if (keyType == XSConstantMacro.keyTypeTime) {
|
if (keyType == XSConstantMacro.keyTypeTime) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user