std_binding.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. // || $scope.StdReg.std_mobile.length != 11
  23. if (!$scope.StdReg.std_mobile) {
  24. $.alert('请输入正确的手机号码!');
  25. return false;
  26. }
  27. }
  28. if ($rootScope.getParamValue('EnrolStdBindingExamId', 'InActive') == 'Active') {
  29. if ($scope.StdReg.exam_id == undefined ) {
  30. $.alert('请输入正确的考生号!');
  31. return false;
  32. }
  33. }
  34. $rootScope.ajaxRequest({
  35. url : '../enrol/wx/reg/binding.htm',
  36. data : $scope.StdReg
  37. }, function(response) {
  38. $scope.curStep = 'success';
  39. });
  40. }
  41. } ])