修复创建公司考勤bug
This commit is contained in:
parent
21b2746e2c
commit
c2fd318087
@ -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:
|
||||
|
||||
@ -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: "设置成功");
|
||||
}
|
||||
|
||||
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@ class LockSetState {
|
||||
var passwordTF = TextEditingController();
|
||||
|
||||
var settingUpSupportFeatures = 0;
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
|
||||
Completer? deletWaitScanCompleter;
|
||||
Timer? deletWaitScanTimer;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user