doctorBookingSure.min.js 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. (function (c) {
  2. config.init();
  3. var a = {
  4. scheduleCode: Fx.getUrlParam("scheduleCode"),
  5. hospitalId: Fx.getUrlParam("hospitalId"),
  6. deptId: Fx.getUrlParam("deptId"),
  7. doctorId: Fx.getUrlParam("doctorId"),
  8. regDate: Fx.getUrlParam("regDate"),
  9. timeFlag: Fx.getUrlParam("timeFlag"),
  10. regFee: Fx.getUrlParam("regFee"),
  11. startTime: Fx.getUrlParam("startTime"),
  12. endTime: Fx.getUrlParam("endTime"),
  13. treatFee: Fx.getUrlParam("treatFee")
  14. };
  15. var b = {
  16. doing: function () {
  17. hzAPI.getData(window.apiUrl + "?c=Index&a=customerFamilyList", {},
  18. "#family", 1, true, 6)
  19. }
  20. };
  21. hzAPI.getData(window.apiUrl + "?c=Index&a=doctorInfo", a, "#list #form", 0, true, null, true);
  22. b.doing();
  23. c("#sure").on("tap",
  24. function () {
  25. c.extend(a, {
  26. //todo 更改控件
  27. customerFamilyId: c("input[type=radio][name=customerFamilyId]:checked").val()
  28. });
  29. var d = {
  30. doing: function (e) {
  31. setTimeout(function () {
  32. if (e[0].userFlag == "0") {
  33. //首诊患者请到医院缴费并办理就诊卡
  34. hzAPI.dialog(false, 6000, "<span style='font-size: 22px;' >请绑定诊疗卡</span><br>如无诊疗卡请通过电话预约<br><sapn style='color: #326bd4;font-size: 14px;'>020-61641888</sapn><br>预约时间08:00-23:00");
  35. setTimeout(function () {
  36. window.location = "doctorCalendar.html?id=" + a.customerFamilyId
  37. },
  38. 3000)
  39. } else {
  40. window.location = "cardPay.html?hospitalId=" + a.hospitalId + "&hospitalName=" + encodeURI(encodeURI(c("#hospitalName").text().trim())) + "&customerFamilyId=" + a.customerFamilyId
  41. }
  42. },
  43. 2000)
  44. }
  45. };
  46. hzAPI.sendData(window.apiUrl + "?c=Other&a=appointsOrder", a, false, [null, "挂号成功"], null, null, d)
  47. });
  48. c("i.add").on("tap",
  49. function () {
  50. window.location = "familyDataAdd.html"
  51. });
  52. c(".hd .fr i").on("tap",
  53. function () {
  54. if (validate.check("#testForm")) {
  55. var d = {
  56. trueName: c("#trueName").val(),
  57. phone: c("#phone").val(),
  58. tel: c("#tel").val(),
  59. email: c("#email").val(),
  60. idNo: c("#idNo").val(),
  61. birthDay: c("#idNo").val().substr(6, 8).replace(/(.{4})(.{2})/, "$1-$2-"),
  62. address: c("#address").val(),
  63. sex: c("#sex").val(),
  64. nation: c("#nation").val(),
  65. province: null,
  66. city: null,
  67. area: null,
  68. ownership: c("#ownership").val()
  69. };
  70. hzAPI.sendData(window.apiUrl + "?c=Index&a=customerFamilyAdd", d, false, ["添加失败", "添加成功"], null, null, b)
  71. }
  72. })
  73. })(Zepto);