zx_appointment_list.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. app.controller('ZxStdReexamListCtrl', [ '$rootScope', '$scope', '$stateParams', '$timeout', function($rootScope, $scope, $stateParams, $timeout) {
  2. $scope.curStep = 'appointment_info';
  3. $scope.ReexamEnrolArr = [];
  4. $scope.getEnrolArray = function() {
  5. $rootScope.ajaxRequest({
  6. url : '../enrol/std/reexam/list.htm'
  7. }, function(response) {
  8. for (var i = 0; i < response.array.length; i++) {
  9. if(response.array[i].std_batch >1) {
  10. $scope.ReexamEnrolArr.push(response.array[i]);
  11. }
  12. }
  13. // if (response.array.length == 1) {
  14. // $scope.goInfo(response.array[0]);
  15. // return;
  16. // }
  17. //$scope.EnrolArray = response.array;
  18. });
  19. }
  20. $scope.goInfo = function(enrol) {
  21. if($rootScope.isAfterTime(enrol.batch_end_time)) {
  22. $rootScope.goLocation('zxappointment/info/' + enrol.enrol_id+'/'+enrol.aspect_id);
  23. }
  24. }
  25. $scope.goBatchPay = function(enrol) {
  26. // 需要去判断是否已经超过时间
  27. if (enrol.batch_pay_status == 'Active') {
  28. $.alert('该专业已经进行了确认!');
  29. return;
  30. }
  31. $.showLoading('正在创建微信支付订单,请稍候......');
  32. $rootScope.ajaxRequest({
  33. url : '../enrol/std/enrol/pay/wx.htm',
  34. data : {
  35. enrol_id : enrol.enrol_id,
  36. aspect_batch : 2
  37. }
  38. }, function(data) {
  39. data.entity.success = function(res) {
  40. $timeout(function() {
  41. $scope.curStep = 'paySuccess';
  42. }, 100);
  43. };
  44. wx.chooseWXPay(data.entity);
  45. });
  46. };
  47. $scope.goReeExam = function() {
  48. $scope.curStep = 'appointment_info';
  49. $scope.ReexamEnrolArr = [];
  50. $scope.getEnrolArray();
  51. }
  52. $scope.getEnrolArray();
  53. } ])