app.controller('StdTicketInfoCtrl', [ '$rootScope', '$scope', '$stateParams', '$timeout', function($rootScope, $scope, $stateParams, $timeout) { if ($stateParams == undefined || $stateParams.ly_ticket_id == undefined) { $.alert('参数错误,无法获取准考证详细信息', function() { $rootScope.goWechat(); }); return; } $scope.getTicket = function() { $rootScope.ajaxRequest({ url : '../enrol/std/ticket/find.htm', data : { ly_ticket_id : $stateParams.ly_ticket_id, aspect_batch : 1 } }, function(response) { $scope.TicketMap = response.map; console.log($scope.TicketMap); }); } $scope.goDownloadTicket = function(download_type) { $rootScope.ajaxRequest({ url : "../enrol/std/ticket/download.htm", data : { ly_ticket_id : $stateParams.ly_ticket_id, download_type : download_type } }, function(data) { var url = $rootScope.FrameParam.EnrolMaterialWebPath + $scope.TicketMap.LyStdTicket.ticket_file_name; if (download_type == 'Download') { $('#ticket_url').attr('href', url); document.getElementById("ticket_url").click(); } else { $.alert($rootScope.FrameParam.EnrolMaterialWebPath + $scope.TicketMap.LyStdTicket.ticket_file_name, '请手动进行复制操作'); // var clipboard = new ClipboardJS('#copyTicket'); // clipboard.on('success', function(e) { // $.alert("复制成功"); // }); // // clipboard.on('error', function(e) { // $.alert($rootScope.FrameParam.EnrolMaterialWebPath // + $scope.TicketMap.LyStdTicket.ticket_file_name, '请手动进行复制操作'); // // }); } }); }; $scope.getTicket(); } ])