(function (e) { config.init(); e("i.icon-arrow-left").on("tap", function () { window.location = "card.html" }); e("#back").on("tap", function () { e("#popup_layer").removeClass("show") }); e("#cancelFlag").on("tap", function () { if (!e(this).hasClass("disable")) { e("#popup_layer").removeClass("show"); var g = { doing: function () { setTimeout(function () { window.location = "doctorCalendar.html" }, 2000) } }; if (a.payFlag == "0") { hzAPI.sendData(window.apiUrl + "?c=ReqHis&a=returnPay", e.extend(a, { payMode: 1, patientId: JSON.parse(e("ul.card a").attr("data")).patientId }), false, ["退费失败", "退费成功"], null, null, g) } else { hzAPI.sendData(window.apiUrl + "?c=ReqHis&a=cancelOrder", a, false, ["取消挂号失败", "取消挂号成功"], null, null, g) } } }); e("#payFlag").on("tap", function () { if (!e(this).hasClass("disable")) { e("#popup_layer").removeClass("show"); var g = { doing: function () { setTimeout(function () { //进行发短信 var s = { smsType: "appointPay", orderId: d.orderId }; hzAPI.sendData(window.apiUrl + "?c=Other&a=sendSmsInfo", s, false, null, null, null, null); c.doing(); }, 2000) } }; hzAPI.sendData(window.apiUrl + "?c=ReqHis&a=payOrder", e.extend(a, { payMode: 1, payCardNum: JSON.parse(e("ul.card a").attr("data")).cardId, patientId: JSON.parse(e("ul.card a").attr("data")).patientId }), false, ["支付失败,请就诊当天到医院人工窗口取号", "支付成功"], null, null, g) } }); var b = { doing: function () { hzAPI.scroll(window.apiUrl + "?c=Index&a=historyListForPay", f, "#list ul.historyList", 1, false); e("ul.historyList li a").on("tap", function () { a = JSON.parse(e(this).attr("data")); if (a.returnFlag == "0") { if (!e("#cancelFlag").hasClass("disable")) { e("#cancelFlag").addClass("disable"); e("#cancelFlag i").addClass("disable"); e("#payFlag").addClass("disable"); e("#payFlag i").addClass("disable") } } else { if (a.payFlag == "0") { if (!e("#payFlag").hasClass("disable")) { e("#payFlag").addClass("disable"); e("#payFlag i").addClass("disable") } } else { if (e("#payFlag").hasClass("disable")) { e("#payFlag").removeClass("disable"); e("#payFlag i").removeClass("disable") } if (e("#cancelFlag").hasClass("disable")) { e("#cancelFlag").removeClass("disable"); e("#cancelFlag i").removeClass("disable") } } } if (!e("#popup_layer").hasClass("show")) { e("#popup_layer").addClass("show") } }) } }; var f = { rowed: 0, pageSize: 5 }; var d = { doing: function () { var g = JSON.parse(e("ul.card a").attr("data")); e.extend(f, { payCardNum: g.cardId, hospitalId: g("#hospitalId").val() }); hzAPI.getData(window.apiUrl + "?c=Index&a=historyListForPay", f, "#list ul.historyList", 1, true, null, false, "无未支付项目", b) } }; var c = { doing: function () { hzAPI.getData(window.apiUrl + "?c=ReqHis&a=cardMoney", a, ".lists ul.card", 0, true, null, true, "未办理诊疗卡", d) } }; var a = { customerFamilyId: Fx.getUrlParam("customerFamilyId"), hospitalId: Fx.getUrlParam("hospitalId"), hospitalName: decodeURI(decodeURI(Fx.getUrlParam("hospitalName"))) }; c.doing(); icoNav.ton(".popup_layer li") })(Zepto);