From ff00ed60c007eb294c9f58b9c7af08fcabc44684 Mon Sep 17 00:00:00 2001 From: wyf <494641114@qq.com> Date: Sat, 2 Aug 2025 14:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/langs/en_US.json | 3 +- assets/langs/zh_CN.json | 3 +- assets/langs/zh_TW.json | 3 +- assets/mhlangs/en_US.json | 7 +++-- assets/mhlangs/zh_CN.json | 7 +++-- assets/mhlangs/zh_TW.json | 9 ++++-- lib/common/util/requestWithLog.dart | 2 +- .../device/blueteeth_bind_controller.dart | 6 ++-- .../device/body_device_controller.dart | 10 +++---- .../device/device_share_controller.dart | 10 +++---- .../device/device_share_list_controller.dart | 4 +-- .../device/device_type_controller.dart | 5 ++-- lib/controller/login/login_controller.dart | 6 ++-- .../message/message_controller.dart | 8 +++--- .../mh_controller/message_controller.dart | 2 +- lib/controller/person/person_controller.dart | 6 ++-- lib/controller/repair/repair_controller.dart | 4 +-- .../after_device_calibration_person.dart | 6 ++-- lib/pages/device_bind/device_calibration.dart | 9 ++---- .../device_bind/device_calibration_copy.dart | 8 +++--- .../device_calibration_person.dart | 6 ++-- lib/pages/device_bind/device_type.dart | 2 +- lib/pages/device_bind/device_type_list.dart | 2 +- lib/pages/main_bottom/message_page.dart | 2 +- lib/pages/mh_page/bluetooth.dart | 7 +++-- lib/pages/mh_page/device/device.dart | 24 ++++++++-------- .../mh_page/device/mht_bind_device_type.dart | 2 +- .../device/mht_device_calibration copy.dart | 6 ++-- .../device/mht_device_calibration.dart | 6 ++-- .../device/mht_device_calibration_after.dart | 8 ++---- lib/pages/mh_page/device/mht_people_info.dart | 4 +++ .../controller/mht_home_controller.dart | 4 +-- .../homepage/mht_sleep_report_page.dart | 8 ++++-- lib/pages/mh_page/homepage/new_Home_page.dart | 6 ++-- lib/pages/mh_page/message_page.dart | 10 +++---- lib/pages/mh_page/repair_list.dart | 1 - .../mh_page/user/page/mht_login_page.dart | 2 +- .../sleep_report/component/SleepCard.dart | 28 +++++++++++-------- .../component/SleepScoreWidget.dart | 27 ++++++++++++------ .../sleep_report/new_sleep_report_page.dart | 3 -- 40 files changed, 150 insertions(+), 126 deletions(-) diff --git a/assets/langs/en_US.json b/assets/langs/en_US.json index 35bf86d..16ccdf4 100644 --- a/assets/langs/en_US.json +++ b/assets/langs/en_US.json @@ -421,6 +421,7 @@ "昨日数据":"today", "次":"times", "秒":"sec", - "暂无":"none" + "暂无":"none", + "失败": "Failed" } \ No newline at end of file diff --git a/assets/langs/zh_CN.json b/assets/langs/zh_CN.json index 18c74b1..75e885b 100644 --- a/assets/langs/zh_CN.json +++ b/assets/langs/zh_CN.json @@ -435,7 +435,8 @@ "绑定流程未走完是否继续":"绑定流程未走完是否继续", "暂无":"暂无", "设备连接超时,请重试":"设备连接超时,请点击刷新重试", - "设备连接失败":"设备连接失败,请点击刷新重试" + "设备连接失败":"设备连接失败,请点击刷新重试", + "失败":"服务器内部错误,请联系管理员" diff --git a/assets/langs/zh_TW.json b/assets/langs/zh_TW.json index 17216c4..ce03537 100644 --- a/assets/langs/zh_TW.json +++ b/assets/langs/zh_TW.json @@ -420,5 +420,6 @@ "今日数据":"今日數據", "昨日数据":"昨日數據", "次":"次", - "秒":"秒" + "秒":"秒", + "失败": "失敗" } \ No newline at end of file diff --git a/assets/mhlangs/en_US.json b/assets/mhlangs/en_US.json index 8840f1e..8c21b31 100644 --- a/assets/mhlangs/en_US.json +++ b/assets/mhlangs/en_US.json @@ -174,8 +174,8 @@ "SWES 智能床": "SWES Smart Bed", "SWES 智能床垫": "SWES Smart Mattress", "标题": "Title", - "分享标题": "Share Title", - "分享内容": "Share Content", + "分享标题": "Do you want to share?", + "分享内容": "After the device is successfully bound, you can immediately share your sleep data with friends or family. Once shared, they will have permission to view this device and receive its sleep reports.", "立即分享": "Share Now", "失败": "Failed", "添加设备": "Add Device", @@ -594,5 +594,6 @@ "删除后": "After deletion", "该设备的历史数据将被清除": "The device's historical data will be deleted", "有一条新的设备分享消息": "You have a new device sharing message", - "去查看": "View now" + "去查看": "View now", + "正常值":"range:" } \ No newline at end of file diff --git a/assets/mhlangs/zh_CN.json b/assets/mhlangs/zh_CN.json index c43c5fc..f79e69a 100644 --- a/assets/mhlangs/zh_CN.json +++ b/assets/mhlangs/zh_CN.json @@ -174,8 +174,8 @@ "SWES 智能床": "SWES 智能床", "SWES 智能床垫": "SWES 智能床垫", "标题": "标题", - "分享标题": "分享标题", - "分享内容": "分享内容", + "分享标题": "是否进行分享?", + "分享内容": "设备绑定成功后,如需对朋友或家人共享我的睡眠情况,可以进行立即分享,分享成功后,对方即可享受查看该设备权限,可以收到该设备的睡眠报告。 ", "立即分享": "立即分享", "失败": "失败", "添加设备": "添加设备", @@ -590,5 +590,6 @@ "皮肤指数": "皮肤指数", "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。": "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。", "删除后": "删除后", - "该设备的历史数据将被清除": "该设备的历史数据将被清除","有一条新的设备分享消息":"有一条新的设备分享消息","去查看":"去查看" + "该设备的历史数据将被清除": "该设备的历史数据将被清除","有一条新的设备分享消息":"有一条新的设备分享消息","去查看":"去查看", + "正常值":"正常值:" } \ No newline at end of file diff --git a/assets/mhlangs/zh_TW.json b/assets/mhlangs/zh_TW.json index 415eb50..0124c31 100644 --- a/assets/mhlangs/zh_TW.json +++ b/assets/mhlangs/zh_TW.json @@ -174,8 +174,8 @@ "SWES 智能床": "SWES 智能床", "SWES 智能床垫": "SWES 智能床墊", "标题": "標題", - "分享标题": "分享標題", - "分享内容": "分享內容", + "分享标题": "是否進行分享?", + "分享內容": "設備綁定成功後,如需與朋友或家人共享我的睡眠情況,可以立即進行分享。分享成功後,對方即可擁有查看該設備的權限,並能收到該設備的睡眠報告。", "立即分享": "立即分享", "失败": "失敗", "添加设备": "添加設備", @@ -590,5 +590,8 @@ "皮肤指数": "皮膚指數", "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。": "皮膚指數透過用戶睡眠過程中的體徵資料,計算皮膚電反應,生成綜合評估指標,用於睡眠中的生理應激狀態或自主神經活動。", "删除后": "刪除後", - "该设备的历史数据将被清除": "該設備的歷史數據將被清除","有一条新的设备分享消息": "有一條新的設備分享消息","去查看": "去查看" + "该设备的历史数据将被清除": "該設備的歷史數據將被清除", + "有一条新的设备分享消息": "有一條新的設備分享消息", + "去查看": "去查看", + "正常值": "正常值:" } \ No newline at end of file diff --git a/lib/common/util/requestWithLog.dart b/lib/common/util/requestWithLog.dart index 1a05c2d..e76172b 100644 --- a/lib/common/util/requestWithLog.dart +++ b/lib/common/util/requestWithLog.dart @@ -85,7 +85,7 @@ Future requestWithLog({ return apiResponse; } else { - apiResponse = ApiResponse(code: -1, msg: "服务器.失败".tr); + apiResponse = ApiResponse(code: -1, msg: "失败".tr); onFailure?.call(apiResponse); return apiResponse; } diff --git a/lib/controller/device/blueteeth_bind_controller.dart b/lib/controller/device/blueteeth_bind_controller.dart index f69cf67..4fd3471 100644 --- a/lib/controller/device/blueteeth_bind_controller.dart +++ b/lib/controller/device/blueteeth_bind_controller.dart @@ -80,7 +80,7 @@ class BlueteethBindController extends GetControllerEx { RxMap selectWifi = {}.obs; //正在连接wifi信息 int returnPage = 0; //0返回首页 1.返回设备列表 - var shareDevice;//分享设备信息 + var shareDevice; //分享设备信息 // 安全展示 TopSlideNotification void safeShowNotification(String msg) { @@ -378,7 +378,7 @@ class BlueteethBindController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } catch (e) { EasyDartModule.logger.info("蓝牙绑定.绑定异常: $e"); @@ -430,7 +430,7 @@ class BlueteethBindController extends GetControllerEx { } apiResponse.msg = res.msg ?? apiResponse.msg; } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { diff --git a/lib/controller/device/body_device_controller.dart b/lib/controller/device/body_device_controller.dart index 987f7a1..cc0efcf 100644 --- a/lib/controller/device/body_device_controller.dart +++ b/lib/controller/device/body_device_controller.dart @@ -46,8 +46,6 @@ class BodyDeviceController extends GetControllerEx { String wifiMac = ""; - - Future getDeviceNum() async { try { ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备.设备列表请求失败".tr); @@ -80,7 +78,7 @@ class BodyDeviceController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { @@ -123,7 +121,7 @@ class BodyDeviceController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { @@ -166,7 +164,7 @@ class BodyDeviceController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { @@ -303,7 +301,7 @@ class BodyDeviceController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { diff --git a/lib/controller/device/device_share_controller.dart b/lib/controller/device/device_share_controller.dart index 08854a9..5b3b235 100644 --- a/lib/controller/device/device_share_controller.dart +++ b/lib/controller/device/device_share_controller.dart @@ -76,7 +76,7 @@ class DeviceShareController extends GetControllerEx { } return res; } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } @@ -134,12 +134,12 @@ class DeviceShareController extends GetControllerEx { updateAll(); return res; } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } catch (e) { EasyDartModule.logger.info("分享设备失败:${e.toString()}"); DailyLogUtils.writeLog("分享设备失败:${e.toString()}"); - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } @@ -186,12 +186,12 @@ class DeviceShareController extends GetControllerEx { MyUtils.formatResponse(res, "操作成功".tr, "操作失败".tr); return res; } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } catch (e) { EasyDartModule.logger.info("确认消息分享失败->$e"); DailyLogUtils.writeLog("确认消息分享失败->$e"); - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } } diff --git a/lib/controller/device/device_share_list_controller.dart b/lib/controller/device/device_share_list_controller.dart index c47cc80..e29b1a9 100644 --- a/lib/controller/device/device_share_list_controller.dart +++ b/lib/controller/device/device_share_list_controller.dart @@ -76,7 +76,7 @@ class DeviceShareListController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { @@ -122,7 +122,7 @@ class DeviceShareListController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { diff --git a/lib/controller/device/device_type_controller.dart b/lib/controller/device/device_type_controller.dart index cd6f721..95be06b 100644 --- a/lib/controller/device/device_type_controller.dart +++ b/lib/controller/device/device_type_controller.dart @@ -6,6 +6,7 @@ import 'package:ef/ef.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:vbvs_app/common/color/ServiceConstant.dart'; import 'package:vbvs_app/common/color/app_uri_status.dart'; +import 'package:vbvs_app/controller/mh_controller/mh_language_controller.dart'; import 'package:vbvs_app/controller/setting/language/language_controller.dart'; import 'package:vbvs_app/model/api_response.dart'; @@ -39,7 +40,7 @@ class DeviceTypeController extends GetControllerEx { attr = GetModel(DeviceTypeModel()).obs; } RxList deviceTypeList = [].obs; - LanguageController languageController = Get.find(); + MHLanguageController languageController = Get.find(); Future getDeviceType() async { ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败".tr); @@ -75,7 +76,7 @@ class DeviceTypeController extends GetControllerEx { } return res; } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } catch (e) { return apiResponse; diff --git a/lib/controller/login/login_controller.dart b/lib/controller/login/login_controller.dart index 660c6a6..defc3b0 100644 --- a/lib/controller/login/login_controller.dart +++ b/lib/controller/login/login_controller.dart @@ -113,7 +113,7 @@ class LoginController extends GetControllerEx { } return res; } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } @@ -174,10 +174,10 @@ class LoginController extends GetControllerEx { } return res; } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } catch (e) { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } diff --git a/lib/controller/message/message_controller.dart b/lib/controller/message/message_controller.dart index 69190b7..82a3422 100644 --- a/lib/controller/message/message_controller.dart +++ b/lib/controller/message/message_controller.dart @@ -80,7 +80,7 @@ class MessageController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { @@ -144,7 +144,7 @@ class MessageController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { @@ -191,12 +191,12 @@ class MessageController extends GetControllerEx { MyUtils.formatResponse(res, "操作成功".tr, "操作成功".tr); return res; } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } catch (e) { EasyDartModule.logger.info("更新消息已读状态->$e"); DailyLogUtils.writeLog("更新消息已读状态->$e"); - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } } diff --git a/lib/controller/mh_controller/message_controller.dart b/lib/controller/mh_controller/message_controller.dart index be556ca..e317616 100644 --- a/lib/controller/mh_controller/message_controller.dart +++ b/lib/controller/mh_controller/message_controller.dart @@ -20,7 +20,7 @@ class MhMessageModel { int? type = 1; //设备类型 1:体征消息 2.系统消息 int? body_message_read = 0; //体征消息 0:已读 1:未读 int? system_message_read = 0; //系统消息 0:已读 1:未读 - + MhMessageModel(); // 从JSON反序列化时的异常处理 diff --git a/lib/controller/person/person_controller.dart b/lib/controller/person/person_controller.dart index b8ebaf9..e516fb6 100644 --- a/lib/controller/person/person_controller.dart +++ b/lib/controller/person/person_controller.dart @@ -108,7 +108,7 @@ class PersonController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { @@ -158,7 +158,7 @@ class PersonController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { @@ -200,7 +200,7 @@ class PersonController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { diff --git a/lib/controller/repair/repair_controller.dart b/lib/controller/repair/repair_controller.dart index a400825..a3e640a 100644 --- a/lib/controller/repair/repair_controller.dart +++ b/lib/controller/repair/repair_controller.dart @@ -96,7 +96,7 @@ class RepairController extends GetControllerEx { updateAll(); return res; } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } else { apiResponse.msg = "我的.未选择图片".tr; @@ -105,7 +105,7 @@ class RepairController extends GetControllerEx { } catch (e) { EasyDartModule.logger.error("上传图片失败->$e"); DailyLogUtils.writeError("上传图片失败->$e"); - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } } } diff --git a/lib/pages/device_bind/after/after_device_calibration_person.dart b/lib/pages/device_bind/after/after_device_calibration_person.dart index 89098fe..9422738 100644 --- a/lib/pages/device_bind/after/after_device_calibration_person.dart +++ b/lib/pages/device_bind/after/after_device_calibration_person.dart @@ -762,7 +762,7 @@ class _AfterCalibrationPersonPageState failureNotifier.value = true; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); @@ -829,7 +829,7 @@ class _AfterCalibrationPersonPageState failureNotifier.value = true; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); @@ -1055,7 +1055,7 @@ class _AfterCalibrationPersonPageState deviceCalibrationController.cd.value = 10000; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); }, diff --git a/lib/pages/device_bind/device_calibration.dart b/lib/pages/device_bind/device_calibration.dart index f46aaa6..dc62db4 100644 --- a/lib/pages/device_bind/device_calibration.dart +++ b/lib/pages/device_bind/device_calibration.dart @@ -90,9 +90,6 @@ class _CalibrationPageState extends State { fontSize: 30.rpx, ), ), - - - Positioned( left: 0, child: returnIconButtomAddCallback(() { @@ -674,7 +671,7 @@ class _CalibrationPageState extends State { failureNotifier.value = true; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); @@ -741,7 +738,7 @@ class _CalibrationPageState extends State { failureNotifier.value = true; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); @@ -969,7 +966,7 @@ class _CalibrationPageState extends State { deviceCalibrationController.cd.value = 10000; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); }, diff --git a/lib/pages/device_bind/device_calibration_copy.dart b/lib/pages/device_bind/device_calibration_copy.dart index 050b779..8a76d33 100644 --- a/lib/pages/device_bind/device_calibration_copy.dart +++ b/lib/pages/device_bind/device_calibration_copy.dart @@ -681,7 +681,7 @@ class _CalibrationPageState extends State { failureNotifier.value = true; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController .currentColor.sc9, ); @@ -705,7 +705,7 @@ class _CalibrationPageState extends State { onFailure: (res) { TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); @@ -825,7 +825,7 @@ class _CalibrationPageState extends State { failureNotifier.value = true; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController .currentColor.sc9, ); @@ -849,7 +849,7 @@ class _CalibrationPageState extends State { onFailure: (res) { TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); diff --git a/lib/pages/device_bind/device_calibration_person.dart b/lib/pages/device_bind/device_calibration_person.dart index ffc4c39..042db57 100644 --- a/lib/pages/device_bind/device_calibration_person.dart +++ b/lib/pages/device_bind/device_calibration_person.dart @@ -673,7 +673,7 @@ class _CalibrationPersonPageState extends State { failureNotifier.value = true; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); @@ -740,7 +740,7 @@ class _CalibrationPersonPageState extends State { failureNotifier.value = true; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); @@ -968,7 +968,7 @@ class _CalibrationPersonPageState extends State { deviceCalibrationController.cd.value = 10000; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); }, diff --git a/lib/pages/device_bind/device_type.dart b/lib/pages/device_bind/device_type.dart index 862fbae..c0a6f64 100644 --- a/lib/pages/device_bind/device_type.dart +++ b/lib/pages/device_bind/device_type.dart @@ -38,7 +38,7 @@ class _EPageState extends State { // 延迟到 widget 构建后再执行 show TopSlideNotification.show( context, // 用当前页面 context 替代 Get.context! - text: response.msg ?? "服务器.失败".tr, + text: response.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); } diff --git a/lib/pages/device_bind/device_type_list.dart b/lib/pages/device_bind/device_type_list.dart index 4726c2e..9cbf81b 100644 --- a/lib/pages/device_bind/device_type_list.dart +++ b/lib/pages/device_bind/device_type_list.dart @@ -33,7 +33,7 @@ class _DeviceTypeListPageState extends State { WidgetsBinding.instance.addPostFrameCallback((_) { TopSlideNotification.show( context, - text: response.msg ?? "服务器.失败".tr, + text: response.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); }); diff --git a/lib/pages/main_bottom/message_page.dart b/lib/pages/main_bottom/message_page.dart index 367d897..aa8a0aa 100644 --- a/lib/pages/main_bottom/message_page.dart +++ b/lib/pages/main_bottom/message_page.dart @@ -40,7 +40,7 @@ class _MessagePageState extends State { if (response.code != HttpStatusCodes.ok) { TopSlideNotification.show( Get.context!, - text: response.msg ?? "服务器.失败".tr, + text: response.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); } diff --git a/lib/pages/mh_page/bluetooth.dart b/lib/pages/mh_page/bluetooth.dart index 32a6934..f301cea 100644 --- a/lib/pages/mh_page/bluetooth.dart +++ b/lib/pages/mh_page/bluetooth.dart @@ -9,6 +9,7 @@ import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/controller/mh_controller/device_list_controller.dart'; import 'package:vbvs_app/model/api_response.dart'; import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart'; +import 'package:vbvs_app/pages/mh_page/device/device.dart'; import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart'; import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart'; import 'dart:ui' as ui; @@ -94,7 +95,8 @@ class _BluetoothPageState extends State { alignment: Alignment.center, children: [ Text( - obsData['name']?.toString() ?? '未命名'.tr, + obsData['name']?.toString() ?? + getNameByType(obsData.value), style: TextStyle( color: Colors.white, fontSize: 40.rpx, @@ -110,7 +112,8 @@ class _BluetoothPageState extends State { 2 + _calculateTextHalfWidth( obsData['name']?.toString() ?? - '未命名'.tr) + + getNameByType( + obsData.value)) + 22.rpx, top: 5.rpx, child: ClickableContainer( diff --git a/lib/pages/mh_page/device/device.dart b/lib/pages/mh_page/device/device.dart index 09d9c43..c1aed73 100644 --- a/lib/pages/mh_page/device/device.dart +++ b/lib/pages/mh_page/device/device.dart @@ -102,8 +102,8 @@ class DeviceInfoWidget extends GetView { children: [ _buildInfoRow( '设备ID'.tr, - deviceListController - .model.deviceList[index]["mac".tr] ?? + deviceListController.model + .deviceList[index]["mac".tr] ?? '', valueColor: (deviceListController .model.deviceList[index] @@ -410,16 +410,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; - } +getNameByType(device) { + if (device['device_type'] == null) { + return '未知类型设备'.tr; + } + if (device['device_type'] == 2) { + return '智能电动床'.tr; + } + if (device['device_type'] == 3) { + return '律动智能床垫'.tr; } } diff --git a/lib/pages/mh_page/device/mht_bind_device_type.dart b/lib/pages/mh_page/device/mht_bind_device_type.dart index 6588b91..1a68ef8 100644 --- a/lib/pages/mh_page/device/mht_bind_device_type.dart +++ b/lib/pages/mh_page/device/mht_bind_device_type.dart @@ -35,7 +35,7 @@ class _MHTBindDeviceTypePageState extends State { // 延迟到 widget 构建后再执行 show TopSlideNotification.show( context, // 用当前页面 context 替代 Get.context! - text: response.msg ?? "服务器.失败".tr, + text: response.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); } diff --git a/lib/pages/mh_page/device/mht_device_calibration copy.dart b/lib/pages/mh_page/device/mht_device_calibration copy.dart index 6591320..a9c094d 100644 --- a/lib/pages/mh_page/device/mht_device_calibration copy.dart +++ b/lib/pages/mh_page/device/mht_device_calibration copy.dart @@ -671,7 +671,7 @@ class _MHTCalibrationPageCopyState extends State { failureNotifier.value = true; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); @@ -735,7 +735,7 @@ class _MHTCalibrationPageCopyState extends State { failureNotifier.value = true; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); @@ -960,7 +960,7 @@ class _MHTCalibrationPageCopyState extends State { deviceCalibrationController.cd.value = 10000; TopSlideNotification.show( context, - text: res.msg ?? "服务器.失败".tr, + text: res.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); }, diff --git a/lib/pages/mh_page/device/mht_device_calibration.dart b/lib/pages/mh_page/device/mht_device_calibration.dart index 0df2722..e1f7698 100644 --- a/lib/pages/mh_page/device/mht_device_calibration.dart +++ b/lib/pages/mh_page/device/mht_device_calibration.dart @@ -741,7 +741,7 @@ class _MHTCalibrationPageState extends State { } void _requestProgress( - String serviceAddress, String progressApi, bool isSecondStep) { + String serviceAddress, String progressApi, bool isSecondStep) { String cid = blueteethBindController.cid!.value; String progressUrl = "$serviceAddress$progressApi?id=$cid"; @@ -804,7 +804,7 @@ class _MHTCalibrationPageState extends State { } }, onFailure: (res) { - _handleCalibrationFailure(res.msg ?? "服务器.失败".tr); + _handleCalibrationFailure(res.msg ?? "失败".tr); }, ); } @@ -920,7 +920,7 @@ class _MHTCalibrationPageState extends State { _startPollingProgress(serviceAddress, progressApi, isSecondStep); }, onFailure: (res) { - _handleCalibrationFailure(res.msg ?? "服务器.失败".tr); + _handleCalibrationFailure(res.msg ?? "失败".tr); }, ); } diff --git a/lib/pages/mh_page/device/mht_device_calibration_after.dart b/lib/pages/mh_page/device/mht_device_calibration_after.dart index 597dd05..29a30fe 100644 --- a/lib/pages/mh_page/device/mht_device_calibration_after.dart +++ b/lib/pages/mh_page/device/mht_device_calibration_after.dart @@ -173,7 +173,6 @@ class _MHTCalibrationAfterPageState extends State { // ), // ), // ), - ], ), ), @@ -811,7 +810,7 @@ class _MHTCalibrationAfterPageState extends State { } }, onFailure: (res) { - _handleCalibrationFailure(res.msg ?? "服务器.失败".tr); + _handleCalibrationFailure(res.msg ?? "失败".tr); }, ); } @@ -903,8 +902,7 @@ class _MHTCalibrationAfterPageState extends State { }; if (deviceCalibrationController.bed_type.value == 1) { - data["macB"] = - widget.deviceInfo.value['bind_mac_b']; + data["macB"] = widget.deviceInfo.value['bind_mac_b']; } if (isSecondStep) { @@ -927,7 +925,7 @@ class _MHTCalibrationAfterPageState extends State { _startPollingProgress(serviceAddress, progressApi, isSecondStep); }, onFailure: (res) { - _handleCalibrationFailure(res.msg ?? "服务器.失败".tr); + _handleCalibrationFailure(res.msg ?? "失败".tr); }, ); } diff --git a/lib/pages/mh_page/device/mht_people_info.dart b/lib/pages/mh_page/device/mht_people_info.dart index 3b3d374..458a2c3 100644 --- a/lib/pages/mh_page/device/mht_people_info.dart +++ b/lib/pages/mh_page/device/mht_people_info.dart @@ -395,6 +395,7 @@ class _MHTPeopleInfoPageState extends State { () { showHeightPickerDialog( context, + title: "选择身高".tr, initialHeight: int.tryParse( peopleList[index]['height'] ?? '170') ?? @@ -461,6 +462,8 @@ class _MHTPeopleInfoPageState extends State { () { showWeightPickerDialog( context, + title: "选择体重".tr, + initialWeight: "50", onConfirm: (int selectedWeight) { setState(() { @@ -523,6 +526,7 @@ class _MHTPeopleInfoPageState extends State { const Duration(milliseconds: 250), () { showDateSelectionDialog(context, + title: "选择生日".tr, checkDate: peopleList[index] ['birthday'] is DateTime ? peopleList[index]['birthday'] diff --git a/lib/pages/mh_page/homepage/controller/mht_home_controller.dart b/lib/pages/mh_page/homepage/controller/mht_home_controller.dart index 4a1cb1f..8fa1a38 100644 --- a/lib/pages/mh_page/homepage/controller/mht_home_controller.dart +++ b/lib/pages/mh_page/homepage/controller/mht_home_controller.dart @@ -248,7 +248,7 @@ class MHTHomeController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { @@ -385,7 +385,7 @@ class MHTHomeController extends GetControllerEx { return res; } } else { - return ApiResponse(code: -1, msg: "服务器.失败".tr); + return ApiResponse(code: -1, msg: "失败".tr); } return apiResponse; } catch (e) { diff --git a/lib/pages/mh_page/homepage/mht_sleep_report_page.dart b/lib/pages/mh_page/homepage/mht_sleep_report_page.dart index d6f9ea4..13ef1f9 100644 --- a/lib/pages/mh_page/homepage/mht_sleep_report_page.dart +++ b/lib/pages/mh_page/homepage/mht_sleep_report_page.dart @@ -361,8 +361,12 @@ class _MhtSleepReportPageState extends State { "#FFFFFF"), size: 30.rpx, ), - fillColor: stringToColor( - "#184468"), + // fillColor: stringToColor( + // "#184468"), + // fillColor: stringToColor( + // "##011D33"), + fillColor: + Color(0xFF003058), elevation: 2, borderColor: Colors.transparent, diff --git a/lib/pages/mh_page/homepage/new_Home_page.dart b/lib/pages/mh_page/homepage/new_Home_page.dart index 938ec61..bbb3546 100644 --- a/lib/pages/mh_page/homepage/new_Home_page.dart +++ b/lib/pages/mh_page/homepage/new_Home_page.dart @@ -249,7 +249,7 @@ class _NewHomePageState extends State { return Row( children: [ Text( - "${weatherModelController.model.cityName ?? '未知数据'.tr}", + "${weatherModelController.model.cityName ?? '-'.tr}", style: TextStyle( color: Colors.white, fontSize: AppConstants() @@ -257,7 +257,7 @@ class _NewHomePageState extends State { ), ), Text( - "${(weatherModelController.model.current_temperature != null && weatherModelController.model.current_temperature! > 0) ? weatherModelController.model.current_temperature : '未知数据'.tr}" + + "${(weatherModelController.model.current_temperature != null && weatherModelController.model.current_temperature! > 0) ? weatherModelController.model.current_temperature : '-'.tr}" + "°C", style: TextStyle( color: Colors.white, @@ -266,7 +266,7 @@ class _NewHomePageState extends State { ), ), Text( - "${(weatherModelController.model.weather_info?.isNotEmpty ?? false) ? weatherModelController.model.weather_info : '未知数据'.tr}", + "${(weatherModelController.model.weather_info?.isNotEmpty ?? false) ? weatherModelController.model.weather_info : '-'.tr}", style: TextStyle( color: Colors.white, fontSize: AppConstants() diff --git a/lib/pages/mh_page/message_page.dart b/lib/pages/mh_page/message_page.dart index d1c9d87..cadf6cf 100644 --- a/lib/pages/mh_page/message_page.dart +++ b/lib/pages/mh_page/message_page.dart @@ -45,7 +45,7 @@ class _MessagePageState extends State { TopSlideNotification.show( // Get.context!, context, - text: response.msg ?? "服务器.失败".tr, + text: response.msg ?? "失败".tr, textColor: themeController.currentColor.sc9, ); } @@ -213,11 +213,11 @@ class _MessagePageState extends State { child: TextButton( onPressed: () async { if (messageController.model.type == 1) { - messageController.updateMessageReadStatus(context,"app_vsm", all: true); - + messageController.updateMessageReadStatus(context, "app_vsm", + all: true); } else { - messageController.updateMessageReadStatus(context,"app_system", all: true); - + messageController.updateMessageReadStatus(context, "app_system", + all: true); } }, child: Row( diff --git a/lib/pages/mh_page/repair_list.dart b/lib/pages/mh_page/repair_list.dart index 678e89d..1dc3241 100644 --- a/lib/pages/mh_page/repair_list.dart +++ b/lib/pages/mh_page/repair_list.dart @@ -110,7 +110,6 @@ class DeviceRepairPage extends GetView { "报修须知".tr, style: TextStyle( fontSize: 30.rpx, - fontWeight: FontWeight.bold, color: Colors.white, ), textAlign: TextAlign.center, diff --git a/lib/pages/mh_page/user/page/mht_login_page.dart b/lib/pages/mh_page/user/page/mht_login_page.dart index 9212b0d..70f0251 100644 --- a/lib/pages/mh_page/user/page/mht_login_page.dart +++ b/lib/pages/mh_page/user/page/mht_login_page.dart @@ -1798,7 +1798,7 @@ class MHTLoginPage extends GetView { true) { TopSlideNotification.show( context, - text: "登录页.未同意协议".tr, + text: "需要同意协议".tr, textColor: themeController.currentColor.sc9, ); diff --git a/lib/pages/sleep_report/component/SleepCard.dart b/lib/pages/sleep_report/component/SleepCard.dart index 4395bc2..b9cd549 100644 --- a/lib/pages/sleep_report/component/SleepCard.dart +++ b/lib/pages/sleep_report/component/SleepCard.dart @@ -4,6 +4,7 @@ import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/component/home_page/SleepDataModuleWidget.dart'; import 'package:EasyDartModule/EasyDartModule.dart' as es; +import 'package:vbvs_app/language/AppLanguage.dart'; class SleepCard extends StatefulWidget { final dynamic sleepReport; @@ -30,9 +31,10 @@ class _SleepCardState extends State with TickerProviderStateMixin { _shouldAnimate = true; _initAnimation(); } - + WidgetsBinding.instance.addPostFrameCallback((_) { - if (widget.highlightItem != null && _highlightKey.currentContext != null) { + if (widget.highlightItem != null && + _highlightKey.currentContext != null) { Scrollable.ensureVisible( _highlightKey.currentContext!, duration: Duration(milliseconds: 500), @@ -67,7 +69,7 @@ class _SleepCardState extends State with TickerProviderStateMixin { } } }); - + _animationController!.forward(); } @@ -85,7 +87,8 @@ class _SleepCardState extends State with TickerProviderStateMixin { widget.sleepReport.isEmpty) { return Container(); } - + String lcode = mhLanguageController.selectLanguage.value!.language_code!; + int num = AppLanguage().isChinese() ? 3 : 2; List data = widget.sleepReport['bs'] ?? []; return Container( @@ -104,11 +107,10 @@ class _SleepCardState extends State with TickerProviderStateMixin { children: List.generate(data.length, (index) { final item = data[index]; item['showTip'] = true; - final bool isHighlighted = _shouldAnimate && - item['id'] == _highlightedId; - + final bool isHighlighted = + _shouldAnimate && item['id'] == _highlightedId; return SizedBox( - width: (MediaQuery.of(context).size.width - 160.rpx) / 3, + width: (MediaQuery.of(context).size.width - 160.rpx) / num, child: AnimatedBuilder( animation: _animationController ?? AlwaysStoppedAnimation(0), builder: (context, child) { @@ -118,13 +120,17 @@ class _SleepCardState extends State with TickerProviderStateMixin { ? BoxDecoration( border: Border.all( color: themeController.currentColor.sc2 - .withOpacity(_animationController?.value ?? 0), + .withOpacity( + _animationController?.value ?? 0), width: 1.rpx, ), borderRadius: BorderRadius.circular(8), ) : null, - child: SleepDataModuleWidget(data: item,sleepReportData: widget.sleepReport,), + child: SleepDataModuleWidget( + data: item, + sleepReportData: widget.sleepReport, + ), ); }, ), @@ -138,4 +144,4 @@ class _SleepCardState extends State with TickerProviderStateMixin { return Container(); } } -} \ No newline at end of file +} diff --git a/lib/pages/sleep_report/component/SleepScoreWidget.dart b/lib/pages/sleep_report/component/SleepScoreWidget.dart index 3177be0..5b3ae69 100644 --- a/lib/pages/sleep_report/component/SleepScoreWidget.dart +++ b/lib/pages/sleep_report/component/SleepScoreWidget.dart @@ -148,12 +148,24 @@ class _SleepScoreWidgetState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - "睡眠评分".tr, - style: TextStyle( - color: stringToColor("#FFFFFF"), + // Text( + // "睡眠评分".tr, + // style: TextStyle( + // color: stringToColor("#FFFFFF"), + // fontSize: + // AppConstants().normal_text_fontSize), + // ), + Padding( + padding: EdgeInsets.only( + top: 12.rpx), // 👈 向下偏移的关键 + child: Text( + "睡眠评分".tr, + style: TextStyle( + color: Colors.white, fontSize: - AppConstants().normal_text_fontSize), + AppConstants().normal_text_fontSize, + ), + ), ), Text( '${widget.sleepReport['score']?['score']}', @@ -172,10 +184,7 @@ class _SleepScoreWidgetState extends State { ), ) ], - ) - - - ), + )), SizedBox(height: 50.rpx), Wrap( spacing: 32.rpx, diff --git a/lib/pages/sleep_report/new_sleep_report_page.dart b/lib/pages/sleep_report/new_sleep_report_page.dart index 0ad5ce5..a415323 100644 --- a/lib/pages/sleep_report/new_sleep_report_page.dart +++ b/lib/pages/sleep_report/new_sleep_report_page.dart @@ -93,9 +93,6 @@ class _NewSleepReportPageState extends State { if (MainPageBBottomChange.getCurrentIndex() == 1) { TopSlideNotification.show(context, text: res.msg!, textColor: themeController.currentColor.sc9); - } else { - TopSlideNotification.show(context, - text: res.msg!, textColor: themeController.currentColor.sc9); } } catch (_) {} sleepReportController.sleepReport.value = {};