更新快检功能必传mac参数

This commit is contained in:
wyf
2026-03-14 10:44:28 +08:00
parent 6472baf993
commit 2d28a550bd
28 changed files with 1993 additions and 795 deletions

View File

@@ -25,7 +25,12 @@ class _HealthExperienceHistoryState extends State<HealthExperienceHistory> {
@override
void initState() {
super.initState();
loadData(widget.data);
WidgetsBinding.instance.addPostFrameCallback((_) {
loadData(widget.data).then((aa) {
deviceTypeController.updateAll();
});
});
}
@override
@@ -35,89 +40,97 @@ class _HealthExperienceHistoryState extends State<HealthExperienceHistory> {
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, bodysize) => GestureDetector(
// onTap: () => FocusScope.of(context).unfocus(),,
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(getBackgroundImageNoImage()), // 本地图片
fit: BoxFit.fill, // 填满整个 Container
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
backgroundColor: themeController.currentColor.sc17,
automaticallyImplyLeading: false,
iconTheme: IconThemeData(
color: themeController.currentColor.sc3,
try {
return LayoutBuilder(
builder: (context, bodysize) => GestureDetector(
// onTap: () => FocusScope.of(context).unfocus(),,
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(getBackgroundImageNoImage()), // 本地图片
fit: BoxFit.fill, // 填满整个 Container
),
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,
),
),
Positioned(
left: 0,
// child: returnIconButtom,
child: returnIconButtomAddCallback(() {}),
),
],
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
backgroundColor: themeController.currentColor.sc17,
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,
),
),
Positioned(
left: 0,
// child: returnIconButtom,
child: returnIconButtomAddCallback(() {}),
),
],
),
),
actions: [],
centerTitle: false,
),
actions: [],
centerTitle: false,
),
body: SafeArea(
top: true,
child: Padding(
padding:
EdgeInsetsDirectional.fromSTEB(30.rpx, 0.rpx, 30.rpx, 0),
child: Column(
children: [
Expanded(
child: Obx(() {
final list = deviceTypeController.cqHistoryList.value;
return list.isEmpty
? const NullDataWidget()
: _buildMessageListView(list);
}),
),
],
body: SafeArea(
top: true,
child: Padding(
padding:
EdgeInsetsDirectional.fromSTEB(30.rpx, 0.rpx, 30.rpx, 0),
child: Obx(() {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (deviceTypeController.qcListLoading.value)
Center(
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
themeController.currentColor.sc1,
),
),
),
if (!deviceTypeController.qcListLoading.value)
Expanded(
child: Obx(() {
final list =
deviceTypeController.cqHistoryList.value;
return list.isEmpty
? const NullDataWidget()
: _buildMessageListView(list);
}),
),
],
);
}),
),
),
),
),
),
),
);
);
} catch (e) {
return Container();
}
}
Future<void> loadData(data) async {
//todo 请求历史体征数据
// String serviceAddress = ServiceConstant.service_address;
// String serviceName = ServiceConstant.server_service;
// String serviceApi = ServiceConstant.message_list;
// String queryUrl =
// "${serviceAddress}${serviceName}${serviceApi}?type=app_vsm&mac=${data['mac']}";
// ApiResponse apiResponse = await requestWithLog(
// logTitle: "查询消息回看数据", method: MyHttpMethod.get, queryUrl: queryUrl);
// messageReviewController.messageList.value = apiResponse.data;
// messageReviewController.updateAll();
deviceTypeController.getCheckHistory();
deviceTypeController.getCheckHistory(mac: data['mac']);
}
Widget _buildMessageListView(List dataList) {