|
|
|
@ -1,10 +1,9 @@
|
|
|
|
|
import 'package:aku_community_manager/mock_models/borrow/borrow_data.dart';
|
|
|
|
|
import 'package:aku_community_manager/mock_models/borrow/borrow_model.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/ui/sub_pages/borrow_manager/all_borrow_goods.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
|
|
|
|
|
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
@ -17,15 +16,38 @@ class BorrowManagerPage extends StatefulWidget {
|
|
|
|
|
_BorrowManagerPageState createState() => _BorrowManagerPageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _BorrowManagerPageState extends State<BorrowManagerPage> {
|
|
|
|
|
class _BorrowManagerPageState extends State<BorrowManagerPage>
|
|
|
|
|
with TickerProviderStateMixin {
|
|
|
|
|
USER_ROLE get role =>
|
|
|
|
|
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
|
|
|
|
|
TabController _tabController;
|
|
|
|
|
List<String> get _tabs {
|
|
|
|
|
switch (role) {
|
|
|
|
|
case USER_ROLE.MANAGER:
|
|
|
|
|
return ['全部', '出借中', '待检查', '已归还'];
|
|
|
|
|
default:
|
|
|
|
|
return ['全部', '出借中', '已归还'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
_tabController = TabController(length: _tabs.length, vsync: this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final userProvider = Provider.of<UserProvider>(context);
|
|
|
|
|
return AkuScaffold(
|
|
|
|
|
title: '物品清单',
|
|
|
|
|
appBarBottom: PreferredSize(
|
|
|
|
|
child: AkuTabBar(
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
tabs: _tabs,
|
|
|
|
|
),
|
|
|
|
|
preferredSize: Size.fromHeight(96.w)),
|
|
|
|
|
actions: [
|
|
|
|
|
userProvider.userInfoModel.role != USER_ROLE.MANAGER
|
|
|
|
|
? AkuMaterialButton(
|
|
|
|
|
AkuMaterialButton(
|
|
|
|
|
minWidth: 178.w,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Get.to(AllBorrowGoods());
|
|
|
|
@ -37,8 +59,7 @@ class _BorrowManagerPageState extends State<BorrowManagerPage> {
|
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|