diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index 4aa55a9..73029ed 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -8,6 +8,7 @@ import 'package:aku_community_manager/ui/home/business/business_page.dart'; import 'package:aku_community_manager/ui/home/messages/message.dart'; import 'package:aku_community_manager/ui/home/application/applications_page.dart'; import 'package:aku_community_manager/ui/home/personal_draw.dart'; +import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart'; import 'package:aku_community_manager/ui/tool_pages/scan_page.dart'; import 'package:aku_ui/aku_ui.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart'; @@ -291,7 +292,7 @@ class _HomePageState extends State { _menuButton( R.ASSETS_HOME_IC_POLICE_PNG, '一键报警', HomePage()), _menuButton( - R.ASSETS_HOME_IC_VISITORS_PNG, '访客管理', HomePage()), + R.ASSETS_HOME_IC_VISITORS_PNG, '访客管理', VisitorManagerPage()), _menuButton( R.ASSETS_HOME_IC_SERVICE_PNG, '报事报修', HomePage()), _menuButton( diff --git a/lib/ui/sub_pages/visitor_manager/visitor_manager_page.dart b/lib/ui/sub_pages/visitor_manager/visitor_manager_page.dart index 8ff00a5..1522194 100644 --- a/lib/ui/sub_pages/visitor_manager/visitor_manager_page.dart +++ b/lib/ui/sub_pages/visitor_manager/visitor_manager_page.dart @@ -1,20 +1,48 @@ +import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class VisitorManagerPage extends StatefulWidget { - VisitorManagerPage({Key key}) : super(key: key); + final initIndex; + VisitorManagerPage({Key key, this.initIndex = 0}) : super(key: key); @override _VisitorManagerPageState createState() => _VisitorManagerPageState(); } -class _VisitorManagerPageState extends State { +class _VisitorManagerPageState extends State + with TickerProviderStateMixin { + List tabs = ['全部', '未到访', '已到访', '已过期']; + + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = + TabController(length: 4, vsync: this, initialIndex: widget.initIndex); + } + @override Widget build(BuildContext context) { return AkuScaffold( - // title: '', - // appBarBottom: , - // body: , - ); + title: '访客管理', + appBarBottom: PreferredSize( + child: TabBar( + tabs: tabs.map((e) => Tab(text: e)).toList(), + labelStyle: AppStyle().primaryStyle, + labelColor: AppStyle.primaryTextColor, + unselectedLabelColor: AppStyle.minorTextColor, + unselectedLabelStyle: TextStyle(fontSize:28.sp), + controller: _tabController, + indicatorColor: Color(0xFFFFC40C), + indicatorSize: TabBarIndicatorSize.label, + ), + preferredSize: Size.fromHeight(88.w)), + body: ListView( + children: [], + ), + ); } }