123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- app.controller('MainCtrl', [ '$rootScope', '$scope', '$timeout', function($rootScope, $scope, $timeout) {
- if (!$rootScope.loginSuccess)
- return;
- $scope.showAppointment = false;
- $scope.showTicket = false;
- $scope.firstQualified = false;//是否存在初始合格
- $scope.showInfo = false;
- $scope.getEnrolArray2 = function() {
- console.log('12312');
- $rootScope.ajaxRequest({
- url : '../enrol/std/enrol/list.htm'
- }, function(response) {
- $scope.EnrolArray2 = response.array;
- console.log(response.array);
- });
- }
- $scope.getEnrolArray = function() {
- $rootScope.ajaxRequest({
- url : '../enrol/std/score/ym/final/list.htm'
- }, function(response) {
- debugger;
- $rootScope.EnrolArray = response.array;
- var qualified_total = 0;
- for(var i=0; i<response.array.length; i++) {
- /*if (response.array[i].aspect_qualified == "初试合格") {
- $scope.firstQualified = true;
- }*/
- }
- if(response.array.length == 0) {
- $scope.getEnrolArray2();
- }
- });
- }
-
- //TODO 临时
- $scope.getAgent = function() {
- $rootScope.ajaxRequest({
- url : '../enrol/agent/find.htm?agent_id=101'
- }, function(response) {
- $scope.Agent = response.map;
- var now = $rootScope.parseLongString(response.map.now);
- if ($rootScope.parseLongString(response.map.ticket_start_time) < now
- && $rootScope.parseLongString(response.map.ticket_end_time) > now) {
- // 判断考点是否开放了预约,只处理当天
- $scope.showTicket = true;
- }
- });
- }
-
- $scope.goEnrol = function(e) {
- //$rootScope.goLocation('ym/score/' + e.aspect_name + '/' + e.batch);
- $rootScope.goLocation('enrol/info/' + e.enrol_id + '/InActive');
- }
- $scope.getEnrolArray2();
- $scope.getAgent();//TODO 临时
- } ])
|