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

hmxc
小赖 4 years ago
parent e73e75e96c
commit 22dcebf677

@ -80,4 +80,10 @@ class _Manage {
///
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
Widget build(BuildContext context) {
ScreenUtil.init(context,
designSize: Size(750, 1334), allowFontScaling: true);
return Scaffold(
body: Center(
child: Image.asset(R.ASSETS_PLACEHOLDER_WEBP),

@ -1,44 +1,27 @@
// 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';
// Package imports:
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:get/get.dart';
// Project imports:
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/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 {
final ItemsOutdoorModel cardModel;
final bool isdetail;
ItemsOutdoorCard({
Key key,
@required this.cardModel,
this.isdetail = false,
}) : super(key: key);
final GoodsOutItemModel model;
ItemsOutdoorCard({Key key, @required this.model}) : 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 =
@ -47,250 +30,196 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
color: Color(0xFFFFFFFF),
margin: EdgeInsets.only(top: 16.w),
padding: EdgeInsets.only(left: 24.w, right: 24.w),
child: Column(children: [
widget.isdetail
? Container(
alignment: Alignment.centerLeft,
height: 90.w,
width: double.infinity,
child: Row(
children: [
Text(
'出户信息',
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(
child: Column(
children: [
Container(
alignment: Alignment.centerLeft,
height: 88.w,
width: double.infinity,
child: Row(
children: [
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)),
],
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),
),
),
)
: Container(
height: 112.w,
alignment: Alignment.centerRight,
child: AkuButton(
onPressed: () {
Get.to(ItemsOutdoorDetailsPage(
cardMedel: _cardModel,
));
},
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,
),
AkuBox.w(16),
//TODO
// Text(
// widget.model.create,
// style: TextStyle(
// color: AppStyle.minorTextColor,
// fontSize: 22.sp,
// ),
// ),
Spacer(),
Text(
widget.model.statusValue,
style: TextStyle(
color: widget.model.statusColor,
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(),
//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:
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:aku_community_manager/tools/extensions/list_extension_tool.dart';
// Package imports:
import 'package:aku_ui/aku_ui.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:get/get.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';
class ItemsOutdoorDetailsPage extends StatefulWidget {
final ItemsOutdoorModel cardMedel;
ItemsOutdoorDetailsPage({Key key, @required this.cardMedel})
: super(key: key);
final int id;
ItemsOutdoorDetailsPage({Key key, @required this.id}) : super(key: key);
@override
_ItemsOutdoorDetailsPageState createState() =>
@ -31,137 +37,246 @@ class ItemsOutdoorDetailsPage extends StatefulWidget {
}
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
Widget build(BuildContext context) {
UserProvider _userprovider =
Provider.of<UserProvider>(context, listen: false);
USER_ROLE userRole = _userprovider.userInfoModel.role;
return AkuScaffold(
title: '出户详情',
body: ListView(
children: [
ItemsOutdoorCard(
cardModel: widget.cardMedel,
isdetail: true,
),
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(
widget.cardMedel.items.itemname,
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(
widget.cardMedel.items.weight < 50.0
? '<50kg'
: '${widget.cardMedel.items.weight}kg',
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,
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)),
],
),
Spacer(),
Text(
widget.cardMedel.items.way,
style: AppStyle().primaryStyle,
)
],
),
AkuBox.h(16),
Row(
children: [
Image.asset(
R.ASSETS_OUTDOOR_IC_IMAGE_PNG,
width: 40.w,
height: 40.w,
),
Divider(height: 1.w),
MaterialButton(
onPressed: () {},
elevation: 0,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
R.ASSETS_OUTDOOR_IC_PHONEBLUE_PNG,
width: 30.w,
height: 30.w,
),
AkuBox.w(16),
Text(
'联系业主',
style: TextStyle(
color: Color(0xFF3F8FFE),
fontSize: 28.sp,
),
),
],
),
AkuBox.w(4),
Text(
'图片信息',
style: AppStyle().secondaryTextStyle,
color: Colors.white,
height: 96.w,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
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) {
switch (widget.cardMedel.status) {
case OUTDOORSTATUS.NOT_OUT:
return userRole == USER_ROLE.SECURITY
Widget _bottomCard() {
final userProvider = Provider.of<UserProvider>(context);
switch (_model.status) {
case 1:
return userProvider.infoModel.canPass
? Container(
height: 98.w,
decoration: BoxDecoration(
@ -181,9 +296,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
children: [
AkuButton(
onPressed: () {
Get.to(OutdoorNotpassPage(
model: widget.cardMedel,
));
//TODO not pass
// Get.to(OutdoorNotpassPage(
// model: widget.cardMedel,
// ));
},
child: Container(
width: 304.w,
@ -203,9 +319,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
Spacer(),
AkuMaterialButton(
onPressed: () {
Get.to(OutdoorPassPage(
model: widget.cardMedel,
));
//TODO pass
// Get.to(OutdoorPassPage(
// model: widget.cardMedel,
// ));
},
radius: 4.w,
color: Color(0xFFFFC40C),
@ -221,7 +338,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
)
: SizedBox();
break;
case OUTDOORSTATUS.OUT_DONE:
case 2:
return Container(
height: 226.w,
color: Color(0xFFFFFFFF),
@ -247,7 +364,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
),
Spacer(),
Text(
widget.cardMedel.finalOutTime,
DateUtil.formatDate(
_model.expected,
format: 'yyyy-MM-dd HH:mm',
),
style: AppStyle().primaryStyle,
),
],
@ -267,7 +387,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
),
Spacer(),
Text(
widget.cardMedel.outPlace,
_model.exportValue,
style: AppStyle().primaryStyle,
),
],
@ -276,7 +396,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
),
);
break;
case OUTDOORSTATUS.REJECTED:
case 3:
return Container(
height: 226.w,
color: Color(0xFFFFFFFF),
@ -302,7 +422,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
),
Spacer(),
Text(
widget.cardMedel.finalOutTime,
DateUtil.formatDate(
_model.expected,
format: 'yyyy-MM-dd HH:mm',
),
style: AppStyle().primaryStyle,
),
],
@ -321,11 +444,13 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
style: AppStyle().secondaryTextStyle,
),
Spacer(),
Text(widget.cardMedel.rejectReason,
style: TextStyle(
color: Color(0xFFFF4501),
fontSize: 28.sp,
fontWeight: FontWeight.bold)),
Text(
_model.remarks,
style: TextStyle(
color: Color(0xFFFF4501),
fontSize: 28.sp,
fontWeight: FontWeight.bold),
),
],
),
],

@ -1,5 +1,10 @@
// 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_easyrefresh/easy_refresh.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -23,6 +28,7 @@ class _ItemsOutdoorPageState extends State<ItemsOutdoorPage>
with TickerProviderStateMixin {
List<String> _tabs = ['待出户', '已出户', '已驳回', '已作废', '全部'];
TabController _tabController;
EasyRefreshController _refreshController = EasyRefreshController();
@override
void initState() {
super.initState();
@ -44,24 +50,15 @@ class _ItemsOutdoorPageState extends State<ItemsOutdoorPage>
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,
isdetail: false,
))
.toList(),
controller: _tabController,
children: [
ItemsOutdoorView(status: 1),
ItemsOutdoorView(status: 2),
ItemsOutdoorView(status: 3),
ItemsOutdoorView(status: 4),
ItemsOutdoorView(status: null),
],
),
);
}
}

@ -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