修复创建公司考勤bug
This commit is contained in:
parent
21b2746e2c
commit
c2fd318087
@ -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:
|
||||||
|
|||||||
@ -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: "设置成功");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user