物品出户页面,物品出户详情页面接口对接

hmxc
小赖 4 years ago
parent e73e75e96c
commit 22dcebf677

@ -80,4 +80,10 @@ class _Manage {
/// ///
String get borrowCheck => '/user/borrow/submitCheck'; String get borrowCheck => '/user/borrow/submitCheck';
///()
String get goodsOutList => '/user/articleOut/list';
///id
String get goodsOutDetail => '/user/articleOut/findById';
} }

@ -0,0 +1,181 @@
import 'package:aku_community_manager/models/common/img_model.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
// * id id
// * status (1.2.3.)
// * roomName
// * applicantName
// * identity 123
// * applicantTel
// * expectedTime
// * articleOutName
// * weight (1. <50kg , 2. 50kg-100kg , 3. >100kg)
// * approach 1.2.
// * imgUrls
// * reviewDate status=2:status=3:
// * export (1.2.3.西4.)status=2
// * remarks 使status=3
class GoodsOutDetailModel {
int id;
///status (1.2.3.)
int status;
String roomName;
String applicantName;
///identity 123
int identity;
String applicantTel;
String expectedTime;
String articleOutName;
int weight;
///approach 1.2.
int approach;
List<ImgModel> imgUrls;
String reviewDate;
int export;
String remarks;
String get exportValue {
switch (export) {
case 1:
return '东门';
case 2:
return '南门';
case 3:
return '西门';
case 4:
return '北门';
default:
return '未知';
}
}
DateTime get review => DateUtil.getDateTime(reviewDate);
DateTime get expected => DateUtil.getDateTime(expectedTime);
///approach 1.2.
String get approachValue {
switch (approach) {
case 1:
return '自己搬运';
case 2:
return '搬家公司';
default:
return '未知';
}
}
///status (1.2.3.)
String get statusValue {
switch (status) {
case 1:
return '待出门';
case 2:
return '已出门';
case 3:
return '驳回申请';
default:
return ' 未知';
}
}
Color get statusColor {
switch (status) {
case 2:
return Color(0xFF999999);
default:
return Color(0xFFFF4501);
}
}
///identity 123
String get identityValue {
switch (identity) {
case 1:
return '业主';
case 2:
return '亲属';
case 3:
return '租客';
default:
return '未知';
}
}
String get weightValue {
switch (weight) {
case 1:
return '<50kg';
case 2:
return '50kg-100kg';
case 3:
return '>100kg';
default:
return '未知';
}
}
GoodsOutDetailModel(
{this.id,
this.status,
this.roomName,
this.applicantName,
this.identity,
this.applicantTel,
this.expectedTime,
this.articleOutName,
this.weight,
this.approach,
this.imgUrls,
this.reviewDate,
this.export,
this.remarks});
GoodsOutDetailModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
status = json['status'];
roomName = json['roomName'];
applicantName = json['applicantName'];
identity = json['identity'];
applicantTel = json['applicantTel'];
expectedTime = json['expectedTime'];
articleOutName = json['articleOutName'];
weight = json['weight'];
approach = json['approach'];
if (json['imgUrls'] != null) {
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgModel.fromJson(v));
});
} else
imgUrls = [];
reviewDate = json['reviewDate'];
export = json['export'];
remarks = json['remarks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['status'] = this.status;
data['roomName'] = this.roomName;
data['applicantName'] = this.applicantName;
data['identity'] = this.identity;
data['applicantTel'] = this.applicantTel;
data['expectedTime'] = this.expectedTime;
data['articleOutName'] = this.articleOutName;
data['weight'] = this.weight;
data['approach'] = this.approach;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
}
data['reviewDate'] = this.reviewDate;
data['export'] = this.export;
data['remarks'] = this.remarks;
return data;
}
}

@ -0,0 +1,93 @@
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
/// * id id
/// * status (1.2.3.)
/// * roomName
/// * applicantName
/// * identity 123
/// * articleOutName
/// * expectedTime
class GoodsOutItemModel {
int id;
///(1.2.3.)
int status;
String roomName;
String applicantName;
/// 123
int identity;
String articleOutName;
String expectedTime;
DateTime get expected => DateUtil.getDateTime(expectedTime);
///(1.2.3.)
String get statusValue {
switch (status) {
case 1:
return '待出门';
case 2:
return '已出门';
case 3:
return '驳回申请';
default:
return '未知';
}
}
Color get statusColor {
switch (status) {
case 2:
return Color(0xFF999999);
default:
return Color(0xFFFF4501);
}
}
/// 123
String get identityValue {
switch (identity) {
case 1:
return '业主';
case 2:
return '亲属';
case 3:
return '租客';
default:
return '未知';
}
}
GoodsOutItemModel(
{this.id,
this.status,
this.roomName,
this.applicantName,
this.identity,
this.articleOutName,
this.expectedTime});
GoodsOutItemModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
status = json['status'];
roomName = json['roomName'];
applicantName = json['applicantName'];
identity = json['identity'];
articleOutName = json['articleOutName'];
expectedTime = json['expectedTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['status'] = this.status;
data['roomName'] = this.roomName;
data['applicantName'] = this.applicantName;
data['identity'] = this.identity;
data['articleOutName'] = this.articleOutName;
data['expectedTime'] = this.expectedTime;
return data;
}
}

@ -50,6 +50,8 @@ class _SplashPageState extends State<SplashPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ScreenUtil.init(context,
designSize: Size(750, 1334), allowFontScaling: true);
return Scaffold( return Scaffold(
body: Center( body: Center(
child: Image.asset(R.ASSETS_PLACEHOLDER_WEBP), child: Image.asset(R.ASSETS_PLACEHOLDER_WEBP),

@ -1,44 +1,27 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/models/manager/goods_out/goods_out_item_model.dart';
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:aku_ui/common_widgets/aku_common_widgets.dart'; import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/const/resource.dart';
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/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart'; import 'package:get/get.dart';
class ItemsOutdoorCard extends StatefulWidget { class ItemsOutdoorCard extends StatefulWidget {
final ItemsOutdoorModel cardModel; final GoodsOutItemModel model;
final bool isdetail; ItemsOutdoorCard({Key key, @required this.model}) : super(key: key);
ItemsOutdoorCard({
Key key,
@required this.cardModel,
this.isdetail = false,
}) : super(key: key);
@override @override
_ItemsOutdoorCardState createState() => _ItemsOutdoorCardState(); _ItemsOutdoorCardState createState() => _ItemsOutdoorCardState();
} }
class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> { 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
TextStyle _textStyle = TextStyle _textStyle =
@ -47,35 +30,9 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
margin: EdgeInsets.only(top: 16.w), margin: EdgeInsets.only(top: 16.w),
padding: EdgeInsets.only(left: 24.w, right: 24.w), padding: EdgeInsets.only(left: 24.w, right: 24.w),
child: Column(children: [ child: Column(
widget.isdetail
? Container(
alignment: Alignment.centerLeft,
height: 90.w,
width: double.infinity,
child: Row(
children: [ children: [
Text( Container(
'出户信息',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 36.sp,
fontWeight: FontWeight.bold),
),
Spacer(),
Text(
ItemsOutdoorModel.outdoorStatusMap[_cardModel.status],
style: TextStyle(
color: _cardModel.status == OUTDOORSTATUS.CANCELLATION
? Color(0xFF999999)
: Color(0xFFFF4501),
fontSize: 24.sp,
fontWeight: FontWeight.bold),
),
],
),
)
: Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
height: 88.w, height: 88.w,
width: double.infinity, width: double.infinity,
@ -86,8 +43,7 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
width: 112.w, width: 112.w,
height: 40.w, height: 40.w,
decoration: BoxDecoration( decoration: BoxDecoration(
border: border: Border.all(color: Color(0xFF3F8FFE), width: 2.w),
Border.all(color: Color(0xFF3F8FFE), width: 2.w),
), ),
child: Text( child: Text(
'物品出户', '物品出户',
@ -98,22 +54,22 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
), ),
), ),
AkuBox.w(16), AkuBox.w(16),
Text( //TODO
_datetime, // Text(
style: TextStyle( // widget.model.create,
color: AppStyle.minorTextColor, // style: TextStyle(
fontSize: 22.sp, // color: AppStyle.minorTextColor,
), // fontSize: 22.sp,
), // ),
// ),
Spacer(), Spacer(),
Text( Text(
ItemsOutdoorModel.outdoorStatusMap[_cardModel.status], widget.model.statusValue,
style: TextStyle( style: TextStyle(
color: _cardModel.status == OUTDOORSTATUS.CANCELLATION color: widget.model.statusColor,
? Color(0xFF999999)
: Color(0xFFFF4501),
fontSize: 24.sp, fontSize: 24.sp,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold,
),
), ),
], ],
), ),
@ -131,8 +87,9 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
style: _textStyle, style: _textStyle,
), ),
Spacer(), Spacer(),
//TODO
Text( Text(
_cardModel.communityname, 'XXXXXX',
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -149,7 +106,7 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
Text('详细地址', style: _textStyle), Text('详细地址', style: _textStyle),
Spacer(), Spacer(),
Text( Text(
_cardModel.adress, widget.model.roomName,
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -169,7 +126,7 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
), ),
Spacer(), Spacer(),
Text( Text(
_cardModel.name, widget.model.applicantName,
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -189,7 +146,7 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
), ),
Spacer(), Spacer(),
Text( Text(
_cardModel.identify, widget.model.identityValue,
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -208,7 +165,7 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
), ),
Spacer(), Spacer(),
Text( Text(
_cardModel.items.itemname, widget.model.articleOutName,
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -228,7 +185,7 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
), ),
Spacer(), Spacer(),
Text( Text(
_cardModel.outtime, widget.model.expectedTime,
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -237,38 +194,12 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
Divider( Divider(
height: 1.w, height: 1.w,
), ),
widget.isdetail Container(
? AkuButton(
onPressed: () {},
child: Container(
alignment: Alignment.center,
height: 96.w,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
R.ASSETS_OUTDOOR_IC_PHONEBLUE_PNG,
width: 38.w,
height: 39.w,
),
AkuBox.w(16),
Text('联系业主',
style: TextStyle(
color: Color(0xFF3F8FFE),
fontSize: 28.sp,
fontWeight: FontWeight.bold)),
],
),
),
)
: Container(
height: 112.w, height: 112.w,
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: AkuButton( child: AkuButton(
onPressed: () { onPressed: () {
Get.to(ItemsOutdoorDetailsPage( Get.to(ItemsOutdoorDetailsPage(id: widget.model.id));
cardMedel: _cardModel,
));
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -279,10 +210,7 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
colors: [ colors: [AppStyle.primaryColor, AppStyle.minorColor])),
AppStyle.primaryColor,
AppStyle.minorColor
])),
child: Text( child: Text(
'查看详情', '查看详情',
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
@ -290,7 +218,8 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
), ),
), ),
), ),
]), ],
),
); );
} }
} }

@ -1,9 +1,16 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/goods_out/goods_out_detail_model.dart';
import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
// Package imports: // Package imports:
import 'package:aku_ui/aku_ui.dart'; import 'package:aku_ui/aku_ui.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -21,9 +28,8 @@ import 'package:aku_community_manager/ui/sub_pages/items_outdoor/outdoor_pass_pa
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class ItemsOutdoorDetailsPage extends StatefulWidget { class ItemsOutdoorDetailsPage extends StatefulWidget {
final ItemsOutdoorModel cardMedel; final int id;
ItemsOutdoorDetailsPage({Key key, @required this.cardMedel}) ItemsOutdoorDetailsPage({Key key, @required this.id}) : super(key: key);
: super(key: key);
@override @override
_ItemsOutdoorDetailsPageState createState() => _ItemsOutdoorDetailsPageState createState() =>
@ -31,18 +37,126 @@ class ItemsOutdoorDetailsPage extends StatefulWidget {
} }
class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> { class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
GoodsOutDetailModel _model;
_buildTile(String path, String title, String subTitle) {
return Row(
children: [
Image.asset(
path,
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text(
title ?? '',
style: TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp),
),
Spacer(),
Text(
subTitle ?? '',
style: AppStyle().primaryStyle,
),
],
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
UserProvider _userprovider =
Provider.of<UserProvider>(context, listen: false);
USER_ROLE userRole = _userprovider.userInfoModel.role;
return AkuScaffold( return AkuScaffold(
title: '出户详情', title: '出户详情',
body: ListView( body: EasyRefresh(
firstRefresh: true,
onRefresh: () async {
BaseModel model = await NetUtil().get(
API.manage.goodsOutDetail,
params: {'articleOutId': widget.id},
);
_model = GoodsOutDetailModel.fromJson(model.data);
setState(() {});
},
header: MaterialHeader(),
child: _model == null
? SizedBox()
: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w),
children: [
Container(
padding:
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
'出户信息',
style: AppStyle().barTitleStyle,
),
Spacer(),
Text(
_model.statusValue,
style: TextStyle(
color: _model.statusColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold,
),
),
],
),
AkuBox.h(16),
...<Widget>[
_buildTile(
R.ASSETS_OUTDOOR_IC_HOME_PNG, '小区名称', 'XXXX'),
_buildTile(
R.ASSETS_OUTDOOR_IC_ADDRESS_PNG,
'详细地址',
_model.roomName,
),
_buildTile(R.ASSETS_OUTDOOR_IC_HOME_PNG, '出户人',
_model.applicantName),
_buildTile(R.ASSETS_OUTDOOR_IC_HOME_PNG, '身份',
_model.identityValue),
_buildTile(R.ASSETS_OUTDOOR_IC_HOME_PNG, '联系方式',
_model.applicantTel),
_buildTile(
R.ASSETS_OUTDOOR_IC_HOME_PNG,
'出户时间',
DateUtil.formatDate(
_model.expected,
format: 'yyyy-MM-dd HH:mm',
),
),
].sepWidget(separate: AkuBox.h(12)),
],
),
),
Divider(height: 1.w),
MaterialButton(
onPressed: () {},
elevation: 0,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [ children: [
ItemsOutdoorCard( Image.asset(
cardModel: widget.cardMedel, R.ASSETS_OUTDOOR_IC_PHONEBLUE_PNG,
isdetail: true, width: 30.w,
height: 30.w,
),
AkuBox.w(16),
Text(
'联系业主',
style: TextStyle(
color: Color(0xFF3F8FFE),
fontSize: 28.sp,
),
),
],
),
color: Colors.white,
height: 96.w,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
), ),
Container( Container(
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
@ -71,7 +185,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
), ),
Spacer(), Spacer(),
Text( Text(
widget.cardMedel.items.itemname, _model.articleOutName ?? '',
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -91,9 +205,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
), ),
Spacer(), Spacer(),
Text( Text(
widget.cardMedel.items.weight < 50.0 _model.weightValue,
? '<50kg'
: '${widget.cardMedel.items.weight}kg',
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -113,7 +225,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
), ),
Spacer(), Spacer(),
Text( Text(
widget.cardMedel.items.way, _model.approachValue,
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
) )
], ],
@ -137,12 +249,13 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
AkuBox.h(16), AkuBox.h(16),
Wrap( Wrap(
spacing: 16.w, spacing: 16.w,
children: widget.cardMedel.items.imagepath children: _model.imgUrls
.map( .map(
(e) => ClipRRect( (e) => ClipRRect(
borderRadius: BorderRadius.circular(4.w), borderRadius: BorderRadius.circular(4.w),
child: Image.asset( child: FadeInImage.assetNetwork(
e, placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e?.url ?? ''),
width: 218.w, width: 218.w,
height: 218.w, height: 218.w,
)), )),
@ -154,14 +267,16 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
), ),
], ],
), ),
bottom: _bottomCard(userRole), ),
bottom: _model == null ? SizedBox() : _bottomCard(),
); );
} }
Widget _bottomCard(USER_ROLE userRole) { Widget _bottomCard() {
switch (widget.cardMedel.status) { final userProvider = Provider.of<UserProvider>(context);
case OUTDOORSTATUS.NOT_OUT: switch (_model.status) {
return userRole == USER_ROLE.SECURITY case 1:
return userProvider.infoModel.canPass
? Container( ? Container(
height: 98.w, height: 98.w,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -181,9 +296,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
children: [ children: [
AkuButton( AkuButton(
onPressed: () { onPressed: () {
Get.to(OutdoorNotpassPage( //TODO not pass
model: widget.cardMedel, // Get.to(OutdoorNotpassPage(
)); // model: widget.cardMedel,
// ));
}, },
child: Container( child: Container(
width: 304.w, width: 304.w,
@ -203,9 +319,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
Spacer(), Spacer(),
AkuMaterialButton( AkuMaterialButton(
onPressed: () { onPressed: () {
Get.to(OutdoorPassPage( //TODO pass
model: widget.cardMedel, // Get.to(OutdoorPassPage(
)); // model: widget.cardMedel,
// ));
}, },
radius: 4.w, radius: 4.w,
color: Color(0xFFFFC40C), color: Color(0xFFFFC40C),
@ -221,7 +338,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
) )
: SizedBox(); : SizedBox();
break; break;
case OUTDOORSTATUS.OUT_DONE: case 2:
return Container( return Container(
height: 226.w, height: 226.w,
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
@ -247,7 +364,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
), ),
Spacer(), Spacer(),
Text( Text(
widget.cardMedel.finalOutTime, DateUtil.formatDate(
_model.expected,
format: 'yyyy-MM-dd HH:mm',
),
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -267,7 +387,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
), ),
Spacer(), Spacer(),
Text( Text(
widget.cardMedel.outPlace, _model.exportValue,
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -276,7 +396,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
), ),
); );
break; break;
case OUTDOORSTATUS.REJECTED: case 3:
return Container( return Container(
height: 226.w, height: 226.w,
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
@ -302,7 +422,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
), ),
Spacer(), Spacer(),
Text( Text(
widget.cardMedel.finalOutTime, DateUtil.formatDate(
_model.expected,
format: 'yyyy-MM-dd HH:mm',
),
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
@ -321,11 +444,13 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
style: AppStyle().secondaryTextStyle, style: AppStyle().secondaryTextStyle,
), ),
Spacer(), Spacer(),
Text(widget.cardMedel.rejectReason, Text(
_model.remarks,
style: TextStyle( style: TextStyle(
color: Color(0xFFFF4501), color: Color(0xFFFF4501),
fontSize: 28.sp, fontSize: 28.sp,
fontWeight: FontWeight.bold)), fontWeight: FontWeight.bold),
),
], ],
), ),
], ],

@ -1,5 +1,10 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/goods_out/goods_out_item_model.dart';
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_view.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
// Package imports: // Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -23,6 +28,7 @@ class _ItemsOutdoorPageState extends State<ItemsOutdoorPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
List<String> _tabs = ['待出户', '已出户', '已驳回', '已作废', '全部']; List<String> _tabs = ['待出户', '已出户', '已驳回', '已作废', '全部'];
TabController _tabController; TabController _tabController;
EasyRefreshController _refreshController = EasyRefreshController();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -45,23 +51,14 @@ class _ItemsOutdoorPageState extends State<ItemsOutdoorPage>
), ),
body: TabBarView( body: TabBarView(
controller: _tabController, controller: _tabController,
children: children: [
_tabs.map((e) => _buildListView(_tabs.indexOf(e))).toList()), ItemsOutdoorView(status: 1),
); ItemsOutdoorView(status: 2),
} ItemsOutdoorView(status: 3),
ItemsOutdoorView(status: 4),
Widget _buildListView(int index) { ItemsOutdoorView(status: null),
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,
isdetail: false,
))
.toList(),
); );
} }
} }

@ -0,0 +1,45 @@
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/goods_out/goods_out_item_model.dart';
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_card.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ItemsOutdoorView extends StatefulWidget {
final int status;
ItemsOutdoorView({Key key, this.status}) : super(key: key);
@override
_ItemsOutdoorViewState createState() => _ItemsOutdoorViewState();
}
class _ItemsOutdoorViewState extends State<ItemsOutdoorView>
with AutomaticKeepAliveClientMixin {
EasyRefreshController _refreshController = new EasyRefreshController();
@override
Widget build(BuildContext context) {
super.build(context);
return BeeListView(
path: API.manage.goodsOutList,
extraParams: {'articleOutStatus': widget.status},
controller: _refreshController,
convert: (model) =>
model.tableList.map((e) => GoodsOutItemModel.fromJson(e)).toList(),
builder: (items) {
return ListView.builder(
itemBuilder: (context, index) {
return ItemsOutdoorCard(
model: items[index],
);
},
padding: EdgeInsets.only(left: 32.w, right: 32.w),
itemCount: items.length,
);
},
);
}
@override
bool get wantKeepAlive => true;
}
Loading…
Cancel
Save