app.controller('StdBindingCtrl', [ '$rootScope', '$scope', function($rootScope, $scope) { $scope.curStep = 'info'; $scope.StdReg = {}; if(!$rootScope.loginSuccess) return; $scope.goStep = function(step) { $scope.curStep = step; } $scope.stdBinding = function() { $scope.StdReg.cert_id = $.trim($scope.StdReg.cert_id); $scope.StdReg.std_name = $.trim($scope.StdReg.std_name); $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 ($rootScope.getParamValue('EnrolStdBindingStdMobile', 'Active') == 'Active') { // || $scope.StdReg.std_mobile.length != 11 if (!$scope.StdReg.std_mobile) { $.alert('请输入正确的手机号码!'); return false; } } if ($rootScope.getParamValue('EnrolStdBindingExamId', 'InActive') == 'Active') { if ($scope.StdReg.exam_id == undefined ) { $.alert('请输入正确的考生号!'); return false; } } $rootScope.ajaxRequest({ url : '../enrol/wx/reg/binding.htm', data : $scope.StdReg }, function(response) { $scope.curStep = 'success'; }); } } ])