diff --git a/lan/lan_en.json b/lan/lan_en.json index c2fbf2a7..f0fb0b45 100644 --- a/lan/lan_en.json +++ b/lan/lan_en.json @@ -1151,5 +1151,8 @@ "请将手机切换至2.4G WiFi进行手动连接": "Please switch your phone to 2.4G WiFi for manual connection", "请确保网络是2.4GHz Wi-Fi": "Please ensure that the network is 2.4GHz Wi Fi", "是否要远程开锁": "Do you want to unlock remotely", + "国家地区的选择将影响数据安全,你当前选择的是": "The choice of country or region will affect data security. What is your current choice", + "请确认后再继续": "Please confirm before continuing", + "此功能的开启和关闭只能在锁附近通过手机蓝牙进行": "The activation and deactivation of this feature can only be done through Bluetooth on the phone near the lock", "网关添加成功": "Gateway added successfully" } diff --git a/lan/lan_hk.json b/lan/lan_hk.json index 754865ba..9f3a2e13 100644 --- a/lan/lan_hk.json +++ b/lan/lan_hk.json @@ -152,7 +152,7 @@ "升级": "更新", "空闲": "空置", "已入住": "佔領", - "多语言": "語言", + "多语言": "多語言", "添加锁": "添加鎖", "锁地址": "鎖定地址", "选择锁类型": "選擇鎖類型", @@ -1149,5 +1149,7 @@ "2.在APP里开启锁的远程开锁功能(这个功能默认是关闭的)。如果没有这个选项,则锁不支持Google Home": "2.喺APP中開啟鎖嘅遠程解鎖功能(此功能默認關閉)。 如果此選項不可用,則鎖將唔撐Google Home", "3.安装Google Home APP,点击左上角的加号按钮": "3.安裝Google Home應用,點擊左上角嘅加號掣", "暂无最新记录": "目前冇可用嘅最新記錄", + "繁体中文(中国台湾)": "繁體中文(中國臺灣)", + "繁体中文(中国香港)": "繁體中文(中國香港)", "请将手机切换至2.4G WiFi进行手动连接": "請把手機切換到2.4G WiFi進行手動連接" } \ No newline at end of file diff --git a/lan/lan_keys.json b/lan/lan_keys.json index f93afdae..5f37ad05 100755 --- a/lan/lan_keys.json +++ b/lan/lan_keys.json @@ -1156,5 +1156,10 @@ "请确保网络是2.4GHz Wi-Fi": "请确保网络是2.4GHz Wi-Fi", "已选": "已选", "是否要远程开锁": "是否要远程开锁", + "繁体中文(中国台湾)": "繁体中文(中国台湾)", + "繁体中文(中国香港)": "繁体中文(中国香港)", + "国家地区的选择将影响数据安全,你当前选择的是": "国家地区的选择将影响数据安全,你当前选择的是", + "请确认后再继续": "请确认后再继续", + "此功能的开启和关闭只能在锁附近通过手机蓝牙进行": "此功能的开启和关闭只能在锁附近通过手机蓝牙进行", "网关添加成功": "网关添加成功" } diff --git a/lan/lan_tw.json b/lan/lan_tw.json index 6de33a41..8f32a68e 100644 --- a/lan/lan_tw.json +++ b/lan/lan_tw.json @@ -151,7 +151,7 @@ "升级": "更新", "空闲": "空缺", "已入住": "已占用", - "多语言": "語言", + "多语言": "多語言", "添加锁": "添加鎖定", "锁地址": "鎖地址", "选择锁类型": "選擇鎖定類型", @@ -1149,5 +1149,7 @@ "2.在APP里开启锁的远程开锁功能(这个功能默认是关闭的)。如果没有这个选项,则锁不支持Google Home": "2. 在APP中開啓鎖的遠程開鎖功能(默認關閉)。如果這個選項不可用,鎖將不支持谷歌Home", "3.安装Google Home APP,点击左上角的加号按钮": "3. 安裝谷歌Home應用程序並單擊左上角的加號按鈕", "暂无最新记录": "目前沒有最新的記錄", + "繁体中文(中国台湾)": "繁體中文(中國臺灣)", + "繁体中文(中国香港)": "繁體中文(中國香港)", "请将手机切换至2.4G WiFi进行手动连接": "手動連接時請將手機調至2.4G WiFi" } \ No newline at end of file diff --git a/lan/lan_zh.json b/lan/lan_zh.json index 351e3fff..a2c5906f 100755 --- a/lan/lan_zh.json +++ b/lan/lan_zh.json @@ -62,6 +62,8 @@ "批量授权锁": "批量授权锁", "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人", "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。", + "此功能的开启和关闭只能在锁附近通过手机蓝牙进行": "此功能的开启和关闭只能在锁附近通过手机蓝牙进行", + "功能开启后,你将可以通过网关远程开锁。": "功能开启后,你将可以通过网关远程开锁。", "排列方式": "排列方式", "早到榜": "早到榜", @@ -1156,5 +1158,9 @@ "请确保网络是2.4GHz Wi-Fi": "请确保网络是2.4GHz Wi-Fi", "已选": "已选", "是否要远程开锁": "是否要远程开锁", + "繁体中文(中国台湾)": "繁体中文(中国台湾)", + "繁体中文(中国香港)": "繁体中文(中国香港)", + "国家地区的选择将影响数据安全,你当前选择的是": "国家地区的选择将影响数据安全,你当前选择的是", + "请确认后再继续": "请确认后再继续", "网关添加成功": "网关添加成功" } diff --git a/lib/blue/reciver_data.dart b/lib/blue/reciver_data.dart index 8f1db2af..2fc7fe54 100755 --- a/lib/blue/reciver_data.dart +++ b/lib/blue/reciver_data.dart @@ -57,7 +57,20 @@ class CommandReciverManager { if (data.isEmpty) { return; } + final int dataSize = data.length; + + // 验证CRC校验 + if (dataSize >= 2) { + final int calculatedCrc = + _calculateCRC16(data.sublist(0, dataSize - 2), dataSize - 2); + final int receivedCrc = (data[dataSize - 2] << 8) | data[dataSize - 1]; + + if (calculatedCrc != receivedCrc) { + AppLog.log('CRC校验失败'); + return; + } + } // 当小于包头加起来13个字节 if (dataSize < 13) { return; @@ -123,6 +136,16 @@ class CommandReciverManager { } } +// CRC16 校验计算 + static int _calculateCRC16(List bytes, int len) { + int value = 0x0000; + for (int i = 0; i < len; i++) { + int tmp = _reverse8(bytes[i]); + value = ((value << 8) ^ _crcTable[(value >> 8) ^ tmp & 0xFF]) & 0xFFFF; + } + return _reverse16(value); + } + static Future parseData(List data) async { if (data.isNotEmpty) { final int cmd = data[0] * 256 + data[1]; @@ -472,4 +495,282 @@ class CommandReciverManager { } return null; } + + // CRC16 查找表 + static const List _crcTable = [ + 0x0000, + 0x1021, + 0x2042, + 0x3063, + 0x4084, + 0x50a5, + 0x60c6, + 0x70e7, + 0x8108, + 0x9129, + 0xa14a, + 0xb16b, + 0xc18c, + 0xd1ad, + 0xe1ce, + 0xf1ef, + 0x1231, + 0x0210, + 0x3273, + 0x2252, + 0x52b5, + 0x4294, + 0x72f7, + 0x62d6, + 0x9339, + 0x8318, + 0xb37b, + 0xa35a, + 0xd3bd, + 0xc39c, + 0xf3ff, + 0xe3de, + 0x2462, + 0x3443, + 0x0420, + 0x1401, + 0x64e6, + 0x74c7, + 0x44a4, + 0x5485, + 0xa56a, + 0xb54b, + 0x8528, + 0x9509, + 0xe5ee, + 0xf5cf, + 0xc5ac, + 0xd58d, + 0x3653, + 0x2672, + 0x1611, + 0x0630, + 0x76d7, + 0x66f6, + 0x5695, + 0x46b4, + 0xb75b, + 0xa77a, + 0x9719, + 0x8738, + 0xf7df, + 0xe7fe, + 0xd79d, + 0xc7bc, + 0x48c4, + 0x58e5, + 0x6886, + 0x78a7, + 0x0840, + 0x1861, + 0x2802, + 0x3823, + 0xc9cc, + 0xd9ed, + 0xe98e, + 0xf9af, + 0x8948, + 0x9969, + 0xa90a, + 0xb92b, + 0x5af5, + 0x4ad4, + 0x7ab7, + 0x6a96, + 0x1a71, + 0x0a50, + 0x3a33, + 0x2a12, + 0xdbfd, + 0xcbdc, + 0xfbbf, + 0xeb9e, + 0x9b79, + 0x8b58, + 0xbb3b, + 0xab1a, + 0x6ca6, + 0x7c87, + 0x4ce4, + 0x5cc5, + 0x2c22, + 0x3c03, + 0x0c60, + 0x1c41, + 0xedae, + 0xfd8f, + 0xcdec, + 0xddcd, + 0xad2a, + 0xbd0b, + 0x8d68, + 0x9d49, + 0x7e97, + 0x6eb6, + 0x5ed5, + 0x4ef4, + 0x3e13, + 0x2e32, + 0x1e51, + 0x0e70, + 0xff9f, + 0xefbe, + 0xdfdd, + 0xcffc, + 0xbf1b, + 0xaf3a, + 0x9f59, + 0x8f78, + 0x9188, + 0x81a9, + 0xb1ca, + 0xa1eb, + 0xd10c, + 0xc12d, + 0xf14e, + 0xe16f, + 0x1080, + 0x00a1, + 0x30c2, + 0x20e3, + 0x5004, + 0x4025, + 0x7046, + 0x6067, + 0x83b9, + 0x9398, + 0xa3fb, + 0xb3da, + 0xc33d, + 0xd31c, + 0xe37f, + 0xf35e, + 0x02b1, + 0x1290, + 0x22f3, + 0x32d2, + 0x4235, + 0x5214, + 0x6277, + 0x7256, + 0xb5ea, + 0xa5cb, + 0x95a8, + 0x8589, + 0xf56e, + 0xe54f, + 0xd52c, + 0xc50d, + 0x34e2, + 0x24c3, + 0x14a0, + 0x0481, + 0x7466, + 0x6447, + 0x5424, + 0x4405, + 0xa7db, + 0xb7fa, + 0x8799, + 0x97b8, + 0xe75f, + 0xf77e, + 0xc71d, + 0xd73c, + 0x26d3, + 0x36f2, + 0x0691, + 0x16b0, + 0x6657, + 0x7676, + 0x4615, + 0x5634, + 0xd94c, + 0xc96d, + 0xf90e, + 0xe92f, + 0x99c8, + 0x89e9, + 0xb98a, + 0xa9ab, + 0x5844, + 0x4865, + 0x7806, + 0x6827, + 0x18c0, + 0x08e1, + 0x3882, + 0x28a3, + 0xcb7d, + 0xdb5c, + 0xeb3f, + 0xfb1e, + 0x8bf9, + 0x9bd8, + 0xabbb, + 0xbb9a, + 0x4a75, + 0x5a54, + 0x6a37, + 0x7a16, + 0x0af1, + 0x1ad0, + 0x2ab3, + 0x3a92, + 0xfd2e, + 0xed0f, + 0xdd6c, + 0xcd4d, + 0xbdaa, + 0xad8b, + 0x9de8, + 0x8dc9, + 0x7c26, + 0x6c07, + 0x5c64, + 0x4c45, + 0x3ca2, + 0x2c83, + 0x1ce0, + 0x0cc1, + 0xef1f, + 0xff3e, + 0xcf5d, + 0xdf7c, + 0xaf9b, + 0xbfba, + 0x8fd9, + 0x9ff8, + 0x6e17, + 0x7e36, + 0x4e55, + 0x5e74, + 0x2e93, + 0x3eb2, + 0x0ed1, + 0x1ef0 + ]; + + // 8位字节反转 + static int _reverse8(int data) { + int temp = 0; + for (int i = 0; i < 8; i++) { + temp |= ((data >> i) & 0x01) << (7 - i); + } + return temp; + } + + // 16位字反转 + static int _reverse16(int data) { + int temp = 0; + for (int i = 0; i < 16; i++) { + temp |= ((data >> i) & 0x0001) << (15 - i); + } + return temp; + } } diff --git a/lib/blue/sm4Encipher/sm4.dart b/lib/blue/sm4Encipher/sm4.dart index 38df45db..382cd5fa 100755 --- a/lib/blue/sm4Encipher/sm4.dart +++ b/lib/blue/sm4Encipher/sm4.dart @@ -263,7 +263,12 @@ class SM4 { 0x48 ]; - static const List FK = [0xA3B1BAC6, 0x56AA3350, 0x677D9197, 0xB27022DC]; + static const List FK = [ + 0xA3B1BAC6, + 0x56AA3350, + 0x677D9197, + 0xB27022DC + ]; static const List CK = [ 0x00070e15, @@ -411,11 +416,27 @@ class SM4 { } return paddedList; } else { + // 解密时去除PKCS7填充 + final int lastByte = input.last; + if (lastByte > 0 && lastByte <= blockSize) { + // 验证填充是否合法 + bool isValidPadding = true; + for (int i = input.length - lastByte; i < input.length; i++) { + if (input[i] != lastByte) { + isValidPadding = false; + break; + } + } + if (isValidPadding) { + return input.sublist(0, input.length - lastByte); + } + } + return input; // final lastByte = input.last; // final cutLen = input.length - lastByte; - // AppLog.log("object input.length:${input.length} lastByte:$lastByte input:$input cutLen:$cutLen"); + // // AppLog.log("object input.length:${input.length} lastByte:$lastByte input:$input cutLen:$cutLen"); // return input.sublist(0, cutLen); - return input; + // return input; } } @@ -480,7 +501,8 @@ class SM4 { final List supplementList = List.filled(16, 0x00); /// complete list - final List completeList = [...list, ...supplementList].sublist(0, 16); + final List completeList = + [...list, ...supplementList].sublist(0, 16); return completeList; } diff --git a/lib/login/forgetPassword/starLock_forgetPassword_logic.dart b/lib/login/forgetPassword/starLock_forgetPassword_logic.dart index 7036c80c..8015cc6b 100755 --- a/lib/login/forgetPassword/starLock_forgetPassword_logic.dart +++ b/lib/login/forgetPassword/starLock_forgetPassword_logic.dart @@ -19,6 +19,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController { final StarLockForgetPasswordState state = StarLockForgetPasswordState(); late Timer _timer; + void _startTimer() { _timer = Timer.periodic(1.seconds, (Timer timer) { if (state.currentSecond > 1) { @@ -37,12 +38,12 @@ class StarLockForgetPasswordLogic extends BaseGetXController { } Future resetPassword() async { - if(state.pwd.value != state.surePwd.value){ + if (state.pwd.value != state.surePwd.value) { showToast('两次密码不一致哦'.tr); return; } - if(!RegularExpression().validateString(state.pwd.value)){ + if (!RegularExpression().validateString(state.pwd.value)) { showToast('密码需至少包含数字/字母/字符中的2种组合'.tr); return; } @@ -56,42 +57,44 @@ class StarLockForgetPasswordLogic extends BaseGetXController { state.verificationCode.value); if (entity.errorCode!.codeIsSuccessful) { ApmHelper.instance.trackEvent('resetPassword_result', { - 'account':state.phoneStr.value, - 'date':DateTool().getNowDateWithType(1), - 'resetPassword_res':'成功', + 'account': state.phoneStr.value, + 'date': DateTool().getNowDateWithType(1), + 'resetPassword_res': '成功', }); showToast('重置成功'.tr); Get.back(); - }else{ + } else { ApmHelper.instance.trackEvent('resetPassword_result', { - 'account':state.phoneStr.value, - 'date':DateTool().getNowDateWithType(1), - 'resetPassword_res':'${entity.errorCode}--${entity.errorMsg}', + 'account': state.phoneStr.value, + 'date': DateTool().getNowDateWithType(1), + 'resetPassword_res': '${entity.errorCode}--${entity.errorMsg}', }); } } Future sendValidationCode() async { - final SendValidationCodeEntity entity = await ApiRepository.to.sendValidationCodeUnLogin( - // state.countryCode.value, - countryCode:state.countryCode.value, - account:state.phoneStr.value, - channel:state.codeType.value, - codeType:'2', - xWidth:state.xWidth.value.toString()); + final SendValidationCodeEntity entity = + await ApiRepository.to.sendValidationCodeUnLogin( + // state.countryCode.value, + countryCode: state.countryCode.value, + account: state.phoneStr.value, + channel: state.codeType.value, + codeType: '2', + xWidth: state.xWidth.value.toString()); if (entity.errorCode!.codeIsSuccessful) { _startTimer(); } } Future checkIpAction() async { - final CheckIPEntity entity = await ApiRepository.to.checkIpAction( - ip: '' - ); + final CheckIPEntity entity = await ApiRepository.to.checkIpAction(ip: ''); if (entity.errorCode!.codeIsSuccessful) { - if(state.countryName.value == entity.data!.name){ - ShowTipView().showSureAlertDialog('国家地区的选择将影响数据安全,你当前选择的是阿尔巴尼亚,请确认后再继续'.tr, tipTitle: '确认国家或地区'.tr, sureStr: '我知道了'.tr); + if (state.countryName.value != entity.data!.name) { + ShowTipView().showSureAlertDialog( + '国家地区的选择将影响数据安全,你当前选择的是' + state.countryName.value + '请确认后再继续'.tr, + tipTitle: '确认国家或地区'.tr, + sureStr: '我知道了'.tr); } } } @@ -103,9 +106,9 @@ class StarLockForgetPasswordLogic extends BaseGetXController { void changeInput(TextEditingController controller) { if (controller == state.phoneController) { state.phoneStr.value = controller.text; - if(state.phoneStr.value.contains('@')){ + if (state.phoneStr.value.contains('@')) { state.codeType.value = '2'; - }else{ + } else { state.codeType.value = '1'; } } @@ -120,11 +123,13 @@ class StarLockForgetPasswordLogic extends BaseGetXController { } _resetCanSendCode(); _resetCanSub(); - AppLog.log('state.canSub.value:${state.canSub.value} state.pwdIsOK:${state.pwdIsOK} state.codeIsOK:${state.codeIsOK} state.phoneStr.value:${state.phoneStr.value}'); + AppLog.log( + 'state.canSub.value:${state.canSub.value} state.pwdIsOK:${state.pwdIsOK} state.codeIsOK:${state.codeIsOK} state.phoneStr.value:${state.phoneStr.value}'); } void _resetCanSub() { - state.canSub.value = state.pwdIsOK && state.codeIsOK && state.phoneStr.value.isNotEmpty; + state.canSub.value = + state.pwdIsOK && state.codeIsOK && state.phoneStr.value.isNotEmpty; } void _resetCanSendCode() { diff --git a/lib/login/forgetPassword/starLock_forgetPassword_page.dart b/lib/login/forgetPassword/starLock_forgetPassword_page.dart index 9e20dc8f..7cc992e6 100755 --- a/lib/login/forgetPassword/starLock_forgetPassword_page.dart +++ b/lib/login/forgetPassword/starLock_forgetPassword_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -58,8 +57,7 @@ class _StarLockForgetPasswordPageState children: [ SizedBox(width: 5.w), Expanded( - child: Text( - '国家/地区'.tr, + child: Text('国家/地区'.tr, style: TextStyle( fontSize: 26.sp, color: AppColors.blackColor))), SizedBox(width: 20.w), diff --git a/lib/login/login/starLock_login_logic.dart b/lib/login/login/starLock_login_logic.dart index 570fa80c..4dfa2b5d 100755 --- a/lib/login/login/starLock_login_logic.dart +++ b/lib/login/login/starLock_login_logic.dart @@ -141,9 +141,9 @@ class StarLockLoginLogic extends BaseGetXController { Future checkIpAction() async { final CheckIPEntity entity = await ApiRepository.to.checkIpAction(ip: ''); if (entity.errorCode!.codeIsSuccessful) { - if (state.countryName == entity.data!.name) { + if (state.countryName != entity.data!.name) { ShowTipView().showSureAlertDialog( - '国家地区的选择将影响数据安全,你当前选择的是阿尔巴尼亚,请确认后再继续'.tr, + '国家地区的选择将影响数据安全,你当前选择的是'+state.countryName+'请确认后再继续'.tr, tipTitle: '确认国家或地区'.tr, sureStr: '我知道了'.tr); } diff --git a/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart b/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart index ca0be0d9..4373a087 100755 --- a/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart +++ b/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart @@ -72,17 +72,6 @@ class ConfiguringWifiLogic extends BaseGetXController { secretKey: secretKey, peerId: peerId, ); - - if (state.pageName.value == 'lockSet') { - Get.close(2); - } else { - Get.offAllNamed(Routers.starLockMain); - } - dismissEasyLoading(); - if (state.loadingTimer != null) { - state.loadingTimer!.cancel(); - state.loadingTimer = null; - } }); } } @@ -398,8 +387,10 @@ class ConfiguringWifiLogic extends BaseGetXController { // 上传数据获取设置 Future _getUploadLockSet() async { - // showBlueConnetctToastTimer(action: (){ - // }); + showEasyLoading(); + showBlueConnetctToastTimer(action: () { + dismissEasyLoading(); + }); BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async { if (connectionState == BluetoothConnectionState.connected) { @@ -408,10 +399,10 @@ class ConfiguringWifiLogic extends BaseGetXController { _uploadLockSet(getTokenList); } else if (connectionState == BluetoothConnectionState.disconnected) { - // cancelBlueConnetctToastTimer(); - // if(state.ifCurrentScreen.value == true){ - // showBlueConnetctToast(); - // } + cancelBlueConnetctToastTimer(); + if (state.ifCurrentScreen.value == true) { + showBlueConnetctToast(); + } } }); } @@ -468,13 +459,23 @@ class ConfiguringWifiLogic extends BaseGetXController { required int recordType, required List records}) async { final LoginEntity entity = await ApiRepository.to.lockDataUpload( - lockId: CommonDataManage().currentKeyInfo.lockId!, + lockId: state.lockBasicInfo.value.lockId ?? -1, uploadType: uploadType, recordType: recordType, records: records, isUnShowLoading: true); if (entity.errorCode!.codeIsSuccessful) { - update(); + await Future.delayed((Duration(seconds: 1))); + if (state.pageName.value == 'lockSet') { + Get.close(2); + } else { + Get.offAllNamed(Routers.starLockMain); + } + dismissEasyLoading(); + if (state.loadingTimer != null) { + state.loadingTimer!.cancel(); + state.loadingTimer = null; + } } } diff --git a/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_page.dart b/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_page.dart index 1e6d6ac4..ed653308 100755 --- a/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_page.dart +++ b/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_page.dart @@ -44,12 +44,17 @@ class _ConfiguringWifiPageState extends State SizedBox( height: 50.h, ), - SubmitBtn( - btnName: '确定'.tr, - onClick: () { - FocusScope.of(context).requestFocus(FocusNode()); - logic.senderConfiguringWifiAction(); - }, + Obx( + () => SubmitBtn( + btnName: '确定'.tr, + isDisabled: state.isLoading.isFalse, + onClick: state.isLoading.isTrue + ? null + : () { + FocusScope.of(context).requestFocus(FocusNode()); + logic.senderConfiguringWifiAction(); + }, + ), ), SizedBox( height: 20.h, diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart index a0011308..6760a1c0 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart @@ -362,7 +362,7 @@ class _LockSetPageState extends State //todo: 双重认证、双锁联动国际化、API接口 //双重认证 Obx(() => Visibility( - visible: true, + visible: state.lockFeature.value.doubleAuthentication == 1, child: CommonItem( leftTitel: '双重认证'.tr, rightTitle: '', diff --git a/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart b/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart index dd061929..191fd5a9 100755 --- a/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart +++ b/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart @@ -35,6 +35,7 @@ class _RemoteUnlockingPageState extends State body: Container( padding: EdgeInsets.all(30.w), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.start, @@ -65,7 +66,7 @@ class _RemoteUnlockingPageState extends State }), Padding( padding: EdgeInsets.only(top: 20.h), - child: Text('功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。'.tr, + child: Text('此功能的开启和关闭只能在锁附近通过手机蓝牙进行'.tr, style: TextStyle(fontSize: 20.sp)), ), SizedBox( diff --git a/lib/mine/addLock/nearbyLock/nearbyLock_page.dart b/lib/mine/addLock/nearbyLock/nearbyLock_page.dart index 25413554..a06d469a 100755 --- a/lib/mine/addLock/nearbyLock/nearbyLock_page.dart +++ b/lib/mine/addLock/nearbyLock/nearbyLock_page.dart @@ -105,6 +105,11 @@ class _NearbyLockPageState extends State with RouteAware { Widget nearbyLockItem( String lockTypeIcon, ScanResult scanResult, Function() action) { + // 如果广播名称为空或空字符串,则不显示该项 + if (scanResult.advertisementData.advName.isEmpty) { + return const SizedBox.shrink(); + } + return GestureDetector( onTap: () { final String? serviceUuid =