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

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,250 +30,196 @@ 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 children: [
? Container( Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
height: 90.w, height: 88.w,
width: double.infinity, width: double.infinity,
child: Row( 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,
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: [
Image.asset(
R.ASSETS_OUTDOOR_IC_CHUHU_PNG,
width: 40.w,
height: 40.w,
),
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,
),
],
),
AkuBox.h(24),
Divider(
height: 1.w,
),
widget.isdetail
? AkuButton(
onPressed: () {},
child: Container(
alignment: Alignment.center, alignment: Alignment.center,
height: 96.w, width: 112.w,
child: Row( height: 40.w,
mainAxisSize: MainAxisSize.min, decoration: BoxDecoration(
children: [ border: Border.all(color: Color(0xFF3F8FFE), width: 2.w),
Image.asset( ),
R.ASSETS_OUTDOOR_IC_PHONEBLUE_PNG, child: Text(
width: 38.w, '物品出户',
height: 39.w, style: TextStyle(
), color: Color(0xFF3F8FFE),
AkuBox.w(16), fontSize: 20.sp,
Text('联系业主', fontWeight: FontWeight.bold),
style: TextStyle(
color: Color(0xFF3F8FFE),
fontSize: 28.sp,
fontWeight: FontWeight.bold)),
],
), ),
), ),
) AkuBox.w(16),
: Container( //TODO
height: 112.w, // Text(
alignment: Alignment.centerRight, // widget.model.create,
child: AkuButton( // style: TextStyle(
onPressed: () { // color: AppStyle.minorTextColor,
Get.to(ItemsOutdoorDetailsPage( // fontSize: 22.sp,
cardMedel: _cardModel, // ),
)); // ),
}, Spacer(),
child: Container( Text(
alignment: Alignment.center, widget.model.statusValue,
width: 160.w, style: TextStyle(
height: 64.w, color: widget.model.statusColor,
decoration: BoxDecoration( fontSize: 24.sp,
borderRadius: BorderRadius.circular(8.w), fontWeight: FontWeight.bold,
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
AppStyle.primaryColor,
AppStyle.minorColor
])),
child: Text(
'查看详情',
style: AppStyle().primaryStyle,
),
), ),
), ),
],
),
),
Row(
children: [
Image.asset(
R.ASSETS_OUTDOOR_IC_HOME_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text(
'小区名称',
style: _textStyle,
),
Spacer(),
//TODO
Text(
'XXXXXX',
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(
widget.model.roomName,
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(
widget.model.applicantName,
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(
widget.model.identityValue,
style: AppStyle().primaryStyle,
),
],
),
AkuBox.h(12),
Row(
children: [
Image.asset(
R.ASSETS_OUTDOOR_IC_CHUHU_PNG,
width: 40.w,
height: 40.w,
),
Text(
'出户物品',
style: _textStyle,
),
Spacer(),
Text(
widget.model.articleOutName,
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(
widget.model.expectedTime,
style: AppStyle().primaryStyle,
),
],
),
AkuBox.h(24),
Divider(
height: 1.w,
),
Container(
height: 112.w,
alignment: Alignment.centerRight,
child: AkuButton(
onPressed: () {
Get.to(ItemsOutdoorDetailsPage(id: widget.model.id));
},
child: Container(
alignment: Alignment.center,
width: 160.w,
height: 64.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [AppStyle.primaryColor, AppStyle.minorColor])),
child: Text(
'查看详情',
style: AppStyle().primaryStyle,
),
), ),
]), ),
),
],
),
); );
} }
} }

@ -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,137 +37,246 @@ 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(
children: [ firstRefresh: true,
ItemsOutdoorCard( onRefresh: () async {
cardModel: widget.cardMedel, BaseModel model = await NetUtil().get(
isdetail: true, API.manage.goodsOutDetail,
), params: {'articleOutId': widget.id},
Container( );
color: Color(0xFFFFFFFF), _model = GoodsOutDetailModel.fromJson(model.data);
margin: EdgeInsets.only(top: 16.w), setState(() {});
padding: EdgeInsets.only( },
top: 24.w, left: 32.w, right: 32.w, bottom: 40.w), header: MaterialHeader(),
child: Column( child: _model == null
crossAxisAlignment: CrossAxisAlignment.start, ? SizedBox()
children: [ : ListView(
Text( padding: EdgeInsets.symmetric(vertical: 16.w),
'物品信息', children: [
style: AppStyle().barTitleStyle, Container(
), padding:
AkuBox.h(16), EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
Row( color: Colors.white,
children: [ child: Column(
Image.asset( crossAxisAlignment: CrossAxisAlignment.start,
R.ASSETS_OUTDOOR_IC_CHUHU_PNG, children: [
width: 40.w, Row(
height: 40.w, children: [
), Text(
AkuBox.w(4), '出户信息',
Text( style: AppStyle().barTitleStyle,
'出户物品', ),
style: AppStyle().secondaryTextStyle, Spacer(),
), Text(
Spacer(), _model.statusValue,
Text( style: TextStyle(
widget.cardMedel.items.itemname, color: _model.statusColor,
style: AppStyle().primaryStyle, fontSize: 24.sp,
), fontWeight: FontWeight.bold,
], ),
), ),
AkuBox.h(16), ],
Row( ),
children: [ AkuBox.h(16),
Image.asset( ...<Widget>[
R.ASSETS_OUTDOOR_IC_WEIGHT_PNG, _buildTile(
width: 40.w, R.ASSETS_OUTDOOR_IC_HOME_PNG, '小区名称', 'XXXX'),
height: 40.w, _buildTile(
), R.ASSETS_OUTDOOR_IC_ADDRESS_PNG,
AkuBox.w(4), '详细地址',
Text( _model.roomName,
'物品重量', ),
style: AppStyle().secondaryTextStyle, _buildTile(R.ASSETS_OUTDOOR_IC_HOME_PNG, '出户人',
), _model.applicantName),
Spacer(), _buildTile(R.ASSETS_OUTDOOR_IC_HOME_PNG, '身份',
Text( _model.identityValue),
widget.cardMedel.items.weight < 50.0 _buildTile(R.ASSETS_OUTDOOR_IC_HOME_PNG, '联系方式',
? '<50kg' _model.applicantTel),
: '${widget.cardMedel.items.weight}kg', _buildTile(
style: AppStyle().primaryStyle, R.ASSETS_OUTDOOR_IC_HOME_PNG,
), '出户时间',
], DateUtil.formatDate(
), _model.expected,
AkuBox.h(16), format: 'yyyy-MM-dd HH:mm',
Row( ),
children: [ ),
Image.asset( ].sepWidget(separate: AkuBox.h(12)),
R.ASSETS_OUTDOOR_IC_TRANSPORT_PNG, ],
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text(
'搬运方式',
style: AppStyle().secondaryTextStyle,
), ),
Spacer(), ),
Text( Divider(height: 1.w),
widget.cardMedel.items.way, MaterialButton(
style: AppStyle().primaryStyle, onPressed: () {},
) elevation: 0,
], child: Row(
), mainAxisSize: MainAxisSize.min,
AkuBox.h(16), children: [
Row( Image.asset(
children: [ R.ASSETS_OUTDOOR_IC_PHONEBLUE_PNG,
Image.asset( width: 30.w,
R.ASSETS_OUTDOOR_IC_IMAGE_PNG, height: 30.w,
width: 40.w, ),
height: 40.w, AkuBox.w(16),
Text(
'联系业主',
style: TextStyle(
color: Color(0xFF3F8FFE),
fontSize: 28.sp,
),
),
],
), ),
AkuBox.w(4), color: Colors.white,
Text( height: 96.w,
'图片信息', materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
style: AppStyle().secondaryTextStyle, ),
Container(
color: Color(0xFFFFFFFF),
margin: EdgeInsets.only(top: 16.w),
padding: EdgeInsets.only(
top: 24.w, left: 32.w, right: 32.w, bottom: 40.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'物品信息',
style: AppStyle().barTitleStyle,
),
AkuBox.h(16),
Row(
children: [
Image.asset(
R.ASSETS_OUTDOOR_IC_CHUHU_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text(
'出户物品',
style: AppStyle().secondaryTextStyle,
),
Spacer(),
Text(
_model.articleOutName ?? '',
style: AppStyle().primaryStyle,
),
],
),
AkuBox.h(16),
Row(
children: [
Image.asset(
R.ASSETS_OUTDOOR_IC_WEIGHT_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text(
'物品重量',
style: AppStyle().secondaryTextStyle,
),
Spacer(),
Text(
_model.weightValue,
style: AppStyle().primaryStyle,
),
],
),
AkuBox.h(16),
Row(
children: [
Image.asset(
R.ASSETS_OUTDOOR_IC_TRANSPORT_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text(
'搬运方式',
style: AppStyle().secondaryTextStyle,
),
Spacer(),
Text(
_model.approachValue,
style: AppStyle().primaryStyle,
)
],
),
AkuBox.h(16),
Row(
children: [
Image.asset(
R.ASSETS_OUTDOOR_IC_IMAGE_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text(
'图片信息',
style: AppStyle().secondaryTextStyle,
),
Spacer(),
],
),
AkuBox.h(16),
Wrap(
spacing: 16.w,
children: _model.imgUrls
.map(
(e) => ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e?.url ?? ''),
width: 218.w,
height: 218.w,
)),
)
.toList(),
),
],
), ),
Spacer(), ),
], ],
), ),
AkuBox.h(16),
Wrap(
spacing: 16.w,
children: widget.cardMedel.items.imagepath
.map(
(e) => ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: Image.asset(
e,
width: 218.w,
height: 218.w,
)),
)
.toList(),
),
],
),
),
],
), ),
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(
style: TextStyle( _model.remarks,
color: Color(0xFFFF4501), style: TextStyle(
fontSize: 28.sp, color: Color(0xFFFF4501),
fontWeight: FontWeight.bold)), fontSize: 28.sp,
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();
@ -44,24 +50,15 @@ class _ItemsOutdoorPageState extends State<ItemsOutdoorPage>
child: AkuTabBar(controller: _tabController, tabs: _tabs), child: AkuTabBar(controller: _tabController, tabs: _tabs),
), ),
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