更新应用跳转方法

修改装修详情权限
hmxc
张萌 4 years ago
parent fdaecab4f2
commit 4327020565

@ -24,9 +24,6 @@ import 'package:aku_community_manager/ui/splash/splash_page.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// await Firebase.initializeApp();
// await AmapCore.init('');
// await AmapLocation.instance.init(iosKey: '');
JPush jpush = new JPush();
const isProduct = const bool.fromEnvironment('ISPRODUCT');
DevUtil.setDev(!isProduct);

@ -31,7 +31,7 @@ import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class AppApplication {
String name;
String assetPath;
Widget page;
dynamic page;
AppApplication(
this.name,
this.assetPath,
@ -54,27 +54,27 @@ class _ApplicationPageState extends State<ApplicationPage>
List<AppApplication> _recommandApplications = [
AppApplication(
'活动管理', R.ASSETS_HOME_IC_ACTIVITY_PNG, ActivityManagerPage()),
AppApplication('访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, VisitorManagerPage()),
AppApplication('借还管理', R.ASSETS_HOME_IC_BORROW_PNG, BorrowManagerPage()),
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, WarningPage()),
'活动管理', R.ASSETS_HOME_IC_ACTIVITY_PNG, ()=>ActivityManagerPage()),
AppApplication('访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, ()=>VisitorManagerPage()),
AppApplication('借还管理', R.ASSETS_HOME_IC_BORROW_PNG, ()=>BorrowManagerPage()),
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, ()=>WarningPage()),
];
List<AppApplication> _wisdomApplications = [
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, WarningPage()),
AppApplication('访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, VisitorManagerPage()),
AppApplication('报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, BusinessAndFixPage()),
AppApplication('物品出户', R.ASSETS_HOME_IC_ARTICLE_PNG, ItemsOutdoorPage()),
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, ()=>WarningPage()),
AppApplication('访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, ()=>VisitorManagerPage()),
AppApplication('报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, ()=>BusinessAndFixPage()),
AppApplication('物品出户', R.ASSETS_HOME_IC_ARTICLE_PNG, ()=>ItemsOutdoorPage()),
AppApplication(
'装修管理', R.ASSETS_HOME_IC_DECORATION_PNG, DecorationManagerPage()),
'装修管理', R.ASSETS_HOME_IC_DECORATION_PNG, ()=> DecorationManagerPage()),
AppApplication(
'活动管理', R.ASSETS_HOME_IC_ACTIVITY_PNG, ActivityManagerPage()),
AppApplication('借还管理', R.ASSETS_HOME_IC_BORROW_PNG, BorrowManagerPage()),
AppApplication('巡检管理', R.ASSETS_HOME_IC_PATROL_PNG, InspectionManagePage()),
AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, GreenManagePage()),
AppApplication('设施检查', R.ASSETS_HOME_IC_FACILITIES_PNG, FacilitiesPage()),
AppApplication('包裹管理', R.ASSETS_HOME_PACKAGE_PNG, PackagesManagePage()),
AppApplication('钥匙管理', R.ASSETS_HOME_KEY_PNG, KeyManagePage()),
AppApplication('规程管理', R.ASSETS_HOME_RULES_PNG, RulesManagePage())
'活动管理', R.ASSETS_HOME_IC_ACTIVITY_PNG, ()=> ActivityManagerPage()),
AppApplication('借还管理', R.ASSETS_HOME_IC_BORROW_PNG, ()=>BorrowManagerPage()),
AppApplication('巡检管理', R.ASSETS_HOME_IC_PATROL_PNG, ()=>InspectionManagePage()),
AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, ()=>GreenManagePage()),
AppApplication('设施检查', R.ASSETS_HOME_IC_FACILITIES_PNG, ()=> FacilitiesPage()),
AppApplication('包裹管理', R.ASSETS_HOME_PACKAGE_PNG, ()=> PackagesManagePage()),
AppApplication('钥匙管理', R.ASSETS_HOME_KEY_PNG, ()=> KeyManagePage()),
AppApplication('规程管理', R.ASSETS_HOME_RULES_PNG, ()=> RulesManagePage())
];
@override

@ -2,6 +2,7 @@
import 'dart:math';
// Flutter imports:
import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -43,9 +44,6 @@ class DecorationManagerDetailPage extends StatefulWidget {
class _DecorationManagerDetailStatePage
extends State<DecorationManagerDetailPage> {
bool get isWaitHandOut => widget.model.type == DecorationType.WAIT_HAND_OUT;
USER_ROLE get role =>
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
@override
Widget build(BuildContext context) {
return AkuScaffold(
@ -65,7 +63,7 @@ class _DecorationManagerDetailStatePage
),
bottom: Builder(builder: (context) {
final CycleCheck cycleCheck = widget.model.cycleCheck;
if (role == USER_ROLE.MANAGER) {
if (UserTool.userProvider.infoModel.canOperation) {
switch (widget.model.type) {
case DecorationType.WAIT_HAND_OUT:
return AkuBottomButton(
@ -86,7 +84,7 @@ class _DecorationManagerDetailStatePage
}
// else if(widget.model.type)
} else if (role == USER_ROLE.PROPERTY) {
} else if (UserTool.userProvider.infoModel.canOperation) {
switch (widget.model.type) {
case DecorationType.HAND_OUT:
return AkuBottomButton(
@ -319,7 +317,7 @@ class _DecorationManagerDetailStatePage
_buildRow(
title: '接受人',
subTitle: widget.model.cycleCheck?.authPerson?.name,
onTap: isWaitHandOut
onTap: UserTool.userProvider.infoModel.canOperation
? () {
Get.to(DecorationDepartmentPage(
model: widget.model,
@ -334,7 +332,7 @@ class _DecorationManagerDetailStatePage
widget.model.cycleCheck?.startDate,
format: 'yyyy-MM-dd',
),
onTap: isWaitHandOut
onTap: UserTool.userProvider.infoModel.canOperation
? () {
showAkuSheet(
child: Column(
@ -390,7 +388,7 @@ class _DecorationManagerDetailStatePage
subTitle: widget.model.cycleCheck.checkCycle == null
? null
: '${widget.model.cycleCheck.checkCycle}',
onTap: isWaitHandOut
onTap: UserTool.userProvider.infoModel.canOperation
? () {
showAkuSheet(
child: Column(
@ -500,7 +498,7 @@ class _DecorationManagerDetailStatePage
onChange: (details) {
widget.model.cycleCheck.checkDetails = details;
},
canTap: isWaitHandOut,
canTap: UserTool.userProvider.infoModel.canOperation,
)
],
);

Loading…
Cancel
Save