Commit b95e2acc authored by 张宏's avatar 张宏

ui调整

parent 5bd72d8e
...@@ -4,21 +4,21 @@ import 'package:smart_hotel_app/views/home/inspection/cubit/inspection_state.dar ...@@ -4,21 +4,21 @@ import 'package:smart_hotel_app/views/home/inspection/cubit/inspection_state.dar
class InspectionCubit extends Cubit<InspectionState> { class InspectionCubit extends Cubit<InspectionState> {
static const List<String> allRooms = [ static const List<String> allRooms = [
'客厅', '101',
'主卧', '102',
'玄关', '103',
'厨房', '104',
'书房', '105',
'阳台', '106',
]; ];
static final List<InspectionDevice> allDevices = [ static final List<InspectionDevice> allDevices = [
InspectionDevice( InspectionDevice(
id: '1', id: '1',
icon: Icons.wifi, icon: Icons.wifi,
name: '客厅主控网关', name: '101主控网关',
type: '智能网关', type: '智能网关',
location: '客厅电视柜', location: '101电视柜',
status: '正常', status: '正常',
time: '2024-01-15 14:30:00', time: '2024-01-15 14:30:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0), statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
...@@ -26,9 +26,9 @@ class InspectionCubit extends Cubit<InspectionState> { ...@@ -26,9 +26,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice( InspectionDevice(
id: '2', id: '2',
icon: Icons.thermostat, icon: Icons.thermostat,
name: '温湿度传感器-客厅', name: '温湿度传感器-101',
type: '传感器', type: '传感器',
location: '客厅角落', location: '101角落',
status: '正常', status: '正常',
time: '2024-01-15 14:25:00', time: '2024-01-15 14:25:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0), statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
...@@ -36,9 +36,9 @@ class InspectionCubit extends Cubit<InspectionState> { ...@@ -36,9 +36,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice( InspectionDevice(
id: '3', id: '3',
icon: Icons.videocam, icon: Icons.videocam,
name: '智能摄像头-门口', name: '智能摄像头-102',
type: '摄像头', type: '摄像头',
location: '入户门口', location: '102门口',
status: '告警', status: '告警',
time: '2024-01-15 10:00:00', time: '2024-01-15 10:00:00',
statusColor: const Color.fromRGBO(255, 77, 79, 1.0), statusColor: const Color.fromRGBO(255, 77, 79, 1.0),
...@@ -46,9 +46,9 @@ class InspectionCubit extends Cubit<InspectionState> { ...@@ -46,9 +46,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice( InspectionDevice(
id: '4', id: '4',
icon: Icons.light, icon: Icons.light,
name: '智能吸顶灯-主卧', name: '智能吸顶灯-102',
type: '传感器', type: '传感器',
location: '主卧天花板', location: '102天花板',
status: '正常', status: '正常',
time: '2024-01-15 14:25:00', time: '2024-01-15 14:25:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0), statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
...@@ -56,9 +56,9 @@ class InspectionCubit extends Cubit<InspectionState> { ...@@ -56,9 +56,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice( InspectionDevice(
id: '5', id: '5',
icon: Icons.thermostat, icon: Icons.thermostat,
name: '温湿度传感器-主卧', name: '温湿度传感器-103',
type: '传感器', type: '传感器',
location: '主卧角落', location: '103角落',
status: '正常', status: '正常',
time: '2024-01-15 14:25:00', time: '2024-01-15 14:25:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0), statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
...@@ -66,9 +66,9 @@ class InspectionCubit extends Cubit<InspectionState> { ...@@ -66,9 +66,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice( InspectionDevice(
id: '6', id: '6',
icon: Icons.light, icon: Icons.light,
name: '玄关灯-智能', name: '103灯-智能',
type: '智能灯', type: '智能灯',
location: '玄关', location: '103',
status: '开启', status: '开启',
time: '2024-01-15 14:20:00', time: '2024-01-15 14:20:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0), statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
...@@ -76,9 +76,9 @@ class InspectionCubit extends Cubit<InspectionState> { ...@@ -76,9 +76,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice( InspectionDevice(
id: '7', id: '7',
icon: Icons.sensor_door, icon: Icons.sensor_door,
name: '门窗传感器-阳台', name: '门窗传感器-104',
type: '传感器', type: '传感器',
location: '阳台门', location: '104门',
status: '离线', status: '离线',
time: '2024-01-15 12:00:00', time: '2024-01-15 12:00:00',
statusColor: const Color.fromRGBO(102, 102, 102, 1.0), statusColor: const Color.fromRGBO(102, 102, 102, 1.0),
...@@ -86,9 +86,9 @@ class InspectionCubit extends Cubit<InspectionState> { ...@@ -86,9 +86,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice( InspectionDevice(
id: '8', id: '8',
icon: Icons.kitchen, icon: Icons.kitchen,
name: '智能插座-厨房', name: '智能插座-105',
type: '插座', type: '插座',
location: '厨房台面', location: '105台面',
status: '关闭', status: '关闭',
time: '2024-01-15 14:15:00', time: '2024-01-15 14:15:00',
statusColor: const Color.fromRGBO(100, 116, 139, 1.0), statusColor: const Color.fromRGBO(100, 116, 139, 1.0),
...@@ -96,9 +96,9 @@ class InspectionCubit extends Cubit<InspectionState> { ...@@ -96,9 +96,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice( InspectionDevice(
id: '9', id: '9',
icon: Icons.smoke_free, icon: Icons.smoke_free,
name: '烟雾报警器-厨房', name: '烟雾报警器-105',
type: '报警器', type: '报警器',
location: '厨房天花板', location: '105天花板',
status: '正常', status: '正常',
time: '2024-01-15 14:30:00', time: '2024-01-15 14:30:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0), statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
...@@ -106,9 +106,9 @@ class InspectionCubit extends Cubit<InspectionState> { ...@@ -106,9 +106,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice( InspectionDevice(
id: '10', id: '10',
icon: Icons.desk, icon: Icons.desk,
name: '智能台灯-书房', name: '智能台灯-106',
type: '智能灯', type: '智能灯',
location: '书房书桌', location: '106书桌',
status: '关闭', status: '关闭',
time: '2024-01-15 14:10:00', time: '2024-01-15 14:10:00',
statusColor: const Color.fromRGBO(100, 116, 139, 1.0), statusColor: const Color.fromRGBO(100, 116, 139, 1.0),
...@@ -116,9 +116,9 @@ class InspectionCubit extends Cubit<InspectionState> { ...@@ -116,9 +116,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice( InspectionDevice(
id: '11', id: '11',
icon: Icons.ac_unit, icon: Icons.ac_unit,
name: '智能空调-客厅', name: '智能空调-101',
type: '空调', type: '空调',
location: '客厅', location: '101',
status: '正常', status: '正常',
time: '2024-01-15 14:30:00', time: '2024-01-15 14:30:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0), statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
......
...@@ -33,7 +33,7 @@ class InspectionState extends Equatable { ...@@ -33,7 +33,7 @@ class InspectionState extends Equatable {
const InspectionState({ const InspectionState({
this.selectedTab = DeviceStatusTab.total, this.selectedTab = DeviceStatusTab.total,
this.selectedRooms = const ['客厅'], this.selectedRooms = const ['101'],
this.deviceList = const [], this.deviceList = const [],
this.tabCounts = const { this.tabCounts = const {
DeviceStatusTab.total: 11, DeviceStatusTab.total: 11,
......
...@@ -19,12 +19,12 @@ class FilterPanel extends StatelessWidget { ...@@ -19,12 +19,12 @@ class FilterPanel extends StatelessWidget {
}); });
static const List<String> allRooms = [ static const List<String> allRooms = [
'客厅', '101',
'主卧', '102',
'玄关', '103',
'厨房', '104',
'书房', '105',
'阳台', '106',
]; ];
@override @override
......
...@@ -83,6 +83,36 @@ class InspectionDeviceView extends StatelessWidget { ...@@ -83,6 +83,36 @@ class InspectionDeviceView extends StatelessWidget {
), ),
SizedBox(height: 30.h), SizedBox(height: 30.h),
StartInspectionButton(deviceId: state.deviceId), StartInspectionButton(deviceId: state.deviceId),
SizedBox(height: 20.h),
GestureDetector(
onTap: () {
context.pushRoute(
InspectionHistoryRoute(deviceId: state.deviceId),
);
},
child: Container(
width: double.infinity,
height: 88.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(24.r),
border: Border.all(
color: const Color.fromRGBO(66, 165, 245, 1.0),
width: 2.w,
),
),
child: Center(
child: Text(
'巡检记录',
style: TextStyle(
color: const Color.fromRGBO(66, 165, 245, 1.0),
fontSize: 32.sp,
fontWeight: FontWeight.bold,
),
),
),
),
),
SizedBox(height: 30.h), SizedBox(height: 30.h),
], ],
); );
......
import 'package:auto_route/auto_route.dart'; import 'package:auto_route/auto_route.dart';
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:loading_animation_widget/loading_animation_widget.dart';
import 'package:smart_hotel_app/routes/app_router.gr.dart'; import 'package:smart_hotel_app/routes/app_router.gr.dart';
class StartInspectionButton extends StatelessWidget { class StartInspectionButton extends StatelessWidget {
...@@ -11,10 +12,45 @@ class StartInspectionButton extends StatelessWidget { ...@@ -11,10 +12,45 @@ class StartInspectionButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () async {
context.pushRoute( showDialog(
InspectionHistoryRoute(deviceId: deviceId), context: context,
barrierDismissible: false,
builder: (context) => Center(
child: Container(
width: 140.w,
height: 140.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20.r),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
LoadingAnimationWidget.waveDots(
color: const Color.fromRGBO(66, 165, 245, 1.0),
size: 50,
),
SizedBox(height: 12.h),
Text(
'巡检中...',
style: TextStyle(
color: const Color.fromRGBO(100, 116, 139, 1.0),
fontSize: 24.sp,
),
),
],
),
),
),
); );
await Future.delayed(const Duration(seconds: 3));
if (context.mounted) {
context.popRoute();
context.pushRoute(
InspectionHistoryRoute(deviceId: deviceId),
);
}
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
......
...@@ -29,8 +29,8 @@ class ProfileMenuBlock extends StatelessWidget { ...@@ -29,8 +29,8 @@ class ProfileMenuBlock extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Container( Container(
width: 96.w, width: 68.w,
height: 96.h, height: 68.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color.fromRGBO(229, 241, 255, 1), color: const Color.fromRGBO(229, 241, 255, 1),
borderRadius: BorderRadius.circular(28.r), borderRadius: BorderRadius.circular(28.r),
...@@ -52,11 +52,12 @@ class ProfileMenuBlock extends StatelessWidget { ...@@ -52,11 +52,12 @@ class ProfileMenuBlock extends StatelessWidget {
), ),
), ),
), ),
Icon( if (item.title == '告警信息' || item.title == '设备列表')
Icons.chevron_right, Icon(Icons.chevron_right,
color: const Color.fromRGBO(100, 116, 139, 1.0), color: const Color.fromRGBO(100, 116, 139, 1.0),
size: 32.sp, size: 32.sp,
), ),
], ],
), ),
), ),
...@@ -65,6 +66,9 @@ class ProfileMenuBlock extends StatelessWidget { ...@@ -65,6 +66,9 @@ class ProfileMenuBlock extends StatelessWidget {
void _handleMenuTap(BuildContext context, String title) { void _handleMenuTap(BuildContext context, String title) {
switch (title) { switch (title) {
case '设备列表':
context.pushRoute(const InspectionDetailRoute());
break;
case '告警信息': case '告警信息':
context.pushRoute(const AbnormalListRoute()); context.pushRoute(const AbnormalListRoute());
break; break;
......
This diff is collapsed.
This diff is collapsed.
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