std_binding.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. app.controller('StdBindingCtrl', [ '$rootScope', '$scope', function($rootScope, $scope) {
  2. $scope.curStep = 'info';
  3. $scope.StdReg = {};
  4. if(!$rootScope.loginSuccess)
  5. return;
  6. $scope.goStep = function(step) {
  7. $scope.curStep = step;
  8. }
  9. $scope.stdBinding = function() {
  10. $scope.StdReg.cert_id = $.trim($scope.StdReg.cert_id);
  11. $scope.StdReg.std_name = $.trim($scope.StdReg.std_name);
  12. $scope.StdReg.std_mobile = $.trim($scope.StdReg.std_mobile);
  13. if ($scope.StdReg.cert_id == undefined || $scope.StdReg.cert_id.length == 0) {
  14. $.alert('请输入证件号码信息!');
  15. return false;
  16. }
  17. if ($scope.StdReg.std_name == undefined || $scope.StdReg.std_name.length == 0) {
  18. $.alert('请输入考生姓名信息!');
  19. return false;
  20. }
  21. if ($rootScope.getParamValue('EnrolStdBindingStdMobile', 'Active') == 'Active') {
  22. if ($scope.StdReg.std_mobile == undefined || $scope.StdReg.std_mobile.length != 11) {
  23. $.alert('请输入正确的手机号码!');
  24. return false;
  25. }
  26. }
  27. if ($rootScope.getParamValue('EnrolStdBindingExamId', 'InActive') == 'Active') {
  28. if ($scope.StdReg.exam_id == undefined ) {
  29. $.alert('请输入正确的考生号!');
  30. return false;
  31. }
  32. }
  33. $rootScope.ajaxRequest({
  34. url : '../enrol/wx/reg/binding.htm',
  35. data : $scope.StdReg
  36. }, function(response) {
  37. $scope.curStep = 'success';
  38. });
  39. }
  40. } ])