(function () { var page = { isScroll: false, init: function ($page) { //数据绑定 learun.layer.loading(true, '获取数据中'); learun.httpget(config.webapi + "StuInfoFresh/stuInfoFresh", {}, (data) => { if (data) { for (var id in data) { if (id == "StuInfoFreshEntity") { $page.find("#ID").val(data[id].ID); $page.find("#StudentLoan").val(data[id].StudentLoan); if (data[id].StudentLoanStatus == "1") { learun.layer.loading(false); learun.layer.confirm('新生助学贷款已审核!', function (_index) { learun.nav.closeCurrent(); }, '智慧校园提示', ['确定']); return false; } } } page.bind($page); learun.layer.loading(false); } }); //保存 $page.find('#saveBtn').on('tap', function () { var postdata = { ID: $('#ID').val(), StudentLoan: $('#StudentLoan').val(), StudentLoanStatus: "0" }; if ($('#StudentLoan').val().trim() != null && $('#StudentLoan').val().trim() != "" && $('#StudentLoan').val().trim() != undefined) { postdata.StudentLoanStatus = "1"; } learun.httpget(config.webapi + "StuInfoFresh/saveLoan", postdata, (data) => { if (data) { learun.layer.toast('保存成功'); setTimeout(function () { learun.nav.closeCurrent(); }, 2000); } }); }); }, bind: function ($page) { } }; return page; })();