对接接口:查询物品出户信息

hmxc
张萌 4 years ago
parent e8c1d86fd1
commit 1575da2f96

@ -12,7 +12,8 @@ import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/dotted_line.dart'; import 'package:akuCommunity/widget/dotted_line.dart';
class DetoCodePage extends StatelessWidget { class DetoCodePage extends StatelessWidget {
const DetoCodePage({Key key}) : super(key: key); final int id;
const DetoCodePage({Key key, this.id}) : super(key: key);
Widget _header() { Widget _header() {
return Container( return Container(

@ -42,7 +42,9 @@ class _GoodsDetoPageState extends State<GoodsDetoPage> {
builder: (items) { builder: (items) {
return ListView.builder( return ListView.builder(
itemBuilder: (context, index) { itemBuilder: (context, index) {
return GoodsInfoCard(); return GoodsInfoCard(
model: items[index],
);
}, },
itemCount: items.length, itemCount: items.length,
); );

@ -1,4 +1,7 @@
// Flutter imports: // Flutter imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/model/manager/goods_out_model.dart';
import 'package:akuCommunity/utils/bee_map.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -8,11 +11,46 @@ import 'goods_info_card_button.dart';
import 'image_horizontal_list.dart'; import 'image_horizontal_list.dart';
class GoodsInfoCard extends StatelessWidget { class GoodsInfoCard extends StatelessWidget {
final List<String> listImage; final GoodsOutModel model;
final String status; GoodsInfoCard({
final List<Map<String, dynamic>> detoInfoList; Key key,
GoodsInfoCard({Key key,this.listImage,this.status,this.detoInfoList}) : super(key: key); this.model,
}) : super(key: key);
Widget _builTile(String title, String text) {
return Container(
padding: EdgeInsets.only(top: 8.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: TextStyle(fontSize: 28.sp, color: Color(0xff999999)),
),
Text(
text,
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
),
],
),
);
}
Color _getColor(int state) {
switch (state) {
case 1:
case 2:
case 3:
return kDarkPrimaryColor;
case 4:
case 5:
case 6:
case 7:
return ktextSubColor;
default:
return kDangerColor;
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -41,18 +79,15 @@ class GoodsInfoCard extends StatelessWidget {
blurRadius: 10.0), blurRadius: 10.0),
], ],
), ),
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 25.w, left: 24.w, right: 24.w),
top: 25.w,
left: 24.w,
right: 24.w),
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only(bottom: 24.w), padding: EdgeInsets.only(bottom: 24.w),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom:
color: Color(0xffeeeeee), width: 0.5)), BorderSide(color: Color(0xffeeeeee), width: 0.5)),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -64,13 +99,11 @@ class GoodsInfoCard extends StatelessWidget {
fontSize: 32.sp, fontSize: 32.sp,
color: Color(0xff333333)), color: Color(0xff333333)),
), ),
Text( Text(BeeMap().fixState[model.status],
status, style: TextStyle(
style: TextStyle( fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, fontSize: 28.sp,
fontSize: 28.sp, color: _getColor(model.status))),
color: Color(0xff333333))
),
], ],
), ),
), ),
@ -81,35 +114,16 @@ class GoodsInfoCard extends StatelessWidget {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom:
color: Color(0xffeeeeee), width: 0.5)), BorderSide(color: Color(0xffeeeeee), width: 0.5)),
),
child: Column(
children: detoInfoList
.map(
(item) => Container(
padding: EdgeInsets.only(top: 8.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
item['title'],
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff999999)),
),
Text(
item['content'],
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff333333)),
),
],
),
),
)
.toList(),
), ),
child: Column(children: [
_builTile('物品重量', BeeMap().goodsOutweight[model.weight]),
_builTile('出户时间', model.expectedTime),
_builTile('物品名称', model.name),
_builTile(
'搬运方式', BeeMap().goodsOutApproach[model.approach]),
]),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -120,22 +134,25 @@ class GoodsInfoCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(bottom: 25.w), margin: EdgeInsets.only(bottom: 25.w),
child: Text( child: Text(
'图片信息', '图片信息',
style: TextStyle( style: TextStyle(
fontSize: 28.sp, fontSize: 28.sp, color: Color(0xff333333)),
color: Color(0xff333333)),
), ),
), ),
ImageHorizontalList(imageUrl: listImage), ImageHorizontalList(imageUrl: []),
], ],
), ),
), ),
], ],
), ),
), ),
GoodsInfoCardButton() GoodsInfoCardButton(
id:model.id,
tel: model.movingCompanyTel,
)
], ],
), ),
); );

@ -13,7 +13,9 @@ import 'package:akuCommunity/pages/goods_deto_page/deto_code_page/deto_code_page
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
class GoodsInfoCardButton extends StatelessWidget { class GoodsInfoCardButton extends StatelessWidget {
GoodsInfoCardButton({Key key}) : super(key: key); final String tel;
final int id;
GoodsInfoCardButton({Key key, this.tel, this.id}) : super(key: key);
final List<Map<String, dynamic>> _listButton = [ final List<Map<String, dynamic>> _listButton = [
{'title': '查看二维码', 'icon': MaterialCommunityIcons.qrcode}, {'title': '查看二维码', 'icon': MaterialCommunityIcons.qrcode},
@ -92,10 +94,15 @@ class GoodsInfoCardButton extends StatelessWidget {
onTap: () { onTap: () {
switch (_listButton[index]['title']) { switch (_listButton[index]['title']) {
case '查看二维码': case '查看二维码':
DetoCodePage().to; DetoCodePage(
id: id,
).to();
break; break;
case '搬家公司': case '搬家公司':
_showDialog(context, '0574-88467897'); if (tel.isEmptyOrNull) {
return null;
} else
_showDialog(context, tel);
break; break;
default: default:
} }
@ -122,8 +129,7 @@ class GoodsInfoCardButton extends StatelessWidget {
color: Color(0xff333333), color: Color(0xff333333),
), ),
Container( Container(
margin: margin: EdgeInsets.only(left: 14.w),
EdgeInsets.only(left: 14.w),
child: Text( child: Text(
_listButton[index]['title'], _listButton[index]['title'],
style: TextStyle( style: TextStyle(

@ -26,4 +26,14 @@ class BeeMap {
8: '作废', 8: '作废',
9: '取消' 9: '取消'
}; };
Map<int, String> goodsOutweight = {
1: '< 50kg',
2: '50kg-100kg',
3: '> 100kg',
};
Map<int,String> goodsOutApproach={
1:'自己搬运',
2:'搬家公司',
};
} }

Loading…
Cancel
Save