Merge branch 'master' of http://test.akuhotel.com:8099/zhangmeng/aku_community_manager
# Conflicts: # lib/ui/home/home_page.darthmxc
commit
8b2bd7b226
@ -1,10 +1,56 @@
|
||||
import 'dart:io';
|
||||
|
||||
enum USER_ROLE {
|
||||
///管家角色
|
||||
MANAGER,
|
||||
|
||||
///修理师傅角色
|
||||
FIXER,
|
||||
|
||||
///保安角色
|
||||
SECURITY,
|
||||
|
||||
///无角色
|
||||
EMPTY,
|
||||
}
|
||||
|
||||
class UserInfoModel {
|
||||
String nickName;
|
||||
File avatar;
|
||||
USER_ROLE role;
|
||||
UserInfoModel({
|
||||
this.nickName,
|
||||
this.avatar,
|
||||
this.role,
|
||||
});
|
||||
|
||||
UserInfoModel.empty({
|
||||
this.nickName = '',
|
||||
this.avatar,
|
||||
this.role = USER_ROLE.EMPTY,
|
||||
});
|
||||
|
||||
///管家角色生成
|
||||
///password 000000
|
||||
UserInfoModel.manager({
|
||||
this.nickName = '李管家',
|
||||
this.avatar,
|
||||
this.role = USER_ROLE.MANAGER,
|
||||
});
|
||||
|
||||
///师傅角色生成
|
||||
///password 000001
|
||||
UserInfoModel.fixer({
|
||||
this.nickName = '王师傅',
|
||||
this.avatar,
|
||||
this.role = USER_ROLE.FIXER,
|
||||
});
|
||||
|
||||
///师傅角色生成
|
||||
///password 000002
|
||||
UserInfoModel.security({
|
||||
this.nickName = '林保安',
|
||||
this.avatar,
|
||||
this.role = USER_ROLE.SECURITY,
|
||||
});
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:aku_community_manager/tools/screen_tool.dart';
|
||||
|
||||
class BusinessCard extends StatefulWidget {
|
||||
BusinessCard({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BusinessCardState createState() => _BusinessCardState();
|
||||
}
|
||||
|
||||
class _BusinessCardState extends State<BusinessCard> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
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/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_community_manager/tools/screen_tool.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BusinessAndFixPage extends StatefulWidget {
|
||||
BusinessAndFixPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BusinessAndFixPageState createState() => _BusinessAndFixPageState();
|
||||
}
|
||||
|
||||
class _BusinessAndFixPageState extends State<BusinessAndFixPage>
|
||||
with TickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
|
||||
List<String> get _tabs {
|
||||
final userProvider = Provider.of<UserProvider>(context, listen: false);
|
||||
switch (userProvider.userInfoModel.role) {
|
||||
case USER_ROLE.MANAGER:
|
||||
return [];
|
||||
break;
|
||||
case USER_ROLE.FIXER:
|
||||
return [];
|
||||
break;
|
||||
case USER_ROLE.SECURITY:
|
||||
return [];
|
||||
break;
|
||||
default:
|
||||
return [];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_tabController = TabController(length: _tabs.length, vsync: this);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_tabController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '报事报修',
|
||||
bottom: PreferredSize(
|
||||
preferredSize: Size.fromHeight(88.w),
|
||||
child: AkuTabBar(
|
||||
controller: _tabController,
|
||||
tabs: _tabs,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:aku_community_manager/tools/screen_tool.dart';
|
||||
|
||||
class AkuTabBar extends StatefulWidget {
|
||||
final TabController controller;
|
||||
final List<String> tabs;
|
||||
AkuTabBar({Key key, @required this.controller, @required this.tabs})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_AkuTabBarState createState() => _AkuTabBarState();
|
||||
}
|
||||
|
||||
class _AkuTabBarState extends State<AkuTabBar> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TabBar(
|
||||
labelColor: AppStyle.primaryTextColor,
|
||||
unselectedLabelColor: AppStyle.minorTextColor,
|
||||
labelStyle: TextStyle(
|
||||
fontSize: 28.w,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
unselectedLabelStyle: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
indicatorColor: AppStyle.primaryColor,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
controller: widget.controller,
|
||||
tabs: widget.tabs.map((e) => Tab(text: e)).toList(),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue