noticeServiceCtrl.js 1.0 KB

1234567891011121314151617181920212223242526272829
  1. angular.module('push')
  2. .controller('noticeServiceCtrl', function ($scope, AccountService) {
  3. //获取疫情信息
  4. var getEpidemicList = function(){
  5. AccountService.getEpidemicList().then(function(res){
  6. if(res.code == 3350){
  7. $scope.epidemicList = res.data;
  8. $scope.nohanle = 0;
  9. $scope.handling = 0;
  10. $scope.handled = 0;
  11. angular.forEach($scope.epidemicList, function(val){
  12. if(!val.status || val.status == 0){
  13. $scope.handling ++;
  14. }else if(val.status == 2){
  15. $scope.nohanle ++;
  16. }else if(val.status == 1){
  17. $scope.handled ++;
  18. }
  19. });
  20. }
  21. })
  22. }
  23. getEpidemicList();
  24. $scope.goEpidemicDetail = function(epidemic){
  25. $scope.go('noticeServiceDetail', {epidemic: epidemic});
  26. }
  27. });