app.controller('TabbarCtrl', [ '$rootScope', '$scope', '$timeout', '$location', function($rootScope, $scope, $timeout, $location) { $scope.FuncMap = { 'me' : [ { text : '个人信息', url : 'std/cert' }, /*{ text : '通讯地址', url : 'std/info' }, */{ text : '报考材料', url : 'std/material', param : 'WeixinMenuMaterial' } ], 'help' : [ { text : '解除绑定', url : 'std/unbinding' } ], 'enrol' : [ { text : '专业报考', url : 'enrol/guide', param : 'WeixinMenuEnrolGuide' }, { text : '已报专业', url : 'enrol/list' }, { text : '面试预约', url : 'appointment/list', param : 'WeixinMenuAppointment' }, { text : '准考证下载', url : 'ticket/list', param : 'WeixinMenuTicket' }, { text : '复试确认', url : 'reexam/list', param : 'WeixinMenuReExam' } ], 'score' : [ { text : '分数查询', url : 'score/list' }, { text : '核查申请', url : 'score/admit' }, { text : '合格证下载', url : 'quality/download' } ] } $scope.showMenu = function(name) { var array = []; angular.forEach($scope.FuncMap[name], function(m) { if (m.param == undefined || m.param == '' || $rootScope.getParamValue(m.param, 'InActive') == 'Active') { array.push({ text : m.text, onClick : function() { $timeout(function() { $location.path('app/' + m.url); }, 100); } }); } }); $.actions({ actions : array }); } } ]);