3.修改睡眠报告文字 正常窦性心律
This commit is contained in:
@@ -94,19 +94,28 @@ class _HealthReportCardWidgetState extends State<HealthReportCardWidget> {
|
||||
_formatTime(reportData['create_time']),
|
||||
onViewTap: () async {
|
||||
// 查看按钮点击事件
|
||||
edm.EasyDartModule.logger.info("快检报告查看按钮点击");
|
||||
String ID = reportData['id'];
|
||||
DeviceTypeController deviceTypeController =
|
||||
Get.find();
|
||||
await deviceTypeController.getCheckHistory(
|
||||
id: ID, mac: reportData['mac']);
|
||||
if (deviceTypeController.currentCq.value == null ||
|
||||
deviceTypeController.currentCq.value.isEmpty) {
|
||||
NewTopSlideNotification.show(
|
||||
text: "未找到快检报告".tr,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
return;
|
||||
}
|
||||
_onViewReport(deviceTypeController.currentCq.value);
|
||||
Map data = {
|
||||
'id': ID,
|
||||
'mac': reportData['mac'],
|
||||
};
|
||||
// await deviceTypeController.getCheckHistory(
|
||||
// id: ID, mac: reportData['mac']);
|
||||
// if (Get.currentRoute != '/healthExperienceHistory')
|
||||
// return;
|
||||
// if (deviceTypeController.currentCq.value == null ||
|
||||
// deviceTypeController.currentCq.value.isEmpty) {
|
||||
// NewTopSlideNotification.show(
|
||||
// text: "未找到快检报告".tr,
|
||||
// textColor: themeController.currentColor.sc9);
|
||||
// return;
|
||||
// }
|
||||
// _onViewReport(deviceTypeController.currentCq.value);
|
||||
Get.toNamed('/healthQuickCheckReportPage',
|
||||
arguments: data);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1262,11 +1262,14 @@ class _HealthCheckPageState extends State<HealthCheckPage>
|
||||
progressNotifier.value = 0;
|
||||
edm.EasyDartModule.logger.info("快检结束,停止定时查询");
|
||||
_checkStatusTimer?.cancel();
|
||||
await deviceTypeController.getCheckHistory(
|
||||
id: deviceTypeController.experience_id.value,
|
||||
mac: widget.personInfo['mac']);
|
||||
Get.toNamed('/healthQuickCheckReportPage',
|
||||
arguments: deviceTypeController.currentCq.value);
|
||||
Map data = {
|
||||
"id": deviceTypeController.experience_id.value,
|
||||
"mac": widget.personInfo['mac']
|
||||
};
|
||||
// await deviceTypeController.getCheckHistory(
|
||||
// id: deviceTypeController.experience_id.value,
|
||||
// mac: widget.personInfo['mac']);
|
||||
Get.toNamed('/healthQuickCheckReportPage', arguments: data);
|
||||
} catch (e) {
|
||||
edm.EasyDartModule.logger.error("快检报告页面加载失败---?${e.toString()}");
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:vbvs_app/controller/message/message_review_controller.dart';
|
||||
import 'package:vbvs_app/pages/device/component/HealthReportCard.dart';
|
||||
|
||||
class HealthExperienceHistory extends StatefulWidget {
|
||||
var data; //1.绑定时 2.绑定后
|
||||
var data;
|
||||
HealthExperienceHistory({super.key, required this.data});
|
||||
|
||||
@override
|
||||
|
||||
@@ -6,9 +6,11 @@ import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/NewTopSlideNotification.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/pages/sleep_report/QcReportWidget.dart';
|
||||
import 'package:vbvs_app/pages/sleep_report/chart/StatusBarWithIndicator.dart';
|
||||
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||
|
||||
class QuickHealthReportPage extends StatefulWidget {
|
||||
var data;
|
||||
@@ -27,6 +29,7 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
|
||||
final GlobalKey breatheCardKey = GlobalKey();
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
final RxBool isRightLimit = false.obs;
|
||||
DeviceTypeController deviceTypeController = Get.find();
|
||||
|
||||
@override
|
||||
void didUpdateWidget(QuickHealthReportPage oldWidget) {
|
||||
@@ -47,249 +50,291 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
|
||||
@override
|
||||
void 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
|
||||
Widget build(BuildContext context) {
|
||||
final healthLevelInfo = getHealthLevelInfo(widget.data);
|
||||
|
||||
double lineWidth = 150.rpx;
|
||||
try {
|
||||
if (widget.data == null || widget.data.isEmpty) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: (widget.data['noBackImg'] != null &&
|
||||
widget.data['noBackImg'] == true)
|
||||
? null // ✅ 不要背景图
|
||||
: DecorationImage(
|
||||
image: (widget.data['backgroundImg'] != null &&
|
||||
widget.data['backgroundImg']
|
||||
.toString()
|
||||
.isNotEmpty)
|
||||
? AssetImage(widget.data['backgroundImg'])
|
||||
: AssetImage(getBackgroundImageNoImage())
|
||||
as ImageProvider,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent, // 背景透明
|
||||
appBar: (widget.data['arrow'] != null &&
|
||||
widget.data['arrow'] == false)
|
||||
? null
|
||||
: AppBar(
|
||||
backgroundColor: widget.data['backgroundColor'] != null
|
||||
? widget.data['backgroundColor'].withOpacity(0.8)
|
||||
: themeController.currentColor.sc5,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(
|
||||
color: themeController.currentColor.sc3),
|
||||
titleSpacing: 0,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
/// 居中标题
|
||||
Text(
|
||||
'快检报告'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
return Obx(() {
|
||||
final healthLevelInfo =
|
||||
getHealthLevelInfo(deviceTypeController.currentCq.value);
|
||||
if (deviceTypeController.qcDetailLoading.value) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: (deviceTypeController.currentCq.value['noBackImg'] !=
|
||||
null &&
|
||||
deviceTypeController.currentCq.value['noBackImg'] ==
|
||||
true)
|
||||
? null // ✅ 不要背景图
|
||||
: DecorationImage(
|
||||
image: (deviceTypeController
|
||||
.currentCq.value['backgroundImg'] !=
|
||||
null &&
|
||||
deviceTypeController
|
||||
.currentCq.value['backgroundImg']
|
||||
.toString()
|
||||
.isNotEmpty)
|
||||
? AssetImage(deviceTypeController
|
||||
.currentCq.value['backgroundImg'])
|
||||
: AssetImage(getBackgroundImageNoImage())
|
||||
as ImageProvider,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent, // 背景透明
|
||||
appBar:
|
||||
(deviceTypeController.currentCq.value['arrow'] != null &&
|
||||
deviceTypeController.currentCq.value['arrow'] ==
|
||||
false)
|
||||
? null
|
||||
: AppBar(
|
||||
backgroundColor: deviceTypeController
|
||||
.currentCq.value['backgroundColor'] !=
|
||||
null
|
||||
? deviceTypeController
|
||||
.currentCq.value['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 (deviceTypeController
|
||||
.currentCq.value['arrow'] ==
|
||||
null ||
|
||||
deviceTypeController
|
||||
.currentCq.value['arrow'] ==
|
||||
true)
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtomNew(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
/// 左边返回按钮
|
||||
if (widget.data['arrow'] == null ||
|
||||
widget.data['arrow'] == true)
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtomNew(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Text('无数据'.tr),
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: themeController.currentColor.sc1,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: (widget.data['noBackImg'] != null &&
|
||||
widget.data['noBackImg'] == true)
|
||||
? null // ✅ 不要背景图
|
||||
: DecorationImage(
|
||||
image: (widget.data['backgroundImg'] != null &&
|
||||
widget.data['backgroundImg']
|
||||
.toString()
|
||||
.isNotEmpty)
|
||||
? AssetImage(widget.data['backgroundImg'])
|
||||
: AssetImage(getBackgroundImageNoImage())
|
||||
as ImageProvider,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent, // 背景透明
|
||||
appBar: (widget.data['arrow'] != null &&
|
||||
widget.data['arrow'] == false)
|
||||
? null
|
||||
: AppBar(
|
||||
backgroundColor: widget.data['backgroundColor'] != null
|
||||
? widget.data['backgroundColor'].withOpacity(0.8)
|
||||
: themeController.currentColor.sc5,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(
|
||||
color: themeController.currentColor.sc3),
|
||||
titleSpacing: 0,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
/// 居中标题
|
||||
Text(
|
||||
'快检报告'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
|
||||
/// 左边返回按钮
|
||||
if (widget.data['arrow'] == null ||
|
||||
widget.data['arrow'] == true)
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtomNew(),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: (deviceTypeController.currentCq.value['noBackImg'] !=
|
||||
null &&
|
||||
deviceTypeController.currentCq.value['noBackImg'] ==
|
||||
true)
|
||||
? null // ✅ 不要背景图
|
||||
: DecorationImage(
|
||||
image: (deviceTypeController
|
||||
.currentCq.value['backgroundImg'] !=
|
||||
null &&
|
||||
deviceTypeController
|
||||
.currentCq.value['backgroundImg']
|
||||
.toString()
|
||||
.isNotEmpty)
|
||||
? AssetImage(deviceTypeController
|
||||
.currentCq.value['backgroundImg'])
|
||||
: AssetImage(getBackgroundImageNoImage())
|
||||
as ImageProvider,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
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(
|
||||
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(
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent, // 背景透明
|
||||
appBar:
|
||||
(deviceTypeController.currentCq.value['arrow'] != null &&
|
||||
deviceTypeController.currentCq.value['arrow'] ==
|
||||
false)
|
||||
? null
|
||||
: AppBar(
|
||||
backgroundColor: deviceTypeController
|
||||
.currentCq.value['backgroundColor'] !=
|
||||
null
|
||||
? deviceTypeController
|
||||
.currentCq.value['backgroundColor']
|
||||
.withOpacity(0.8)
|
||||
: themeController.currentColor.sc5,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(
|
||||
color: themeController.currentColor.sc3),
|
||||
titleSpacing: 0,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(30.rpx),
|
||||
decoration: BoxDecoration(
|
||||
// color: themeController.currentColor.sc5,
|
||||
borderRadius: BorderRadius.circular(16.rpx),
|
||||
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(
|
||||
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(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
// 左边的Column,包含五行文字
|
||||
// 左侧图标
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 7.rpx),
|
||||
child: Icon(
|
||||
Icons.info_outline,
|
||||
size: 26.rpx,
|
||||
color: themeController.currentColor.sc8,
|
||||
),
|
||||
),
|
||||
|
||||
// 中间可换行文字
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${widget.data['person']['name']} (${widget.data['person']['gender']} ${widget.data['person']['age'].toInt()}岁)',
|
||||
style: TextStyle(
|
||||
fontSize: AppConstants()
|
||||
.bigger_text_fontSize,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
// fontWeight: FontWeight.bold,
|
||||
),
|
||||
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,
|
||||
),
|
||||
SizedBox(height: 18.rpx),
|
||||
Text(
|
||||
"快检得分:".tr +
|
||||
'${widget.data['score']['score'].toInt()} 分',
|
||||
style: TextStyle(
|
||||
fontSize: AppConstants()
|
||||
.small_an_text_fontSize,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 18.rpx),
|
||||
Row(
|
||||
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,
|
||||
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: [
|
||||
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(
|
||||
fontSize: AppConstants()
|
||||
.small_an_text_fontSize,
|
||||
@@ -297,156 +342,178 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
|
||||
.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(
|
||||
healthLevelInfo['text'],
|
||||
"设备ID:".tr +
|
||||
'${deviceTypeController.currentCq.value['mac']}',
|
||||
style: TextStyle(
|
||||
fontSize: AppConstants()
|
||||
.small_an_text_fontSize,
|
||||
color:
|
||||
healthLevelInfo['color'],
|
||||
color: themeController
|
||||
.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), // 两个容器之间的间距
|
||||
|
||||
// 第二个容器 - 包含StatusBarWithIndicator todo接入报告数据
|
||||
Container(
|
||||
width: double.infinity,
|
||||
// height: 220.rpx,
|
||||
decoration: BoxDecoration(
|
||||
// color: themeController.currentColor.sc5,
|
||||
borderRadius: BorderRadius.circular(16.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(
|
||||
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(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 20.rpx, 30.rpx, 20.rpx),
|
||||
child: StatusBarWithIndicator(
|
||||
selectKey: widget.data['score']['level']
|
||||
.toInt(), // 这里传入对应的 level 值
|
||||
showLabel:
|
||||
(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, // 显示范围
|
||||
Text(
|
||||
"注:本页报告是基于心率、呼吸等体征波形数据,通过AI算法模型分析完成,其结果仅供参考;其中报告未见数据异常部分,并不代表没有潜在性的疾病风险,如有不适请及时就医。"
|
||||
.tr,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize:
|
||||
AppConstants().smaller_text_fontSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
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算法模型分析完成,其结果仅供参考;其中报告未见数据异常部分,并不代表没有潜在性的疾病风险,如有不适请及时就医。"
|
||||
.tr,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize: AppConstants().smaller_text_fontSize,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40.rpx,
|
||||
),
|
||||
]
|
||||
.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) {
|
||||
NewTopSlideNotification.show(
|
||||
text: '页面渲染失败:${e.toString()}'.tr,
|
||||
@@ -456,15 +523,20 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: (widget.data['noBackImg'] != null &&
|
||||
widget.data['noBackImg'] == true)
|
||||
image: (deviceTypeController.currentCq.value['noBackImg'] !=
|
||||
null &&
|
||||
deviceTypeController.currentCq.value['noBackImg'] == true)
|
||||
? null // ✅ 不要背景图
|
||||
: DecorationImage(
|
||||
image: (widget.data['backgroundImg'] != null &&
|
||||
widget.data['backgroundImg']
|
||||
image: (deviceTypeController
|
||||
.currentCq.value['backgroundImg'] !=
|
||||
null &&
|
||||
deviceTypeController
|
||||
.currentCq.value['backgroundImg']
|
||||
.toString()
|
||||
.isNotEmpty)
|
||||
? AssetImage(widget.data['backgroundImg'])
|
||||
? AssetImage(deviceTypeController
|
||||
.currentCq.value['backgroundImg'])
|
||||
: AssetImage(getBackgroundImageNoImage())
|
||||
as ImageProvider,
|
||||
fit: BoxFit.fill,
|
||||
@@ -472,12 +544,16 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent, // 背景透明
|
||||
appBar: (widget.data['arrow'] != null &&
|
||||
widget.data['arrow'] == false)
|
||||
appBar: (deviceTypeController.currentCq.value['arrow'] != null &&
|
||||
deviceTypeController.currentCq.value['arrow'] == false)
|
||||
? null
|
||||
: AppBar(
|
||||
backgroundColor: widget.data['backgroundColor'] != null
|
||||
? widget.data['backgroundColor'].withOpacity(0.8)
|
||||
backgroundColor: deviceTypeController
|
||||
.currentCq.value['backgroundColor'] !=
|
||||
null
|
||||
? deviceTypeController
|
||||
.currentCq.value['backgroundColor']
|
||||
.withOpacity(0.8)
|
||||
: themeController.currentColor.sc5,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(
|
||||
@@ -501,8 +577,10 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
|
||||
),
|
||||
|
||||
/// 左边返回按钮
|
||||
if (widget.data['arrow'] == null ||
|
||||
widget.data['arrow'] == true)
|
||||
if (deviceTypeController.currentCq.value['arrow'] ==
|
||||
null ||
|
||||
deviceTypeController.currentCq.value['arrow'] ==
|
||||
true)
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtomNew(),
|
||||
|
||||
Reference in New Issue
Block a user