修复创建公司考勤bug

This commit is contained in:
魏少阳 2024-01-09 18:48:08 +08:00
parent 21b2746e2c
commit c2fd318087
5 changed files with 23 additions and 12 deletions

View File

@ -72,8 +72,6 @@ class AutomaticBlockingLogic extends BaseGetXController{
case 0x00: case 0x00:
// //
print("${reply.commandType}数据解析成功"); print("${reply.commandType}数据解析成功");
state.sureBtnState.value = 0;
dismissEasyLoading();
state.autoLockTime.value = reply.data[7].toString(); state.autoLockTime.value = reply.data[7].toString();
break; break;
case 0x06: case 0x06:
@ -107,6 +105,7 @@ class AutomaticBlockingLogic extends BaseGetXController{
// //
print("${reply.commandType}数据解析成功"); print("${reply.commandType}数据解析成功");
state.sureBtnState.value = 0; state.sureBtnState.value = 0;
dismissEasyLoading();
setAutoUnLock(); setAutoUnLock();
break; break;
case 0x06: case 0x06:

View File

@ -35,7 +35,9 @@ class CheckInCreatCompanyLogic extends BaseGetXController{
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
state.lockSetInfoData.value.lockSettingInfo!.attendance = 1; state.lockSetInfoData.value.lockSettingInfo!.attendance = 1;
print("333state.lockSetInfoData.value.lockSettingInfo!.attendance:${state.lockSetInfoData.value.lockSettingInfo!.attendance}");
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, 1));
Get.back(); Get.back();
Toast.show(msg: "设置成功"); Toast.show(msg: "设置成功");
} }

View File

@ -216,6 +216,7 @@ class LockSetLogic extends BaseGetXController {
// //
print("${reply.commandType}数据解析成功"); print("${reply.commandType}数据解析成功");
// Toast.show(msg: "操作成功");featureEnable = state.isOpenStayWarn.value == 1 ? 0 : 1; // Toast.show(msg: "操作成功");featureEnable = state.isOpenStayWarn.value == 1 ? 0 : 1;
dismissEasyLoading();
if (state.settingUpSupportFeatures == 55) { if (state.settingUpSupportFeatures == 55) {
// APP开锁时是否需联网 // APP开锁时是否需联网
// state.isOpenLockNeedOnline.value = state.isOpenLockNeedOnline.value == 1 ? 0 : 1; // state.isOpenLockNeedOnline.value = state.isOpenLockNeedOnline.value == 1 ? 0 : 1;
@ -366,7 +367,9 @@ class LockSetLogic extends BaseGetXController {
// () // ()
Future<void> sendBurglarAlarm(int type) async { Future<void> sendBurglarAlarm(int type) async {
showEasyLoading(); showEasyLoading();
showBlueConnetctToastTimer(); showBlueConnetctToastTimer(action: (){
dismissEasyLoading();
});
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
if (connectionState == DeviceConnectionState.connected) { if (connectionState == DeviceConnectionState.connected) {
@ -407,7 +410,10 @@ class LockSetLogic extends BaseGetXController {
privateKey: getPrivateKeyList); privateKey: getPrivateKeyList);
} else if (connectionState == DeviceConnectionState.disconnected) { } else if (connectionState == DeviceConnectionState.disconnected) {
dismissEasyLoading(); dismissEasyLoading();
showBlueConnetctToast(); cancelBlueConnetctToastTimer();
if(state.ifCurrentScreen.value == true){
showBlueConnetctToast();
}
} }
}); });
} }
@ -643,7 +649,8 @@ class LockSetLogic extends BaseGetXController {
// eventBus // eventBus
_passCurrentLockInformationEvent = eventBus.on<PassCurrentLockInformationEvent>().listen((event) { _passCurrentLockInformationEvent = eventBus.on<PassCurrentLockInformationEvent>().listen((event) {
state.lockSetInfoData.value = event.lockSetInfoData; state.lockSetInfoData.value = event.lockSetInfoData;
// print("event.lockSetInfoData.lockSettingInfo!.autoLockSecond:${event.lockSetInfoData.lockSettingInfo!.autoLockSecond}"); state.isAttendance.value = state.lockSetInfoData.value.lockSettingInfo!.attendance!;
// print("22222event.lockSetInfoData.lockSettingInfo!.autoLockSecond:${event.lockSetInfoData.lockSettingInfo!.autoLockSecond}");
blockSetStateCallback(); blockSetStateCallback();
}); });
} }

View File

@ -453,8 +453,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
})); }));
}), }),
// //
Obx( Obx(() => Visibility(
() => Visibility(
visible: state.lockFeature.value.attendance == 1 ? true : false, visible: state.lockFeature.value.attendance == 1 ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr, leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
@ -600,12 +599,12 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
// //
CupertinoSwitch _openCheckInSwitch() { CupertinoSwitch _openCheckInSwitch() {
// print("111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}"); print("111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}");
return CupertinoSwitch( return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue, activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5, trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white, thumbColor: CupertinoColors.white,
value: ((state.isAttendance.value) == 1) ? true : false, value: state.isAttendance.value == 1 ? true : false,
onChanged: (value) { onChanged: (value) {
logic.openCheckingInData((checkingInInfoDataEntity) { logic.openCheckingInData((checkingInInfoDataEntity) {
if (checkingInInfoDataEntity.data!.companyId == 0) { if (checkingInInfoDataEntity.data!.companyId == 0) {
@ -718,7 +717,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
CupertinoDialogAction( CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr), child: Text(TranslationLoader.lanKeys!.cancel!.tr),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Get.back();
}, },
), ),
CupertinoDialogAction( CupertinoDialogAction(
@ -808,6 +807,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
void didPush() { void didPush() {
super.didPush(); super.didPush();
print("lockSet===didPush"); print("lockSet===didPush");
state.ifCurrentScreen.value = true;
} }
/// ///
@ -824,6 +824,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
state.deletWaitScanCompleter!.complete(); state.deletWaitScanCompleter!.complete();
} }
BlueManage().stopScan(); BlueManage().stopScan();
state.ifCurrentScreen.value = false;
} }
/// ///
@ -831,7 +832,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
void didPopNext() { void didPopNext() {
super.didPopNext(); super.didPopNext();
print("lockSet===didPopNext"); print("lockSet===didPopNext");
state.ifCurrentScreen.value = true;
} }
/// ///
@ -848,6 +849,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
if(state.deletWaitScanCompleter != null && !state.deletWaitScanCompleter!.isCompleted){ if(state.deletWaitScanCompleter != null && !state.deletWaitScanCompleter!.isCompleted){
state.deletWaitScanCompleter!.complete(); state.deletWaitScanCompleter!.complete();
} }
// BlueManage().stopScan(); BlueManage().stopScan();
state.ifCurrentScreen.value = false;
} }
} }

View File

@ -26,6 +26,7 @@ class LockSetState {
var passwordTF = TextEditingController(); var passwordTF = TextEditingController();
var settingUpSupportFeatures = 0; var settingUpSupportFeatures = 0;
var ifCurrentScreen = true.obs; // ,
Completer? deletWaitScanCompleter; Completer? deletWaitScanCompleter;
Timer? deletWaitScanTimer; Timer? deletWaitScanTimer;