From f84b02f0b18b1d39dc62f34589ded5958d8cd02c Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Tue, 3 Nov 2020 11:42:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BF=E5=AE=A2=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/home/home_page.dart | 4 +- .../visitor_manager/visitor_manager_card.dart | 68 +++++++++++++++++-- .../visitor_manager/visitor_manager_page.dart | 39 ++++++++--- 3 files changed, 95 insertions(+), 16 deletions(-) diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index c0a29f8..c6a1536 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -27,7 +27,7 @@ class HomePage extends StatefulWidget { } class _HomePageState extends State { - //自定义bar的菜单按钮 + ///自定义bar的菜单按钮 Widget _menuButton(String assetPath, String text, Widget page) { return Expanded( child: AkuButton( @@ -59,7 +59,7 @@ class _HomePageState extends State { ); } -//底部信息栏卡片 +///底部信息栏卡片 Widget _card( String number, String text, diff --git a/lib/ui/sub_pages/visitor_manager/visitor_manager_card.dart b/lib/ui/sub_pages/visitor_manager/visitor_manager_card.dart index c9eecf5..d67f00e 100644 --- a/lib/ui/sub_pages/visitor_manager/visitor_manager_card.dart +++ b/lib/ui/sub_pages/visitor_manager/visitor_manager_card.dart @@ -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_screenutil/flutter_screenutil.dart'; 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 _VisitorManagerCardState createState() => _VisitorManagerCardState(); } class _VisitorManagerCardState extends State { + +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 Widget build(BuildContext context) { - return Container( - // child: child, + return Column( + 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(),), + ],), + ), + ], ); } } \ No newline at end of file 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 1522194..1dc0cef 100644 --- a/lib/ui/sub_pages/visitor_manager/visitor_manager_page.dart +++ b/lib/ui/sub_pages/visitor_manager/visitor_manager_page.dart @@ -1,8 +1,25 @@ 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/inner/aku_tab_bar.dart'; import 'package:flutter/material.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 { final initIndex; VisitorManagerPage({Key key, this.initIndex = 0}) : super(key: key); @@ -13,8 +30,13 @@ class VisitorManagerPage extends StatefulWidget { class _VisitorManagerPageState extends State with TickerProviderStateMixin { - List tabs = ['全部', '未到访', '已到访', '已过期']; + List tabs = ['全部', '未到访', '已到访', '已过期']; + List 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; @override @@ -29,19 +51,16 @@ class _VisitorManagerPageState extends State return AkuScaffold( 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), + child: AkuTabBar( + tabs: tabs, controller: _tabController, - indicatorColor: Color(0xFFFFC40C), - indicatorSize: TabBarIndicatorSize.label, ), preferredSize: Size.fromHeight(88.w)), 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(), + ], ), ); }