修改锁设置bug

This commit is contained in:
魏少阳 2023-11-27 09:57:53 +08:00
parent 3623b43797
commit e972d81599
11 changed files with 39 additions and 40 deletions

View File

@ -56,7 +56,6 @@ class CheckingInSetLogic extends BaseGetXController{
);
if(entity.errorCode!.codeIsSuccessful){
state.companyName.value = state.changeNameController.text;
print("state.checkingInSetInfo.value.companyName:${state.checkingInSetInfo.value.companyName}");
Toast.show(msg: "修改成功");
}
}

View File

@ -71,7 +71,7 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
SubmitBtn(
btnName: '确定',
onClick: () {
print('得到lockid为$selectLockIdList ');
// print('得到lockid为$selectLockIdList ');
Map<String, dynamic> resultMap = {};
resultMap['selectLockIdList'] = selectLockIdList;
Navigator.pop(context, resultMap);

View File

@ -20,10 +20,21 @@ class AutomaticBlockingLogic extends BaseGetXController{
final AutomaticBlockingState state = AutomaticBlockingState();
void setAutoUnLock() async{
String autoTime;
if(state.isOpen.value == false){
autoTime = "0";
}else{
if(state.isCustomLockTime.value == true){
autoTime = state.timeController.text;
}else{
autoTime = state.autoLockTime.value;
}
}
var entity = await ApiRepository.to.setAutoUnlock(
lockId: state.lockSetInfoData.value.lockId!,
autoLock:state.isOpen.value == true ? 1 : 0,
autoLockSecond: int.parse(state.autoLockTime.value),
autoLockSecond: int.parse(autoTime),
);
if(entity.errorCode!.codeIsSuccessful){

View File

@ -83,6 +83,7 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> {
//
clickCallBack: (int index, var str) {
if(index != 5){
state.isCustomLockTime.value = false;
state.autoLockTime.value = str.toString();
}else{
state.isCustomLockTime.value = true;

View File

@ -194,7 +194,7 @@ class LockSetLogic extends BaseGetXController {
}
}
//
//
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
int status = reply.data[2];
switch(status){
@ -204,10 +204,10 @@ class LockSetLogic extends BaseGetXController {
// Toast.show(msg: "操作成功");featureEnable = state.isOpenStayWarn.value == 1 ? 0 : 1;
if(state.settingUpSupportFeatures == 55){
// APP开锁时是否需联网
state.isOpenLockNeedOnline.value = state.isOpenLockNeedOnline.value == 1 ? 0 : 1;
state.lockSetInfoData.value.lockSettingInfo!.appUnlockOnline = state.isOpenLockNeedOnline.value;
// state.isOpenLockNeedOnline.value = state.isOpenLockNeedOnline.value == 1 ? 0 : 1;
// state.lockSetInfoData.value.lockSettingInfo!.appUnlockOnline = state.isOpenLockNeedOnline.value;
setLockSetOpenLockNeedOnline();
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, state.lockSetInfoData.value.lockSettingInfo!.appUnlockOnline!));
// eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, state.lockSetInfoData.value.lockSettingInfo!.appUnlockOnline!));
}else if(state.settingUpSupportFeatures == 56){
// 广
state.isOpenBlueBroadcast.value = state.isOpenBlueBroadcast.value == 1 ? 0 : 1;
@ -416,7 +416,7 @@ class LockSetLogic extends BaseGetXController {
password: state.passwordTF.text,
);
if (entity.errorCode!.codeIsSuccessful) {
deletLockInfoData();
// deletLockInfoData();
blockDeletNumberCheckPasswordCallback();
// if(state.currentDeviceUUid.value.isEmpty){
@ -500,11 +500,11 @@ class LockSetLogic extends BaseGetXController {
if(entity.errorCode!.codeIsSuccessful){
eventBus.fire(RefreshLockListInfoDataEvent());
state.isAttendance.value = (state.isAttendance.value == 1 ? 0 : 1);
state.lockSettingInfo.value.attendance = state.isAttendance.value;
state.isOpenLockNeedOnline.value = (state.isOpenLockNeedOnline.value == 1 ? 0 : 1);
state.lockSettingInfo.value.appUnlockOnline = state.isOpenLockNeedOnline.value;
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, state.lockSettingInfo.value.attendance!));
print("state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}");
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, state.lockSettingInfo.value.appUnlockOnline!));
print("state.lockSettingInfo.value.appUnlockOnline:${state.lockSettingInfo.value.appUnlockOnline}");
Toast.show(msg: "设置成功");
}
}

View File

@ -57,28 +57,23 @@ class LockDetailLogic extends BaseGetXController{
//
Future<void> _replyOpenLock(Reply reply) async {
var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
var signKey = await Storage.getStringList(saveBlueSignKey);
List<int> signKeyDataList = changeStringListToIntList(signKey!);
var tokenData = reply.data.sublist(2, 6);
var saveStrList = changeIntListToStringList(tokenData);
// print("openDoorToken:$tokenData");
Storage.setStringList(saveBlueToken, saveStrList);
//
int power = reply.data[7];
state.electricQuantity.value = power;
int status = reply.data[6];
print("status:$status");
switch(status){
case 0x00:
//
//
print("${reply.commandType}数据解析成功");
//
int power = reply.data[7];
state.electricQuantity.value = power;
getLockRecordLastUploadDataTime();
state.lockState.value = 2;
state.animationController.reset();
@ -89,6 +84,12 @@ class LockDetailLogic extends BaseGetXController{
//
print("${reply.commandType}需要鉴权");
var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
var signKey = await Storage.getStringList(saveBlueSignKey);
List<int> signKeyDataList = changeStringListToIntList(signKey!);
IoSenderManage.senderOpenLock(
keyID: BlueManage().connectDeviceName,
userID: await Storage.getUid(),
@ -526,10 +527,8 @@ class LockDetailLogic extends BaseGetXController{
_lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent = eventBus.on<LockSetChangeSetRefreshLockDetailWithType>().listen((event) {
if(event.type == 0){
// 0
print("event.setResult:${event.setResult}");
state.isAttendance.value = event.setResult;
state.keyInfos.value.lockSetting!.attendance = event.setResult;
print("state.keyInfos.value.lockSetting!.attendance:${state.keyInfos.value.lockSetting!.attendance}");
}else if(event.type == 1){
// 1
state.isOpenLockNeedOnline.value = event.setResult;

View File

@ -274,7 +274,6 @@ class _LockDetailPageState extends State<LockDetailPage>
List<Widget> getShowWidget() {
var showWidgetArr = <Widget>[];
print("pagepagepage:state.keyInfos.value.lockSetting!.attendance:${state.keyInfos.value.lockSetting!.attendance}");
//
if (state.isAttendance.value == 1) {
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png',

View File

@ -30,9 +30,7 @@ class OtherTypeKeyListLogic extends BaseGetXController{
void _initReplySubscription() {
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
// ()
print("111111111111111 isDeletFingerprintData:${state.isDeletFingerprintData} isDeletICCardData:${state.isDeletICCardData}");
if((reply is SenderAddFingerprintReply) && (state.isDeletFingerprintData == true)) {
print("111111111111111");
_replyAddFingerprintBegin(reply);
}

View File

@ -29,22 +29,14 @@ class _AbountPageState extends State<AbountPage> {
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 150.h,
),
SizedBox(height: 150.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
"images/icon_main_1024.png",
width: 160.w,
height: 160.w,
),
],
),
SizedBox(
height: 20.h,
Image.asset("images/icon_main_1024.png", width: 160.w, height: 160.w),
]
),
SizedBox(height: 20.h),
Text(
"星锁 1.0.0.02(preRelease-20231124)",
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),