diff --git a/lib/const/api.dart b/lib/const/api.dart index bdb33c0..dbb9cce 100644 --- a/lib/const/api.dart +++ b/lib/const/api.dart @@ -43,6 +43,7 @@ class _User { ///个人资料:根据新手机号发送修改验证码 String get updateTel => '/user/personalData/updateTel'; + ///个人资料:修改管家用户头像 String get updateAvatar => '/user/personalData/updateHeadPortrait'; } @@ -84,6 +85,9 @@ class _Manage { ///借还管理:提交检查结果 String get borrowCheck => '/user/borrow/submitCheck'; + ///借还管理:修改物品明细信息 + String get borrowEdit => '/user/borrow/updateArticleDetail'; + ///物品出户:查询所有的物品出户信息(包含搜索条件) String get goodsOutList => '/user/articleOut/list'; diff --git a/lib/ui/sub_pages/borrow_manager/borrow_item_detail_page.dart b/lib/ui/sub_pages/borrow_manager/borrow_item_detail_page.dart index 53b796b..9b5767a 100644 --- a/lib/ui/sub_pages/borrow_manager/borrow_item_detail_page.dart +++ b/lib/ui/sub_pages/borrow_manager/borrow_item_detail_page.dart @@ -3,6 +3,7 @@ import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/models/manager/borrow/borrow_item_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:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; // Package imports: @@ -51,7 +52,21 @@ class _BorrowItemDetailPageState extends State { userProvider.userInfoModel.role == USER_ROLE.MANAGER ? AkuMaterialButton( minWidth: 120.w, - onPressed: () { + onPressed: () async { + if (_isEditing && _detailModel != null) { + Function cancel = BotToast.showLoading(); + await NetUtil().post( + API.manage.borrowEdit, + params: { + 'id': _detailModel.id, + 'name': _textEditingController.text, + 'fileUrls': _detailModel.imgUrls, + }, + showMessage: true, + ); + await Future.delayed(Duration(milliseconds: 1000)); + cancel(); + } setState(() { _isEditing = !_isEditing; });