From 6862b97e1766f76d51ed7f65760fc68c9b269dd1 Mon Sep 17 00:00:00 2001 From: wyf <494641114@qq.com> Date: Thu, 16 Oct 2025 10:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=B9=E6=AE=8A=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=B5=8B=E8=AF=95=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/color/appConstants.dart | 6 +- .../home_page/DynamicReportDetailWidget.dart | 110 ++-- lib/component/home_page/SleepDateWidget.dart | 57 +- lib/controller/login/login_controller.dart | 8 + lib/controller/user_info_controller.dart | 5 + lib/main.dart | 22 +- lib/model/user_data.dart | 1 + .../component/DeviceDataComponentWidget.dart | 532 +++++++++++------- lib/pages/main_bottom/message_page.dart | 170 +++--- lib/pages/main_bottom/mine_page.dart | 2 +- 10 files changed, 553 insertions(+), 360 deletions(-) diff --git a/lib/common/color/appConstants.dart b/lib/common/color/appConstants.dart index 87c42f7..a99cd6d 100644 --- a/lib/common/color/appConstants.dart +++ b/lib/common/color/appConstants.dart @@ -54,14 +54,16 @@ class AppConstants { //系统参数 //运行打包APP模式 - int ent_type = APPPackageType.MHT.code; //1.默认太和 2.欢睡 3.眠花糖 - // int ent_type = APPPackageType.TH.code; //1.默认太和 2.欢睡 3.眠花糖 + // int ent_type = APPPackageType.MHT.code; //1.默认太和 2.欢睡 3.眠花糖 + int ent_type = APPPackageType.TH.code; //1.默认太和 2.欢睡 3.眠花糖 // int ent_type = APPPackageType.HUANSHUI.code; //1.默认太和 2.欢睡 3.眠花糖 int text_length = 8; int wifi1 = -45; int wifi2 = -60; int wifi3 = -75; + + static bool is_test_account = true; //是否测试账号 } //获取协议地址 diff --git a/lib/component/home_page/DynamicReportDetailWidget.dart b/lib/component/home_page/DynamicReportDetailWidget.dart index 21d71a4..c2bf1d1 100644 --- a/lib/component/home_page/DynamicReportDetailWidget.dart +++ b/lib/component/home_page/DynamicReportDetailWidget.dart @@ -74,7 +74,8 @@ class _DynamicReportDetailWidgetState extends State { SizedBox(height: 33.rpx), _buildSleepDateWidgets(), SizedBox(height: 20.rpx), - _buildSleepDataModuleWidgets(), + if (!AppConstants.is_test_account) + _buildSleepDataModuleWidgets(), ], ), ), @@ -104,62 +105,63 @@ class _DynamicReportDetailWidgetState extends State { ), ), ), - ClickableContainer( - backgroundColor: Colors.transparent, - highlightColor: themeController.currentColor.sc3, - borderRadius: 0, - padding: EdgeInsets.zero, - onTap: () { - String mac = targetDevice['mac']; - List selectedWidgets = widget.sleepDateWidgets - .where((w) => w.isSelected == true) - .toList(); - if (selectedWidgets.isNotEmpty) { - DateTime dateTime = DateTime.fromMillisecondsSinceEpoch( - int.parse(selectedWidgets[0].time!)); - String time = MyUtils.formatBindTime(dateTime); - // String sleepReportUrl = - // "${ServiceConstant.sleep_report_url}?mac=$mac&token=${ServiceConstant.sleep_token}&date=$time"; - // Get.toNamed("/sleepReportPage", arguments: sleepReportUrl); - Get.toNamed("/newSleepReportPage", arguments: { - 'date': dateTime != null - ? dateTime.millisecondsSinceEpoch - : DateTime.now().millisecondsSinceEpoch, - "mac": mac, - 'type': 1, - 'name': 'sleep', //'sleep', 'heartRate' 或 'breathe' - // 'itemName': widget.data['id'], - 'person': widget.targetDevice['person'], - }); - } else { - TopSlideNotification.show(context, - text: "当前暂无数据".tr, - textColor: themeController.currentColor.sc9); - } - }, - child: Row( - children: [ - Text( - '首页.报告详情'.tr, - style: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController.currentColor.sc3, + if (!AppConstants.is_test_account) + ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: themeController.currentColor.sc3, + borderRadius: 0, + padding: EdgeInsets.zero, + onTap: () { + String mac = targetDevice['mac']; + List selectedWidgets = widget.sleepDateWidgets + .where((w) => w.isSelected == true) + .toList(); + if (selectedWidgets.isNotEmpty) { + DateTime dateTime = DateTime.fromMillisecondsSinceEpoch( + int.parse(selectedWidgets[0].time!)); + String time = MyUtils.formatBindTime(dateTime); + // String sleepReportUrl = + // "${ServiceConstant.sleep_report_url}?mac=$mac&token=${ServiceConstant.sleep_token}&date=$time"; + // Get.toNamed("/sleepReportPage", arguments: sleepReportUrl); + Get.toNamed("/newSleepReportPage", arguments: { + 'date': dateTime != null + ? dateTime.millisecondsSinceEpoch + : DateTime.now().millisecondsSinceEpoch, + "mac": mac, + 'type': 1, + 'name': 'sleep', //'sleep', 'heartRate' 或 'breathe' + // 'itemName': widget.data['id'], + 'person': widget.targetDevice['person'], + }); + } else { + TopSlideNotification.show(context, + text: "当前暂无数据".tr, + textColor: themeController.currentColor.sc9); + } + }, + child: Row( + children: [ + Text( + '首页.报告详情'.tr, + style: TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController.currentColor.sc3, + ), ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB(0, 6.rpx, 0, 0.rpx), - child: SvgPicture.asset( - 'assets/img/icon/arrow_right.svg', - width: 14.rpx, - height: 14.rpx, - color: themeController.currentColor.sc3, + Padding( + padding: EdgeInsetsDirectional.fromSTEB(0, 6.rpx, 0, 0.rpx), + child: SvgPicture.asset( + 'assets/img/icon/arrow_right.svg', + width: 14.rpx, + height: 14.rpx, + color: themeController.currentColor.sc3, + ), ), - ), - ].divide(SizedBox(width: 22.rpx)), + ].divide(SizedBox(width: 22.rpx)), + ), ), - ), ], ); } diff --git a/lib/component/home_page/SleepDateWidget.dart b/lib/component/home_page/SleepDateWidget.dart index a60e9a6..da812af 100644 --- a/lib/component/home_page/SleepDateWidget.dart +++ b/lib/component/home_page/SleepDateWidget.dart @@ -140,37 +140,38 @@ class _SleepDateWidgetState extends State { ], ), ), - Container( - width: 0.2.rpx, - height: 2.4.rpx, - constraints: BoxConstraints( - minWidth: 123.rpx, - minHeight: 47.rpx, - ), - child: FFButtonWidget( - onPressed: () { - print('合格按钮点击'); - }, - text: (widget.comment?.trim().isEmpty ?? true) - ? '暂无'.tr - : widget.comment!, - options: FFButtonOptions( - height: 40.rpx, - padding: - EdgeInsetsDirectional.fromSTEB(16.rpx, 0, 16.rpx, 0), - iconPadding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0), - color: - widget.textColor ?? themeController.currentColor.sc4, - textStyle: TextStyle( - // fontFamily: 'Inter Tight', - color: themeController.currentColor.sc3, - letterSpacing: 0.0, + if (!AppConstants.is_test_account) + Container( + width: 0.2.rpx, + height: 2.4.rpx, + constraints: BoxConstraints( + minWidth: 123.rpx, + minHeight: 47.rpx, + ), + child: FFButtonWidget( + onPressed: () { + print('合格按钮点击'); + }, + text: (widget.comment?.trim().isEmpty ?? true) + ? '暂无'.tr + : widget.comment!, + options: FFButtonOptions( + height: 40.rpx, + padding: EdgeInsetsDirectional.fromSTEB( + 16.rpx, 0, 16.rpx, 0), + iconPadding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0), + color: widget.textColor ?? + themeController.currentColor.sc4, + textStyle: TextStyle( + // fontFamily: 'Inter Tight', + color: themeController.currentColor.sc3, + letterSpacing: 0.0, + ), + elevation: 0, + borderRadius: BorderRadius.circular(50.rpx), ), - elevation: 0, - borderRadius: BorderRadius.circular(50.rpx), ), ), - ), ], )), ), diff --git a/lib/controller/login/login_controller.dart b/lib/controller/login/login_controller.dart index 5e8bd9e..efe785e 100644 --- a/lib/controller/login/login_controller.dart +++ b/lib/controller/login/login_controller.dart @@ -105,6 +105,11 @@ class LoginController extends GetControllerEx { UserInfoController userInfoController = Get.find(); userInfoController.model.login = 1; userInfoController.model.user = UserModel.fromJson(res.data); + if (res.data['test'] != null && res.data['test'] == true) { + AppConstants.is_test_account = true; + } else { + AppConstants.is_test_account = false; + } String token = response.headers['token']!.first; EasyDartModule.dio.token = token; final box = GetStorage(); @@ -178,11 +183,14 @@ class LoginController extends GetControllerEx { res.msg = "其他手机登录页.发送成功".tr; } } + EasyDartModule.logger.info('msg:发送验证码成功'); return res; } else { + EasyDartModule.logger.error('msg:发送验证码失败:${response}'); return ApiResponse(code: -1, msg: "失败".tr); } } catch (e) { + EasyDartModule.logger.error('msg:发送验证码失败:${e}'); return ApiResponse(code: -1, msg: "失败".tr); } } diff --git a/lib/controller/user_info_controller.dart b/lib/controller/user_info_controller.dart index 53eecf6..30cf407 100644 --- a/lib/controller/user_info_controller.dart +++ b/lib/controller/user_info_controller.dart @@ -225,6 +225,11 @@ class UserInfoController extends GetControllerEx { MyUtils.formatResponse(apiResponse, "保存成功".tr, "保存失败".tr); if (res.code == HttpStatusCodes.ok) { UserInfoController userInfoController = Get.find(); + if (res.data['test'] != null && res.data['test'] == true) { + AppConstants.is_test_account = true; + } else { + AppConstants.is_test_account = false; + } userInfoController.model.user = UserModel.fromJson(res.data); final box = GetStorage(); box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息 diff --git a/lib/main.dart b/lib/main.dart index 300f56f..ffd79ca 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -189,12 +189,12 @@ Future initWX() async { Fluwx fluwx = Fluwx(); fluwx.registerApi( //请填写自己的微信appid - // appId: "wxeb2688220799e2c5", //太和 - appId: "wx929c548fea6af9c7", //眠花糖 + appId: "wxeb2688220799e2c5", //太和 + // appId: "wx929c548fea6af9c7", //眠花糖 doOnAndroid: true, doOnIOS: true, - // universalLink: "https://app.he-info.com/theh/", - universalLink: "https://zhmht.swes.com.cn/app/", + universalLink: "https://app.he-info.com/theh/", + // universalLink: "https://zhmht.swes.com.cn/app/", ); } @@ -629,7 +629,10 @@ void initEasyDartModule() { try { EasyDartModule.init( loggerConfig: - LoggerConfig(host: ServiceConstant.logService, serviceName: "智慧眠花糖在线2025-10-9"), + // LoggerConfig(host: ServiceConstant.logService, serviceName: "智慧眠花糖在线2025-10-9"), + LoggerConfig( + host: ServiceConstant.logService, + serviceName: "太和e护在线2025-10-14"), webSocketConfig: WebSocketConfig(ServiceConstant.webSocketService, (data) { // 接收到服务消息 @@ -701,7 +704,9 @@ Future initLogin() async { EasyDartModule.dio.token = null; } else { userInfoController.model.login = 1; - await JPushUtil.initJPush(); + if (AppConstants().ent_type == APPPackageType.MHT.code) { + await JPushUtil.initJPush(); + } updateAppSystemNotify(true); } } else { @@ -713,6 +718,11 @@ Future initLogin() async { if (userMap != null) { UserModel user = UserModel.fromJson(userMap); userInfoController.model.user = user; + if (user.test != null && (user.test)!) { + AppConstants.is_test_account = true; + } else { + AppConstants.is_test_account = false; + } } } catch (e) { print(e); diff --git a/lib/model/user_data.dart b/lib/model/user_data.dart index 192cb6f..6902649 100644 --- a/lib/model/user_data.dart +++ b/lib/model/user_data.dart @@ -16,6 +16,7 @@ class UserModel { String? status; int? created_at; String? email; + bool? test; UserModel(); static UserModel fromJson(Map json) => diff --git a/lib/pages/device/component/DeviceDataComponentWidget.dart b/lib/pages/device/component/DeviceDataComponentWidget.dart index aba83a7..bd46306 100644 --- a/lib/pages/device/component/DeviceDataComponentWidget.dart +++ b/lib/pages/device/component/DeviceDataComponentWidget.dart @@ -1025,154 +1025,107 @@ class _DeviceDataComponentWidgetState extends State { color: themeController.currentColor.sc4, ), SizedBox(height: 5.rpx), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded( - child: CustomCard( - borderRadius: AppConstants().button_container_radius, - onTap: () async { - if (widget.device['person'] != null) { - personController.currentPersonId.value = - widget.device['_id']; - personController.name.value = - widget.device['person']['name']; - personController.update_person_mac.value = - widget.device['mac']; - personController.gender.value = - widget.device['person']['gender'] ?? 1; - personController.weight?.value = - widget.device['person']['weight'] == null - ? '' - : widget.device['person']['weight'] - .toString(); + if (!AppConstants.is_test_account) + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: CustomCard( + borderRadius: AppConstants().button_container_radius, + onTap: () async { + if (widget.device['person'] != null) { + personController.currentPersonId.value = + widget.device['_id']; + personController.name.value = + widget.device['person']['name']; + personController.update_person_mac.value = + widget.device['mac']; + personController.gender.value = + widget.device['person']['gender'] ?? 1; + personController.weight?.value = + widget.device['person']['weight'] == null + ? '' + : widget.device['person']['weight'] + .toString(); - personController.height.value = - widget.device['person']['height'] == null - ? '' - : widget.device['person']['height'] - .toString(); + personController.height.value = + widget.device['person']['height'] == null + ? '' + : widget.device['person']['height'] + .toString(); - personController.selectedDiseaseIds.value = - widget.device['person']['disease'] ?? []; - personController.birthday.value = - widget.device['person']['birthday'] ?? ''; - personController.dateTime = - MyUtils.formatBirthdayTime( - widget.device['person']['birthday']); - } else { - personController.update_person_mac.value = - widget.device['mac']; - personController.currentPersonId.value = - widget.device['_id']; - personController.name.value = ""; - personController.gender.value = 1; - personController.dateTime = null; - personController.height.value = ""; - personController.weight.value = ""; - personController.diseaseList.value = []; - } - await Get.toNamed("/updatePersonPage", - arguments: widget.device['bind_type']); - bodyDeviceController.getDeviceList(); - }, - colors: [ - themeController.currentColor.sc1, - themeController.currentColor.sc2, - ], - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.rpx, 0.rpx, 0.rpx, 0.rpx), - child: Container( - alignment: Alignment.center, - height: MediaQuery.sizeOf(context).height * 0.0037, - constraints: BoxConstraints( - minWidth: 143.rpx, - minHeight: 61.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)), - ), - ), - ), - ), - ), - SizedBox( - width: 20.rpx, - ), - Expanded( - // 使用 Expanded 来占据屏幕宽度 - child: CustomCard( - borderRadius: AppConstants().button_container_radius, - onTap: () { - Get.toNamed("/instantBodyPage", - arguments: widget.device); - }, - colors: [ - themeController.currentColor.sc1, - themeController.currentColor.sc2, - ], - child: Container( - alignment: Alignment.center, - height: MediaQuery.sizeOf(context).height * 0.0037, - constraints: BoxConstraints( - minWidth: 143.rpx, - minHeight: 61.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, - ), + personController.selectedDiseaseIds.value = + widget.device['person']['disease'] ?? []; + personController.birthday.value = + widget.device['person']['birthday'] ?? ''; + personController.dateTime = + MyUtils.formatBirthdayTime( + widget.device['person']['birthday']); + } else { + personController.update_person_mac.value = + widget.device['mac']; + personController.currentPersonId.value = + widget.device['_id']; + personController.name.value = ""; + personController.gender.value = 1; + personController.dateTime = null; + personController.height.value = ""; + personController.weight.value = ""; + personController.diseaseList.value = []; + } + await Get.toNamed("/updatePersonPage", + arguments: widget.device['bind_type']); + bodyDeviceController.getDeviceList(); + }, + colors: [ + themeController.currentColor.sc1, + themeController.currentColor.sc2, + ], + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.rpx, 0.rpx, 0.rpx, 0.rpx), + child: Container( + alignment: Alignment.center, + height: MediaQuery.sizeOf(context).height * 0.0037, + constraints: BoxConstraints( + minWidth: 143.rpx, + minHeight: 61.rpx, ), - ].divide(SizedBox(width: 17.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)), + ), + ), ), ), ), - ), - ], - ), - SizedBox( - height: 20.rpx, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded( - // 使用 Expanded 来占据屏幕宽度的一半 - child: CustomCard( - borderRadius: AppConstants().button_container_radius, - onTap: () { - // TopSlideNotification.show(context, text: "待开发功能".tr); - Get.toNamed("/messageReviewPage", - arguments: widget.device); - }, - colors: [ - themeController.currentColor.sc1, - themeController.currentColor.sc2, - ], - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.rpx, 0.rpx, 0.rpx, 0.rpx), + SizedBox( + width: 20.rpx, + ), + Expanded( + // 使用 Expanded 来占据屏幕宽度 + child: CustomCard( + borderRadius: AppConstants().button_container_radius, + onTap: () { + Get.toNamed("/instantBodyPage", + arguments: widget.device); + }, + colors: [ + themeController.currentColor.sc1, + themeController.currentColor.sc2, + ], child: Container( alignment: Alignment.center, height: MediaQuery.sizeOf(context).height * 0.0037, @@ -1185,7 +1138,7 @@ class _DeviceDataComponentWidgetState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - "体征检测设备.消息回看".tr, + "体征检测设备.实时体征".tr, style: TextStyle( color: themeController.currentColor.sc3, fontFamily: 'Inter', @@ -1198,64 +1151,251 @@ class _DeviceDataComponentWidgetState extends State { ), ), ), - ), - SizedBox( - width: 20.rpx, - ), - Expanded( - // 使用 Expanded 来占据屏幕宽度的一半 - child: CustomCard( - borderRadius: AppConstants().button_container_radius, - onTap: () { - // String mac = widget.device['mac']; - // String sleepReportUrl = - // "${ServiceConstant.sleep_report_url}?mac=${mac}&token=${ServiceConstant.sleep_token}"; - // Get.toNamed("/sleepReportPage", - // arguments: sleepReportUrl); - Get.toNamed("/newSleepReportPage", arguments: { - 'date': DateTime.now().millisecondsSinceEpoch, - "mac": widget.device['mac'], - 'type': 1, - 'name': 'sleep', //'sleep', 'heartRate' 或 'breathe' - // 'itemName': widget.data['id'], - 'person': widget.device['person'], - }); - }, - colors: [ - themeController.currentColor.sc1, - themeController.currentColor.sc2, - ], - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.rpx, 0.rpx, 0.rpx, 0.rpx), - child: Container( - alignment: Alignment.center, - height: MediaQuery.sizeOf(context).height * 0.0037, - constraints: BoxConstraints( - minWidth: 143.rpx, - minHeight: 61.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, + ], + ), + if (!AppConstants.is_test_account) + SizedBox( + height: 20.rpx, + ), + if (!AppConstants.is_test_account) + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + // 使用 Expanded 来占据屏幕宽度的一半 + child: CustomCard( + borderRadius: AppConstants().button_container_radius, + onTap: () { + // TopSlideNotification.show(context, text: "待开发功能".tr); + Get.toNamed("/messageReviewPage", + arguments: widget.device); + }, + colors: [ + themeController.currentColor.sc1, + themeController.currentColor.sc2, + ], + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.rpx, 0.rpx, 0.rpx, 0.rpx), + child: Container( + alignment: Alignment.center, + height: MediaQuery.sizeOf(context).height * 0.0037, + constraints: BoxConstraints( + minWidth: 143.rpx, + minHeight: 61.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)), + ].divide(SizedBox(width: 17.rpx)), + ), ), ), ), ), - ), - ], - ), + SizedBox( + width: 20.rpx, + ), + Expanded( + // 使用 Expanded 来占据屏幕宽度的一半 + child: CustomCard( + borderRadius: AppConstants().button_container_radius, + onTap: () { + // String mac = widget.device['mac']; + // String sleepReportUrl = + // "${ServiceConstant.sleep_report_url}?mac=${mac}&token=${ServiceConstant.sleep_token}"; + // Get.toNamed("/sleepReportPage", + // arguments: sleepReportUrl); + Get.toNamed("/newSleepReportPage", arguments: { + 'date': DateTime.now().millisecondsSinceEpoch, + "mac": widget.device['mac'], + 'type': 1, + 'name': 'sleep', //'sleep', 'heartRate' 或 'breathe' + // 'itemName': widget.data['id'], + 'person': widget.device['person'], + }); + }, + colors: [ + themeController.currentColor.sc1, + themeController.currentColor.sc2, + ], + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.rpx, 0.rpx, 0.rpx, 0.rpx), + child: Container( + alignment: Alignment.center, + height: MediaQuery.sizeOf(context).height * 0.0037, + constraints: BoxConstraints( + minWidth: 143.rpx, + minHeight: 61.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)), + ), + ), + ), + ), + ), + ], + ), + if (AppConstants.is_test_account) + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: CustomCard( + borderRadius: AppConstants().button_container_radius, + onTap: () async { + if (widget.device['person'] != null) { + personController.currentPersonId.value = + widget.device['_id']; + personController.name.value = + widget.device['person']['name']; + personController.update_person_mac.value = + widget.device['mac']; + personController.gender.value = + widget.device['person']['gender'] ?? 1; + personController.weight?.value = + widget.device['person']['weight'] == null + ? '' + : widget.device['person']['weight'] + .toString(); + + personController.height.value = + widget.device['person']['height'] == null + ? '' + : widget.device['person']['height'] + .toString(); + + personController.selectedDiseaseIds.value = + widget.device['person']['disease'] ?? []; + personController.birthday.value = + widget.device['person']['birthday'] ?? ''; + personController.dateTime = + MyUtils.formatBirthdayTime( + widget.device['person']['birthday']); + } else { + personController.update_person_mac.value = + widget.device['mac']; + personController.currentPersonId.value = + widget.device['_id']; + personController.name.value = ""; + personController.gender.value = 1; + personController.dateTime = null; + personController.height.value = ""; + personController.weight.value = ""; + personController.diseaseList.value = []; + } + await Get.toNamed("/updatePersonPage", + arguments: widget.device['bind_type']); + bodyDeviceController.getDeviceList(); + }, + colors: [ + themeController.currentColor.sc1, + themeController.currentColor.sc2, + ], + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.rpx, 0.rpx, 0.rpx, 0.rpx), + child: Container( + alignment: Alignment.center, + height: MediaQuery.sizeOf(context).height * 0.0037, + constraints: BoxConstraints( + minWidth: 143.rpx, + minHeight: 61.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)), + ), + ), + ), + ), + ), + SizedBox( + width: 20.rpx, + ), + Expanded( + // 使用 Expanded 来占据屏幕宽度的一半 + child: CustomCard( + borderRadius: AppConstants().button_container_radius, + onTap: () { + // TopSlideNotification.show(context, text: "待开发功能".tr); + Get.toNamed("/messageReviewPage", + arguments: widget.device); + }, + colors: [ + themeController.currentColor.sc1, + themeController.currentColor.sc2, + ], + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.rpx, 0.rpx, 0.rpx, 0.rpx), + child: Container( + alignment: Alignment.center, + height: MediaQuery.sizeOf(context).height * 0.0037, + constraints: BoxConstraints( + minWidth: 143.rpx, + minHeight: 61.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)), + ), + ), + ), + ), + ), + ], + ), ].divide(SizedBox(height: 0.rpx)), ), ), diff --git a/lib/pages/main_bottom/message_page.dart b/lib/pages/main_bottom/message_page.dart index 95a6e59..345d65a 100644 --- a/lib/pages/main_bottom/message_page.dart +++ b/lib/pages/main_bottom/message_page.dart @@ -109,63 +109,64 @@ class _MessagePageState extends State { Row( children: [ // 第一个容器,宽度占屏幕一半 - Obx(() { - return Expanded( - child: ClickableContainer( - padding: EdgeInsets.all(0), - backgroundColor: Colors.transparent, - highlightColor: - themeController.currentColor.sc21, - borderRadius: 8.rpx, - onTap: () => _onTabChanged(0), - child: Container( - alignment: Alignment.center, - child: Stack( + if (!AppConstants.is_test_account) + Obx(() { + return Expanded( + child: ClickableContainer( + padding: EdgeInsets.all(0), + backgroundColor: Colors.transparent, + highlightColor: + themeController.currentColor.sc21, + borderRadius: 8.rpx, + onTap: () => _onTabChanged(0), + child: Container( alignment: Alignment.center, - clipBehavior: Clip.none, - children: [ - Text( - '体征消息'.tr, - style: TextStyle( - fontFamily: 'Inter', - fontSize: AppConstants() - .title_text_fontSize, - color: - messageController - .model.type == - 2 - ? themeController - .currentColor.sc3 - : themeController - .currentColor.sc2, + child: Stack( + alignment: Alignment.center, + clipBehavior: Clip.none, + children: [ + Text( + '体征消息'.tr, + style: TextStyle( + fontFamily: 'Inter', + fontSize: AppConstants() + .title_text_fontSize, + color: + messageController + .model.type == + 2 + ? themeController + .currentColor.sc3 + : themeController + .currentColor.sc2, + ), ), - ), - Obx(() { - return messageController.model - .body_message_read == - 1 - ? Positioned( - top: -4, - right: -14, - child: Container( - width: 8, - height: 8, - decoration: - const BoxDecoration( - color: Colors.red, - shape: - BoxShape.circle, + Obx(() { + return messageController.model + .body_message_read == + 1 + ? Positioned( + top: -4, + right: -14, + child: Container( + width: 8, + height: 8, + decoration: + const BoxDecoration( + color: Colors.red, + shape: + BoxShape.circle, + ), ), - ), - ) - : const SizedBox.shrink(); - }), - ], + ) + : const SizedBox.shrink(); + }), + ], + ), ), ), - ), - ); - }), + ); + }), SizedBox(width: 10.rpx), // 第二个容器,宽度占屏幕一半 Obx(() { @@ -228,28 +229,51 @@ class _MessagePageState extends State { ], ), // 动画线 - Obx(() { - double lineWidth = - MediaQuery.sizeOf(context).width * 0.5 - - 20.rpx; // 每个容器占宽度的一半 - return AnimatedPositioned( - duration: const Duration(milliseconds: 300), - curve: Curves.easeInOut, - bottom: 0, - left: messageController.model.type == 1 - ? 0 - : MediaQuery.sizeOf(context).width * 0.5 + - 10.rpx, // 动态设置左侧位置 - child: Container( - width: lineWidth, - height: 4.rpx, - decoration: BoxDecoration( - color: themeController.currentColor.sc2, - borderRadius: BorderRadius.circular(2.rpx), + if (!AppConstants.is_test_account) + Obx(() { + double lineWidth = + MediaQuery.sizeOf(context).width * 0.5 - + 20.rpx; // 每个容器占宽度的一半 + return AnimatedPositioned( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + bottom: 0, + left: messageController.model.type == 1 + ? 0 + : MediaQuery.sizeOf(context).width * 0.5 + + 10.rpx, // 动态设置左侧位置 + child: Container( + width: lineWidth, + height: 4.rpx, + decoration: BoxDecoration( + color: themeController.currentColor.sc2, + borderRadius: + BorderRadius.circular(2.rpx), + ), ), - ), - ); - }), + ); + }), + if (AppConstants.is_test_account) + Obx(() { + double lineWidth = MediaQuery.sizeOf(context) + .width; // 每个容器占宽度的一半 + messageController.model.type == 2; + return AnimatedPositioned( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + bottom: 0, + left: 0, // 动态设置左侧位置 + child: Container( + width: lineWidth, + height: 4.rpx, + decoration: BoxDecoration( + color: themeController.currentColor.sc2, + borderRadius: + BorderRadius.circular(2.rpx), + ), + ), + ); + }), ], ), ), diff --git a/lib/pages/main_bottom/mine_page.dart b/lib/pages/main_bottom/mine_page.dart index c959852..6857b8d 100644 --- a/lib/pages/main_bottom/mine_page.dart +++ b/lib/pages/main_bottom/mine_page.dart @@ -674,7 +674,7 @@ class _MinePageState extends State { mainAxisSize: MainAxisSize.max, children: [ Text( - 'V1.0.2509.19', + 'V1.0.2510.14', style: TextStyle( fontFamily: 'Inter', color: Color(0xFFD9E3EB),