Before Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 736 B |
After Width: | Height: | Size: 656 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 77 KiB |
@ -0,0 +1,20 @@
|
|||||||
|
import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_model.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class OutdoorProvider extends ChangeNotifier{
|
||||||
|
List<ItemsOutdoorModel> _itemOutdoorModel=ItemsOutdoorModel.initList();
|
||||||
|
List<ItemsOutdoorModel> get itemOutdoorModels => _itemOutdoorModel;
|
||||||
|
addOutdoormodel(ItemsOutdoorModel model){
|
||||||
|
_itemOutdoorModel.insert(0, model);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
List<ItemsOutdoorModel> getOutdoorModels(int index){
|
||||||
|
return [
|
||||||
|
_itemOutdoorModel.where((element) => element.status==OUTDOORSTATUS.NOT_OUT).toList(),
|
||||||
|
_itemOutdoorModel.where((element) => element.status==OUTDOORSTATUS.OUT_DONE).toList(),
|
||||||
|
_itemOutdoorModel.where((element) => element.status==OUTDOORSTATUS.REJECTED).toList(),
|
||||||
|
_itemOutdoorModel.where((element) => element.status==OUTDOORSTATUS.CANCELLATION).toList(),
|
||||||
|
_itemOutdoorModel,
|
||||||
|
][index];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,199 @@
|
|||||||
|
import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_model.dart';
|
||||||
|
import 'package:aku_community_manager/style/app_style.dart';
|
||||||
|
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||||
|
import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
|
||||||
|
import 'package:common_utils/common_utils.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:aku_community_manager/const/resource.dart';
|
||||||
|
|
||||||
|
class ItemsOutdoorCard extends StatefulWidget {
|
||||||
|
final ItemsOutdoorModel cardModel;
|
||||||
|
ItemsOutdoorCard({
|
||||||
|
Key key,
|
||||||
|
@required this.cardModel,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ItemsOutdoorCardState createState() => _ItemsOutdoorCardState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
|
||||||
|
ItemsOutdoorModel _cardModel;
|
||||||
|
String _datetime;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_cardModel = widget.cardModel;
|
||||||
|
_datetime =
|
||||||
|
DateUtil.formatDate(_cardModel.datetime, format: "yyyy/MM/dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
TextStyle _textStyle =
|
||||||
|
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
|
||||||
|
return AkuButton(
|
||||||
|
child: Container(
|
||||||
|
color: Color(0xFFFFFFFF),
|
||||||
|
margin: EdgeInsets.only(top: 16.w),
|
||||||
|
padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 24.w),
|
||||||
|
child: Column(children: [
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
height: 88.w,
|
||||||
|
width: double.infinity,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
width: 112.w,
|
||||||
|
height: 40.w,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Color(0xFF3F8FFE), width: 2.w),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'物品出户',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color(0xFF3F8FFE),
|
||||||
|
fontSize: 20.sp,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AkuBox.w(16),
|
||||||
|
Text(
|
||||||
|
_datetime,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.minorTextColor,
|
||||||
|
fontSize: 22.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
Text(
|
||||||
|
ItemsOutdoorModel.outdoorStatusMap[_cardModel.status],
|
||||||
|
style: TextStyle(
|
||||||
|
color: _cardModel.status == OUTDOORSTATUS.CANCELLATION
|
||||||
|
? Color(0xFF999999)
|
||||||
|
: Color(0xFFFF4501),
|
||||||
|
fontSize: 24.sp,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
R.ASSETS_OUTDOOR_IC_HOME_PNG,
|
||||||
|
width: 40.w,
|
||||||
|
height: 40.w,
|
||||||
|
),
|
||||||
|
AkuBox.w(4),
|
||||||
|
Text(
|
||||||
|
'小区名称',
|
||||||
|
style: _textStyle,
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
Text(
|
||||||
|
_cardModel.communityname,
|
||||||
|
style: AppStyle().primaryStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
AkuBox.h(12),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
R.ASSETS_OUTDOOR_IC_ADDRESS_PNG,
|
||||||
|
width: 40.w,
|
||||||
|
height: 40.w,
|
||||||
|
),
|
||||||
|
AkuBox.w(4),
|
||||||
|
Text('详细地址', style: _textStyle),
|
||||||
|
Spacer(),
|
||||||
|
Text(
|
||||||
|
_cardModel.adress,
|
||||||
|
style: AppStyle().primaryStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
AkuBox.h(12),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
R.ASSETS_OUTDOOR_IC_GOOUT_PNG,
|
||||||
|
width: 40.w,
|
||||||
|
height: 40.w,
|
||||||
|
),
|
||||||
|
AkuBox.w(4),
|
||||||
|
Text(
|
||||||
|
'出户人',
|
||||||
|
style: _textStyle,
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
Text(
|
||||||
|
_cardModel.name,
|
||||||
|
style: AppStyle().primaryStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
AkuBox.h(12),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
R.ASSETS_OUTDOOR_IC_PEOPLE_PNG,
|
||||||
|
width: 40.w,
|
||||||
|
height: 40.w,
|
||||||
|
),
|
||||||
|
AkuBox.w(4),
|
||||||
|
Text(
|
||||||
|
'身份',
|
||||||
|
style: _textStyle,
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
Text(
|
||||||
|
_cardModel.identify,
|
||||||
|
style: AppStyle().primaryStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
AkuBox.h(12),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'出户物品',
|
||||||
|
style: _textStyle,
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
Text(
|
||||||
|
_cardModel.items.itemname,
|
||||||
|
style: AppStyle().primaryStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
AkuBox.h(12),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
R.ASSETS_OUTDOOR_IC_TIME_PNG,
|
||||||
|
width: 40.w,
|
||||||
|
height: 40.w,
|
||||||
|
),
|
||||||
|
AkuBox.w(4),
|
||||||
|
Text(
|
||||||
|
'出户时间',
|
||||||
|
style: _textStyle,
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
Text(
|
||||||
|
_cardModel.outtime,
|
||||||
|
style: AppStyle().primaryStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_model.dart';
|
||||||
|
import 'package:aku_community_manager/provider/outdoor_provider.dart';
|
||||||
|
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_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';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class ItemsOutdoorPage extends StatefulWidget {
|
||||||
|
ItemsOutdoorPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ItemsOutdoorPageState createState() => _ItemsOutdoorPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ItemsOutdoorPageState extends State<ItemsOutdoorPage> with TickerProviderStateMixin {
|
||||||
|
List<String> _tabs = ['待出户', '已出户', '已驳回', '已作废', '全部'];
|
||||||
|
TabController _tabController;
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_tabController=TabController(length: _tabs.length, vsync: this);
|
||||||
|
}
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_tabController?.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AkuScaffold(
|
||||||
|
title: '物品出户',
|
||||||
|
appBarBottom: PreferredSize(
|
||||||
|
preferredSize: Size.fromHeight(88.w),
|
||||||
|
child: AkuTabBar(controller: _tabController, tabs: _tabs),
|
||||||
|
),
|
||||||
|
body: TabBarView(
|
||||||
|
controller: _tabController,
|
||||||
|
children: _tabs.map((e) => _buildListView(_tabs.indexOf(e))).toList()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Widget _buildListView(int index){
|
||||||
|
final _outdoorModels=Provider.of<OutdoorProvider>(context);
|
||||||
|
List<ItemsOutdoorModel> _selectModels = _outdoorModels.getOutdoorModels(index);
|
||||||
|
return ListView(
|
||||||
|
padding: EdgeInsets.only(left: 32.w,right: 32.w),
|
||||||
|
children: _selectModels.map((e) => ItemsOutdoorCard(cardModel:e)).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|