修改删除bug
This commit is contained in:
parent
96572aeecf
commit
bd04a5a9b3
@ -216,7 +216,9 @@ class BlueManage{
|
|||||||
|
|
||||||
// 重新连接
|
// 重新连接
|
||||||
Future<void> judgeReconnect(String deviceMAC, String deviceName, ConnectStateCallBack? connectStateCallBack, {bool isShowLoading = true}) async {
|
Future<void> judgeReconnect(String deviceMAC, String deviceName, ConnectStateCallBack? connectStateCallBack, {bool isShowLoading = true}) async {
|
||||||
|
print("11111111$deviceConnectionState");
|
||||||
if(deviceConnectionState == DeviceConnectionState.connected){
|
if(deviceConnectionState == DeviceConnectionState.connected){
|
||||||
|
print("2222222:$deviceConnectionState");
|
||||||
if(isShowLoading){
|
if(isShowLoading){
|
||||||
EasyLoading.show();
|
EasyLoading.show();
|
||||||
Future.delayed(const Duration(seconds: 10), () { //asynchronous delay
|
Future.delayed(const Duration(seconds: 10), () { //asynchronous delay
|
||||||
@ -228,8 +230,10 @@ class BlueManage{
|
|||||||
}
|
}
|
||||||
connectStateCallBack!(deviceConnectionState!);
|
connectStateCallBack!(deviceConnectionState!);
|
||||||
}else{
|
}else{
|
||||||
|
print("333333333:${deviceConnectionState}");
|
||||||
connect(deviceMAC, deviceName, isShowLoading: false, connectStateCallBack: (state){
|
connect(deviceMAC, deviceName, isShowLoading: false, connectStateCallBack: (state){
|
||||||
connectStateCallBack!(deviceConnectionState!);
|
print("44444444:${state}");
|
||||||
|
connectStateCallBack!(state);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -237,11 +237,11 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
blockDeletNumberCheckPasswordCallback();
|
blockDeletNumberCheckPasswordCallback();
|
||||||
if(state.currentDeviceUUid.value.isEmpty){
|
// if(state.currentDeviceUUid.value.isEmpty){
|
||||||
Toast.show(msg: "未扫描到当前设备,请确保您在设备旁边、设备已开启、设备未被其他人连接");
|
// Toast.show(msg: "未扫描到当前设备,请确保您在设备旁边、设备已开启、设备未被其他人连接");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if(state.currentDeviceUUid.value[31] == "1"){
|
// if(state.currentDeviceUUid.value[31] == "1"){
|
||||||
// 已配对
|
// 已配对
|
||||||
if(state.getKeyInfosData.value.isLockOwner == 1){
|
if(state.getKeyInfosData.value.isLockOwner == 1){
|
||||||
// 调用删除锁协议
|
// 调用删除锁协议
|
||||||
@ -250,16 +250,16 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
// 调用删除钥匙协议
|
// 调用删除钥匙协议
|
||||||
deletUserAction();
|
deletUserAction();
|
||||||
}
|
}
|
||||||
}else if(state.currentDeviceUUid.value[31] == "0"){
|
// }else if(state.currentDeviceUUid.value[31] == "0"){
|
||||||
// 未配对
|
// // 未配对
|
||||||
if(state.getKeyInfosData.value.isLockOwner == 1){
|
// if(state.getKeyInfosData.value.isLockOwner == 1){
|
||||||
// 直接调用删除锁接口
|
// // 直接调用删除锁接口
|
||||||
deletLockInfoData();
|
// deletLockInfoData();
|
||||||
}else{
|
// }else{
|
||||||
// 直接调用删除要是接口
|
// // 直接调用删除要是接口
|
||||||
deletKeyData();
|
// deletKeyData();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -440,7 +440,7 @@ class LockDetailLogic extends BaseGetXController{
|
|||||||
BlueManage().connectDeviceMacAddress = v[knownDeviceIndex].id;
|
BlueManage().connectDeviceMacAddress = v[knownDeviceIndex].id;
|
||||||
connectBlue(v[knownDeviceIndex].id, state.keyInfos.value.bluetooth!.bluetoothDeviceName!);
|
connectBlue(v[knownDeviceIndex].id, state.keyInfos.value.bluetooth!.bluetoothDeviceName!);
|
||||||
eventBus.fire(ScanAllDeviceFindCurrentDeviceConnectedEvent(v[knownDeviceIndex].serviceUuids[0].toString()));
|
eventBus.fire(ScanAllDeviceFindCurrentDeviceConnectedEvent(v[knownDeviceIndex].serviceUuids[0].toString()));
|
||||||
// BlueManage().stopScan();
|
BlueManage().stopScan();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -367,7 +367,7 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
|
|||||||
bottomItem(
|
bottomItem(
|
||||||
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
|
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
|
||||||
() {
|
() {
|
||||||
// BlueManage().stopScan();
|
BlueManage().stopScan();
|
||||||
Get.toNamed(Routers.lockSetPage, arguments: widget.keyInfo);
|
Get.toNamed(Routers.lockSetPage, arguments: widget.keyInfo);
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|||||||
@ -11,7 +11,7 @@ class AddLockLogic extends BaseGetXController {
|
|||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
|
||||||
BlueManage().stopScan();
|
// BlueManage().stopScan();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -29,10 +29,12 @@ class NearbyLockLogic extends BaseGetXController{
|
|||||||
// 点击连接设备
|
// 点击连接设备
|
||||||
void connect(String lockId, String deviceName){
|
void connect(String lockId, String deviceName){
|
||||||
// BlueManage().stopScan();
|
// BlueManage().stopScan();
|
||||||
BlueManage().judgeReconnect(lockId, deviceName, (DeviceConnectionState state) async {
|
// BlueManage().judgeReconnect(lockId, deviceName, (DeviceConnectionState state) async {
|
||||||
IoSenderManage.getPublicKey(lockId: deviceName);
|
// if (state == DeviceConnectionState.connected) {
|
||||||
}, isShowLoading: true);
|
// IoSenderManage.getPublicKey(lockId: deviceName);
|
||||||
// BlueManage().connect(lockId, deviceName, isFrist: true, isShowLoading: true);
|
// }
|
||||||
|
// }, isShowLoading: true);
|
||||||
|
BlueManage().connect(lockId, deviceName, isFrist: true, isShowLoading: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user