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 {
// 生成新的序列号
final currentSeq = ++_requestSequence;
if (id == null || id.isEmpty) {
qcListLoading.value = true; 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>;
} }
if (id == null || id.isEmpty) {
qcListLoading.value = false; 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;
if (id == null || id.isEmpty) {
qcListLoading.value = false; 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,28 +50,50 @@ 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(() {
final healthLevelInfo =
getHealthLevelInfo(deviceTypeController.currentCq.value);
if (deviceTypeController.qcDetailLoading.value) {
return LayoutBuilder( return LayoutBuilder(
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,
@@ -76,12 +101,18 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, // 背景透明 backgroundColor: Colors.transparent, // 背景透明
appBar: (widget.data['arrow'] != null && appBar:
widget.data['arrow'] == false) (deviceTypeController.currentCq.value['arrow'] != null &&
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(
@@ -105,8 +136,12 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
), ),
/// 左边返回按钮 /// 左边返回按钮
if (widget.data['arrow'] == null || if (deviceTypeController
widget.data['arrow'] == true) .currentCq.value['arrow'] ==
null ||
deviceTypeController
.currentCq.value['arrow'] ==
true)
Positioned( Positioned(
left: 0, left: 0,
child: returnIconButtomNew(), child: returnIconButtomNew(),
@@ -117,26 +152,35 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
), ),
body: SafeArea( body: SafeArea(
top: true, top: true,
child: Text('无数据'.tr), child: Center(
child: CircularProgressIndicator(
color: themeController.currentColor.sc1,
)),
), ),
), ),
), ),
), ),
); );
} } else {
return LayoutBuilder( return LayoutBuilder(
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,
@@ -144,12 +188,18 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, // 背景透明 backgroundColor: Colors.transparent, // 背景透明
appBar: (widget.data['arrow'] != null && appBar:
widget.data['arrow'] == false) (deviceTypeController.currentCq.value['arrow'] != null &&
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(
@@ -173,8 +223,12 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
), ),
/// 左边返回按钮 /// 左边返回按钮
if (widget.data['arrow'] == null || if (deviceTypeController
widget.data['arrow'] == true) .currentCq.value['arrow'] ==
null ||
deviceTypeController
.currentCq.value['arrow'] ==
true)
Positioned( Positioned(
left: 0, left: 0,
child: returnIconButtomNew(), child: returnIconButtomNew(),
@@ -189,8 +243,8 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: padding: EdgeInsets.fromLTRB(
EdgeInsets.fromLTRB(30.rpx, 30.rpx, 30.rpx, 26.rpx), 30.rpx, 30.rpx, 30.rpx, 26.rpx),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
constraints: BoxConstraints( constraints: BoxConstraints(
@@ -226,7 +280,8 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
fontFamily: 'Inter', fontFamily: 'Inter',
fontSize: AppConstants() fontSize: AppConstants()
.smaller_text_fontSize, .smaller_text_fontSize,
color: themeController.currentColor.sc8, color: themeController
.currentColor.sc8,
height: 1.4, height: 1.4,
), ),
softWrap: true, softWrap: true,
@@ -253,10 +308,12 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
padding: EdgeInsets.all(30.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: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
// 左边的Column包含五行文字 // 左边的Column包含五行文字
Expanded( Expanded(
@@ -265,7 +322,7 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'${widget.data['person']['name']} (${widget.data['person']['gender']} ${widget.data['person']['age'].toInt()}岁)', '${deviceTypeController.currentCq.value['person']['name']} (${deviceTypeController.currentCq.value['person']['gender']} ${deviceTypeController.currentCq.value['person']['age'].toInt()}岁)',
style: TextStyle( style: TextStyle(
fontSize: AppConstants() fontSize: AppConstants()
.bigger_text_fontSize, .bigger_text_fontSize,
@@ -277,7 +334,7 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
SizedBox(height: 18.rpx), SizedBox(height: 18.rpx),
Text( Text(
"快检得分:".tr + "快检得分:".tr +
'${widget.data['score']['score'].toInt()}', '${deviceTypeController.currentCq.value['score']['score'].toInt()}',
style: TextStyle( style: TextStyle(
fontSize: AppConstants() fontSize: AppConstants()
.small_an_text_fontSize, .small_an_text_fontSize,
@@ -302,8 +359,8 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
style: TextStyle( style: TextStyle(
fontSize: AppConstants() fontSize: AppConstants()
.small_an_text_fontSize, .small_an_text_fontSize,
color: color: healthLevelInfo[
healthLevelInfo['color'], 'color'],
), ),
), ),
], ],
@@ -311,7 +368,7 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
SizedBox(height: 18.rpx), SizedBox(height: 18.rpx),
Text( Text(
"设备ID".tr + "设备ID".tr +
'${widget.data['mac']}', '${deviceTypeController.currentCq.value['mac']}',
style: TextStyle( style: TextStyle(
fontSize: AppConstants() fontSize: AppConstants()
.small_an_text_fontSize, .small_an_text_fontSize,
@@ -322,7 +379,7 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
SizedBox(height: 18.rpx), SizedBox(height: 18.rpx),
Text( Text(
"快检时间:".tr + "快检时间:".tr +
'${MyUtils.timestampToDateString(widget.data['create_time'].toInt())}', '${MyUtils.timestampToDateString(deviceTypeController.currentCq.value['create_time'].toInt())}',
style: TextStyle( style: TextStyle(
fontSize: AppConstants() fontSize: AppConstants()
.small_an_text_fontSize, .small_an_text_fontSize,
@@ -361,28 +418,34 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
// height: 220.rpx, // height: 220.rpx,
decoration: BoxDecoration( decoration: BoxDecoration(
// color: themeController.currentColor.sc5, // color: themeController.currentColor.sc5,
borderRadius: BorderRadius.circular(16.rpx), borderRadius:
BorderRadius.circular(16.rpx),
), ),
child: Padding( child: Padding(
padding: EdgeInsetsDirectional.fromSTEB( padding: EdgeInsetsDirectional.fromSTEB(
30.rpx, 20.rpx, 30.rpx, 20.rpx), 30.rpx, 20.rpx, 30.rpx, 20.rpx),
child: StatusBarWithIndicator( child: StatusBarWithIndicator(
selectKey: widget.data['score']['level'] selectKey: deviceTypeController
.currentCq.value['score']['level']
.toInt(), // 这里传入对应的 level 值 .toInt(), // 这里传入对应的 level 值
showLabel: showLabel: (deviceTypeController
(widget.data['type']['score'] as List) .currentCq
.value['type']['score'] as List)
.map<Map<String, dynamic>>((item) { .map<Map<String, dynamic>>((item) {
return { return {
'key': item['level']?.toInt() ?? 'key': item['level']?.toInt() ??
0, // 使用 level 作为 key 0, // 使用 level 作为 key
'name': item['name'] ?? '', 'name': item['name'] ?? '',
'color': stringToColor(item['color'] ?? 'color': stringToColor(
item['color'] ??
''), // 将颜色字符串转换为 Color ''), // 将颜色字符串转换为 Color
'range': item['range'] ?? '', // 添加范围数据 'range':
item['range'] ?? '', // 添加范围数据
}; };
}).toList(), }).toList(),
showCurrentValue: true, // 显示当前值 showCurrentValue: true, // 显示当前值
currentValueText: '当前属于'.tr, // 或者根据实际值动态生成 currentValueText:
'当前属于'.tr, // 或者根据实际值动态生成
showRange: true, // 显示范围 showRange: true, // 显示范围
), ),
), ),
@@ -402,7 +465,8 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
// color: themeController.currentColor.sc5, // color: themeController.currentColor.sc5,
borderRadius: BorderRadius.circular(16.rpx), borderRadius: BorderRadius.circular(16.rpx),
), ),
child: QcReportWidget(widget.data), child: QcReportWidget(
deviceTypeController.currentCq.value),
), ),
), ),
Padding( Padding(
@@ -411,7 +475,7 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
children: [ children: [
// Text( // Text(
// "MAC号".tr + // "MAC号".tr +
// ": ${widget.data['mac'] ?? '未知数据'.tr}", // ": ${deviceTypeController.currentCq.value['mac'] ?? '未知数据'.tr}",
// style: TextStyle( // style: TextStyle(
// color: themeController.currentColor.sc4, // color: themeController.currentColor.sc4,
// fontSize: // fontSize:
@@ -426,7 +490,8 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
.tr, .tr,
style: TextStyle( style: TextStyle(
color: themeController.currentColor.sc4, color: themeController.currentColor.sc4,
fontSize: AppConstants().smaller_text_fontSize, fontSize:
AppConstants().smaller_text_fontSize,
), ),
), ),
], ],
@@ -447,6 +512,8 @@ class _QuickHealthReportPageState extends State<QuickHealthReportPage> {
), ),
), ),
); );
}
});
} 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(),