wy_std_binding.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. app.controller('WyStdBindingCtrl', [ '$rootScope', '$scope', '$timeout', function($rootScope, $scope, $timeout) {
  2. $scope.curStep = 'info';
  3. $scope.StdReg = {};
  4. if(!$rootScope.loginSuccess)
  5. return;
  6. $scope.goStep = function(step) {
  7. $scope.curStep = step;
  8. }
  9. $timeout(function() {
  10. $scope.changeCode('imgCode');
  11. }, 100);
  12. $scope.stdBinding = function() {
  13. $scope.StdReg.exam_id = $.trim($scope.StdReg.exam_id);
  14. $scope.StdReg.login_pass = $.trim($scope.StdReg.login_pass);
  15. if ($scope.StdReg.exam_id == undefined || $scope.StdReg.exam_id.length == 0) {
  16. $.alert('请输入高考报名号!');
  17. return false;
  18. }
  19. if ($scope.StdReg.login_pass == undefined ) {
  20. $.alert('请输入登录密码!');
  21. return false;
  22. }
  23. $rootScope.ajaxRequest({
  24. url : '../enrol/wx/reg/wybinding.htm',
  25. data : $scope.StdReg
  26. }, function(response) {
  27. $scope.curStep = 'success';
  28. });
  29. }
  30. $scope.changeCode = function (elementId) {
  31. $('#' + elementId).attr('src', '../frame/verification/random.htm?verify=' + Math.random() + '&img_width=120&font_size=30&margin_left=15&font_interval=20&img_height=40&margin_top=25');
  32. }
  33. } ])