对接:app 包裹代收:查询所有的快递包裹(包含条件搜索)

hmxc
张萌 4 years ago
parent b06ecb1487
commit 29b762e56a

@ -215,6 +215,9 @@ class _Manager {
/// ///
String get paymentRecord => '/user/dailyPayment/paymentRecord'; String get paymentRecord => '/user/dailyPayment/paymentRecord';
///app
String get expressPackageList => '/user/packageCollection/list';
} }
class _Community { class _Community {

@ -0,0 +1,37 @@
import 'package:equatable/equatable.dart';
import 'package:flustars/flustars.dart';
import 'package:json_annotation/json_annotation.dart';
part 'express_package_list_model.g.dart';
@JsonSerializable()
class ExpressPackageListModel extends Equatable {
final int id;
final String code;
final String addresseeName;
final String addresseeTel;
final String address;
final int status;
final String? receiveDate;
final String createDate;
final String placePosition;
ExpressPackageListModel({
required this.id,
required this.code,
required this.addresseeName,
required this.addresseeTel,
required this.address,
required this.status,
required this.receiveDate,
required this.createDate,
required this.placePosition,
});
factory ExpressPackageListModel.fromJson(Map<String, dynamic> json) =>
_$ExpressPackageListModelFromJson(json);
String get createDateString => DateUtil.formatDateStr(this.createDate,
format: 'yyyy-MM-dd HH:mm');
@override
List<Object?> get props => throw UnimplementedError();
}

@ -0,0 +1,22 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'express_package_list_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ExpressPackageListModel _$ExpressPackageListModelFromJson(
Map<String, dynamic> json) {
return ExpressPackageListModel(
id: json['id'] as int,
code: json['code'] as String,
addresseeName: json['addresseeName'] as String,
addresseeTel: json['addresseeTel'] as String,
address: json['address'] as String,
status: json['status'] as int,
receiveDate: json['receiveDate'] as String?,
createDate: json['createDate'] as String,
placePosition: json['placePosition'] as String,
);
}

@ -1,3 +1,4 @@
import 'package:aku_community/models/express_package/express_package_list_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -10,7 +11,9 @@ import 'package:aku_community/widget/bee_divider.dart';
class ExpressPackageCard extends StatefulWidget { class ExpressPackageCard extends StatefulWidget {
final int index; final int index;
ExpressPackageCard({Key? key, required this.index}) : super(key: key); final ExpressPackageListModel model;
ExpressPackageCard({Key? key, required this.index, required this.model})
: super(key: key);
@override @override
_ExpressPackageCardState createState() => _ExpressPackageCardState(); _ExpressPackageCardState createState() => _ExpressPackageCardState();
@ -30,7 +33,7 @@ class _ExpressPackageCardState extends State<ExpressPackageCard> {
Row( Row(
children: [ children: [
Text( Text(
'3号柜7号箱', widget.model.placePosition,
style: TextStyle( style: TextStyle(
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -51,17 +54,25 @@ class _ExpressPackageCardState extends State<ExpressPackageCard> {
24.w.heightBox, 24.w.heightBox,
...<Widget>[ ...<Widget>[
_rowTile(R.ASSETS_ICONS_APPOINTMENT_ADDRESS_PNG, '包裹单号', _rowTile(R.ASSETS_ICONS_APPOINTMENT_ADDRESS_PNG, '包裹单号',
'131891726735'.text.size(24.sp).color(ktextSubColor).make()), widget.model.code.text.size(24.sp).color(ktextSubColor).make()),
_rowTile(R.ASSETS_ICONS_APPOINTMENT_ADDRESS_PNG, '收件人', _rowTile(
'小蒋'.text.size(24.sp).color(ktextSubColor).make()), R.ASSETS_ICONS_APPOINTMENT_ADDRESS_PNG,
_rowTile(R.ASSETS_ICONS_APPOINTMENT_ADDRESS_PNG, '联系方式', '收件人',
'131891726735'.text.size(24.sp).color(ktextSubColor).make()), widget.model.addresseeName.text
_rowTile(R.ASSETS_ICONS_APPOINTMENT_ADDRESS_PNG, '配送公司', .size(24.sp)
'顺丰速递'.text.size(24.sp).color(ktextSubColor).make()), .color(ktextSubColor)
.make()),
_rowTile(
R.ASSETS_ICONS_APPOINTMENT_ADDRESS_PNG,
'联系方式',
widget.model.addresseeTel.text
.size(24.sp)
.color(ktextSubColor)
.make()),
_rowTile( _rowTile(
R.ASSETS_ICONS_APPOINTMENT_DATE_PNG, R.ASSETS_ICONS_APPOINTMENT_DATE_PNG,
'送达时间', '送达时间',
'2020-04-13 11:21' widget.model.createDateString
.text .text
.size(24.sp) .size(24.sp)
.color(ktextSubColor) .color(ktextSubColor)
@ -86,7 +97,9 @@ class _ExpressPackageCardState extends State<ExpressPackageCard> {
hoverElevation: 0, hoverElevation: 0,
disabledElevation: 0, disabledElevation: 0,
highlightElevation: 0, highlightElevation: 0,
onPressed: () {}, onPressed: () {
},
child: '确认领取' child: '确认领取'
.text .text
.size(24.sp) .size(24.sp)

@ -1,8 +1,11 @@
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/express_package/express_package_list_model.dart';
import 'package:aku_community/pages/express_packages/express_package_card.dart';
import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/pages/express_packages/express_package_card.dart';
class ExpressPackageView extends StatefulWidget { class ExpressPackageView extends StatefulWidget {
final int index; final int index;
@ -13,11 +16,44 @@ class ExpressPackageView extends StatefulWidget {
} }
class _ExpressPackageViewState extends State<ExpressPackageView> { class _ExpressPackageViewState extends State<ExpressPackageView> {
late EasyRefreshController _refreshController;
@override
void initState() {
super.initState();
_refreshController = EasyRefreshController();
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView( // return ListView(
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w), // padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w),
children: [ExpressPackageCard(index: widget.index)], // children: [ExpressPackageCard(index: widget.index)],
); // );
return BeeListView(
path: API.manager.expressPackageList,
controller: _refreshController,
convert: (models) {
return models.tableList
?.map((e) => ExpressPackageListModel.fromJson(e))
.toList() ??
[];
},
builder: (items) {
return ListView.separated(
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w),
itemBuilder: (context, index) {
return ExpressPackageCard(index: widget.index,model: items[index],);
},
separatorBuilder: (_, __) {
return 16.w.heightBox;
},
itemCount: items.length);
});
} }
} }

Loading…
Cancel
Save