Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart_hotel_app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张宏
smart_hotel_app
Commits
b95e2acc
Commit
b95e2acc
authored
Jun 05, 2026
by
张宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui调整
parent
5bd72d8e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
505 additions
and
45 deletions
+505
-45
inspection_cubit.dart
lib/views/home/inspection/cubit/inspection_cubit.dart
+28
-28
inspection_state.dart
lib/views/home/inspection/cubit/inspection_state.dart
+1
-1
filter_panel.dart
lib/views/home/inspection/widget/filter_panel.dart
+6
-6
inspection_device_view.dart
lib/views/home/inspection_device/inspection_device_view.dart
+30
-0
start_inspection_button.dart
...ome/inspection_device/widget/start_inspection_button.dart
+39
-3
profile_menu_block.dart
lib/views/profile/index/widget/profile_menu_block.dart
+11
-7
上手帮助.md
上手帮助.md
+390
-0
技术方案.md
技术方案.md
+0
-0
No files found.
lib/views/home/inspection/cubit/inspection_cubit.dart
View file @
b95e2acc
...
@@ -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
),
...
...
lib/views/home/inspection/cubit/inspection_state.dart
View file @
b95e2acc
...
@@ -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
,
...
...
lib/views/home/inspection/widget/filter_panel.dart
View file @
b95e2acc
...
@@ -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
...
...
lib/views/home/inspection_device/inspection_device_view.dart
View file @
b95e2acc
...
@@ -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
),
],
],
);
);
...
...
lib/views/home/inspection_device/widget/start_inspection_button.dart
View file @
b95e2acc
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
,
...
...
lib/views/profile/index/widget/profile_menu_block.dart
View file @
b95e2acc
...
@@ -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
;
...
...
上手帮助.md
0 → 100644
View file @
b95e2acc
This diff is collapsed.
Click to expand it.
技术方案.md
0 → 100644
View file @
b95e2acc
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment