|
|
|
@ -1,29 +1,33 @@
|
|
|
|
|
// 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';
|
|
|
|
|
|
|
|
|
|
// 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/mock_models/users/user_info_model.dart';
|
|
|
|
|
import 'package:aku_community_manager/provider/user_provider.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_card.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/outdoor_pass_page.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
|
import 'package:url_launcher/url_launcher.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,18 +35,128 @@ 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(
|
|
|
|
|
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: () {
|
|
|
|
|
launch('tel:${_model.applicantTel}');
|
|
|
|
|
},
|
|
|
|
|
elevation: 0,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
ItemsOutdoorCard(
|
|
|
|
|
cardModel: widget.cardMedel,
|
|
|
|
|
isdetail: true,
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
height: 96.w,
|
|
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
@ -71,7 +185,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
widget.cardMedel.items.itemname,
|
|
|
|
|
_model.articleOutName ?? '',
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -91,9 +205,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
widget.cardMedel.items.weight < 50.0
|
|
|
|
|
? '<50kg'
|
|
|
|
|
: '${widget.cardMedel.items.weight}kg',
|
|
|
|
|
_model.weightValue,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -113,7 +225,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
widget.cardMedel.items.way,
|
|
|
|
|
_model.approachValue,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
@ -137,12 +249,13 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Wrap(
|
|
|
|
|
spacing: 16.w,
|
|
|
|
|
children: widget.cardMedel.items.imagepath
|
|
|
|
|
children: _model.imgUrls
|
|
|
|
|
.map(
|
|
|
|
|
(e) => ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(4.w),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
e,
|
|
|
|
|
child: FadeInImage.assetNetwork(
|
|
|
|
|
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
|
|
|
|
|
image: API.image(e?.url ?? ''),
|
|
|
|
|
width: 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) {
|
|
|
|
|
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,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
children: [
|
|
|
|
|
AkuButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Get.to(OutdoorNotpassPage(
|
|
|
|
|
model: widget.cardMedel,
|
|
|
|
|
));
|
|
|
|
|
Get.to(OutdoorNotpassPage(id: _model.id));
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 304.w,
|
|
|
|
@ -203,9 +316,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
Spacer(),
|
|
|
|
|
AkuMaterialButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Get.to(OutdoorPassPage(
|
|
|
|
|
model: widget.cardMedel,
|
|
|
|
|
));
|
|
|
|
|
Get.to(OutdoorPassPage(id: _model.id));
|
|
|
|
|
},
|
|
|
|
|
radius: 4.w,
|
|
|
|
|
color: Color(0xFFFFC40C),
|
|
|
|
@ -221,7 +332,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
)
|
|
|
|
|
: SizedBox();
|
|
|
|
|
break;
|
|
|
|
|
case OUTDOORSTATUS.OUT_DONE:
|
|
|
|
|
case 2:
|
|
|
|
|
return Container(
|
|
|
|
|
height: 226.w,
|
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
@ -247,7 +358,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 +381,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
widget.cardMedel.outPlace,
|
|
|
|
|
_model.exportValue,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -276,7 +390,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
case OUTDOORSTATUS.REJECTED:
|
|
|
|
|
case 3:
|
|
|
|
|
return Container(
|
|
|
|
|
height: 226.w,
|
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
@ -302,7 +416,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 +438,13 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
style: AppStyle().secondaryTextStyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(widget.cardMedel.rejectReason,
|
|
|
|
|
Text(
|
|
|
|
|
_model.remarks,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Color(0xFFFF4501),
|
|
|
|
|
fontSize: 28.sp,
|
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|