更新应用跳转方法

修改装修详情权限
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 { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
// await Firebase.initializeApp();
// await AmapCore.init('');
// await AmapLocation.instance.init(iosKey: '');
JPush jpush = new JPush(); JPush jpush = new JPush();
const isProduct = const bool.fromEnvironment('ISPRODUCT'); const isProduct = const bool.fromEnvironment('ISPRODUCT');
DevUtil.setDev(!isProduct); DevUtil.setDev(!isProduct);

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

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

Loading…
Cancel
Save