From b04ef43c1c880b62175a97f7daa3ec702af54676 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Tue, 23 Feb 2021 16:43:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E7=89=A9=E5=93=81=E5=87=BA?= =?UTF-8?q?=E6=88=B7=E4=B8=8D=E6=94=BE=E8=A1=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/const/api.dart | 3 ++ .../items_outdoor_details_page.dart | 5 +-- .../items_outdoor/outdoor_notpass_page.dart | 31 +++++++++++++------ 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/lib/const/api.dart b/lib/const/api.dart index d2e31ae..069bace 100644 --- a/lib/const/api.dart +++ b/lib/const/api.dart @@ -89,4 +89,7 @@ class _Manage { ///物品出户:放行 String get goodsOutRelease => '/user/articleOut/release'; + + ///物品出户:不放行 + String get goodsOutNotRelease => '/user/articleOut/noRelease'; } diff --git a/lib/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart b/lib/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart index 5d2fce3..b76e01e 100644 --- a/lib/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart +++ b/lib/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart @@ -299,10 +299,7 @@ class _ItemsOutdoorDetailsPageState extends State { children: [ AkuButton( onPressed: () { - //TODO not pass - // Get.to(OutdoorNotpassPage( - // model: widget.cardMedel, - // )); + Get.to(OutdoorNotpassPage(id: _model.id)); }, child: Container( width: 304.w, diff --git a/lib/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart b/lib/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart index 2c48bfa..8371cd3 100644 --- a/lib/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart +++ b/lib/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart @@ -1,4 +1,7 @@ // Flutter imports: +import 'package:aku_community_manager/const/api.dart'; +import 'package:aku_community_manager/utils/network/net_util.dart'; +import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; // Package imports: @@ -14,8 +17,8 @@ import 'package:aku_community_manager/ui/widgets/common/aku_radio.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; class OutdoorNotpassPage extends StatefulWidget { - final ItemsOutdoorModel model; - OutdoorNotpassPage({Key key, @required this.model}) : super(key: key); + final int id; + OutdoorNotpassPage({Key key, @required this.id}) : super(key: key); @override _OutdoorNotpassPageState createState() => _OutdoorNotpassPageState(); @@ -185,13 +188,23 @@ class _OutdoorNotpassPageState extends State { ], ), bottom: AkuButton( - onPressed: () { - widget.model.finalOutTime = _currentTime; - widget.model.datetime = DateTime.now(); - _select == 3 - ? widget.model.rejectReason = _textEditingController.text - : widget.model.rejectReason = _rejectReason[_select]; - widget.model.status = OUTDOORSTATUS.REJECTED; + onPressed: () async { + Function cancel = BotToast.showLoading(); + String remark = ''; + if (_select <= 2) { + remark = _rejectReason[_select]; + } else { + remark = _textEditingController.text; + } + await NetUtil().post( + API.manage.goodsOutNotRelease, + params: { + 'id': widget.id, + 'remarks': remark, + }, + showMessage: true, + ); + cancel(); Get.back(); Get.back(); },