123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- app.controller('StdRegCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$state', '$stateParams', function($rootScope, $scope, $http, $timeout, $state, $stateParams) {
- $scope.curStep = 'start';
- $scope.StdReg = {};
- if(!$rootScope.loginSuccess)
- return;
- if ($rootScope.ArtStdReg !== undefined) {
- $scope.StdReg = angular.extend({}, $rootScope.ArtStdReg);
- if ($scope.StdReg.reg_status == 'IdCard') {
- $scope.curStep = 'NoCrownPhotoWarning';
- } else if ($scope.StdReg.reg_status == 'NoCrownPhoto') {
- $scope.curStep = 'StdExtendInfo';
- }
- }
- $rootScope.ajaxRequest({
- url : '../enrol/reg/province/list.htm'
- }, function(response) {
- $scope.provinceArray = response.array;
- });
-
- //alert($rootScope.checkParamValue('EnrolVerifyStdIdentity', 'InActive', 'Active'));
- // alert($rootScope.getParamValue('EnrolVerifyStdIdentity', 'InActive'));
- // console.log($rootScope.FrameParam);
- /***************************************************************************
- * 选择生源地
- */
- $scope.chooseProvince = function(p) {
- if(p.reg_status == 'InActive') {
- var msg = '未开放【'+p.province_name+'】考生注册!';
- if(p.reg_fetch_param != undefined)
- msg = p.reg_fetch_param;
- $.alert(msg);
- return;
- }
- $scope.currentProvince = p;
- $scope.StdReg.std_province = p.province_id;
- $scope.StdReg.province_name = p.province_name;
- if (p.province_id < '70') {
- if (p.ksh_status == 'Active') {
- // 必须有高考报名号
- $scope.curStep = 'ExamIdWarning';
- } else {
- // 大陆,需要上传身份证
- $scope.curStep = 'IdCardWarning';
- $scope.StdReg.cert_type = 'IdCard';
- }
- } else if ((p.province_id + '') == '90') {
- // 外国,护照
- $scope.curStep = 'PassportWarning';
- $scope.StdReg.cert_type = 'Passport';
- } else if ((p.province_id + '') == '71') {
- // 台湾,台湾居民往来大陆通行证,澳门,香港 港澳居民来往内地通行证
- $scope.curStep = 'IdCard71Warning';
- $scope.StdReg.cert_type = 'TaiWanPass';
- } else {
- // 澳门,香港 港澳居民来往内地通行证
- $scope.curStep = 'IdCard80Warning';
- $scope.StdReg.cert_type = 'HongKongMacaoPass';
- }
- }
- $scope.checkExamId = function() {
- $scope.StdReg.exam_id = $.trim($scope.StdReg.exam_id);
- if ($scope.StdReg.exam_id == undefined || $scope.StdReg.exam_id.length == 0) {
- $.alert('高考报名号必须填写!');
- return false;
- }
- $.showLoading("正在提交考生信息,请稍后...")
- $rootScope.ajaxRequest({
- url : '../enrol/reg/province/check.htm',
- data : $scope.StdReg
- }, function(response) {
- $.hideLoading();
- // 大陆,需要上传身份证
- $scope.curStep = 'IdCardWarning';
- $scope.StdReg.cert_type = 'IdCard';
- });
- }
- /***************************************************************************
- * 识别正确,保存用户信息
- */
- $scope.saveIdCard = function() {
- $scope.StdReg.cert_id = $.trim($scope.StdReg.cert_id);
- $scope.StdReg.std_name = $.trim($scope.StdReg.std_name);
- $scope.StdReg.std_sex = $.trim($scope.StdReg.std_sex);
- $scope.StdReg.std_mobile = $.trim($scope.StdReg.std_mobile);
- if ($scope.StdReg.cert_id == undefined || $scope.StdReg.cert_id.length == 0) {
- $.alert('请输入证件号码信息!');
- return false;
- }
- if ($scope.StdReg.std_name == undefined || $scope.StdReg.std_name.length == 0) {
- $.alert('请输入考生姓名信息!');
- return false;
- }
- if ($scope.StdReg.std_sex == undefined || $scope.StdReg.std_sex.length == 0) {
- $.alert('请选择考生性别!');
- return false;
- }
- if ($scope.StdReg.std_mobile == undefined || $scope.StdReg.std_mobile.length != 11) {
- $.alert('请输入正确的手机号码!');
- return false;
- }
- // 央美香港考生
- if($rootScope.getParamValue('SchoolCode') == '10047' && $scope.StdReg.std_province == '81') {
- if ($scope.StdReg.std_type == undefined || $scope.StdReg.std_type == '') {
- $.alert('请选择参加文化考试的方式!');
- return false;
- }
- }
- $.showLoading("正在提交考生信息,请稍后...")
- $rootScope.ajaxRequest({
- url : '../enrol/reg/save.htm',
- data : $scope.StdReg
- }, function(response) {
- $.hideLoading();
- $scope.StdReg = response.entity;
- $rootScope.ArtStdReg = $scope.StdReg;
- // 上传免冠证件照
- $scope.curStep = 'NoCrownPhotoWarning';
- });
- }
- /***************************************************************************
- * 完善个人信息
- */
- $scope.saveExtendInfo = function() {
- $.showLoading("正在提交考生信息,请稍后...")
- $rootScope.ajaxRequest({
- url : '../enrol/std/info/save.htm',
- data : $scope.StdReg
- }, function(response) {
- $.hideLoading();
- // 显示注册成功
- $scope.curStep = 'RegSuccess';
- });
- }
- /***************************************************************************
- * 上传免冠证件照
- */
- $scope.uploadNoCrownPhoto = function() {
- $rootScope.uploadStdMaterial('NoCrownPhoto', function() {
- // $scope.curStep = 'StdExtendInfo';
- if ($rootScope.checkParamValue('EnrolVerifyStdIdentity', 'InActive', 'Active')) {
- $scope.curStep = 'VerifySuccess';
- } else {
- $scope.curStep = 'StdExtendInfo';
- }
- });
- }
- $scope.goStep = function(step) {
- $scope.curStep = step;
- }
- $scope.openIdCard = function() {
- wx.chooseImage({
- count : 1, // 默认9
- sizeType : [ 'compressed' ], // 可以指定是原图还是压缩图,默认二者都有'original',
- sourceType : [ 'album', 'camera' ], // 可以指定来源是相册还是相机,默认二者都有
- success : function(res) {
- var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
- wx.uploadImage({
- localId : localIds[0], // 需要上传的图片的本地ID,由chooseImage接口获得
- isShowProgressTips : 1, // 默认为1,显示进度提示
- success : function(serverRes) {
- var serverId = serverRes.serverId; // 返回图片的服务器端ID
- $.showLoading("证件照片上传中,请稍后...")
- // 上传成功,去服务器取图片
- $rootScope.ajaxRequest({
- url : '../enrol/wx/reg/idcard/' + ($scope.StdReg.std_province < '70' ? '' : 'other/') + 'upload.htm',
- data : {
- media_id : serverId
- }
- }, function(response) {
- $.hideLoading();
- if ($scope.StdReg.std_province < '70') {
- $scope.StdReg.cert_id = response.map.IdCardInfo.person_code;
- $scope.StdReg.std_name = response.map.IdCardInfo.person_name;
- $scope.StdReg.std_sex = response.map.IdCardInfo.person_sex;
- $scope.StdReg.std_nation = response.map.IdCardInfo.person_nation;
- $scope.StdReg.cert_addr = response.map.IdCardInfo.person_addr;
- $scope.curStep = 'IdCardResult';
- } else {
- $scope.curStep = 'IdCardOther';
- }
- $scope.StdReg.idcard_file_name = response.map.IdCardFileName;
- });
- },
- fail : function(error) {
- $.hideLoading();
- $.alert('图片服务器暂时无法访问,请稍侯再试', '错误提示');
- }
- });
- }
- });
- }
- } ])
|