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
class InspectionCubit extends Cubit<InspectionState> {
static const List<String> allRooms = [
'客厅',
'主卧',
'玄关',
'厨房',
'书房',
'阳台',
'101',
'102',
'103',
'104',
'105',
'106',
];
static final List<InspectionDevice> allDevices = [
InspectionDevice(
id: '1',
icon: Icons.wifi,
name: '客厅主控网关',
name: '101主控网关',
type: '智能网关',
location: '客厅电视柜',
location: '101电视柜',
status: '正常',
time: '2024-01-15 14:30:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
......@@ -26,9 +26,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice(
id: '2',
icon: Icons.thermostat,
name: '温湿度传感器-客厅',
name: '温湿度传感器-101',
type: '传感器',
location: '客厅角落',
location: '101角落',
status: '正常',
time: '2024-01-15 14:25:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
......@@ -36,9 +36,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice(
id: '3',
icon: Icons.videocam,
name: '智能摄像头-门口',
name: '智能摄像头-102',
type: '摄像头',
location: '入户门口',
location: '102门口',
status: '告警',
time: '2024-01-15 10:00:00',
statusColor: const Color.fromRGBO(255, 77, 79, 1.0),
......@@ -46,9 +46,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice(
id: '4',
icon: Icons.light,
name: '智能吸顶灯-主卧',
name: '智能吸顶灯-102',
type: '传感器',
location: '主卧天花板',
location: '102天花板',
status: '正常',
time: '2024-01-15 14:25:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
......@@ -56,9 +56,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice(
id: '5',
icon: Icons.thermostat,
name: '温湿度传感器-主卧',
name: '温湿度传感器-103',
type: '传感器',
location: '主卧角落',
location: '103角落',
status: '正常',
time: '2024-01-15 14:25:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
......@@ -66,9 +66,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice(
id: '6',
icon: Icons.light,
name: '玄关灯-智能',
name: '103灯-智能',
type: '智能灯',
location: '玄关',
location: '103',
status: '开启',
time: '2024-01-15 14:20:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
......@@ -76,9 +76,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice(
id: '7',
icon: Icons.sensor_door,
name: '门窗传感器-阳台',
name: '门窗传感器-104',
type: '传感器',
location: '阳台门',
location: '104门',
status: '离线',
time: '2024-01-15 12:00:00',
statusColor: const Color.fromRGBO(102, 102, 102, 1.0),
......@@ -86,9 +86,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice(
id: '8',
icon: Icons.kitchen,
name: '智能插座-厨房',
name: '智能插座-105',
type: '插座',
location: '厨房台面',
location: '105台面',
status: '关闭',
time: '2024-01-15 14:15:00',
statusColor: const Color.fromRGBO(100, 116, 139, 1.0),
......@@ -96,9 +96,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice(
id: '9',
icon: Icons.smoke_free,
name: '烟雾报警器-厨房',
name: '烟雾报警器-105',
type: '报警器',
location: '厨房天花板',
location: '105天花板',
status: '正常',
time: '2024-01-15 14:30:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
......@@ -106,9 +106,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice(
id: '10',
icon: Icons.desk,
name: '智能台灯-书房',
name: '智能台灯-106',
type: '智能灯',
location: '书房书桌',
location: '106书桌',
status: '关闭',
time: '2024-01-15 14:10:00',
statusColor: const Color.fromRGBO(100, 116, 139, 1.0),
......@@ -116,9 +116,9 @@ class InspectionCubit extends Cubit<InspectionState> {
InspectionDevice(
id: '11',
icon: Icons.ac_unit,
name: '智能空调-客厅',
name: '智能空调-101',
type: '空调',
location: '客厅',
location: '101',
status: '正常',
time: '2024-01-15 14:30:00',
statusColor: const Color.fromRGBO(26, 188, 156, 1.0),
......
......@@ -33,7 +33,7 @@ class InspectionState extends Equatable {
const InspectionState({
this.selectedTab = DeviceStatusTab.total,
this.selectedRooms = const ['客厅'],
this.selectedRooms = const ['101'],
this.deviceList = const [],
this.tabCounts = const {
DeviceStatusTab.total: 11,
......
......@@ -19,12 +19,12 @@ class FilterPanel extends StatelessWidget {
});
static const List<String> allRooms = [
'客厅',
'主卧',
'玄关',
'厨房',
'书房',
'阳台',
'101',
'102',
'103',
'104',
'105',
'106',
];
@override
......
......@@ -83,6 +83,36 @@ class InspectionDeviceView extends StatelessWidget {
),
SizedBox(height: 30.h),
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),
],
);
......
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.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';
class StartInspectionButton extends StatelessWidget {
......@@ -11,10 +12,45 @@ class StartInspectionButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
context.pushRoute(
InspectionHistoryRoute(deviceId: deviceId),
onTap: () async {
showDialog(
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(
width: double.infinity,
......
......@@ -29,8 +29,8 @@ class ProfileMenuBlock extends StatelessWidget {
child: Row(
children: [
Container(
width: 96.w,
height: 96.h,
width: 68.w,
height: 68.h,
decoration: BoxDecoration(
color: const Color.fromRGBO(229, 241, 255, 1),
borderRadius: BorderRadius.circular(28.r),
......@@ -52,11 +52,12 @@ class ProfileMenuBlock extends StatelessWidget {
),
),
),
Icon(
Icons.chevron_right,
color: const Color.fromRGBO(100, 116, 139, 1.0),
size: 32.sp,
),
if (item.title == '告警信息' || item.title == '设备列表')
Icon(Icons.chevron_right,
color: const Color.fromRGBO(100, 116, 139, 1.0),
size: 32.sp,
),
],
),
),
......@@ -65,6 +66,9 @@ class ProfileMenuBlock extends StatelessWidget {
void _handleMenuTap(BuildContext context, String title) {
switch (title) {
case '设备列表':
context.pushRoute(const InspectionDetailRoute());
break;
case '告警信息':
context.pushRoute(const AbnormalListRoute());
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