std_exam_notice.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. app.controller('StdExamNoticeCtrl', function($rootScope, $scope, $http, $timeout, $state, $window, myConfig, Upload, toaster, $q) {
  2. $scope.load = function(){
  3. $scope.examNoticeConfirm = {};
  4. $scope.myPromise = $http({
  5. url : $rootScope.host_url + '/acquire/getExamNoticeConfirm?session=' + $rootScope.session,
  6. method : 'GET'
  7. }).success(function(data) {
  8. if(data.code == 0){
  9. $scope.examNoticeConfirm = data.result;
  10. if($scope.examNoticeConfirm.confirm_time){
  11. $scope.checkStatus = true;
  12. $rootScope.stdExamNoticeConfirmed = true;
  13. }else{
  14. $scope.checkStatus = false;
  15. }
  16. }
  17. }).error(function() {
  18. });
  19. }
  20. $scope.load();
  21. $scope.submitConfirm = function(){
  22. if($scope.checkStatus){
  23. $scope.myPromise = $http({
  24. url : $rootScope.host_url + '/acquire/postExamNoticeConfirm?session=' + $rootScope.session,
  25. method : 'POST'
  26. }).success(function(data) {
  27. if(data.code != 0){
  28. toaster.pop('error', data.message);
  29. }
  30. $scope.load();
  31. }).error(function() {
  32. });
  33. }else{
  34. $rootScope.dialogMsg("请仔细阅读后勾选已阅读。", function(){});
  35. }
  36. }
  37. });