diff --git a/lib/const/api.dart b/lib/const/api.dart index d8eb02b..58f0030 100644 --- a/lib/const/api.dart +++ b/lib/const/api.dart @@ -188,7 +188,9 @@ class _Manage { ///管家app 包裹代收:查询所有的包裹代收信息 String get packageManageList => '/user/packageCollection/list'; - + + ///管家app 包裹代收:提醒领取 + String get packageManageRemind => '/user/packageCollection/remind'; } class _Upload { diff --git a/lib/ui/manage_pages/packages_manage/packages_manage_card.dart b/lib/ui/manage_pages/packages_manage/packages_manage_card.dart index 58cc7ca..526df9a 100644 --- a/lib/ui/manage_pages/packages_manage/packages_manage_card.dart +++ b/lib/ui/manage_pages/packages_manage/packages_manage_card.dart @@ -1,8 +1,12 @@ import 'dart:math'; +import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/models/manager/package_manage/package_manage_list_model.dart'; import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/tools/aku_divider.dart'; +import 'package:aku_community_manager/utils/network/base_model.dart'; +import 'package:aku_community_manager/utils/network/net_util.dart'; +import 'package:bot_toast/bot_toast.dart'; import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -13,7 +17,9 @@ import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart' class PackageManageCard extends StatefulWidget { final int index; final PackageManageListModel model; - PackageManageCard({Key key, this.index, this.model}) : super(key: key); + final VoidCallback callRefresh; + PackageManageCard({Key key, this.index, this.model, this.callRefresh}) + : super(key: key); @override _PackageManageCardState createState() => _PackageManageCardState(); @@ -60,17 +66,28 @@ class _PackageManageCardState extends State { _rowTile( R.ASSETS_MANAGE_IC_RENWU_PNG, '收件人', - widget.model.addresseeName.text.size(24.sp).color(kTextSubColor).make(), + widget.model.addresseeName.text + .size(24.sp) + .color(kTextSubColor) + .make(), ), _rowTile( R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系方式', - widget.model.addresseeTel.text.size(24.sp).color(kTextSubColor).make(), + widget.model.addresseeTel.text + .size(24.sp) + .color(kTextSubColor) + .make(), ), _rowTile( R.ASSETS_MANAGE_IC_TIME_PNG, '送达时间', - DateUtil.formatDate(widget.model.receiveDate,format: 'yyyy-MM-dd HH:mm').text.size(24.sp).color(kTextSubColor).make(), + DateUtil.formatDate(widget.model.receiveDate, + format: 'yyyy-MM-dd HH:mm') + .text + .size(24.sp) + .color(kTextSubColor) + .make(), ), ].sepWidget(separate: 12.w.heightBox), widget.index == 1 ? SizedBox() : _bottomButtons() @@ -91,7 +108,10 @@ class _PackageManageCardState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(74.w)), color: Colors.black, - onPressed: () {}, + onPressed: () async { + await _remindPackage(widget.model.id); + widget.callRefresh(); + }, elevation: 0, focusElevation: 0, hoverElevation: 0, @@ -103,6 +123,14 @@ class _PackageManageCardState extends State { ); } + Future _remindPackage(int packageCollectionId) async { + BaseModel baseModel = await NetUtil().get(API.manage.packageManageRemind, + params: {"packageCollectionId": packageCollectionId}); + if (!baseModel.status) { + BotToast.showText(text: baseModel.message); + } + } + Widget _rowTile(String iconPath, String title, Widget content) { return Row( children: [ diff --git a/lib/ui/manage_pages/packages_manage/packages_manage_view.dart b/lib/ui/manage_pages/packages_manage/packages_manage_view.dart index c7da41e..2524e43 100644 --- a/lib/ui/manage_pages/packages_manage/packages_manage_view.dart +++ b/lib/ui/manage_pages/packages_manage/packages_manage_view.dart @@ -47,6 +47,9 @@ class _PackagesManageViewState extends State { return PackageManageCard( index: widget.index, model: items[index], + callRefresh: () { + _refreshController.callRefresh(); + }, ); }, separatorBuilder: (_, __) {