3.修改睡眠报告文字 正常窦性心律

This commit is contained in:
wyf
2026-03-30 14:18:55 +08:00
parent 3a2956658d
commit 9a431e907e
11 changed files with 510 additions and 390 deletions

View File

@@ -556,7 +556,7 @@
"微信用户": "微信用户", "微信用户": "微信用户",
"其他设备正在绑定中,是否终止其他设备绑定?": "其他设备正在绑定中,是否终止其他设备绑定?", "其他设备正在绑定中,是否终止其他设备绑定?": "其他设备正在绑定中,是否终止其他设备绑定?",
"图形参考": "图像参考", "图形参考": "图像参考",
"正常心率窦性图": "正常心率窦性", "正常心率窦性图": "正常窦性心率",
"窦性心律不齐图": "窦性心律不齐", "窦性心律不齐图": "窦性心律不齐",
"持续性房颤图": "持续性房颤", "持续性房颤图": "持续性房颤",
"阵法性房颤图": "阵法性房颤", "阵法性房颤图": "阵法性房颤",

View File

@@ -551,7 +551,7 @@
"其他设备正在绑定中,是否终止其他设备绑定?": "其他設備正在綁定中,是否終止其他設備綁定?", "其他设备正在绑定中,是否终止其他设备绑定?": "其他設備正在綁定中,是否終止其他設備綁定?",
"未配置网络提示": "當前設備未進行網路配置,是否確認跳過網路配置?", "未配置网络提示": "當前設備未進行網路配置,是否確認跳過網路配置?",
"图形参考": "圖形參考", "图形参考": "圖形參考",
"正常心率窦性图": "正常心率竇性圖", "正常心率窦性图": "正常竇性心率圖",
"窦性心律不齐图": "竇性心律不齊圖", "窦性心律不齐图": "竇性心律不齊圖",
"持续性房颤图": "持續性房顫圖", "持续性房颤图": "持續性房顫圖",
"阵法性房颤图": "陣法性房顫圖", "阵法性房颤图": "陣法性房顫圖",

Binary file not shown.

View File

@@ -1,7 +1,7 @@
class ServiceConstant { class ServiceConstant {
// static const String baseHost = "zhmht.swes.com.cn:27021"; //服务地址 眠花糖测试地址 // static const String baseHost = "zhmht.swes.com.cn:27021"; //服务地址 眠花糖测试地址
static String baseHost = "zhmht.swes.com.cn:27020"; //服务地址 眠花糖正式地址 static String baseHost = "zhmht.swes.com.cn:27020"; //服务地址 眠花糖正式地址
// static const String baseHost = "vsbs-test.he-info.cn"; //服务地址 本地测试地址 // static String baseHost = "vsbs-test.he-info.cn"; //服务地址 本地测试地址
// static const String baseHost = "vsbst-api.he-info.com";//服务地址 // static const String baseHost = "vsbst-api.he-info.com";//服务地址
// static const String service_address = "http://$baseHost"; // static const String service_address = "http://$baseHost";
static String service_address = "https://$baseHost"; static String service_address = "https://$baseHost";

View File

@@ -8,8 +8,8 @@ import 'package:vbvs_app/enum/APPPackageType.dart';
class AppConstants { class AppConstants {
// App-related constants // App-related constants
static const String zhmht_app_version = "SWES_1.2026.3.17"; //眠花糖 static const String zhmht_app_version = "SWES_1.2026.3.30"; //眠花糖
static const String theh_app_version = "1.2603.23"; //太和 static const String theh_app_version = "1.2603.30"; //太和
// 1. 纯字符串列表格式 // 1. 纯字符串列表格式
static const List<String> integerTimeZones = [ static const List<String> integerTimeZones = [

View File

@@ -54,6 +54,9 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
RxBool own = false.obs; //体验id RxBool own = false.obs; //体验id
RxString errmsg = "".obs; RxString errmsg = "".obs;
RxBool qcListLoading = true.obs; RxBool qcListLoading = true.obs;
RxBool qcDetailLoading = true.obs; // 详情加载状态专门用于id不为空时的加载
int _requestSequence = 0;
Future<ApiResponse> getDeviceType() async { Future<ApiResponse> getDeviceType() async {
ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败".tr); ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败".tr);
@@ -128,7 +131,15 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
} }
Future<bool> getCheckHistory({required String mac, String? id}) async { Future<bool> getCheckHistory({required String mac, String? id}) async {
qcListLoading.value = true; // 生成新的序列号
final currentSeq = ++_requestSequence;
if (id == null || id.isEmpty) {
qcListLoading.value = true;
} else {
qcDetailLoading.value = true;
currentCq.value = {};
}
String serviceAddress = ServiceConstant.qc_service_address; String serviceAddress = ServiceConstant.qc_service_address;
String serviceApi = ServiceConstant.getCheckHistory; String serviceApi = ServiceConstant.getCheckHistory;
String queryUrl = "$serviceAddress$serviceApi"; String queryUrl = "$serviceAddress$serviceApi";
@@ -155,6 +166,11 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
method: MyHttpMethod.get, method: MyHttpMethod.get,
queryUrl: queryUrl, queryUrl: queryUrl,
onSuccess: (res) { onSuccess: (res) {
if (_requestSequence != currentSeq) {
print('⚠️ 忽略过期请求 #$currentSeq,当前最新是 #$_requestSequence');
return;
}
flag = true; flag = true;
// 判断返回数据类型 // 判断返回数据类型
if (res.data is List) { if (res.data is List) {
@@ -164,16 +180,30 @@ class DeviceTypeController extends GetControllerEx<DeviceTypeModel> {
// 如果是Map赋值给currentCq // 如果是Map赋值给currentCq
currentCq.value = res.data as Map<String, dynamic>; currentCq.value = res.data as Map<String, dynamic>;
} }
qcListLoading.value = false; if (id == null || id.isEmpty) {
qcListLoading.value = false;
} else {
qcDetailLoading.value = false;
}
// qcListLoading.value = false;
updateAll(); updateAll();
}, },
onFailure: (res) { onFailure: (res) {
if (_requestSequence != currentSeq) {
print('⚠️ 忽略过期失败回调 #$currentSeq');
return;
}
flag = false; flag = false;
qcListLoading.value = false; if (id == null || id.isEmpty) {
qcListLoading.value = false;
} else {
qcDetailLoading.value = false;
}
currentCq.value = {}; currentCq.value = {};
NewTopSlideNotification.show( NewTopSlideNotification.show(
text: "数据加载失败", textColor: themeController.currentColor.sc9); text: "数据加载失败", textColor: themeController.currentColor.sc9);
EasyDartModule.logger.error("快检报告数据加载失败-->${res.msg??'服务器错误'}"); EasyDartModule.logger.error("快检报告数据加载失败-->${res.msg ?? '服务器错误'}");
}, },
); );
return flag; return flag;

View File

@@ -141,8 +141,8 @@ Future<void> main() async {
void initServiceAddress() { void initServiceAddress() {
if (AppConstants().ent_type == APPPackageType.MHT.code) { if (AppConstants().ent_type == APPPackageType.MHT.code) {
// 眠花糖 // 眠花糖
// ServiceConstant.baseHost = "zhmht.swes.com.cn:27020"; ServiceConstant.baseHost = "zhmht.swes.com.cn:27020";
ServiceConstant.baseHost = "vsbs-test.he-info.cn"; // ServiceConstant.baseHost = "vsbs-test.he-info.cn";
} else if (AppConstants().ent_type == APPPackageType.TH.code) { } else if (AppConstants().ent_type == APPPackageType.TH.code) {
// 太和 // 太和
// ServiceConstant.baseHost = "vsbst-api.he-info.com"; // ServiceConstant.baseHost = "vsbst-api.he-info.com";
@@ -698,7 +698,7 @@ void initEasyDartModule() {
EasyDartModule.init( EasyDartModule.init(
loggerConfig: LoggerConfig( loggerConfig: LoggerConfig(
host: "https://zhmht.swes.com.cn:27020/vsbs_log", host: "https://zhmht.swes.com.cn:27020/vsbs_log",
serviceName: "太和e护test2026-03-23"), serviceName: "太和e护test2026-03-30"),
webSocketConfig: webSocketConfig:
WebSocketConfig(ServiceConstant.webSocketService, (data) { WebSocketConfig(ServiceConstant.webSocketService, (data) {
// 接收到服务消息 // 接收到服务消息

View File

@@ -94,19 +94,28 @@ class _HealthReportCardWidgetState extends State<HealthReportCardWidget> {
_formatTime(reportData['create_time']), _formatTime(reportData['create_time']),
onViewTap: () async { onViewTap: () async {
// 查看按钮点击事件 // 查看按钮点击事件
edm.EasyDartModule.logger.info("快检报告查看按钮点击");
String ID = reportData['id']; String ID = reportData['id'];
DeviceTypeController deviceTypeController = DeviceTypeController deviceTypeController =
Get.find(); Get.find();
await deviceTypeController.getCheckHistory( Map data = {
id: ID, mac: reportData['mac']); 'id': ID,
if (deviceTypeController.currentCq.value == null || 'mac': reportData['mac'],
deviceTypeController.currentCq.value.isEmpty) { };
NewTopSlideNotification.show( // await deviceTypeController.getCheckHistory(
text: "未找到快检报告".tr, // id: ID, mac: reportData['mac']);
textColor: themeController.currentColor.sc9); // if (Get.currentRoute != '/healthExperienceHistory')
return; // return;
} // if (deviceTypeController.currentCq.value == null ||
_onViewReport(deviceTypeController.currentCq.value); // deviceTypeController.currentCq.value.isEmpty) {
// NewTopSlideNotification.show(
// text: "未找到快检报告".tr,
// textColor: themeController.currentColor.sc9);
// return;
// }
// _onViewReport(deviceTypeController.currentCq.value);
Get.toNamed('/healthQuickCheckReportPage',
arguments: data);
}, },
), ),
], ],

View File

@@ -1262,11 +1262,14 @@ class _HealthCheckPageState extends State<HealthCheckPage>
progressNotifier.value = 0; progressNotifier.value = 0;
edm.EasyDartModule.logger.info("快检结束,停止定时查询"); edm.EasyDartModule.logger.info("快检结束,停止定时查询");
_checkStatusTimer?.cancel(); _checkStatusTimer?.cancel();
await deviceTypeController.getCheckHistory( Map data = {
id: deviceTypeController.experience_id.value, "id": deviceTypeController.experience_id.value,
mac: widget.personInfo['mac']); "mac": widget.personInfo['mac']
Get.toNamed('/healthQuickCheckReportPage', };
arguments: deviceTypeController.currentCq.value); // await deviceTypeController.getCheckHistory(
// id: deviceTypeController.experience_id.value,
// mac: widget.personInfo['mac']);
Get.toNamed('/healthQuickCheckReportPage', arguments: data);
} catch (e) { } catch (e) {
edm.EasyDartModule.logger.error("快检报告页面加载失败---?${e.toString()}"); edm.EasyDartModule.logger.error("快检报告页面加载失败---?${e.toString()}");
} }

View File

@@ -10,7 +10,7 @@ import 'package:vbvs_app/controller/message/message_review_controller.dart';
import 'package:vbvs_app/pages/device/component/HealthReportCard.dart'; import 'package:vbvs_app/pages/device/component/HealthReportCard.dart';
class HealthExperienceHistory extends StatefulWidget { class HealthExperienceHistory extends StatefulWidget {
var data; //1.绑定时 2.绑定后 var data;
HealthExperienceHistory({super.key, required this.data}); HealthExperienceHistory({super.key, required this.data});
@override @override

View File

@@ -6,9 +6,11 @@ import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/NewTopSlideNotification.dart'; import 'package:vbvs_app/component/tool/NewTopSlideNotification.dart';
import 'package:vbvs_app/controller/date/CalendarController.dart'; import 'package:vbvs_app/controller/date/CalendarController.dart';
import 'package:vbvs_app/controller/device/device_type_controller.dart';
import 'package:vbvs_app/controller/sleep/sleep_report_controller.dart'; import 'package:vbvs_app/controller/sleep/sleep_report_controller.dart';
import 'package:vbvs_app/pages/sleep_report/QcReportWidget.dart'; import 'package:vbvs_app/pages/sleep_report/QcReportWidget.dart';
import 'package:vbvs_app/pages/sleep_report/chart/StatusBarWithIndicator.dart'; import 'package:vbvs_app/pages/sleep_report/chart/StatusBarWithIndicator.dart';
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
class QuickHealthReportPage extends StatefulWidget { class QuickHealthReportPage extends StatefulWidget {
var data; var data;
@@ -27,6 +29,7 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
final GlobalKey breatheCardKey = GlobalKey(); final GlobalKey breatheCardKey = GlobalKey();
final ScrollController _scrollController = ScrollController(); final ScrollController _scrollController = ScrollController();
final RxBool isRightLimit = false.obs; final RxBool isRightLimit = false.obs;
DeviceTypeController deviceTypeController = Get.find();
@override @override
void didUpdateWidget(QuickHealthReportPage oldWidget) { void didUpdateWidget(QuickHealthReportPage oldWidget) {
@@ -47,249 +50,291 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
deviceTypeController
.getCheckHistory(id: widget.data['id'], mac: widget.data['mac'])
.then((res) {
if (deviceTypeController.currentCq.value == null ||
deviceTypeController.currentCq.value.isEmpty) {
// NewTopSlideNotification.show(
// text: "未找到快检报告".tr, textColor: themeController.currentColor.sc9);
edm.EasyDartModule.logger.info("未找到快检报告");
return;
} else {
deviceTypeController.updateAll();
}
});
});
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final healthLevelInfo = getHealthLevelInfo(widget.data);
double lineWidth = 150.rpx; double lineWidth = 150.rpx;
try { try {
if (widget.data == null || widget.data.isEmpty) { return Obx(() {
return LayoutBuilder( final healthLevelInfo =
builder: (context, bodySize) => GestureDetector( getHealthLevelInfo(deviceTypeController.currentCq.value);
child: Container( if (deviceTypeController.qcDetailLoading.value) {
decoration: BoxDecoration( return LayoutBuilder(
image: (widget.data['noBackImg'] != null && builder: (context, bodySize) => GestureDetector(
widget.data['noBackImg'] == true) child: Container(
? null // ✅ 不要背景图 decoration: BoxDecoration(
: DecorationImage( image: (deviceTypeController.currentCq.value['noBackImg'] !=
image: (widget.data['backgroundImg'] != null && null &&
widget.data['backgroundImg'] deviceTypeController.currentCq.value['noBackImg'] ==
.toString() true)
.isNotEmpty) ? null // ✅ 不要背景图
? AssetImage(widget.data['backgroundImg']) : DecorationImage(
: AssetImage(getBackgroundImageNoImage()) image: (deviceTypeController
as ImageProvider, .currentCq.value['backgroundImg'] !=
fit: BoxFit.fill, null &&
), deviceTypeController
), .currentCq.value['backgroundImg']
child: Scaffold( .toString()
backgroundColor: Colors.transparent, // 背景透明 .isNotEmpty)
appBar: (widget.data['arrow'] != null && ? AssetImage(deviceTypeController
widget.data['arrow'] == false) .currentCq.value['backgroundImg'])
? null : AssetImage(getBackgroundImageNoImage())
: AppBar( as ImageProvider,
backgroundColor: widget.data['backgroundColor'] != null fit: BoxFit.fill,
? widget.data['backgroundColor'].withOpacity(0.8) ),
: themeController.currentColor.sc5, ),
automaticallyImplyLeading: false, child: Scaffold(
iconTheme: IconThemeData( backgroundColor: Colors.transparent, // 背景透明
color: themeController.currentColor.sc3), appBar:
titleSpacing: 0, (deviceTypeController.currentCq.value['arrow'] != null &&
title: Container( deviceTypeController.currentCq.value['arrow'] ==
width: double.infinity, false)
height: 180.rpx, ? null
child: Stack( : AppBar(
alignment: Alignment.center, backgroundColor: deviceTypeController
children: [ .currentCq.value['backgroundColor'] !=
/// 居中标题 null
Text( ? deviceTypeController
'快检报告'.tr, .currentCq.value['backgroundColor']
style: TextStyle( .withOpacity(0.8)
fontFamily: 'Readex Pro', : themeController.currentColor.sc5,
color: themeController.currentColor.sc3, automaticallyImplyLeading: false,
letterSpacing: 0, iconTheme: IconThemeData(
fontSize: 30.rpx, color: themeController.currentColor.sc3),
titleSpacing: 0,
title: Container(
width: double.infinity,
height: 180.rpx,
child: Stack(
alignment: Alignment.center,
children: [
/// 居中标题
Text(
'快检报告'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
letterSpacing: 0,
fontSize: 30.rpx,
),
),
/// 左边返回按钮
if (deviceTypeController
.currentCq.value['arrow'] ==
null ||
deviceTypeController
.currentCq.value['arrow'] ==
true)
Positioned(
left: 0,
child: returnIconButtomNew(),
),
],
), ),
), ),
),
/// 左边返回按钮 body: SafeArea(
if (widget.data['arrow'] == null || top: true,
widget.data['arrow'] == true) child: Center(
Positioned( child: CircularProgressIndicator(
left: 0, color: themeController.currentColor.sc1,
child: returnIconButtomNew(), )),
), ),
],
),
),
),
body: SafeArea(
top: true,
child: Text('无数据'.tr),
), ),
), ),
), ),
), );
); } else {
} return LayoutBuilder(
return LayoutBuilder( builder: (context, bodySize) => GestureDetector(
builder: (context, bodySize) => GestureDetector( child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( image: (deviceTypeController.currentCq.value['noBackImg'] !=
image: (widget.data['noBackImg'] != null && null &&
widget.data['noBackImg'] == true) deviceTypeController.currentCq.value['noBackImg'] ==
? null // ✅ 不要背景图 true)
: DecorationImage( ? null // ✅ 不要背景图
image: (widget.data['backgroundImg'] != null && : DecorationImage(
widget.data['backgroundImg'] image: (deviceTypeController
.toString() .currentCq.value['backgroundImg'] !=
.isNotEmpty) null &&
? AssetImage(widget.data['backgroundImg']) deviceTypeController
: AssetImage(getBackgroundImageNoImage()) .currentCq.value['backgroundImg']
as ImageProvider, .toString()
fit: BoxFit.fill, .isNotEmpty)
), ? AssetImage(deviceTypeController
), .currentCq.value['backgroundImg'])
child: Scaffold( : AssetImage(getBackgroundImageNoImage())
backgroundColor: Colors.transparent, // 背景透明 as ImageProvider,
appBar: (widget.data['arrow'] != null && fit: BoxFit.fill,
widget.data['arrow'] == false)
? null
: AppBar(
backgroundColor: widget.data['backgroundColor'] != null
? widget.data['backgroundColor'].withOpacity(0.8)
: themeController.currentColor.sc5,
automaticallyImplyLeading: false,
iconTheme: IconThemeData(
color: themeController.currentColor.sc3),
titleSpacing: 0,
title: Container(
width: double.infinity,
height: 180.rpx,
child: Stack(
alignment: Alignment.center,
children: [
/// 居中标题
Text(
'快检报告'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
letterSpacing: 0,
fontSize: 30.rpx,
),
),
/// 左边返回按钮
if (widget.data['arrow'] == null ||
widget.data['arrow'] == true)
Positioned(
left: 0,
child: returnIconButtomNew(),
),
],
), ),
), ),
), child: Scaffold(
body: SafeArea( backgroundColor: Colors.transparent, // 背景透明
top: true, appBar:
child: SingleChildScrollView( (deviceTypeController.currentCq.value['arrow'] != null &&
child: Column( deviceTypeController.currentCq.value['arrow'] ==
children: [ false)
Padding( ? null
padding: : AppBar(
EdgeInsets.fromLTRB(30.rpx, 30.rpx, 30.rpx, 26.rpx), backgroundColor: deviceTypeController
child: Container( .currentCq.value['backgroundColor'] !=
width: double.infinity, null
constraints: BoxConstraints( ? deviceTypeController
minHeight: 90.rpx, // 最小高度 .currentCq.value['backgroundColor']
), .withOpacity(0.8)
decoration: BoxDecoration( : themeController.currentColor.sc5,
// color: themeController.currentColor.sc5, // 背景色 automaticallyImplyLeading: false,
), iconTheme: IconThemeData(
child: Padding( color: themeController.currentColor.sc3),
padding: EdgeInsetsDirectional.fromSTEB( titleSpacing: 0,
0.rpx, 0.rpx, 0.rpx, 0.rpx), title: Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// 左侧图标
Container(
margin: EdgeInsets.only(right: 7.rpx),
child: Icon(
Icons.info_outline,
size: 26.rpx,
color: themeController.currentColor.sc8,
),
),
// 中间可换行文字
Expanded(
child: Container(
margin: EdgeInsets.only(right: 69.rpx),
child: Text(
'5分钟快速检测可能受到用户当前状态、过程中说话动作、精神紧张等情况影响数据仅供参考。'
.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: AppConstants()
.smaller_text_fontSize,
color: themeController.currentColor.sc8,
height: 1.4,
),
softWrap: true,
),
),
),
],
),
),
),
),
Padding(
padding: EdgeInsets.fromLTRB(30.rpx, 0, 30.rpx, 0),
child: Container(
decoration: BoxDecoration(
color: themeController.currentColor.sc5,
borderRadius: BorderRadius.circular(16.rpx),
),
child: Column(
children: [
// 第一个容器 - 包含Row布局
Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(30.rpx), height: 180.rpx,
decoration: BoxDecoration( child: Stack(
// color: themeController.currentColor.sc5, alignment: Alignment.center,
borderRadius: BorderRadius.circular(16.rpx), children: [
/// 居中标题
Text(
'快检报告'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
letterSpacing: 0,
fontSize: 30.rpx,
),
),
/// 左边返回按钮
if (deviceTypeController
.currentCq.value['arrow'] ==
null ||
deviceTypeController
.currentCq.value['arrow'] ==
true)
Positioned(
left: 0,
child: returnIconButtomNew(),
),
],
), ),
),
),
body: SafeArea(
top: true,
child: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: EdgeInsets.fromLTRB(
30.rpx, 30.rpx, 30.rpx, 26.rpx),
child: Container(
width: double.infinity,
constraints: BoxConstraints(
minHeight: 90.rpx, // 最小高度
),
decoration: BoxDecoration(
// color: themeController.currentColor.sc5, // 背景色
),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 0.rpx, 0.rpx, 0.rpx),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
// 左边的Column包含五行文字 // 左侧图标
Container(
margin: EdgeInsets.only(right: 7.rpx),
child: Icon(
Icons.info_outline,
size: 26.rpx,
color: themeController.currentColor.sc8,
),
),
// 中间可换行文字
Expanded( Expanded(
child: Column( child: Container(
crossAxisAlignment: margin: EdgeInsets.only(right: 69.rpx),
CrossAxisAlignment.start, child: Text(
children: [ '5分钟快速检测可能受到用户当前状态、过程中说话动作、精神紧张等情况影响数据仅供参考。'
Text( .tr,
'${widget.data['person']['name']} (${widget.data['person']['gender']} ${widget.data['person']['age'].toInt()}岁)', style: TextStyle(
style: TextStyle( fontFamily: 'Inter',
fontSize: AppConstants() fontSize: AppConstants()
.bigger_text_fontSize, .smaller_text_fontSize,
color: themeController color: themeController
.currentColor.sc3, .currentColor.sc8,
// fontWeight: FontWeight.bold, height: 1.4,
),
), ),
SizedBox(height: 18.rpx), softWrap: true,
Text( ),
"快检得分:".tr + ),
'${widget.data['score']['score'].toInt()}', ),
style: TextStyle( ],
fontSize: AppConstants() ),
.small_an_text_fontSize, ),
color: themeController ),
.currentColor.sc3, ),
), Padding(
), padding: EdgeInsets.fromLTRB(30.rpx, 0, 30.rpx, 0),
SizedBox(height: 18.rpx), child: Container(
Row( decoration: BoxDecoration(
color: themeController.currentColor.sc5,
borderRadius: BorderRadius.circular(16.rpx),
),
child: Column(
children: [
// 第一个容器 - 包含Row布局
Container(
width: double.infinity,
padding: EdgeInsets.all(30.rpx),
decoration: BoxDecoration(
// color: themeController.currentColor.sc5,
borderRadius:
BorderRadius.circular(16.rpx),
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
// 左边的Column包含五行文字
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"健康等级:".tr, '${deviceTypeController.currentCq.value['person']['name']} (${deviceTypeController.currentCq.value['person']['gender']} ${deviceTypeController.currentCq.value['person']['age'].toInt()}岁)',
style: TextStyle(
fontSize: AppConstants()
.bigger_text_fontSize,
color: themeController
.currentColor.sc3,
// fontWeight: FontWeight.bold,
),
),
SizedBox(height: 18.rpx),
Text(
"快检得分:".tr +
'${deviceTypeController.currentCq.value['score']['score'].toInt()}',
style: TextStyle( style: TextStyle(
fontSize: AppConstants() fontSize: AppConstants()
.small_an_text_fontSize, .small_an_text_fontSize,
@@ -297,156 +342,178 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
.currentColor.sc3, .currentColor.sc3,
), ),
), ),
SizedBox(height: 18.rpx),
Row(
children: [
Text(
"健康等级:".tr,
style: TextStyle(
fontSize: AppConstants()
.small_an_text_fontSize,
color: themeController
.currentColor.sc3,
),
),
Text(
healthLevelInfo['text'],
style: TextStyle(
fontSize: AppConstants()
.small_an_text_fontSize,
color: healthLevelInfo[
'color'],
),
),
],
),
SizedBox(height: 18.rpx),
Text( Text(
healthLevelInfo['text'], "设备ID".tr +
'${deviceTypeController.currentCq.value['mac']}',
style: TextStyle( style: TextStyle(
fontSize: AppConstants() fontSize: AppConstants()
.small_an_text_fontSize, .small_an_text_fontSize,
color: color: themeController
healthLevelInfo['color'], .currentColor.sc3,
),
),
SizedBox(height: 18.rpx),
Text(
"快检时间:".tr +
'${MyUtils.timestampToDateString(deviceTypeController.currentCq.value['create_time'].toInt())}',
style: TextStyle(
fontSize: AppConstants()
.small_an_text_fontSize,
color: themeController
.currentColor.sc3,
), ),
), ),
], ],
), ),
SizedBox(height: 18.rpx),
Text(
"设备ID".tr +
'${widget.data['mac']}',
style: TextStyle(
fontSize: AppConstants()
.small_an_text_fontSize,
color: themeController
.currentColor.sc3,
),
),
SizedBox(height: 18.rpx),
Text(
"快检时间:".tr +
'${MyUtils.timestampToDateString(widget.data['create_time'].toInt())}',
style: TextStyle(
fontSize: AppConstants()
.small_an_text_fontSize,
color: themeController
.currentColor.sc3,
),
),
],
),
),
// SizedBox(width: 20.rpx), // 左边文字和右边图片的间距
// 右边的本地图片
Container(
width: 120.rpx,
height: 190.rpx,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(12.rpx),
image: DecorationImage(
image: AssetImage(
'assets/img/black_body_still.png'), // 替换为您的本地图片路径
fit: BoxFit.cover,
), ),
// SizedBox(width: 20.rpx), // 左边文字和右边图片的间距
// 右边的本地图片
Container(
width: 120.rpx,
height: 190.rpx,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(12.rpx),
image: DecorationImage(
image: AssetImage(
'assets/img/black_body_still.png'), // 替换为您的本地图片路径
fit: BoxFit.cover,
),
),
),
],
),
),
SizedBox(height: 34.rpx), // 两个容器之间的间距
// 第二个容器 - 包含StatusBarWithIndicator todo接入报告数据
Container(
width: double.infinity,
// height: 220.rpx,
decoration: BoxDecoration(
// color: themeController.currentColor.sc5,
borderRadius:
BorderRadius.circular(16.rpx),
),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(
30.rpx, 20.rpx, 30.rpx, 20.rpx),
child: StatusBarWithIndicator(
selectKey: deviceTypeController
.currentCq.value['score']['level']
.toInt(), // 这里传入对应的 level 值
showLabel: (deviceTypeController
.currentCq
.value['type']['score'] as List)
.map<Map<String, dynamic>>((item) {
return {
'key': item['level']?.toInt() ??
0, // 使用 level 作为 key
'name': item['name'] ?? '',
'color': stringToColor(
item['color'] ??
''), // 将颜色字符串转换为 Color
'range':
item['range'] ?? '', // 添加范围数据
};
}).toList(),
showCurrentValue: true, // 显示当前值
currentValueText:
'当前属于'.tr, // 或者根据实际值动态生成
showRange: true, // 显示范围
), ),
), ),
], ),
),
SizedBox(height: 25.rpx), // 两个容器之间的间距
],
), ),
),
SizedBox(height: 34.rpx), // 两个容器之间的间距 ),
Padding(
// 第二个容器 - 包含StatusBarWithIndicator todo接入报告数据 padding: EdgeInsets.fromLTRB(30.rpx, 0, 30.rpx, 0),
Container( child: Container(
width: double.infinity, width: double.infinity,
// height: 220.rpx, // padding: EdgeInsets.all(30.rpx),
decoration: BoxDecoration( decoration: BoxDecoration(
// color: themeController.currentColor.sc5, // color: themeController.currentColor.sc5,
borderRadius: BorderRadius.circular(16.rpx), borderRadius: BorderRadius.circular(16.rpx),
),
child: QcReportWidget(
deviceTypeController.currentCq.value),
),
),
Padding(
padding: EdgeInsets.fromLTRB(46.rpx, 0, 46.rpx, 0),
child: Column(
children: [
// Text(
// "MAC号".tr +
// ": ${deviceTypeController.currentCq.value['mac'] ?? '未知数据'.tr}",
// style: TextStyle(
// color: themeController.currentColor.sc4,
// fontSize:
// AppConstants().smaller_text_fontSize,
// ),
// ),
SizedBox(
height: 4.rpx,
), ),
child: Padding( Text(
padding: EdgeInsetsDirectional.fromSTEB( "本页报告是基于心率、呼吸等体征波形数据通过AI算法模型分析完成其结果仅供参考其中报告未见数据异常部分并不代表没有潜在性的疾病风险如有不适请及时就医。"
30.rpx, 20.rpx, 30.rpx, 20.rpx), .tr,
child: StatusBarWithIndicator( style: TextStyle(
selectKey: widget.data['score']['level'] color: themeController.currentColor.sc4,
.toInt(), // 这里传入对应的 level 值 fontSize:
showLabel: AppConstants().smaller_text_fontSize,
(widget.data['type']['score'] as List)
.map<Map<String, dynamic>>((item) {
return {
'key': item['level']?.toInt() ??
0, // 使用 level 作为 key
'name': item['name'] ?? '',
'color': stringToColor(item['color'] ??
''), // 将颜色字符串转换为 Color
'range': item['range'] ?? '', // 添加范围数据
};
}).toList(),
showCurrentValue: true, // 显示当前值
currentValueText: '当前属于'.tr, // 或者根据实际值动态生成
showRange: true, // 显示范围
), ),
), ),
), ],
SizedBox(height: 25.rpx), // 两个容器之间的间距
],
),
),
),
Padding(
padding: EdgeInsets.fromLTRB(30.rpx, 0, 30.rpx, 0),
child: Container(
width: double.infinity,
// padding: EdgeInsets.all(30.rpx),
decoration: BoxDecoration(
// color: themeController.currentColor.sc5,
borderRadius: BorderRadius.circular(16.rpx),
),
child: QcReportWidget(widget.data),
),
),
Padding(
padding: EdgeInsets.fromLTRB(46.rpx, 0, 46.rpx, 0),
child: Column(
children: [
// Text(
// "MAC号".tr +
// ": ${widget.data['mac'] ?? '未知数据'.tr}",
// style: TextStyle(
// color: themeController.currentColor.sc4,
// fontSize:
// AppConstants().smaller_text_fontSize,
// ),
// ),
SizedBox(
height: 4.rpx,
), ),
Text( ),
"本页报告是基于心率、呼吸等体征波形数据通过AI算法模型分析完成其结果仅供参考其中报告未见数据异常部分并不代表没有潜在性的疾病风险如有不适请及时就医。" SizedBox(
.tr, height: 40.rpx,
style: TextStyle( ),
color: themeController.currentColor.sc4, ]
fontSize: AppConstants().smaller_text_fontSize, .divide(SizedBox(
), height: 25.rpx,
), ))
], .addToEnd(SizedBox(height: 25.rpx)),
),
), ),
SizedBox( ),
height: 40.rpx,
),
]
.divide(SizedBox(
height: 25.rpx,
))
.addToEnd(SizedBox(height: 25.rpx)),
), ),
), ),
), ),
), ),
), );
), }
); });
} catch (e) { } catch (e) {
NewTopSlideNotification.show( NewTopSlideNotification.show(
text: '页面渲染失败:${e.toString()}'.tr, text: '页面渲染失败:${e.toString()}'.tr,
@@ -456,15 +523,20 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
builder: (context, bodySize) => GestureDetector( builder: (context, bodySize) => GestureDetector(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
image: (widget.data['noBackImg'] != null && image: (deviceTypeController.currentCq.value['noBackImg'] !=
widget.data['noBackImg'] == true) null &&
deviceTypeController.currentCq.value['noBackImg'] == true)
? null // ✅ 不要背景图 ? null // ✅ 不要背景图
: DecorationImage( : DecorationImage(
image: (widget.data['backgroundImg'] != null && image: (deviceTypeController
widget.data['backgroundImg'] .currentCq.value['backgroundImg'] !=
null &&
deviceTypeController
.currentCq.value['backgroundImg']
.toString() .toString()
.isNotEmpty) .isNotEmpty)
? AssetImage(widget.data['backgroundImg']) ? AssetImage(deviceTypeController
.currentCq.value['backgroundImg'])
: AssetImage(getBackgroundImageNoImage()) : AssetImage(getBackgroundImageNoImage())
as ImageProvider, as ImageProvider,
fit: BoxFit.fill, fit: BoxFit.fill,
@@ -472,12 +544,16 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, // 背景透明 backgroundColor: Colors.transparent, // 背景透明
appBar: (widget.data['arrow'] != null && appBar: (deviceTypeController.currentCq.value['arrow'] != null &&
widget.data['arrow'] == false) deviceTypeController.currentCq.value['arrow'] == false)
? null ? null
: AppBar( : AppBar(
backgroundColor: widget.data['backgroundColor'] != null backgroundColor: deviceTypeController
? widget.data['backgroundColor'].withOpacity(0.8) .currentCq.value['backgroundColor'] !=
null
? deviceTypeController
.currentCq.value['backgroundColor']
.withOpacity(0.8)
: themeController.currentColor.sc5, : themeController.currentColor.sc5,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
iconTheme: IconThemeData( iconTheme: IconThemeData(
@@ -501,8 +577,10 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
), ),
/// 左边返回按钮 /// 左边返回按钮
if (widget.data['arrow'] == null || if (deviceTypeController.currentCq.value['arrow'] ==
widget.data['arrow'] == true) null ||
deviceTypeController.currentCq.value['arrow'] ==
true)
Positioned( Positioned(
left: 0, left: 0,
child: returnIconButtomNew(), child: returnIconButtomNew(),