修复创建公司考勤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:
//
print("${reply.commandType}数据解析成功");
state.sureBtnState.value = 0;
dismissEasyLoading();
state.autoLockTime.value = reply.data[7].toString();
break;
case 0x06:
@ -107,6 +105,7 @@ class AutomaticBlockingLogic extends BaseGetXController{
//
print("${reply.commandType}数据解析成功");
state.sureBtnState.value = 0;
dismissEasyLoading();
setAutoUnLock();
break;
case 0x06:

View File

@ -35,7 +35,9 @@ class CheckInCreatCompanyLogic extends BaseGetXController{
eventBus.fire(RefreshLockListInfoDataEvent());
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(LockSetChangeSetRefreshLockDetailWithType(0, 1));
Get.back();
Toast.show(msg: "设置成功");
}

View File

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

View File

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

View File

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