访客管理页面

hmxc
张萌 4 years ago
parent 8b2bd7b226
commit f84b02f0b1

@ -27,7 +27,7 @@ class HomePage extends StatefulWidget {
} }
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
//bar ///bar
Widget _menuButton(String assetPath, String text, Widget page) { Widget _menuButton(String assetPath, String text, Widget page) {
return Expanded( return Expanded(
child: AkuButton( child: AkuButton(
@ -59,7 +59,7 @@ class _HomePageState extends State<HomePage> {
); );
} }
// ///
Widget _card( Widget _card(
String number, String number,
String text, String text,

@ -1,17 +1,77 @@
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class VisitorManagerCard extends StatefulWidget { class VisitorManagerCard extends StatefulWidget {
VisitorManagerCard({Key key}) : super(key: key); final String adress;
final String name;
final String plate;
final String time;
VisitorManagerCard({Key key, @required this.adress,@required this.name, this.plate, this.time}) : super(key: key);
@override @override
_VisitorManagerCardState createState() => _VisitorManagerCardState(); _VisitorManagerCardState createState() => _VisitorManagerCardState();
} }
class _VisitorManagerCardState extends State<VisitorManagerCard> { class _VisitorManagerCardState extends State<VisitorManagerCard> {
TextStyle _textStyle=TextStyle(color:AppStyle.primaryTextColor,fontSize:28.sp,);
String _adress;
String _name;
String _plate;
String _time;
@override
void initState() {
super.initState();
_adress=widget.adress;
_name=widget.name;
_plate=widget.plate??'无信息';
_time=widget.time??'无信息';
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Column(
// child: child, children: [
AkuBox.h(16),
Container(
color: Color(0xFFFFFFFF),
width: double.infinity,
height: 201.w,
padding: EdgeInsets.only(top:24.w,left:24.w,bottom: 28.w),
child: Stack(children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children:[
Text(_adress,style: TextStyle(color:AppStyle.primaryTextColor,fontSize:32.sp,fontWeight: FontWeight.bold),),
AkuBox.h(16),
Row(children: [
Image.asset(R.ASSETS_USER_IC_PERSON_PNG,width:40.w ,height: 40.w,),
AkuBox.w(8),
Text('$_name先生',style:_textStyle,),
AkuBox.w(137),
Image.asset(R.ASSETS_IC_BORROW_PNG,width: 40.w,height: 40.w,),
AkuBox.w(8),
Text(_plate,style: _textStyle,),
Spacer(),
],),
Spacer(),
Row(children: [
Image.asset(R.ASSETS_HOME_IC_ARTICLE_PNG,width: 40.w,height: 40.w,),
AkuBox.w(8),
Text(_time,style:_textStyle),
Spacer(),
],),
],
),
Positioned(
left: 582.w,
bottom: 104.w,
child: Placeholder(),),
],),
),
],
); );
} }
} }

@ -1,8 +1,25 @@
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_card.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.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';
enum VisitorStatus{
NOT_VISIT,
VISIT_DONE,
OUTDATE,
}
class VisitorCardsModel {
String adress;
String name;
String plate;
String time;
VisitorStatus status;
VisitorCardsModel(this.adress,this.name, this.status,{this.plate,this.time});
}
class VisitorManagerPage extends StatefulWidget { class VisitorManagerPage extends StatefulWidget {
final initIndex; final initIndex;
VisitorManagerPage({Key key, this.initIndex = 0}) : super(key: key); VisitorManagerPage({Key key, this.initIndex = 0}) : super(key: key);
@ -13,8 +30,13 @@ class VisitorManagerPage extends StatefulWidget {
class _VisitorManagerPageState extends State<VisitorManagerPage> class _VisitorManagerPageState extends State<VisitorManagerPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
List tabs = ['全部', '未到访', '已到访', '已过期']; List<String> tabs = ['全部', '未到访', '已到访', '已过期'];
List<VisitorCardsModel> cards=[
VisitorCardsModel('深圳华悦茂峰1幢1单元702', '马泽城',VisitorStatus.VISIT_DONE, plate:'浙BA9899',time:'2020-10-24 12:00',),
VisitorCardsModel('深圳华悦茂峰2幢2单元702', '刘揪心',VisitorStatus.NOT_VISIT),
VisitorCardsModel('深圳华悦茂峰3幢3单元602', '刘揪心',VisitorStatus.OUTDATE),
];
TabController _tabController; TabController _tabController;
@override @override
@ -29,19 +51,16 @@ class _VisitorManagerPageState extends State<VisitorManagerPage>
return AkuScaffold( return AkuScaffold(
title: '访客管理', title: '访客管理',
appBarBottom: PreferredSize( appBarBottom: PreferredSize(
child: TabBar( child: AkuTabBar(
tabs: tabs.map((e) => Tab(text: e)).toList(), tabs: tabs,
labelStyle: AppStyle().primaryStyle,
labelColor: AppStyle.primaryTextColor,
unselectedLabelColor: AppStyle.minorTextColor,
unselectedLabelStyle: TextStyle(fontSize:28.sp),
controller: _tabController, controller: _tabController,
indicatorColor: Color(0xFFFFC40C),
indicatorSize: TabBarIndicatorSize.label,
), ),
preferredSize: Size.fromHeight(88.w)), preferredSize: Size.fromHeight(88.w)),
body: ListView( body: ListView(
children: [], padding: EdgeInsets.only(left:32.w,right:32.w),
children: [
...cards.map((e) => VisitorManagerCard(adress: e.adress,name: e.name,plate: e.plate,time: e.time,)).toList(),
],
), ),
); );
} }

Loading…
Cancel
Save