合并更新

This commit is contained in:
wyf
2025-07-07 15:57:52 +08:00
parent 471fbc94b7
commit 671ac832a5
12 changed files with 223 additions and 96 deletions

View File

@@ -230,14 +230,6 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
TopSlideNotification.show(context,
text: response.msg!);
if (response.code == HttpStatusCodes.ok) {
try {
WebviewTestController webviewTestController =
Get.find();
webviewTestController.web.jsbridge?.dart
.unBindDevice();
} catch (e) {
ef.log("[h5]通知列表更新报错:$e");
}
homeController.getPersonList();
//请求绑定设备列表
// homeController.getSleepReport();
@@ -254,6 +246,14 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
.getDeviceList(group: 'room')
.then((apiResponse) {
if (apiResponse.code != HttpStatusCodes.ok) {
try {
WebviewTestController webviewTestController =
Get.find();
webviewTestController.web.jsbridge?.dart
.alterDevice();
} catch (e) {
ef.log("[h5]通知列表更新报错:$e");
}
TopSlideNotification.show(
Get.context!,
text: apiResponse.msg!,

View File

@@ -58,7 +58,8 @@ class DeviceInfoWidget extends GetView {
children: [
Text(
deviceListController.model.deviceList[index]['name'] ??
'SWES系列 01号智能一键入眠床',
getNameByType(
deviceListController.model.deviceList[index]),
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -127,14 +128,14 @@ class DeviceInfoWidget extends GetView {
.model.deviceList[index]
["status"]?["status"]) ==
1
? '在线'
: '离线',
? '已绑定'
: '已绑定',
valueColor: (deviceListController
.model.deviceList[index]
["status"]?["status"]) ==
1
? Color(0xFF6BFDAC)
: Color(0xFFFF7159)),
: Color(0xFF6BFDAC)),
// Row(
// mainAxisSize: MainAxisSize.max,
// children: [
@@ -207,15 +208,12 @@ class DeviceInfoWidget extends GetView {
try {
WebviewTestController webviewTestController =
Get.find();
var future = webviewTestController
.web.jsbridge?.dart
.appToHtmlDevice(device);
Future.delayed(Duration(seconds: 5), () {
return;
});
await future;
await webviewTestController.web.jsbridge?.dart
.pageActive(false);
await Future.delayed(Duration(seconds: 1));
await webviewTestController.web.jsbridge?.dart
.appToHtmlDevice(device);
MainPageBBottomChange.jumpTo(2);
Get.until((route) =>
Get.currentRoute ==
@@ -387,15 +385,17 @@ class DeviceInfoWidget extends GetView {
),
InkWell(
onTap: () {
TopSlideNotification.show(
context,
text: "功能开发中...",
);
// TopSlideNotification.show(
// context,
// text: "功能开发中...",
// );
// var a = [device["bindMacA"]];
// if ("${device["bindMacB"]}".length > 6) {
// a.add(device["bindMacB"]);
// }
// Get.toNamed("/sleepWebview", arguments: a);
Get.toNamed("/mhtSleepReportReturnPage",
arguments: device);
},
child: Container(
height: MediaQuery.sizeOf(context).height * 0.1,
@@ -464,4 +464,16 @@ class DeviceInfoWidget extends GetView {
],
);
}
getNameByType(device) {
if (device['device_type'] == null) {
return '未知类型设备'.tr;
}
if (device['device_type'] == 2) {
return 'SWES 智能床'.tr;
}
if (device['device_type'] == 3) {
return 'SWES 智能床垫'.tr;
}
}
}

View File

@@ -164,13 +164,13 @@ class _MHTBindDeviceTypePageState extends State<MHTBindDeviceTypePage> {
return CustomCard(
borderRadius: 20.rpx,
onTap: () {
if (type == 2) {
TopSlideNotification.show(
context,
text: "当前类型不支持绑定".tr,
);
return;
}
// if (type == 2) {
// TopSlideNotification.show(
// context,
// text: "当前类型不支持绑定".tr,
// );
// return;
// }
MHTBlueToothController mhtBlueToothController = Get.find();
mhtBlueToothController.model.deviceType = type.toInt();
Get.toNamed("/mHTBlueteethDevicePage", arguments: data);