更新小e界面白屏问题
This commit is contained in:
@@ -491,7 +491,6 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
print("未知数据格式".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (tmp['data'] != null && tmp['data'] is Map) {
|
||||
var newData = tmp['data'];
|
||||
var mac = newData['mac'];
|
||||
@@ -499,23 +498,6 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
final webviewTestController = Get.find<WebviewTestController>();
|
||||
webviewTestController.web.jsbridge?.dart
|
||||
?.updateDeviceStatusByWifi(order);
|
||||
// 检查是否是当前设备的MAC
|
||||
// if (mac != null && mac == selectDevice['mac']) {
|
||||
// // 更新或添加设备数据
|
||||
// int index = wifiResponseData
|
||||
// .indexWhere((element) => element['mac'] == mac);
|
||||
// if (index >= 0) {
|
||||
// // 更新现有数据
|
||||
// wifiResponseData[index] = newData;
|
||||
// } else {
|
||||
// // 添加新数据
|
||||
// wifiResponseData.add(newData);
|
||||
// }
|
||||
|
||||
// // 可以在这里触发UI更新或其他处理
|
||||
// // 例如:Get.find<SomeController>().updateDeviceData(newData);
|
||||
// print("✅ 收到设备数据: ${newData.toString()}");
|
||||
// }
|
||||
}
|
||||
} catch (e) {
|
||||
ef.log("ws error =>$e");
|
||||
@@ -528,7 +510,9 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
// 1. 先取消可能存在的旧设备监听
|
||||
if (lastSelectDevice != null && lastSelectDevice.isNotEmpty) {
|
||||
String? oldMac = lastSelectDevice['mac'];
|
||||
if (oldMac != null && oldMac.isNotEmpty) {
|
||||
if (oldMac != null &&
|
||||
oldMac.isNotEmpty &&
|
||||
oldMac != selectDevice['mac']) {
|
||||
bool success = ws.send({
|
||||
"type": 2, // 取消监听
|
||||
"path": "/vsbs/web/rt/marttress", // 注意:可能需要不同的路径
|
||||
|
||||
Reference in New Issue
Block a user