Commit 4ffa57f5 authored by 张宏's avatar 张宏

44444444-ui

parent 29eea2f6
This diff is collapsed.
...@@ -31,6 +31,13 @@ ...@@ -31,6 +31,13 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.6" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.6" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_image_compress_macos-1.0.3" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_image_compress-2.4.0" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_image_compress_ohos-0.0.3" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_image_compress_common-1.0.6" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_image_compress_web-0.1.5" />
<root url="file://$PROJECT_DIR$/plugins/vsdk" />
<root url="file://$PROJECT_DIR$/plugins/flutter_webrtc" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />
......
...@@ -52,8 +52,8 @@ class PatientInfoBO extends Equatable { ...@@ -52,8 +52,8 @@ class PatientInfoBO extends Equatable {
/// 患者名称 /// 患者名称
final String name; final String name;
/// 家长信息 /// 宠物类型(猫/狗等)
final String owner; final String type;
/// 联系电话 /// 联系电话
final String phone; final String phone;
...@@ -67,28 +67,44 @@ class PatientInfoBO extends Equatable { ...@@ -67,28 +67,44 @@ class PatientInfoBO extends Equatable {
/// 患者头像地址 /// 患者头像地址
final String avatarUrl; final String avatarUrl;
/// 宠物病因
final String disease;
/// 入住时间
final String checkInDate;
/// 护理等级
final String careLevel;
const PatientInfoBO({ const PatientInfoBO({
required this.name, required this.name,
required this.owner, required this.type,
required this.phone, required this.phone,
required this.breed, required this.breed,
required this.doctor, required this.doctor,
required this.disease,
required this.checkInDate,
required this.careLevel,
this.avatarUrl = '', this.avatarUrl = '',
}); });
factory PatientInfoBO.fromJson(Map<String, dynamic> json) { factory PatientInfoBO.fromJson(Map<String, dynamic> json) {
return PatientInfoBO( return PatientInfoBO(
name: json['name'] as String? ?? '', name: json['name'] as String? ?? '',
owner: json['owner'] as String? ?? '', type: json['type'] as String? ?? '',
phone: json['phone'] as String? ?? '', phone: json['phone'] as String? ?? '',
breed: json['breed'] as String? ?? '', breed: json['breed'] as String? ?? '',
doctor: json['doctor'] as String? ?? '', doctor: json['doctor'] as String? ?? '',
disease: json['disease'] as String? ?? '',
checkInDate: json['checkInDate'] as String? ?? '',
careLevel: json['careLevel'] as String? ?? '',
avatarUrl: json['avatarUrl'] as String? ?? '', avatarUrl: json['avatarUrl'] as String? ?? '',
); );
} }
@override @override
List<Object?> get props => [name, owner, phone, breed, doctor, avatarUrl]; List<Object?> get props =>
[name, type, phone, breed, doctor, disease, checkInDate, careLevel, avatarUrl];
} }
/// 用途:首页监护舱告警信息展示数据 /// 用途:首页监护舱告警信息展示数据
......
...@@ -50,11 +50,14 @@ class MonitoringMockData { ...@@ -50,11 +50,14 @@ class MonitoringMockData {
static PatientInfoBO getMockPatientInfo() { static PatientInfoBO getMockPatientInfo() {
return const PatientInfoBO( return const PatientInfoBO(
name: '妮蔻 Niko', name: '妮蔻',
owner: '家长:王女士', type: '猫',
phone: '联系电话:15845310589', phone: '130-1111-3333',
breed: '品种:长毛三花', breed: '长毛三花',
doctor: '医生:程医生', doctor: '张医生',
disease: '胃炎',
checkInDate: '2025-6-15',
careLevel: '特级',
avatarUrl: '', avatarUrl: '',
); );
} }
...@@ -67,6 +70,12 @@ class MonitoringMockData { ...@@ -67,6 +70,12 @@ class MonitoringMockData {
time: '2026-05-04 16:22:49', time: '2026-05-04 16:22:49',
status: '待处理', status: '待处理',
), ),
AlertInfoBO(
title: '温度异常',
description: '温度高于阈值26℃,当前温度29℃,请立即检查温度传感器,字…',
time: '2026-05-04 16:22:49',
status: '已处理',
),
]; ];
} }
......
...@@ -63,13 +63,13 @@ class PatientInfoCard extends StatelessWidget { ...@@ -63,13 +63,13 @@ class PatientInfoCard extends StatelessWidget {
), ),
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
_buildInfoText(patientInfo.owner), _buildInfoText('类型:${patientInfo.type}'),
SizedBox(height: 4.h), SizedBox(height: 4.h),
_buildInfoText(patientInfo.phone), _buildInfoText('电话:${patientInfo.phone}'),
SizedBox(height: 4.h), SizedBox(height: 4.h),
_buildInfoText(patientInfo.breed), _buildInfoText('品种:${patientInfo.breed}'),
SizedBox(height: 4.h), SizedBox(height: 4.h),
_buildInfoText(patientInfo.doctor), _buildInfoText('医生:${patientInfo.doctor}'),
], ],
), ),
), ),
......
...@@ -95,7 +95,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> { ...@@ -95,7 +95,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
Container( Container(
height: topHeight.clamp(80.0, 104.0), height: topHeight.clamp(80.0, 104.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: BoxBorder.all(width: 1.w,color: Colors.red) // border: BoxBorder.all(width: 1.w,color: Colors.red)
), ),
child: const MonitoringTopStatusBar(), child: const MonitoringTopStatusBar(),
), ),
...@@ -103,7 +103,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> { ...@@ -103,7 +103,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
child: Container( child: Container(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
decoration: BoxDecoration( decoration: BoxDecoration(
border: BoxBorder.all(width: 1.w,color: Colors.red) // border: BoxBorder.all(width: 1.w,color: Colors.red)
), ),
child: _buildMainArea(state, gap), child: _buildMainArea(state, gap),
), ),
...@@ -111,7 +111,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> { ...@@ -111,7 +111,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
Container( Container(
height: bottomHeight.clamp(92.0, 134.0), height: bottomHeight.clamp(92.0, 134.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: BoxBorder.all(width: 1.w,color: Colors.red) // border: BoxBorder.all(width: 1.w,color: Colors.red)
), ),
child: MonitoringBottomMenu(menuItems: state.menuItems), child: MonitoringBottomMenu(menuItems: state.menuItems),
), ),
...@@ -190,7 +190,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> { ...@@ -190,7 +190,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
child: Container( child: Container(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
decoration: BoxDecoration( decoration: BoxDecoration(
border: BoxBorder.all(width: 1.w,color: Colors.red) // border: BoxBorder.all(width: 1.w,color: Colors.red)
), ),
// padding: EdgeInsets.only( // padding: EdgeInsets.only(
// right: metric == displayMetrics.last ? 0 : gap, // right: metric == displayMetrics.last ? 0 : gap,
......
...@@ -2,8 +2,6 @@ import 'package:flutter/material.dart'; ...@@ -2,8 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:laki_icu_app/models/bo/monitoring_bo.dart'; import 'package:laki_icu_app/models/bo/monitoring_bo.dart';
import 'monitoring_panel.dart';
class MonitoringAlertCard extends StatelessWidget { class MonitoringAlertCard extends StatelessWidget {
final List<AlertInfoBO> alerts; final List<AlertInfoBO> alerts;
...@@ -14,43 +12,38 @@ class MonitoringAlertCard extends StatelessWidget { ...@@ -14,43 +12,38 @@ class MonitoringAlertCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final hasPending = alerts.any((item) => item.status.contains('待处理'));
return Container( return Container(
padding: EdgeInsets.zero, padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.h),
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage('lib/assets/monitoring/alert_box_bg_2.png'), image: AssetImage(
hasPending
? 'lib/assets/monitoring/alert_box_bg_2.png'
: 'lib/assets/monitoring/alert_box_bg_1.png',
),
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
border: Border.all(
color: Colors.red,
width: 1.w
)
), ),
// backgroundAsset: alerts.any((item) => item.status.contains('待处理'))
// ? 'lib/assets/monitoring/alert_box_bg_2.png'
// : 'lib/assets/monitoring/alert_box_bg_1.png',
// padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Text(
width: double.infinity, '告警信息',
height: 100.h, style: TextStyle(
decoration: BoxDecoration( color: Colors.white,
border: Border.all( fontSize: 20.sp,
color: Colors.red, fontWeight: FontWeight.bold,
width: 1.w
)
), ),
), ),
SizedBox(height: 12.h),
Expanded( Expanded(
child: _buildEmpty()// alerts.isEmpty ? _buildEmpty() : _buildList(), child: alerts.isEmpty ? _buildEmpty() : _buildList(),
), ),
], ],
), ),
); );
} }
Widget _buildEmpty() { Widget _buildEmpty() {
return Center( return Center(
...@@ -63,44 +56,103 @@ class MonitoringAlertCard extends StatelessWidget { ...@@ -63,44 +56,103 @@ class MonitoringAlertCard extends StatelessWidget {
Widget _buildList() { Widget _buildList() {
return ListView.separated( return ListView.separated(
padding: EdgeInsets.zero, padding: EdgeInsets.symmetric(vertical: 6.h),
itemCount: alerts.length, itemCount: alerts.length,
separatorBuilder: (_, __) => SizedBox(height: 12.h), separatorBuilder: (_, __) => SizedBox(height: 16.h),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = alerts[index]; final item = alerts[index];
final pending = item.status.contains('待处理'); final pending = item.status.contains('待处理');
return Container( return _buildAlertItem(item, pending);
height: 170.h, },
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 14.h), );
decoration: BoxDecoration( }
border: Border.all(
width: 1.w,
color: Colors.red
)
// color: pending ? const Color(0x24FFB800) : const Color(0x1820E5FF),
// borderRadius: BorderRadius.circular(14.r),
// border: Border.all(
// color:
// pending ? const Color(0x99FFB800) : const Color(0x6639D8FF),
// width: 1,
// ),
),
child: Column(
children: [
Text(
item.title,
style: TextStyle(
color: Colors.white,
fontSize: 20.sp,
fontWeight: FontWeight.bold
),
),
Widget _buildAlertItem(AlertInfoBO item, bool pending) {
return IntrinsicHeight(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildIconBlock(pending),
SizedBox(width: 20.w),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
item.title,
style: TextStyle(
color: pending ? const Color(0xFFF26522) : const Color(0xFFFFC14A),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 10.h),
Text(
item.description,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
),
),
// SizedBox(height: 10.h),
Text(
item.time,
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
),
),
],
),
),
],
),
);
}
], Widget _buildIconBlock(bool pending) {
return Container(
width: 100.w,
height: 160.h,
alignment: Alignment.topLeft,
child: Stack(
children: [
Container(
// width: 160.w,
// height: 160.h,
decoration: BoxDecoration(
color: const Color(0xFF2A2E3B),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(18.r),
topRight: Radius.circular(18.r),
bottomLeft: Radius.circular(18.r),
bottomRight: Radius.circular(18.r),
),
),
), ),
); Container(
}, padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h),
decoration: BoxDecoration(
color: pending ? const Color(0xFFFBB03B) : const Color(0xFF6FA8DC),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(18.r),
bottomRight: Radius.circular(18.r),
),
),
child: Text(
pending ? '待处理' : '已处理',
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
// fontWeight: FontWeight.bold,
),
),
),
],
),
); );
} }
} }
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_switch/flutter_switch.dart';
import 'package:laki_icu_app/models/bo/monitoring_bo.dart'; import 'package:laki_icu_app/models/bo/monitoring_bo.dart';
import 'monitoring_panel.dart'; import 'monitoring_panel.dart';
...@@ -7,9 +8,17 @@ import 'monitoring_panel.dart'; ...@@ -7,9 +8,17 @@ import 'monitoring_panel.dart';
class MonitoringMetricCard extends StatelessWidget { class MonitoringMetricCard extends StatelessWidget {
final MonitoringMetricBO metric; final MonitoringMetricBO metric;
/// 开关状态
final bool switchValue;
/// 开关切换回调
final ValueChanged<bool>? onSwitchToggle;
const MonitoringMetricCard({ const MonitoringMetricCard({
super.key, super.key,
required this.metric, required this.metric,
this.switchValue = false,
this.onSwitchToggle,
}); });
@override @override
...@@ -32,7 +41,7 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -32,7 +41,7 @@ class MonitoringMetricCard extends StatelessWidget {
SizedBox(width: 20.w), SizedBox(width: 20.w),
Expanded( Expanded(
flex: 2, flex: 3,
child: Text( child: Text(
displayLabel, displayLabel,
maxLines: 1, maxLines: 1,
...@@ -45,15 +54,18 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -45,15 +54,18 @@ class MonitoringMetricCard extends StatelessWidget {
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 2,
child: Text( child: Align(
"开关", alignment: Alignment.topLeft,
maxLines: 1, child: FlutterSwitch(
overflow: TextOverflow.ellipsis, width: 30.w,
style: TextStyle( height: 30.h,
color: Colors.white, value: switchValue,
fontSize: 19.sp, onToggle: onSwitchToggle ?? (_) {},
fontWeight: FontWeight.w600, activeColor: const Color(0xFF75C1DD),
inactiveColor: Color(0xFF0A1B34),
toggleSize: 12.w,
padding: 2.w,
), ),
), ),
), ),
...@@ -95,10 +107,10 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -95,10 +107,10 @@ class MonitoringMetricCard extends StatelessWidget {
width: 100.w, width: 100.w,
margin: EdgeInsets.only(left: 20.w), margin: EdgeInsets.only(left: 20.w),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( // border: Border.all(
color: Colors.red, // color: Colors.red,
width: 1.w // width: 1.w
) // )
), ),
child: Stack( child: Stack(
clipBehavior: Clip.none, clipBehavior: Clip.none,
......
...@@ -11,10 +11,10 @@ class MonitoringVideoCard extends StatelessWidget { ...@@ -11,10 +11,10 @@ class MonitoringVideoCard extends StatelessWidget {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage(image: AssetImage('lib/assets/monitoring/box_bg_674x509.png'),fit: BoxFit.fill), image: DecorationImage(image: AssetImage('lib/assets/monitoring/box_bg_674x509.png'),fit: BoxFit.fill),
border: Border.all( // border: Border.all(
color: Colors.red, // color: Colors.red,
width: 1.w // width: 1.w
) // )
), ),
child: Stack( child: Stack(
children: [ children: [
......
...@@ -66,13 +66,13 @@ class VideoPlayerWidget extends StatelessWidget { ...@@ -66,13 +66,13 @@ class VideoPlayerWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ClipRRect( return ClipRRect(
child: Container( child: Container(
padding: EdgeInsets.only(top: 15.h,bottom: 35.h,left: 18.w,right: 18.w), padding: EdgeInsets.only(top: 15.h,bottom: 35.h,left: 10.w,right: 15.w),
decoration: BoxDecoration( decoration: BoxDecoration(
image: const DecorationImage( image: const DecorationImage(
image: AssetImage('lib/assets/monitoring/box_bg_674x509.png'), image: AssetImage('lib/assets/monitoring/box_border.png'),
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
border: Border.all(color: Colors.red, width: 1), // border: Border.all(color: Colors.red, width: 1),
), ),
child: Stack( child: Stack(
fit: StackFit.expand, fit: StackFit.expand,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment