resourceApplyCtrl.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. angular.module('push')
  2. .controller('resourceApplyCtrl', function ($scope, $stateParams, AuthorityService, UtilService, $timeout,UserService, ConstantService,CommonService) {
  3. if($scope.app){
  4. $scope.setStatusBar(0);
  5. }
  6. $scope.applymessage = {content: ""};
  7. //初始化当前信息
  8. var authoritydata = angular.fromJson($stateParams.authoritydata);
  9. // console.log(authoritydata);
  10. $scope.apply = function () {
  11. if ($scope.applymessage.content.length < 1) {
  12. if($scope.app){
  13. UtilService.showMess("申请理由不能为空");
  14. }else{
  15. CommonService.showMessage('申请理由不能为空',$scope);
  16. }
  17. return;
  18. }
  19. AuthorityService.applyAuthority(authoritydata, $scope.applymessage.content).then(function (response) {
  20. if (response.code == ConstantService.INTERFACE_STATUS_CODE_3350) {
  21. // $scope.deductUserMemberCount(1);
  22. if($scope.app){
  23. UtilService.showMess("权限申请发送成功,请耐心等待");
  24. }else{
  25. CommonService.showMessage('权限申请发送成功,请耐心等待',$scope);
  26. }
  27. }
  28. $timeout(function () {
  29. $scope.goback();
  30. },1000);
  31. }, function () {
  32. });
  33. };
  34. });