123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- app.controller('MainCtrl', [ '$rootScope', '$scope','$timeout', function($rootScope, $scope,$timeout) {
- if(!$rootScope.loginSuccess)
- return;
- $scope.showAppointment = false;
- $scope.showTicket = false;
- $scope.showAdmit = false;
- $scope.getEnrolArray = function() {
- var today = $rootScope.shortDateString(new Date());
- var now = new Date();
-
- $rootScope.ajaxRequest({
- url : '../enrol/std/enrol/list.htm'
- }, function(response) {
- $scope.EnrolArray = response.array;
- for (var i = 0; i < response.array.length; i++) {
- var enrol = response.array[i];
- if(enrol.pay_status=='Active') {
- $scope.showAdmit = true;
- }
- if (enrol.pay_status == 'Active' && enrol.subscribe_status == 'Active' && today == $rootScope.shortDateString(enrol.subscribe_start_time)
- && $rootScope.parseLongString(enrol.subscribe_start_time) < now && $rootScope.parseLongString(enrol.subscribe_end_time) > now) {
- // 判断考点是否开放了预约,只处理当天
- $scope.showAppointment = true;
- }
-
- if (enrol.pay_status == 'Active' && today == $rootScope.shortDateString(enrol.ticket_start_time)
- && $rootScope.parseLongString(enrol.ticket_start_time) < now && $rootScope.parseLongString(enrol.ticket_end_time) > now) {
- // 判断考点是否开放了预约,只处理当天
- $scope.showTicket = true;
- }
- }
- });
- }
- //考生二维码-app扫码登录
- $scope.getStdQrCode = function() {
- //alert("11 --" + $scope.EnrolArray.length);
- if ($scope.EnrolArray && $scope.EnrolArray.length > 0) {
- $('.qrcode').css('display','none');
- $('#stdQrCode').attr('src', "../enrol/std/app/qrcode.htm.htm?std_id=" + $scope.EnrolArray[0].std_id);
- $('#stdQrCode').css('display','');
- $('#containerDiv').css('display','');
- }
- //alert("over --");
-
- }
-
- $scope.goEnrol = function(e) {
- $rootScope.goLocation('enrol/info/' + e.enrol_id + '/InActive');
- }
- $scope.goDoc = function(enrol_id) {
- $rootScope.goLocation('enrol/doc/' + enrol_id );
- }
-
- //报考是否过期
- $scope.enrolTime = function() {
- $rootScope.ajaxRequest({
- url : '../enrol/agent/expire.htm',
- data: {}
- }, function(data) {
- $scope.enrolTimeFlag = data.entity;
- });
- }
-
- $scope.enrolTime();
- $scope.getEnrolArray();
-
- $timeout(function(){
- $scope.getStdQrCode();
- }, 1500);
- $scope.goVoide = function(e){
- $rootScope.goLocation('exam/voide/' + e.enrol_id+'/false');
-
- // $rootScope.ajaxRequest({
- // url : '../enrol/std/enrol/find.htm',
- // data : {
- // enrol_id : e.enrol_id,
- // aspect_batch : 1
- // }
- // }, function(response) {
- // var voide = response.map.Voide;
- // if(voide.note_date==null){
- // $rootScope.goLocation('exam/voide/' + e.enrol_id+'/false');
- // return;
- // }
- //
- // var d = new Date(voide.note_date.replace(/\-/g, "/"));
- // if (d<new Date()){
- // $rootScope.goLocation('exam/voide/' + e.enrol_id+'/false');
- // }else{
- // $.alert('入场时间未到,请在'+voide.note_date+'后入场!');
- // }
- // });
- }
-
-
- $scope.recordVoide = function(e){
- $rootScope.ajaxRequest({
- url : '../enrol/std/video/exam/record.htm',
- data : {
- cert_id :$rootScope.ArtStdReg.cert_id,
- ly_group_id : 11,
- enrol_id:e.enrol_id
- }
- }, function(data) {
- if(data.success == true){
- window.location.href = data.entity;
- return;
- }
- });
- }
-
- $scope.recordQrcode = function(e){
- $scope.videoRecordLog();
- $rootScope.ajaxRequest({
- url : '../enrol/conf/topic/find.htm',
- data: {
- aspect_id : e.aspect_id
- }
- }, function(data) {
- if(data && data.entity.voide_start_date && data.entity.voide_end_date) {
- var start_date = new Date(data.entity.voide_start_date.replace(/\-/g, "/"));
- var end_date = new Date(data.entity.voide_end_date.replace(/\-/g, "/"));
- var now_date = new Date();
- if (now_date >= start_date && now_date <= end_date){
- $('.qrcode').css('display','none')
- $('#'+e.enrol_id).attr('src', "../enrol/std/video/qrcode.htm?cert_id="+$rootScope.ArtStdReg.cert_id+"&ly_group_id=11&enrol_id="+e.enrol_id);
- $('#'+e.enrol_id).css('display','')
- } else {
- $.alert('录制时间未到,请在'+data.entity.voide_start_date+'后录制!');
- }
- } else {
- $.alert('录制时间未到!');
- }
- });
-
- }
- //录制视频日志
- $scope.videoRecordLog = function() {
- $rootScope.ajaxRequest({
- url : '../enrol/voide/log.htm',
- data: {}
- }, function(data) {
- });
- }
-
- //首页检录
- $scope.checkin = function(e){
- $rootScope.ajaxRequest({
- url: '../exam/online/checkin/inqueue.htm',
- data:{agent_id:e.agent_id, aspect_id:e.aspect_id, std_id:e.std_id}
- }, function(response) {
- $rootScope.goLocation('exam/wait/'+e.agent_id+"/"+e.aspect_id+"/"+e.enrol_id);
- });
- }
- //考试须知
- $scope.goNotice = function(e) {
- //美术类考试须知
- if(e.without_exam_apply == 'Active' || e.without_exam_apply == 'InActive') {
- $rootScope.goLocation('zxnotice/info/2');
- } else { //其他类考试须知
- $rootScope.goLocation('zxnotice/info/1');
- }
- }
-
- //下载合格单
- $scope.goDownloadCertificate = function(download_type) {
- var url =$rootScope.FrameParam.EnrolMaterialWebPath + $rootScope.ArtStdReg.std_score_file;
- if (download_type == 'Download') {
- $('#ticket_url').attr('href', url);
- document.getElementById("ticket_url").click();
- } else {
- }
- };
-
-
- } ])
|