(function (c) { config.init(); var a = { scheduleCode: Fx.getUrlParam("scheduleCode"), hospitalId: Fx.getUrlParam("hospitalId"), deptId: Fx.getUrlParam("deptId"), doctorId: Fx.getUrlParam("doctorId"), regDate: Fx.getUrlParam("regDate"), timeFlag: Fx.getUrlParam("timeFlag"), regFee: Fx.getUrlParam("regFee"), startTime: Fx.getUrlParam("startTime"), endTime: Fx.getUrlParam("endTime"), treatFee: Fx.getUrlParam("treatFee") }; var b = { doing: function () { hzAPI.getData(window.apiUrl + "?c=Index&a=customerFamilyList", {}, "#family", 1, true, 6) } }; hzAPI.getData(window.apiUrl + "?c=Index&a=doctorInfo", a, "#list #form", 0, true, null, true); b.doing(); c("#sure").on("tap", function () { c.extend(a, { //todo 更改控件 customerFamilyId: c("input[type=radio][name=customerFamilyId]:checked").val() }); var d = { doing: function (e) { setTimeout(function () { if (e[0].userFlag == "0") { hzAPI.dialog(false, 3000, "首诊患者请到医院缴费并办理就诊卡"); setTimeout(function () { window.location = "doctorCalendar.html?id=" + a.customerFamilyId }, 3000) } else { window.location = "cardPay.html?hospitalId=" + a.hospitalId + "&hospitalName=" + encodeURI(encodeURI(c("#hospitalName").text().trim())) + "&customerFamilyId=" + a.customerFamilyId } }, 2000) } }; hzAPI.sendData(window.apiUrl + "?c=Other&a=appointsOrder", a, false, [null, "挂号成功"], null, null, d) }); c("i.add").on("tap", function () { window.location = "familyDataAdd.html" }); c(".hd .fr i").on("tap", function () { if (validate.check("#testForm")) { var d = { trueName: c("#trueName").val(), phone: c("#phone").val(), tel: c("#tel").val(), email: c("#email").val(), idNo: c("#idNo").val(), birthDay: c("#idNo").val().substr(6, 8).replace(/(.{4})(.{2})/, "$1-$2-"), address: c("#address").val(), sex: c("#sex").val(), nation: c("#nation").val(), province: null, city: null, area: null, ownership: c("#ownership").val() }; hzAPI.sendData(window.apiUrl + "?c=Index&a=customerFamilyAdd", d, false, ["添加失败", "添加成功"], null, null, b) } }) })(Zepto);