From 0db455258ad92225954657c6546e467e590dee21 Mon Sep 17 00:00:00 2001 From: czz <862977248@qq.com> Date: Fri, 8 Aug 2025 18:16:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E7=BB=91=E5=90=8E=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=89=80=E5=88=86=E4=BA=AB=E4=BA=BA=E5=91=98=20=20=E6=97=A5?= =?UTF-8?q?=E6=8A=A5=E5=91=A8=E6=8A=A5=E6=9C=88=E6=8A=A5=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E7=82=B9=E5=87=BB=E8=8C=83=E5=9B=B4=20=20?= =?UTF-8?q?=E6=B3=A8=E9=94=80=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/mhlangs/en_US.json | 9 +- assets/mhlangs/zh_CN.json | 18 ++- assets/mhlangs/zh_TW.json | 7 +- lib/common/color/ServiceConstant.dart | 9 +- .../mh_controller/device_list_controller.dart | 4 +- lib/controller/user_info_controller.dart | 27 ++++ lib/main.dart | 127 ++++++++++++++++-- lib/pages/common/selectDialog.dart | 53 ++++++-- .../device_bind/componnet/bind_dialog.dart | 79 ++++++++++- .../mh_page/ShareDeviceDetailWidget.dart | 1 + lib/pages/mh_page/delete_account.dart | 66 +++++---- .../user/controller/mht_login_controller.dart | 20 ++- .../chart/HorizontalBarChart.dart | 7 +- .../component/AIAdviceWidget.dart | 2 +- .../component/BreathePauseNewWidget.dart | 2 +- .../component/BreatheStandardWidget.dart | 2 +- .../component/CompareSleepWidget.dart | 2 +- .../component/DiseasePercentsWidget.dart | 2 +- .../component/HeartChangeWidget.dart | 18 ++- .../component/HeartHealthWidget.dart | 2 +- .../component/HeartPointWidget.dart | 2 +- .../component/HeartRateStandardWidget.dart | 2 +- .../component/MonthDataWidget.dart | 2 +- .../component/SkinPercentWidget.dart | 2 +- .../component/SleepChartWidget.dart | 7 +- .../sleep_report/component/SleepView.dart | 2 +- .../component/SnoreViewWidget.dart | 2 +- .../component/TrendDataTablePage.dart | 8 +- .../component/TrendDataTextPage.dart | 2 +- .../component/WeekDataWidget.dart | 2 +- .../component/ZiZhuShenJingPercentWidget.dart | 2 +- 31 files changed, 398 insertions(+), 92 deletions(-) diff --git a/assets/mhlangs/en_US.json b/assets/mhlangs/en_US.json index c4881b0..45f4b5f 100644 --- a/assets/mhlangs/en_US.json +++ b/assets/mhlangs/en_US.json @@ -597,6 +597,11 @@ "去查看": "View now", "正常值": "range:", "绑定设备": "Bind Device", - "设备分享提醒": "Device Sharing Alert","生命体征":"Vital signs", - "无报告":"none" + "设备分享提醒": "Device Sharing Alert", + "生命体征": "Vital signs", + "无报告": "none", + "注销账号成功": "Account deleted successfully", + "注销账号失败": "Failed to delete account", + "是否确认注销?": "Are you sure you want to delete your account?", + "设备已被用户解绑,将取消当前分享!": "The device has been unbound by the user, and the current sharing will be cancelled!","设备解绑提醒": "Device Unbind Reminder" } \ No newline at end of file diff --git a/assets/mhlangs/zh_CN.json b/assets/mhlangs/zh_CN.json index cedc439..3641f84 100644 --- a/assets/mhlangs/zh_CN.json +++ b/assets/mhlangs/zh_CN.json @@ -590,9 +590,17 @@ "皮肤指数": "皮肤指数", "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。": "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。", "删除后": "删除后", - "该设备的历史数据将被清除": "该设备的历史数据将被清除","有一条新的设备分享消息":"有一条新的设备分享消息","去查看":"去查看", - "正常值":"正常值:", - "绑定设备":"绑定设备", - "设备分享提醒":"设备分享提醒","生命体征":"生命体征", - "无报告":"无报告" + "该设备的历史数据将被清除": "该设备的历史数据将被清除", + "有一条新的设备分享消息": "有一条新的设备分享消息", + "去查看": "去查看", + "正常值": "正常值:", + "绑定设备": "绑定设备", + "设备分享提醒": "设备分享提醒", + "生命体征": "生命体征", + "无报告": "无报告", + "注销账号成功": "注销账号成功", + "注销账号失败": "注销账号失败", + "是否确认注销?": "是否确认注销?", + "设备已被用户解绑,将取消当前分享!": "设备已被用户解绑,将取消当前分享!", + "设备解绑提醒": "设备解绑提醒" } \ No newline at end of file diff --git a/assets/mhlangs/zh_TW.json b/assets/mhlangs/zh_TW.json index b43d174..6bd8eb7 100644 --- a/assets/mhlangs/zh_TW.json +++ b/assets/mhlangs/zh_TW.json @@ -597,5 +597,10 @@ "绑定设备": "绑定设备", "设备分享提醒": "設備分享提醒", "生命体征": "生命體徵", - "无报告":"无报告" + "无报告": "无报告", + "注销账号成功": "註銷帳號成功", + "注销账号失败": "註銷帳號失敗", + "是否确认注销?": "是否確認註銷?", + "设备已被用户解绑,将取消当前分享!": "設備已被用戶解綁,將取消當前分享!", + "设备解绑提醒": "設備解绑提醒" } \ No newline at end of file diff --git a/lib/common/color/ServiceConstant.dart b/lib/common/color/ServiceConstant.dart index 07e3c64..c06f025 100644 --- a/lib/common/color/ServiceConstant.dart +++ b/lib/common/color/ServiceConstant.dart @@ -1,15 +1,16 @@ class ServiceConstant { // static const String baseHost = "zhmht.swes.com.cn:27021"; //服务地址 眠花糖测试地址 - static const String baseHost = "zhmht.swes.com.cn:27020"; //服务地址 眠花糖正式地址 - // static const String baseHost = "vsbs-test.he-info.cn"; //服务地址 本地测试地址 + // static const String baseHost = "zhmht.swes.com.cn:27020"; //服务地址 眠花糖正式地址 + static const String baseHost = "vsbs-test.he-info.cn"; //服务地址 本地测试地址 // static const String baseHost = "vsbst-api.he-info.cn";//服务地址 - // static const String service_address = "http://$baseHost"; - static const String service_address = "https://$baseHost"; + static const String service_address = "http://$baseHost"; + // static const String service_address = "https://$baseHost"; static String server_service = "/vsbs_app_server"; //服务名称 static String send_code = "/api/verifycode/send"; //发送验证码 static String login = "/api/user/login"; //登录 + static String delete_account = "/api/user/logout"; static String get_bluetooth_device_status = "/api/device/status/info"; //设备绑定状态 static String device_bind = "/api/device/bind"; //设备绑定 diff --git a/lib/controller/mh_controller/device_list_controller.dart b/lib/controller/mh_controller/device_list_controller.dart index 22ff648..d16d710 100644 --- a/lib/controller/mh_controller/device_list_controller.dart +++ b/lib/controller/mh_controller/device_list_controller.dart @@ -50,8 +50,7 @@ class DeviceListController extends GetControllerEx { String serviceName = ServiceConstant.server_service; String serviceApi = ServiceConstant.device_list; String queryUrl = "${serviceAddress}${serviceName}${serviceApi}$search"; - var response = await EasyDartModule.dio - .get(queryUrl); + var response = await EasyDartModule.dio.get(queryUrl); if (response != null) { var responseData = response.data is String ? jsonDecode(response.data) : response.data; @@ -154,6 +153,7 @@ class DeviceListController extends GetControllerEx { onSuccess: (res) { TopSlideNotification.show(context, text: res.msg!, textColor: Color(0XFF00C1AA)); + Get.back(); }, onFailure: (err) { TopSlideNotification.show(context, diff --git a/lib/controller/user_info_controller.dart b/lib/controller/user_info_controller.dart index e753fd7..3fb397c 100644 --- a/lib/controller/user_info_controller.dart +++ b/lib/controller/user_info_controller.dart @@ -249,4 +249,31 @@ class UserInfoController extends GetControllerEx { mhtHomeController.personnelList.value = []; return apiResponse; } + ApiResponse deleteAccount() { + MHTHomeController mhtHomeController = Get.find(); + ApiResponse apiResponse = ApiResponse(code: 1, msg: "注销成功".tr); + EasyDartModule.logger.info("注销账号"); + DailyLogUtils.writeLog("注销账号"); + + model.login = 0; + EasyDartModule.dio.token = null; + final box = GetStorage(); + box.remove("user"); + box.remove("token"); + BodyDeviceController bodyDeviceController = Get.find(); + bodyDeviceController.bindDeviceNum.value = 0; + HomeController homeController = Get.find(); + homeController.sleepNum.value = 0; + LoginController loginController = Get.find(); + loginController.model.register_agree = null; + bodyDeviceController.sleepReportData.value = {}; + MessageController messageController = Get.find(); + messageController.model.body_message_read = 0; + messageController.model.system_message_read = 0; + CountdownController countdownController = Get.find(); + countdownController.countdown.value = 0; + mhtHomeController.personnelList.value = []; + + return apiResponse; + } } diff --git a/lib/main.dart b/lib/main.dart index 7535131..f1e8380 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -183,15 +183,105 @@ Timer? _messageTimer; // } // }); // } -void startMessagePolling(int ent_type) { +Future startMessagePolling(int ent_type) async { Get.put(MhMessageController()); MhMessageController messageController = Get.find(); final Set _poppedMessageIds = {}; // 本地已弹窗的消息 ID(无论是否已读成功) final Set _readMessageIds = {}; + final controller = Get.find(); _messageTimer?.cancel(); if (ent_type == APPPackageType.MHT.code) { if (Get.isRegistered()) { Get.find().getMessageStatus(); + await controller.getMessageStatus(); + + if (controller.model.system_message_read == 1) { + await controller.getMessageList("app_system"); + + final unhandledShareMessages = + controller.systemMessageList.where((item) { + final data = item['data']; + final id = item['_id']?.toString(); + return data is Map && + data['type'] == 'share' && + id != null && + !_poppedMessageIds.contains(id) && + (item['read_time'] == null); + }).toList(); + + // if (unhandledShareMessages.isNotEmpty) { + // for (final message in unhandledShareMessages) { + // final messageId = message['_id']?.toString(); + // if (messageId == null || _poppedMessageIds.contains(messageId)) + // continue; + + // // 新增:如果当前页面是消息页,则跳过弹窗 + // if (Get.currentRoute == '/messagePage') { + // continue; + // } + + // _poppedMessageIds.add(messageId); + + // try { + // await controller.updateMessageReadStatus(Get.context!, messageId); + // } catch (e) { + // print("标记消息 $messageId 为已读失败: $e"); + // } + + // final result = await showMessageConfirmDialog(title: '设备分享提醒'.tr); + // if (result == 'confirm') { + // Get.toNamed('/messageDetail', arguments: message); + // } + // } + // } + if (unhandledShareMessages.isNotEmpty) { + for (final message in unhandledShareMessages) { + final messageId = message['_id']?.toString(); + + if (messageId == null || _poppedMessageIds.contains(messageId)) + continue; + + // 新增:如果当前页面是消息页,则跳过弹窗 + if (Get.currentRoute == '/messagePage') { + continue; + } + + final data = message['data'] as Map; + final valList = data['val'] as List; + final messageType = data['type']; + + // Extract device ID + final deviceIdEntry = valList.firstWhere( + (item) => item['k'] == '设备ID', + orElse: () => null, + ); + final mac = deviceIdEntry?['v'] as String?; + _poppedMessageIds.add(messageId); + + try { + await controller.updateMessageReadStatus( + Get.context!, message['type'], + mid: messageId); + } catch (e) { + print("标记消息 $messageId 为已读失败: $e"); + } + + String dialogTitle; + String msg; + if (messageType == 'share') { + dialogTitle = '设备分享提醒'.tr; // "Device Sharing Notification" + final result = await showMessageConfirmDialog(title: dialogTitle); + + if (result == 'confirm') { + Get.toNamed('/messageDetail', arguments: message); + } + } else { + dialogTitle = '设备解绑提醒'.tr; + showUnShareMessageDialog(title: dialogTitle, mac: mac!); + } + } + } + } } } else { if (Get.isRegistered()) { @@ -203,18 +293,16 @@ void startMessagePolling(int ent_type) { try { if (ent_type == APPPackageType.MHT.code) { if (Get.isRegistered()) { - final controller = Get.find(); await controller.getMessageStatus(); if (controller.model.system_message_read == 1) { await controller.getMessageList("app_system"); - final unhandledShareMessages = controller.systemMessageList.where((item) { final data = item['data']; final id = item['_id']?.toString(); return data is Map && - data['type'] == 'share' && + (data['type'] == 'share' || data['type'] == 'unShare') && id != null && !_poppedMessageIds.contains(id) && (item['read_time'] == null); @@ -223,6 +311,7 @@ void startMessagePolling(int ent_type) { if (unhandledShareMessages.isNotEmpty) { for (final message in unhandledShareMessages) { final messageId = message['_id']?.toString(); + if (messageId == null || _poppedMessageIds.contains(messageId)) continue; @@ -231,19 +320,39 @@ void startMessagePolling(int ent_type) { continue; } + final data = message['data'] as Map; + final valList = data['val'] as List; + final messageType = data['type']; + + // Extract device ID + final deviceIdEntry = valList.firstWhere( + (item) => item['k'] == '设备ID', + orElse: () => null, + ); + final mac = deviceIdEntry?['v'] as String?; _poppedMessageIds.add(messageId); try { await controller.updateMessageReadStatus( - Get.context!, messageId); + Get.context!, message['type'], + mid: messageId); } catch (e) { print("标记消息 $messageId 为已读失败: $e"); } - final result = - await showMessageConfirmDialog(title: '设备分享提醒'.tr); - if (result == 'confirm') { - Get.toNamed('/messageDetail', arguments: message); + String dialogTitle; + String msg; + if (messageType == 'share') { + dialogTitle = '设备分享提醒'.tr; // "Device Sharing Notification" + final result = + await showMessageConfirmDialog(title: dialogTitle); + + if (result == 'confirm') { + Get.toNamed('/messageDetail', arguments: message); + } + } else { + dialogTitle = '设备解绑提醒'.tr; + showUnShareMessageDialog(title: dialogTitle, mac: mac!); } } } diff --git a/lib/pages/common/selectDialog.dart b/lib/pages/common/selectDialog.dart index 8ccbe7d..70873bf 100644 --- a/lib/pages/common/selectDialog.dart +++ b/lib/pages/common/selectDialog.dart @@ -8,6 +8,7 @@ import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/component/base/SleepCalendarWidget.dart'; import 'package:vbvs_app/component/tool/ClickableContainer.dart'; +import 'package:vbvs_app/component/tool/CustomCard.dart'; import 'package:vbvs_app/controller/device/device_calibration_controller.dart'; import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; @@ -110,8 +111,6 @@ Widget getOnePickers( }); } - - Future showDateSelectionDialog(BuildContext context, {required DateTime checkDate, Function? checkChange, @@ -1232,22 +1231,52 @@ Future showCustomConfirmDialog(BuildContext context, String name, Container( margin: EdgeInsets.only(top: 50.rpx, bottom: 40.rpx), alignment: Alignment.center, - child: InkWell( + // child: InkWell( + // onTap: () { + // Get.back(result: "confirm"); + // }, + // child: Container( + // width: 260.rpx, + // height: 60.rpx, + // alignment: Alignment.center, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(6), + // color: stringToColor("#D3B684")), + // child: Text( + // '$btnName', + // style: TextStyle( + // color: themeController.currentColor.sc3, + // fontSize: 30.rpx), + // ), + // ), + // ), + child: CustomCard( + borderRadius: AppConstants().button_container_radius, onTap: () { Get.back(result: "confirm"); }, + colors: [ + Color(0xFF1592AA), + Color(0xFF0C83A7), + Color(0xFF006FA3) + ], child: Container( width: 260.rpx, height: 60.rpx, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), - color: stringToColor("#D3B684")), - child: Text( - '$btnName', - style: TextStyle( - color: themeController.currentColor.sc3, - fontSize: 30.rpx), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "确定".tr, + style: TextStyle( + color: themeController.currentColor.sc3, + fontFamily: 'Inter', + fontSize: AppConstants().normal_text_fontSize, + letterSpacing: 0.0, + ), + ), + ].divide(SizedBox(width: 17.rpx)), ), ), ), diff --git a/lib/pages/device_bind/componnet/bind_dialog.dart b/lib/pages/device_bind/componnet/bind_dialog.dart index fd6cafb..be0f15c 100644 --- a/lib/pages/device_bind/componnet/bind_dialog.dart +++ b/lib/pages/device_bind/componnet/bind_dialog.dart @@ -1499,7 +1499,8 @@ Future showMessageConfirmDialog({ children: [ TextSpan( text: '有一条新的设备分享消息'.tr, - style: TextStyle(color: Colors.red, fontSize: 26.rpx)), + style: + TextStyle(color: Colors.black, fontSize: 26.rpx)), ], ), ), @@ -1558,3 +1559,79 @@ Future showMessageConfirmDialog({ barrierDismissible: true, ); } + +Future showUnShareMessageDialog({ + required String title, + required String mac, +}) async { + return await Get.dialog( + FrostedDialog( + blurSigma: 3.0, + child: Container( + width: 520.rpx, + height: 460.rpx, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20.0), + ), + child: Padding( + padding: EdgeInsets.only( + left: 45.rpx, right: 45.rpx, top: 90.rpx, bottom: 60.rpx), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + title, + style: TextStyle(fontSize: 30.rpx, color: Colors.black), + ), + const SizedBox(height: 12), + RichText( + textAlign: TextAlign.center, + text: TextSpan( + style: TextStyle(fontSize: 26.rpx, color: Colors.black87), + children: [ + TextSpan( + text: mac, + style: TextStyle(color: Colors.blue, fontSize: 26.rpx)), + TextSpan( + text: " " + '设备已被用户解绑,将取消当前分享!'.tr, + style: + TextStyle(color: Colors.black, fontSize: 26.rpx)), + ], + ), + ), + const SizedBox(height: 24), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CustomCard( + borderRadius: 16.rpx, + onTap: () { + Get.back(result: 'confirm'); + }, + colors: [ + Color(0xFF1592AA), + Color(0XFF0C83A7), + Color(0XFF006FA3) + ], + child: Container( + width: 200.rpx, + height: 90.rpx, + alignment: Alignment.center, + child: Text( + '确定'.tr, + style: TextStyle(fontSize: 26.rpx, color: Colors.white), + ), + ), + ) + ], + ) + ], + ), + ), + ), + ), + barrierDismissible: true, + ); +} diff --git a/lib/pages/mh_page/ShareDeviceDetailWidget.dart b/lib/pages/mh_page/ShareDeviceDetailWidget.dart index f5816fc..da6ac88 100644 --- a/lib/pages/mh_page/ShareDeviceDetailWidget.dart +++ b/lib/pages/mh_page/ShareDeviceDetailWidget.dart @@ -428,6 +428,7 @@ class ShareDeviceDetailWidget extends GetView { data['info'][5]['uid'], data['mac'.tr], context); + }, colors: const [ Color(0xFFFCFCFC), diff --git a/lib/pages/mh_page/delete_account.dart b/lib/pages/mh_page/delete_account.dart index 1c60bc0..5d74b0a 100644 --- a/lib/pages/mh_page/delete_account.dart +++ b/lib/pages/mh_page/delete_account.dart @@ -13,6 +13,7 @@ import 'package:vbvs_app/controller/login/login_controller.dart'; import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; import 'package:vbvs_app/controller/user_info_controller.dart'; import 'package:vbvs_app/pages/common/selectDialog.dart'; +import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart'; class DeletedAccountPage extends GetView { BoxConstraints? bodysize; @@ -262,33 +263,44 @@ class DeletedAccountPage extends GetView { ), child: FFButtonWidget( onPressed: () async { - TopSlideNotification.show( - context, - text: "待开发功能".tr, - ); - // showCustomConfirmDialog(context, "是否确认注销?") - // .then((v) async { - // if (v != "confirm") { - // return; - // } - // LoginController loginController = Get.find(); - // UserInfoController userInfoController = - // Get.find(); - // var code = await loginController.deletedAccount(); - // if (code != null && code == 1) { - // final box = GetStorage(); - // box.remove('user'); - // box.remove('token'); - // userInfoController.model.token = null; - // userInfoController.model.user = null; - // userInfoController.model.login = 0; - // userInfoController.model.message = 0; - // GlobalController globalController = - // Get.find(); - // globalController.resetParmAll(); - // Get.offAllNamed("/loginPage"); - // } - // }); + // TopSlideNotification.show( + // context, + // text: "待开发功能".tr, + // ); + showCustomConfirmDialog(context, "是否确认注销?".tr) + .then((v) async { + if (v != "confirm") { + return; + } + MHTLoginController loginController = Get.find(); + UserInfoController userInfoController = + Get.find(); + int code = await loginController.deletedAccount(); + if (code == 1) { + userInfoController.logOut(); + Get.offAllNamed("/mianPageBottomChange"); + TopSlideNotification.show(context, + text: "注销账号成功".tr, + textColor: themeController.currentColor.sc2); + } else { + TopSlideNotification.show(context, + text: "注销账号失败".tr, + textColor: themeController.currentColor.sc9); + } + + // if (code != null && code == 1) { + // final box = GetStorage(); + // box.remove('user'); + // box.remove('token'); + // userInfoController.model.token = null; + // userInfoController.model.user = null; + // userInfoController.model.login = 0; + // userInfoController.model.message = 0; + // GlobalController globalController = + // Get.find(); + // globalController.resetParmAll(); + // } + }); }, text: '注销账号'.tr, options: FFButtonOptions( diff --git a/lib/pages/mh_page/user/controller/mht_login_controller.dart b/lib/pages/mh_page/user/controller/mht_login_controller.dart index 59557bf..d1435eb 100644 --- a/lib/pages/mh_page/user/controller/mht_login_controller.dart +++ b/lib/pages/mh_page/user/controller/mht_login_controller.dart @@ -300,8 +300,24 @@ class MHTLoginController extends GetControllerEx { } //注销账号 - deletedAccount() async { - // return await repository.deletedAccount(); + Future deletedAccount() async { + String serviceAddress = ServiceConstant.service_address; + String serviceName = ServiceConstant.server_service; + String serviceApi = ServiceConstant.delete_account; + String queryUrl = "${serviceAddress}${serviceName}${serviceApi}"; + int code = 0; + requestWithLog( + logTitle: "注销账号", + method: MyHttpMethod.put, + queryUrl: queryUrl, + onSuccess: (res) { + code = res.code!; + }, + onFailure: (res) { + code = res.code!; + }, + ); + return code; } Future openWeChatCustomerService(BuildContext context) async { diff --git a/lib/pages/sleep_report/chart/HorizontalBarChart.dart b/lib/pages/sleep_report/chart/HorizontalBarChart.dart index a36ba1c..f47fa0d 100644 --- a/lib/pages/sleep_report/chart/HorizontalBarChart.dart +++ b/lib/pages/sleep_report/chart/HorizontalBarChart.dart @@ -151,12 +151,11 @@ class LabelWithSvg extends StatelessWidget { Container( child: Text( explain, - style: TextStyle( - fontSize: 26.rpx, - color: themeController.currentColor.sc3, - ), + style: TextStyle(fontSize: 26.rpx, color: Colors.black), ), ), + backgroundColor: Color(0xFFFFFFFF), + colors: [Color(0XFF1592AA), Color(0xFF0C83A7), Color(0xFF006FA3)], ); }, child: SizedBox( diff --git a/lib/pages/sleep_report/component/AIAdviceWidget.dart b/lib/pages/sleep_report/component/AIAdviceWidget.dart index 747f050..a15feb9 100644 --- a/lib/pages/sleep_report/component/AIAdviceWidget.dart +++ b/lib/pages/sleep_report/component/AIAdviceWidget.dart @@ -70,7 +70,7 @@ class _AIAdviceWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx),// borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/BreathePauseNewWidget.dart b/lib/pages/sleep_report/component/BreathePauseNewWidget.dart index c278353..bc6c0a5 100644 --- a/lib/pages/sleep_report/component/BreathePauseNewWidget.dart +++ b/lib/pages/sleep_report/component/BreathePauseNewWidget.dart @@ -90,7 +90,7 @@ class _SnoreViewWidgetWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx), // borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/BreatheStandardWidget.dart b/lib/pages/sleep_report/component/BreatheStandardWidget.dart index 128f1fc..0129ae9 100644 --- a/lib/pages/sleep_report/component/BreatheStandardWidget.dart +++ b/lib/pages/sleep_report/component/BreatheStandardWidget.dart @@ -132,7 +132,7 @@ class _BreatheStandardWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx), // borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/CompareSleepWidget.dart b/lib/pages/sleep_report/component/CompareSleepWidget.dart index abeb6cd..0cd6b83 100644 --- a/lib/pages/sleep_report/component/CompareSleepWidget.dart +++ b/lib/pages/sleep_report/component/CompareSleepWidget.dart @@ -80,7 +80,7 @@ class _CompareSleepWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx),// borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/DiseasePercentsWidget.dart b/lib/pages/sleep_report/component/DiseasePercentsWidget.dart index dcb2198..b11c852 100644 --- a/lib/pages/sleep_report/component/DiseasePercentsWidget.dart +++ b/lib/pages/sleep_report/component/DiseasePercentsWidget.dart @@ -70,7 +70,7 @@ class _DiseasePercentsWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx), // borderRadius: 0.rpx, // 圆形点击区域 onTap: () { // 你的点击逻辑 diff --git a/lib/pages/sleep_report/component/HeartChangeWidget.dart b/lib/pages/sleep_report/component/HeartChangeWidget.dart index 0be7459..3f3f3ba 100644 --- a/lib/pages/sleep_report/component/HeartChangeWidget.dart +++ b/lib/pages/sleep_report/component/HeartChangeWidget.dart @@ -72,7 +72,7 @@ class _HeartChangeWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx), // borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( @@ -80,14 +80,15 @@ class _HeartChangeWidgetState extends State { Container( child: Text( // "心率变异性(HRV)介绍".tr, - "心率变异性(HRV)是指心脏每次跳动间隔时间的差异程度,反映自主神经系统(交感神经和副交感神经)对心脏的调节能力,是评估心血管健康和压力状态的重要指标。".tr, + "心率变异性(HRV)是指心脏每次跳动间隔时间的差异程度,反映自主神经系统(交感神经和副交感神经)对心脏的调节能力,是评估心血管健康和压力状态的重要指标。" + .tr, style: TextStyle( fontSize: 26.rpx, - color: Colors.black, + color: Colors.black, ), ), ), - backgroundColor: Color(0xFFFFFFFF), + backgroundColor: Color(0xFFFFFFFF), colors: [ Color(0XFF1592AA), Color(0xFF0C83A7), @@ -182,11 +183,16 @@ class _HeartChangeWidgetState extends State { '${data['desc']}', style: TextStyle( fontSize: 26.rpx, - color: - themeController.currentColor.sc3, + color: Colors.black, ), ), ), + backgroundColor: Color(0xFFFFFFFF), + colors: [ + Color(0XFF1592AA), + Color(0xFF0C83A7), + Color(0xFF006FA3) + ], ); }, child: SizedBox( diff --git a/lib/pages/sleep_report/component/HeartHealthWidget.dart b/lib/pages/sleep_report/component/HeartHealthWidget.dart index f5250ad..e0069c4 100644 --- a/lib/pages/sleep_report/component/HeartHealthWidget.dart +++ b/lib/pages/sleep_report/component/HeartHealthWidget.dart @@ -72,7 +72,7 @@ class _HeartHealthWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx),// borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/HeartPointWidget.dart b/lib/pages/sleep_report/component/HeartPointWidget.dart index 774983b..7a03a34 100644 --- a/lib/pages/sleep_report/component/HeartPointWidget.dart +++ b/lib/pages/sleep_report/component/HeartPointWidget.dart @@ -89,7 +89,7 @@ class _HeartPointWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx),// borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/HeartRateStandardWidget.dart b/lib/pages/sleep_report/component/HeartRateStandardWidget.dart index 30966a0..0dbe37e 100644 --- a/lib/pages/sleep_report/component/HeartRateStandardWidget.dart +++ b/lib/pages/sleep_report/component/HeartRateStandardWidget.dart @@ -132,7 +132,7 @@ class _HeartRateStandardWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx),// borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/MonthDataWidget.dart b/lib/pages/sleep_report/component/MonthDataWidget.dart index 22fc197..bcfe0ce 100644 --- a/lib/pages/sleep_report/component/MonthDataWidget.dart +++ b/lib/pages/sleep_report/component/MonthDataWidget.dart @@ -528,7 +528,7 @@ Widget MonthDataWidget( Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text("MAC号:${data['mac']}", + Text("MAC:${data['mac']}", style: TextStyle( color: Color(0xFFD3D3D3).withOpacity(0.2), fontSize: 18.rpx)) ], diff --git a/lib/pages/sleep_report/component/SkinPercentWidget.dart b/lib/pages/sleep_report/component/SkinPercentWidget.dart index 434f331..d71bed7 100644 --- a/lib/pages/sleep_report/component/SkinPercentWidget.dart +++ b/lib/pages/sleep_report/component/SkinPercentWidget.dart @@ -88,7 +88,7 @@ class _SkinPercentWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx), // borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/SleepChartWidget.dart b/lib/pages/sleep_report/component/SleepChartWidget.dart index 7ee1456..d1198c2 100644 --- a/lib/pages/sleep_report/component/SleepChartWidget.dart +++ b/lib/pages/sleep_report/component/SleepChartWidget.dart @@ -47,7 +47,12 @@ class SleepChartContainer extends StatelessWidget { fontSize: 30.rpx, ), ), - GestureDetector( + ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 + padding: EdgeInsetsDirectional.fromSTEB( + 14.rpx, 10.rpx, 14.rpx, 10.rpx), // + borderRadius: 0.rpx, onTap: () { showTipDialog( context, diff --git a/lib/pages/sleep_report/component/SleepView.dart b/lib/pages/sleep_report/component/SleepView.dart index 2b26500..2dcfcbe 100644 --- a/lib/pages/sleep_report/component/SleepView.dart +++ b/lib/pages/sleep_report/component/SleepView.dart @@ -91,7 +91,7 @@ class _SleepViewWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx),// borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/SnoreViewWidget.dart b/lib/pages/sleep_report/component/SnoreViewWidget.dart index 7939b9f..78d2ea3 100644 --- a/lib/pages/sleep_report/component/SnoreViewWidget.dart +++ b/lib/pages/sleep_report/component/SnoreViewWidget.dart @@ -120,7 +120,7 @@ class _SnoreViewWidgetWidgetState extends State { backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx), // borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/TrendDataTablePage.dart b/lib/pages/sleep_report/component/TrendDataTablePage.dart index a4df616..03c8467 100644 --- a/lib/pages/sleep_report/component/TrendDataTablePage.dart +++ b/lib/pages/sleep_report/component/TrendDataTablePage.dart @@ -3,6 +3,7 @@ import 'package:flutter_svg/svg.dart'; import 'package:flutterflow_ui/flutterflow_ui.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; +import 'package:vbvs_app/component/tool/ClickableContainer.dart'; import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart'; class TrendDataTablePage extends StatefulWidget { @@ -46,7 +47,12 @@ class _TrendDataTablePageState extends State { fontSize: 30.rpx, ), ), - GestureDetector( + ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 + padding: EdgeInsetsDirectional.fromSTEB( + 14.rpx, 10.rpx, 14.rpx, 10.rpx), // + borderRadius: 0.rpx, onTap: () { showTipDialog( context, diff --git a/lib/pages/sleep_report/component/TrendDataTextPage.dart b/lib/pages/sleep_report/component/TrendDataTextPage.dart index 6deab67..e43be33 100644 --- a/lib/pages/sleep_report/component/TrendDataTextPage.dart +++ b/lib/pages/sleep_report/component/TrendDataTextPage.dart @@ -58,7 +58,7 @@ class IndicatorCompareCard extends StatelessWidget { backgroundColor: Colors.transparent, highlightColor: Colors.white, padding: - EdgeInsetsDirectional.fromSTEB(14.rpx, 0, 14.rpx, 0), + EdgeInsetsDirectional.fromSTEB(14.rpx, 10.rpx, 14.rpx, 10.rpx), borderRadius: 0.rpx, onTap: () { showTipDialog( diff --git a/lib/pages/sleep_report/component/WeekDataWidget.dart b/lib/pages/sleep_report/component/WeekDataWidget.dart index bdf3356..75a8b27 100644 --- a/lib/pages/sleep_report/component/WeekDataWidget.dart +++ b/lib/pages/sleep_report/component/WeekDataWidget.dart @@ -668,7 +668,7 @@ Widget WeekDataWidget( Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text("MAC号:${data['mac']}", + Text("MAC:${data['mac']}", style: TextStyle( color: Color(0xFFD3D3D3).withOpacity(0.2), fontSize: 18.rpx)) ], diff --git a/lib/pages/sleep_report/component/ZiZhuShenJingPercentWidget.dart b/lib/pages/sleep_report/component/ZiZhuShenJingPercentWidget.dart index 260d109..c651465 100644 --- a/lib/pages/sleep_report/component/ZiZhuShenJingPercentWidget.dart +++ b/lib/pages/sleep_report/component/ZiZhuShenJingPercentWidget.dart @@ -91,7 +91,7 @@ class _ZiZhuShenJingPercentWidgetState backgroundColor: Colors.transparent, highlightColor: Colors.white, // 或设置为你需要的水波纹颜色 padding: EdgeInsetsDirectional.fromSTEB( - 14.rpx, 0.rpx, 14.rpx, 0), // + 14.rpx, 10.rpx, 14.rpx, 10.rpx), // borderRadius: 0.rpx, // 圆形点击区域 onTap: () { showTipDialog(