This commit is contained in:
sky_min 2025-12-13 16:18:00 +08:00
parent 31e49d218e
commit dab98aef62
2 changed files with 49 additions and 51 deletions

View File

@ -696,55 +696,53 @@ class LockDetailLogic extends BaseGetXController {
showToast('猫眼设置为省电模式时无法进行远程开锁,请在猫眼设置中切换为其他模式'.tr);
return;
}
final LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo;
var lockId = currentKeyInfo.lockId ?? 0;
var remoteUnlock = currentKeyInfo.lockSetting?.remoteUnlock ?? 0;
// 使peerId使
final network = currentKeyInfo.network;
var lockPeerId = '';
if (network != null && network.peerId != null && network.peerId!.isNotEmpty) {
lockPeerId = network.peerId!;
StartChartManage().lockPeerId = lockPeerId;
// API
final LoginEntity entity = await ApiRepository.to.remoteOpenLock(
lockId: state.keyInfos.value.lockId.toString(),
timeOut: 60,
);
if (entity.errorCode!.codeIsSuccessful) {
AppLog.log('已开锁'.tr);
}
if (remoteUnlock == 1) {
try {
if (lockPeerId.isEmpty) {
AppLog.log('远程服务未连接,无法进行远程开锁');
return;
}
final response = await StartChartApi.to.analyzeInformationOtherEnd(peerId: lockPeerId);
if (response.statusCode == 200) {
AppLog.log('成功分析对端信息');
} else {
AppLog.log('分析对端信息失败,状态码: ${response.statusCode}');
return;
}
// WiFi锁
final network = currentKeyInfo.network;
if (network != null && (network.peerId != null && network.peerId!.isNotEmpty)){
//
await _sendUnlockViaBluetooth();
}
//
if (state.keyInfos.value.hasGateway == 1) {
// API
final LoginEntity entity = await ApiRepository.to.remoteOpenLock(lockId: lockId.toString(), timeOut: 60);
if (entity.errorCode!.codeIsSuccessful) {
showToast('已开锁'.tr);
StartChartManage().lockListPeerId = [];
}
}
} catch (e) {
AppLog.log('远程开锁失败: $e');
showToast('远程开锁失败'.tr);
//
if (state.keyInfos.value.hasGateway == 1){
// API
final LoginEntity entity = await ApiRepository.to.remoteOpenLock(
lockId: state.keyInfos.value.lockId.toString(),
timeOut: 60,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('已开锁'.tr);
}
} else {
AppLog.log('该锁的远程开锁功能未启用');
showToast('该锁的远程开锁功能未启用'.tr);
}
// WiFi锁
final LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo;
final network = currentKeyInfo.network;
if (network != null && (network.peerId != null && network.peerId!.isNotEmpty)){
final network = currentKeyInfo.network;
var lockPeerId = '';
if (network != null && network.peerId != null && network.peerId!.isNotEmpty) {
lockPeerId = network.peerId!;
StartChartManage().lockPeerId = lockPeerId;
}
if (lockPeerId.isEmpty) {
AppLog.log('远程服务未连接,无法进行远程开锁');
return;
}
final response = await StartChartApi.to.analyzeInformationOtherEnd(peerId: lockPeerId);
if (response.statusCode == 200) {
AppLog.log('成功分析对端信息');
} else {
AppLog.log('分析对端信息失败,状态码: ${response.statusCode}');
return;
}
//
await _sendUnlockViaBluetooth();
}
}

View File

@ -51,12 +51,12 @@ class _ValueAddedServicesPageListState
Get.toNamed(Routers.valueAddedServicesNoteAndEmailDetailPage,
arguments: <String, int>{'type': 1});
}),
_valueAddedServicesItem(
Image.asset('images/mine/icon_mine_valueAddedServices_email.png'),
'邮件'.tr, () {
Get.toNamed(Routers.valueAddedServicesNoteAndEmailDetailPage,
arguments: <String, int>{'type': 2});
}),
// _valueAddedServicesItem(
// Image.asset('images/mine/icon_mine_valueAddedServices_email.png'),
// '邮件'.tr, () {
// Get.toNamed(Routers.valueAddedServicesNoteAndEmailDetailPage,
// arguments: <String, int>{'type': 2});
// }),
_valueAddedServicesItem(
Image.asset(
'images/mine/icon_mine_valueAddedServices_realName.png'),