angular.module('push') .controller('resourceApplyCtrl', function ($scope, $stateParams, AuthorityService, UtilService, $timeout,UserService, ConstantService,CommonService) { if($scope.app){ $scope.setStatusBar(0); } $scope.applymessage = {content: ""}; //初始化当前信息 var authoritydata = angular.fromJson($stateParams.authoritydata); // console.log(authoritydata); $scope.apply = function () { if ($scope.applymessage.content.length < 1) { if($scope.app){ UtilService.showMess("申请理由不能为空"); }else{ CommonService.showMessage('申请理由不能为空',$scope); } return; } AuthorityService.applyAuthority(authoritydata, $scope.applymessage.content).then(function (response) { if (response.code == ConstantService.INTERFACE_STATUS_CODE_3350) { // $scope.deductUserMemberCount(1); if($scope.app){ UtilService.showMess("权限申请发送成功,请耐心等待"); }else{ CommonService.showMessage('权限申请发送成功,请耐心等待',$scope); } } $timeout(function () { $scope.goback(); },1000); }, function () { }); }; });