diff --git a/assets/langs/en_US.json b/assets/langs/en_US.json index ac4d273..19b3f17 100644 --- a/assets/langs/en_US.json +++ b/assets/langs/en_US.json @@ -185,10 +185,10 @@ "搜索": "Search", "我的e护": "Mine", "云关爱": "Cloud", - "设备ID": "Device ID", + "设备ID": "ID", "更新时间": "Update time", "设备来源": "Device source", - "设备状态": "Device status", + "设备状态": "Status", "人员资料": "User information", "实时体征": "Real-time vitals", "消息回看": "Message review", @@ -214,7 +214,7 @@ "标题": "Real-time Vitals", "姓名": "Name", "年龄": "Age", - "设备ID": "Device ID", + "设备ID": "ID", "体重": "Weight", "提示": "Tip: For real-time vital analysis, the user should lie on the designated bed with the device functioning normally. Keep still for 10-30 seconds to display real-time vital data." }, @@ -642,7 +642,7 @@ "开始快检": "Start Quick Check", "健康等级:": "Health Level:", "快检得分:": "Quick Check Score: ", - "设备ID:": "Device ID:", + "设备ID:": "ID:", "快检时间:": "Quick Check Time:", "终止": "Stop", "性别": "Gender", @@ -662,6 +662,9 @@ "设备校准完成": "Calibration Complete", "请校准人员保持在床状态": "Please stay on bed", "请校准人员暂时离开床铺": "Please leave the bed", + "快检报告": "Quick Check Report", + "暂未绑定": "Not Bound", + "用户取消授权": "User Canceled", "获得位置信息,连接附近的蓝牙设备": "Obtain location information, connect to nearby Bluetooth devices", "当前设备已离线,无法快检!": "The current device is offline and cannot be checked!", "设备正在快检中,请稍后再试!": "The device is currently checking, please try again later!", diff --git a/assets/langs/zh_CN.json b/assets/langs/zh_CN.json index 99b0d96..1f4de48 100644 --- a/assets/langs/zh_CN.json +++ b/assets/langs/zh_CN.json @@ -664,6 +664,8 @@ "请校准人员保持在床状态": "请校准人员保持在床状态", "请校准人员暂时离开床铺": "请校准人员暂时离开床铺", "请求成功": "请求成功", + "快检报告": "快检报告", + "暂未绑定": "暂未绑定", "获得位置信息,连接附近的蓝牙设备": "获得位置信息,连接附近的蓝牙设备", "使用方式:人员使用健康快检功能时,只需平躺或坐在正常运行中的体征传感器传感器上方,保持静止,然后点击“启动快检”,待进度条完成,即可得出快检报告。": "使用方式:人员使用健康快检功能时,只需平躺或坐在正常运行中的体征传感器传感器上方,保持静止,然后点击“启动快检”,待进度条完成,即可得出快检报告。", "注:本页报告是基于心率、呼吸等体征波形数据,通过AI算法模型分析完成,其结果仅供参考;其中报告未见数据异常部分,并不代表没有潜在性的疾病风险,如有不适请及时就医。": "注:本页报告是基于心率、呼吸等体征波形数据,通过AI算法模型分析完成,其结果仅供参考;其中报告未见数据异常部分,并不代表没有潜在性的疾病风险,如有不适请及时就医。", diff --git a/assets/langs/zh_TW.json b/assets/langs/zh_TW.json index 4c70fd2..085b5e3 100644 --- a/assets/langs/zh_TW.json +++ b/assets/langs/zh_TW.json @@ -659,6 +659,8 @@ "请校准人员保持在床状态": "請校準人員保持在床狀態", "请校准人员暂时离开床铺": "請校準人員暫時離開床鋪", "请保持身体静止": "請保持身體靜止", + "快检报告": "快檢報告", + "暂未绑定": "暫未綁定", "获得位置信息,连接附近的蓝牙设备": "獲得位置信息,連接附近的藍牙設備", "当前设备已离线,无法快检!": "當前設備已離線,無法快檢! ", "设备正在快检中,请稍后再试!": "當前設備正在快檢中,請稍後再試!", diff --git a/lib/common/util/requestWithLog.dart b/lib/common/util/requestWithLog.dart index a487ebe..ef0811e 100644 --- a/lib/common/util/requestWithLog.dart +++ b/lib/common/util/requestWithLog.dart @@ -80,12 +80,14 @@ Future requestWithLog({ onSuccess?.call(apiResponse); } else { apiResponse.msg = responseData['msg'] ?? errorMsg; + EasyDartModule.logger + .error("$logTitle ${responseData['msg'] ?? errorMsg}"); onFailure?.call(apiResponse); } - return apiResponse; } else { apiResponse = ApiResponse(code: -1, msg: "失败".tr); + EasyDartModule.logger.error("$logTitle 失败"); onFailure?.call(apiResponse); return apiResponse; } diff --git a/lib/controller/device/device_type_controller.dart b/lib/controller/device/device_type_controller.dart index e843f46..1902a7a 100644 --- a/lib/controller/device/device_type_controller.dart +++ b/lib/controller/device/device_type_controller.dart @@ -173,6 +173,7 @@ class DeviceTypeController extends GetControllerEx { currentCq.value = {}; NewTopSlideNotification.show( text: "数据加载失败", textColor: themeController.currentColor.sc9); + EasyDartModule.logger.error("快检报告数据加载失败-->${res.msg??'服务器错误'}"); }, ); return flag; diff --git a/lib/pages/device/component/HealthReportCard.dart b/lib/pages/device/component/HealthReportCard.dart index 1ff5f8b..9e44fa3 100644 --- a/lib/pages/device/component/HealthReportCard.dart +++ b/lib/pages/device/component/HealthReportCard.dart @@ -8,6 +8,7 @@ import 'package:vbvs_app/controller/device/device_share_controller.dart'; import 'package:vbvs_app/controller/device/device_type_controller.dart'; import 'package:vbvs_app/controller/message/message_controller.dart'; import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; +import 'package:EasyDartModule/EasyDartModule.dart' as edm; class HealthReportCardWidget extends StatefulWidget { final data; @@ -96,7 +97,8 @@ class _HealthReportCardWidgetState extends State { String ID = reportData['id']; DeviceTypeController deviceTypeController = Get.find(); - await deviceTypeController.getCheckHistory(id: ID,mac: reportData['mac']); + await deviceTypeController.getCheckHistory( + id: ID, mac: reportData['mac']); if (deviceTypeController.currentCq.value == null || deviceTypeController.currentCq.value.isEmpty) { NewTopSlideNotification.show( @@ -215,7 +217,11 @@ class _HealthReportCardWidgetState extends State { // 可以根据需要跳转到报告详情页面 print('查看报告: ${reportData['_id']}'); // 示例:Get.to(() => ReportDetailPage(reportId: reportData['_id'])); - Get.toNamed('/healthQuickCheckReportPage', arguments: reportData); + try { + Get.toNamed('/healthQuickCheckReportPage', arguments: reportData); + } catch (e) { + edm.EasyDartModule.logger.error("快检报告页面加载失败---?${e.toString()}"); + } } // 格式化时间戳 diff --git a/lib/pages/device/health_experience.dart b/lib/pages/device/health_experience.dart index 644d0ec..29a38e4 100644 --- a/lib/pages/device/health_experience.dart +++ b/lib/pages/device/health_experience.dart @@ -354,494 +354,9 @@ class _HealthCheckPageState extends State }, child: Column( children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Flexible( - // flex: 2, - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // children: [ - // Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .end, - // children: [ - // Text( - // '实时体征.姓名'.tr, - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc4, - // ), - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .start, - // children: [ - // Container( - // width: MediaQuery - // .sizeOf( - // context) - // .width * - // 0.2, - // child: Text( - // device['person'] != null && - // device['person'] - // [ - // 'name'] != - // null && - // device['person'] - // [ - // 'name'] - // .toString() - // .trim() - // .isNotEmpty - // ? device['person'] - // [ - // 'name'] - // .toString() - // : '体征检测设备'.tr, - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: - // 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc3, - // ), - // maxLines: 1, - // overflow: - // TextOverflow - // .ellipsis, - // ), - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // ] - // .divide(SizedBox( - // width: 33.rpx)) - // .addToStart(SizedBox( - // width: 37.rpx)), - // ), - // Row( - // children: [ - // Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .end, - // children: [ - // Text( - // '性别'.tr, - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc4, - // ), - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .start, - // children: [ - // Container( - // width: MediaQuery - // .sizeOf( - // context) - // .width * - // 0.2, - // child: Text( - // device['person'] != null && - // device['person'] - // [ - // 'gender'] != - // null && - // device['person'] - // [ - // 'gender'] - // .toString() - // .trim() - // .isNotEmpty - // ? _getGenderText( - // device['person'] - // [ - // 'gender']) - // : '-'.tr, - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: - // 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc3, - // ), - // maxLines: 1, - // overflow: - // TextOverflow - // .ellipsis, - // ), - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // ] - // .divide(SizedBox( - // width: 33.rpx)) - // .addToStart(SizedBox( - // width: 37.rpx)), - // ), - // Row( - // children: [ - // Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .end, - // children: [ - // Text( - // '身高'.tr, - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc4, - // ), - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .start, - // children: [ - // Container( - // width: MediaQuery - // .sizeOf( - // context) - // .width * - // 0.2, - // child: Text( - // device['person'] != null && - // device['person'] - // [ - // 'height'] != - // null && - // device['person'] - // [ - // 'height'] - // .toString() - // .trim() - // .isNotEmpty - // ? device['person'] - // [ - // 'height'] - // .toString() + - // "cm" - // : '-'.tr + - // "cm", - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: - // 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc3, - // ), - // maxLines: 1, - // overflow: - // TextOverflow - // .ellipsis, - // ), - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // ] - // .divide(SizedBox( - // width: 33.rpx)) - // .addToStart(SizedBox( - // width: 37.rpx)), - // ), - // ] - // .addToStart( - // SizedBox(height: 0.rpx)) - // .addToEnd( - // SizedBox(height: 0.rpx)) - // .divide(SizedBox( - // height: 36.rpx, - // )), - // ), - // ), - // Flexible( - // flex: 3, - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // children: [ - // Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .end, - // children: [ - // Text( - // '实时体征.设备ID'.tr, - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc4, - // ), - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // Expanded( - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .start, - // children: [ - // Text( - // '${device['code'] ?? '未知数据'.tr}', - // // "D11250300003", - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: - // 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc3, - // ), - // maxLines: 1, - // overflow: - // TextOverflow - // .ellipsis, - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // ), - // ] - // .divide(SizedBox( - // width: 33.rpx)) - // .addToStart(SizedBox( - // width: 37.rpx)), - // ), - // Row( - // children: [ - // Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .end, - // children: [ - // Text( - // '年龄'.tr, - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc4, - // ), - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // Expanded( - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .start, - // children: [ - // Text( - // device['person'] != null && - // device['person'] - // [ - // 'birthday'] != - // null && - // device['person'] - // [ - // 'birthday'] - // .toString() - // .trim() - // .isNotEmpty - // ? _calculateAge( - // device['person'] - // [ - // 'birthday'] - // .toString()) - // : '-'.tr, - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: - // 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc3, - // ), - // maxLines: 1, - // overflow: - // TextOverflow - // .ellipsis, - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // ), - // ] - // .divide(SizedBox( - // width: 33.rpx)) - // .addToStart(SizedBox( - // width: 37.rpx)), - // ), - // Row( - // children: [ - // Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .end, - // children: [ - // Text( - // '体重'.tr, - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc4, - // ), - // ), - // // Text( - // // '实时体征.体重'.tr, - // // style: TextStyle( - // // fontFamily: 'Inter', - // // fontSize: 26.rpx, - // // letterSpacing: 0.0, - // // color: themeController - // // .currentColor.sc4, - // // ), - // // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // Expanded( - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment - // .start, - // children: [ - // Text( - // device['person'] != null && - // device['person'] - // [ - // 'weight'] != - // null && - // device['person'] - // [ - // 'weight'] - // .toString() - // .trim() - // .isNotEmpty - // ? device['person'] - // [ - // 'weight'] - // .toString() + - // "kg" - // : '-'.tr + - // "kg", - // style: TextStyle( - // fontFamily: - // 'Inter', - // fontSize: - // 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc3, - // ), - // maxLines: 1, - // overflow: - // TextOverflow - // .ellipsis, - // ), - // ].divide(SizedBox( - // height: 34.rpx)), - // ), - // ), - // ] - // .divide(SizedBox( - // width: 33.rpx)) - // .addToStart(SizedBox( - // width: 37.rpx)), - // ), - // ] - // .addToStart( - // SizedBox(height: 0.rpx)) - // .addToEnd( - // SizedBox(height: 0.rpx)) - // .divide(SizedBox( - // height: 36.rpx, - // )), - // ), - // ), - // ], - // ), Container( padding: EdgeInsets.fromLTRB( - 37.rpx, 37.rpx, 37.rpx, 37.rpx), + 37.rpx, 37.rpx, 20.rpx, 37.rpx), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: @@ -849,7 +364,7 @@ class _HealthCheckPageState extends State children: [ // 左侧列 - 标签和值 Expanded( - flex: 2, + flex: 3, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -862,7 +377,7 @@ class _HealthCheckPageState extends State children: [ // 标签 - 也不能换行,超出显示... Expanded( - flex: 1, + flex: 3, child: Text( '实时体征.姓名'.tr, style: TextStyle( @@ -884,7 +399,7 @@ class _HealthCheckPageState extends State .rpx), // 标签和值之间的间距 // 值 Expanded( - flex: 2, + flex: 4, child: Text( device['person'] != null && @@ -926,7 +441,7 @@ class _HealthCheckPageState extends State .center, children: [ Expanded( - flex: 1, + flex: 3, child: Text( '性别'.tr, style: TextStyle( @@ -945,7 +460,7 @@ class _HealthCheckPageState extends State ), SizedBox(width: 20.rpx), Expanded( - flex: 2, + flex: 4, child: Text( device['person'] != null && @@ -989,7 +504,7 @@ class _HealthCheckPageState extends State .center, children: [ Expanded( - flex: 1, + flex: 3, child: Text( '身高'.tr, style: TextStyle( @@ -1008,7 +523,7 @@ class _HealthCheckPageState extends State ), SizedBox(width: 20.rpx), Expanded( - flex: 2, + flex: 4, child: Text( device['person'] != null && @@ -1049,7 +564,7 @@ class _HealthCheckPageState extends State // 右侧列 - 标签和值 Expanded( - flex: 3, + flex: 4, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1741,31 +1256,21 @@ class _HealthCheckPageState extends State if (deviceTypeController.experience_status.value == APPQuickCheckStatus.completed.value) { //体验正常结束 - deviceTypeController.experience_status.value = 404; - deviceTypeController.experience_status.value = 0; - progressNotifier.value = 0; - edm.EasyDartModule.logger.info("快检结束,停止定时查询"); - _checkStatusTimer?.cancel(); - await deviceTypeController.getCheckHistory( - id: deviceTypeController.experience_id.value,mac: widget.personInfo['mac']); - Get.toNamed('/healthQuickCheckReportPage', - arguments: deviceTypeController.currentCq.value); + try { + deviceTypeController.experience_status.value = 404; + deviceTypeController.experience_status.value = 0; + progressNotifier.value = 0; + edm.EasyDartModule.logger.info("快检结束,停止定时查询"); + _checkStatusTimer?.cancel(); + await deviceTypeController.getCheckHistory( + id: deviceTypeController.experience_id.value, + mac: widget.personInfo['mac']); + Get.toNamed('/healthQuickCheckReportPage', + arguments: deviceTypeController.currentCq.value); + } catch (e) { + edm.EasyDartModule.logger.error("快检报告页面加载失败---?${e.toString()}"); + } } - // if (deviceTypeController.experience_status.value != APPQuickCheckStatus.inProgress.value && - // deviceTypeController.experience_status.value != 201 && - // deviceTypeController.experience_status.value != 404 && - // deviceTypeController.experience_status.value != 203) { - // //体验异常结束 - // deviceTypeController.experience_status.value = 404; - // deviceTypeController.experience_percent.value = 0; - // progressNotifier.value = 0; - // edm.EasyDartModule.logger.info("快检结束,停止定时查询"); - // _checkStatusTimer?.cancel(); - // // NewTopSlideNotification.show( - // // text: - // // "体验异常结束".tr, - // // textColor: themeController.currentColor.sc9); - // } if (deviceTypeController.experience_status.value == APPQuickCheckStatus.timeout.value || deviceTypeController.experience_status.value == diff --git a/lib/pages/device_bind/after/after_wifi_page_person.dart b/lib/pages/device_bind/after/after_wifi_page_person.dart index 25c47db..76bb374 100644 --- a/lib/pages/device_bind/after/after_wifi_page_person.dart +++ b/lib/pages/device_bind/after/after_wifi_page_person.dart @@ -736,6 +736,7 @@ class _AfterWifiPagePersonState extends State { .currentColor.sc9, ); }); + await initWifiStatusAndWifiList(); } else { blueteethBindController.netType.value = 1; diff --git a/lib/pages/device_bind/wifi_page.dart b/lib/pages/device_bind/wifi_page.dart index aaa7518..ff5a6fd 100644 --- a/lib/pages/device_bind/wifi_page.dart +++ b/lib/pages/device_bind/wifi_page.dart @@ -797,12 +797,7 @@ class _WifiPageState extends State { Get.toNamed("/calibrationPage", arguments: 1); }); - } else if (aa == 'unknown') { - // TopSlideNotification.show( - // context, - // text: "获取设备网络类型失败".tr, - // textColor: themeController.currentColor.sc9, - // ); + } else if (aa == 'unknown') { blueteethBindController .netType.value = 3; blueteethBindController.updateAll(); @@ -1185,161 +1180,6 @@ class _WifiPageState extends State { } } - // Future dealWifi(String mac) async { - // final blueteethBindController = Get.find(); - // final themeController = Get.find(); - - // // 显示加载对话框 - // // showLoadingDialog(Get.context!, title: "连接中...".tr); - - // // 设置超时定时器 - // Timer? timeoutTimer; - // bool isConnected = false; - - // try { - // // 开始扫描蓝牙设备 - // await FlutterBluePlus.startScan(timeout: Duration(seconds: 10)); - - // // 设置超时(20秒) - // timeoutTimer = Timer(Duration(seconds: 20), () { - // try { - // if (!isConnected) { - // blueteethBindController.blueConnectFlag.value = 1; - // blueteethBindController.updateAll(); - // // Navigator.of(context).pop(); // 先关闭 dialog - // WidgetsBinding.instance.addPostFrameCallback((_) { - // TopSlideNotification.show( - // context, - // text: "设备连接超时,请重试".tr, - // textColor: themeController.currentColor.sc9, - // ); - // }); - // FlutterBluePlus.stopScan(); - // } - // } catch (e) { - // print(e); - // } - // }); - - // // 监听扫描结果 - // StreamSubscription>? scanSubscription; - // scanSubscription = FlutterBluePlus.scanResults.listen((results) async { - // // 过滤出符合条件的设备 - // ScanResult? targetDevice; - - // for (var r in results) { - // if (r.advertisementData.manufacturerData.containsKey(0xFFED)) { - // List rawData = r.advertisementData.manufacturerData[0xFFED]!; - // BleDeviceData deviceData = parseBleData(rawData); - // String deviceMac = - // deviceData.deviceId.replaceAll(':', '').toLowerCase(); - // if (deviceMac == mac.toLowerCase()) { - // targetDevice = r; - // break; - // } - // } - // } - - // if (targetDevice != null && !isConnected) { - // isConnected = true; - // FlutterBluePlus.stopScan(); - // scanSubscription?.cancel(); - // timeoutTimer?.cancel(); - - // try { - // // 连接设备 - // // await targetDevice.device.connect(); - // THapp bledevice = THapp(device: targetDevice.device); - // await bledevice.device.connect(); - // var res2 = bledevice.isConnected; - // if (res2) { - // // Navigator.pop(context); - // blueteethBindController.blueConnectFlag.value = 2; - // TopSlideNotification.show( - // context, - // text: "蓝牙绑定.连接成功".tr, - // textColor: themeController.currentColor.sc2, - // ); - // blueteethBindController.currentDevice = bledevice; - // if (lisObj != null) { - // lisObj!.cancel(); - // } - // var aa; - // lisObj = blueteethBindController.currentDevice!.statusStream - // .listen((onData) async { - // if (onData.status == BleEventType.recvLineLog) { - // final line = onData.val; - // print("[bleee]:" + line); - // } - // if (onData.status == BleEventType.ready) { - // aa = await getDeviceNetVersion( - // blueteethBindController.currentDevice!, 0); - // if (aa == "4g") { - // // TopSlideNotification.show( - // // Get.context!, - // // text: "4g设备配置wifi提示".tr, - // // textColor: themeController.currentColor.sc9, - // // ); - // updateDeviceBindStatus( - // blueteethBindController.currentDeviceMac!.value); - // WidgetsBinding.instance.addPostFrameCallback((_) { - // TopSlideNotification.show( - // context, - // text: "4g设备配置wifi提示".tr, - // textColor: themeController.currentColor.sc9, - // ); - // Get.back(); - // }); - // return; - // } else if (aa == 'unknown') { - // blueteethBindController.netType.value = 3; - // blueteethBindController.updateAll(); - // WidgetsBinding.instance.addPostFrameCallback((_) { - // TopSlideNotification.show( - // context, - // text: "获取设备网络类型失败".tr, - // textColor: themeController.currentColor.sc9, - // ); - // }); - // } else { - // await initWifiStatusAndWifiList(); - // } - // } - // }); - // } else { - // // Navigator.pop(context); - // TopSlideNotification.show( - // context, - // text: "蓝牙绑定.连接失败".tr, - // textColor: themeController.currentColor.sc9, - // ); - // } - // } catch (e) { - // // Navigator.of(Get.context!).pop(); // 关闭加载对话框 - // TopSlideNotification.show( - // Get.context!, - // text: "设备连接失败".tr, - // textColor: themeController.currentColor.sc9, - // ); - // } - // } - // }); - - // // 等待扫描完成 - // await Future.delayed(Duration(seconds: 20)); - // } catch (e) { - // timeoutTimer?.cancel(); - // Navigator.of(Get.context!).pop(); // 关闭加载对话框 - // TopSlideNotification.show( - // Get.context!, - // text: "扫描过程中发生错误".tr, - // textColor: themeController.currentColor.sc9, - // ); - // } finally { - // timeoutTimer?.cancel(); - // await FlutterBluePlus.stopScan(); - // } - // } Future dealWifi(String mac, {bool needTip = true, bool needSuccess = false}) async { diff --git a/lib/pages/mh_page/device/mht_wifi_page.dart b/lib/pages/mh_page/device/mht_wifi_page.dart index 327f47b..0cdaeb0 100644 --- a/lib/pages/mh_page/device/mht_wifi_page.dart +++ b/lib/pages/mh_page/device/mht_wifi_page.dart @@ -1254,6 +1254,7 @@ class _MHTWifiPageState extends State { text: "获取设备网络类型失败".tr, textColor: themeController.currentColor.sc9, ); + await initWifiStatusAndWifiList(needSuccess: needSuccess); } else { blueteethBindController.netType.value = 1; blueteethBindController.updateAll(); diff --git a/lib/pages/mh_page/device/mht_wifi_page_after.dart b/lib/pages/mh_page/device/mht_wifi_page_after.dart index 2f2a32b..cde49ac 100644 --- a/lib/pages/mh_page/device/mht_wifi_page_after.dart +++ b/lib/pages/mh_page/device/mht_wifi_page_after.dart @@ -1212,6 +1212,7 @@ class _MHTWifiAfterPageState extends State { text: "获取设备网络类型失败".tr, textColor: themeController.currentColor.sc9, ); + await initWifiStatusAndWifiList(needSuccess: needSuccess); } else { blueteethBindController.netType.value = 1; blueteethBindController.updateAll(); diff --git a/lib/pages/mh_page/test/WebviewTestModel.dart b/lib/pages/mh_page/test/WebviewTestModel.dart index 5b878ca..4a88bf9 100644 --- a/lib/pages/mh_page/test/WebviewTestModel.dart +++ b/lib/pages/mh_page/test/WebviewTestModel.dart @@ -352,6 +352,7 @@ class WebviewTestController extends GetControllerEx { await blueToothController.sendCommand(args[0]); } catch (e) { ef.log("[wifi控制下发指令失败]:$e"); + edm.EasyDartModule.logger.error("[wifi控制下发指令失败]:$e"); } return true; }); @@ -495,12 +496,13 @@ class WebviewTestController extends GetControllerEx { return; } if (tmp['data'] != null && tmp['data'] is Map) { - var newData = tmp['data']; + var newData = tmp['data']; MHTBlueToothController mhtBlueToothController = Get.find(); - edm.EasyDartModule.logger.info("收到设备数据:${newData['mac']}" +"wifi指令控制回复时间-->${DateTime.now()}"); + edm.EasyDartModule.logger.info("收到设备数据:${newData['mac']}" + + "wifi指令控制回复时间-->${DateTime.now()}"); ef.log("wifi指令控制回复时间-->${DateTime.now()}"); // mhtBlueToothController.onCommandResponse(true); - + var mac = newData['mac']; ef.log("收到设备数据:${newData['mac']}"); String order = Base64Tool.decode(newData['data']); @@ -510,7 +512,7 @@ class WebviewTestController extends GetControllerEx { } // ef.log("切换设备调试:" + "当前选中设备:${selectDevice['mac']}" +""+"收到设备数据:${mac}"); webviewTestController.web.jsbridge?.dart - ?.updateDeviceStatusByWifi(order,mac); + ?.updateDeviceStatusByWifi(order, mac); } } catch (e) { ef.log("ws error =>$e"); diff --git a/lib/pages/sleep_report/quick_health_report_page.dart b/lib/pages/sleep_report/quick_health_report_page.dart index c5bc435..be1897f 100644 --- a/lib/pages/sleep_report/quick_health_report_page.dart +++ b/lib/pages/sleep_report/quick_health_report_page.dart @@ -4,7 +4,6 @@ import 'package:flutterflow_ui/flutterflow_ui.dart'; import 'package:vbvs_app/common/color/appConstants.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; -import 'package:vbvs_app/component/NullDataComponentWidget.dart'; import 'package:vbvs_app/component/tool/NewTopSlideNotification.dart'; import 'package:vbvs_app/controller/date/CalendarController.dart'; import 'package:vbvs_app/controller/sleep/sleep_report_controller.dart'; @@ -56,6 +55,75 @@ class _QuickHealthReportPageState extends State { double lineWidth = 150.rpx; try { + if (widget.data == null || widget.data.isEmpty) { + return LayoutBuilder( + builder: (context, bodySize) => GestureDetector( + child: Container( + decoration: BoxDecoration( + image: (widget.data['noBackImg'] != null && + widget.data['noBackImg'] == true) + ? null // ✅ 不要背景图 + : DecorationImage( + image: (widget.data['backgroundImg'] != null && + widget.data['backgroundImg'] + .toString() + .isNotEmpty) + ? AssetImage(widget.data['backgroundImg']) + : AssetImage(getBackgroundImageNoImage()) + as ImageProvider, + fit: BoxFit.fill, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, // 背景透明 + appBar: (widget.data['arrow'] != null && + widget.data['arrow'] == false) + ? null + : AppBar( + backgroundColor: widget.data['backgroundColor'] != null + ? widget.data['backgroundColor'].withOpacity(0.8) + : themeController.currentColor.sc5, + automaticallyImplyLeading: false, + iconTheme: IconThemeData( + color: themeController.currentColor.sc3), + titleSpacing: 0, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + /// 居中标题 + Text( + '快检报告'.tr, + style: TextStyle( + fontFamily: 'Readex Pro', + color: themeController.currentColor.sc3, + letterSpacing: 0, + fontSize: 30.rpx, + ), + ), + + /// 左边返回按钮 + if (widget.data['arrow'] == null || + widget.data['arrow'] == true) + Positioned( + left: 0, + child: returnIconButtomNew(), + ), + ], + ), + ), + ), + body: SafeArea( + top: true, + child: Text('无数据'.tr), + ), + ), + ), + ), + ); + } return LayoutBuilder( builder: (context, bodySize) => GestureDetector( child: Container( @@ -384,7 +452,73 @@ class _QuickHealthReportPageState extends State { text: '页面渲染失败:${e.toString()}'.tr, textColor: themeController.currentColor.sc9, ); - return Container(); + return LayoutBuilder( + builder: (context, bodySize) => GestureDetector( + child: Container( + decoration: BoxDecoration( + image: (widget.data['noBackImg'] != null && + widget.data['noBackImg'] == true) + ? null // ✅ 不要背景图 + : DecorationImage( + image: (widget.data['backgroundImg'] != null && + widget.data['backgroundImg'] + .toString() + .isNotEmpty) + ? AssetImage(widget.data['backgroundImg']) + : AssetImage(getBackgroundImageNoImage()) + as ImageProvider, + fit: BoxFit.fill, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, // 背景透明 + appBar: (widget.data['arrow'] != null && + widget.data['arrow'] == false) + ? null + : AppBar( + backgroundColor: widget.data['backgroundColor'] != null + ? widget.data['backgroundColor'].withOpacity(0.8) + : themeController.currentColor.sc5, + automaticallyImplyLeading: false, + iconTheme: IconThemeData( + color: themeController.currentColor.sc3), + titleSpacing: 0, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + /// 居中标题 + Text( + '快检报告'.tr, + style: TextStyle( + fontFamily: 'Readex Pro', + color: themeController.currentColor.sc3, + letterSpacing: 0, + fontSize: 30.rpx, + ), + ), + + /// 左边返回按钮 + if (widget.data['arrow'] == null || + widget.data['arrow'] == true) + Positioned( + left: 0, + child: returnIconButtomNew(), + ), + ], + ), + ), + ), + body: SafeArea( + top: true, + child: Text('页面渲染失败:${e.toString()}'), + ), + ), + ), + ), + ); } }