You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

56 lines
2.1 KiB

  1. (function () {
  2. var page = {
  3. isScroll: false,
  4. init: function ($page) {
  5. //数据绑定
  6. learun.layer.loading(true, '获取数据中');
  7. learun.httpget(config.webapi + "StuInfoFresh/stuInfoFresh", {}, (data) => {
  8. if (data) {
  9. for (var id in data) {
  10. if (id == "StuInfoFreshEntity") {
  11. $page.find("#ID").val(data[id].ID);
  12. $page.find("#StudentLoan").val(data[id].StudentLoan);
  13. if (data[id].StudentLoanStatus == "1") {
  14. learun.layer.loading(false);
  15. learun.layer.confirm('新生助学贷款已审核!', function (_index) {
  16. learun.nav.closeCurrent();
  17. }, '智慧校园提示', ['确定']);
  18. return false;
  19. }
  20. }
  21. }
  22. page.bind($page);
  23. learun.layer.loading(false);
  24. }
  25. });
  26. //保存
  27. $page.find('#saveBtn').on('tap', function () {
  28. var postdata = {
  29. ID: $('#ID').val(),
  30. StudentLoan: $('#StudentLoan').val(),
  31. StudentLoanStatus: "0"
  32. };
  33. if ($('#StudentLoan').val().trim() != null && $('#StudentLoan').val().trim() != "" && $('#StudentLoan').val().trim() != undefined) {
  34. postdata.StudentLoanStatus = "1";
  35. }
  36. learun.httpget(config.webapi + "StuInfoFresh/saveLoan", postdata, (data) => {
  37. if (data) {
  38. learun.layer.toast('保存成功');
  39. setTimeout(function () {
  40. learun.nav.closeCurrent();
  41. }, 2000);
  42. }
  43. });
  44. });
  45. },
  46. bind: function ($page) {
  47. }
  48. };
  49. return page;
  50. })();