From 2dc12ad9964a968e3d7bbd78f0cb79b9a6e5467e Mon Sep 17 00:00:00 2001 From: laiiihz Date: Wed, 24 Feb 2021 10:33:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=9F=E8=BF=98=E7=AE=A1=E7=90=86=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=96=B0=E5=A2=9E=E5=92=8C=E5=88=A0=E9=99=A4=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../borrow_manager/all_borrow_goods.dart | 36 +++-- .../borrow_manager/borrow_items_page.dart | 127 +++++++++--------- 2 files changed, 78 insertions(+), 85 deletions(-) diff --git a/lib/ui/sub_pages/borrow_manager/all_borrow_goods.dart b/lib/ui/sub_pages/borrow_manager/all_borrow_goods.dart index f03d578..33ad832 100644 --- a/lib/ui/sub_pages/borrow_manager/all_borrow_goods.dart +++ b/lib/ui/sub_pages/borrow_manager/all_borrow_goods.dart @@ -5,18 +5,13 @@ import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; import 'package:flutter/material.dart'; // Package imports: -import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; -import 'package:provider/provider.dart'; // Project imports: import 'package:aku_community_manager/const/resource.dart'; -import 'package:aku_community_manager/mock_models/users/user_info_model.dart'; -import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/tools/widget_tool.dart'; -import 'package:aku_community_manager/ui/sub_pages/borrow_manager/add_borrow_object_page.dart'; import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_items_page.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; @@ -31,25 +26,24 @@ class _AllBorrowGoodsState extends State { EasyRefreshController _refreshController = EasyRefreshController(); @override Widget build(BuildContext context) { - final userProvider = Provider.of(context); return AkuScaffold( title: '全部物品', actions: [ - userProvider.userInfoModel.role == USER_ROLE.MANAGER - ? AkuMaterialButton( - minWidth: 120.w, - onPressed: () { - Get.to(AddBorrowObjectPage()); - }, - child: Text( - '新增', - style: TextStyle( - fontSize: 28.w, - color: AppStyle.primaryTextColor, - ), - ), - ) - : SizedBox(), + // userProvider.userInfoModel.role == USER_ROLE.MANAGER + // ? AkuMaterialButton( + // minWidth: 120.w, + // onPressed: () { + // Get.to(AddBorrowObjectPage()); + // }, + // child: Text( + // '新增', + // style: TextStyle( + // fontSize: 28.w, + // color: AppStyle.primaryTextColor, + // ), + // ), + // ) + // : SizedBox(), ], body: BeeListView( path: API.manage.borrowList, diff --git a/lib/ui/sub_pages/borrow_manager/borrow_items_page.dart b/lib/ui/sub_pages/borrow_manager/borrow_items_page.dart index efb31e9..720cdda 100644 --- a/lib/ui/sub_pages/borrow_manager/borrow_items_page.dart +++ b/lib/ui/sub_pages/borrow_manager/borrow_items_page.dart @@ -31,25 +31,24 @@ class _BorrowItemPageState extends State { EasyRefreshController _refreshController = EasyRefreshController(); @override Widget build(BuildContext context) { - final userProvider = Provider.of(context); return AkuScaffold( title: '物品查看', actions: [ - userProvider.userInfoModel.role == USER_ROLE.MANAGER - ? AkuMaterialButton( - minWidth: 120.w, - onPressed: () { - // Get.to(AddBorrowItemPage(object: widget.object)); - }, - child: Text( - '新增', - style: TextStyle( - fontSize: 28.w, - color: AppStyle.primaryTextColor, - ), - ), - ) - : SizedBox(), + // userProvider.userInfoModel.role == USER_ROLE.MANAGER + // ? AkuMaterialButton( + // minWidth: 120.w, + // onPressed: () { + // // Get.to(AddBorrowItemPage(object: widget.object)); + // }, + // child: Text( + // '新增', + // style: TextStyle( + // fontSize: 28.w, + // color: AppStyle.primaryTextColor, + // ), + // ), + // ) + // : SizedBox(), ], body: BeeListView( path: API.manage.borrowDetailList, @@ -94,54 +93,54 @@ class _BorrowItemPageState extends State { ), ), Spacer(), - userProvider.userInfoModel.role == USER_ROLE.MANAGER - ? AkuMaterialButton( - padding: EdgeInsets.symmetric(horizontal: 24.w), - onPressed: () { - showCupertinoDialog( - context: context, - builder: (context) { - return CupertinoAlertDialog( - title: Text('删除物品'), - content: Text('确定要删除${item.name}该物品吗?'), - actions: [ - CupertinoDialogAction( - child: Text('取消'), - onPressed: () { - Get.back(); - }, - ), - CupertinoDialogAction( - child: Text('删除'), - onPressed: () { - //TODO delete - setState(() {}); - Get.back(); - }, - ), - ], - ); - }, - ); - }, - child: Row( - children: [ - Icon( - Icons.delete, - color: AppStyle.minorTextColor, - size: 40.w, - ), - Text( - '删除', - style: TextStyle( - color: AppStyle.minorTextColor, - fontSize: 28.sp, - ), - ), - ], - ), - ) - : SizedBox(), + // userProvider.userInfoModel.role == USER_ROLE.MANAGER + // ? AkuMaterialButton( + // padding: EdgeInsets.symmetric(horizontal: 24.w), + // onPressed: () { + // showCupertinoDialog( + // context: context, + // builder: (context) { + // return CupertinoAlertDialog( + // title: Text('删除物品'), + // content: Text('确定要删除${item.name}该物品吗?'), + // actions: [ + // CupertinoDialogAction( + // child: Text('取消'), + // onPressed: () { + // Get.back(); + // }, + // ), + // CupertinoDialogAction( + // child: Text('删除'), + // onPressed: () { + // //TODO delete + // setState(() {}); + // Get.back(); + // }, + // ), + // ], + // ); + // }, + // ); + // }, + // child: Row( + // children: [ + // Icon( + // Icons.delete, + // color: AppStyle.minorTextColor, + // size: 40.w, + // ), + // Text( + // '删除', + // style: TextStyle( + // color: AppStyle.minorTextColor, + // fontSize: 28.sp, + // ), + // ), + // ], + // ), + // ) + // : SizedBox(), ], ), Divider(