doctorBookingSure.min.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 s = {
  30. doing: function (e, aaa) {
  31. // setTimeout(function () {
  32. // if (e[0].userFlag == "0") {
  33. // //进行发短信?c=Other&a=setSmsInfo&timestamp=1508896856&token=9c5f1ceee44736fdaac97dad03c99b15&smsType=appointSuc&orderId=1506738896496216
  34. // //hzAPI.sendData(window.apiUrl + "?c=Other&a=setSmsInfo", a, false,null, null, null, d)
  35. // //首诊患者请到医院缴费并办理就诊卡
  36. // 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");
  37. // setTimeout(function () {
  38. // window.location = "doctorCalendar.html?id=" + a.customerFamilyId
  39. // }, 3000)
  40. // } else {
  41. // console.log("bb" + e);
  42. // // window.location = "cardPay.html?hospitalId=" + a.hospitalId + "&hospitalName=" + encodeURI(encodeURI(c("#hospitalName").text().trim())) + "&customerFamilyId=" + a.customerFamilyId
  43. // }
  44. // }, 2000)
  45. console.log("cc" + e[0]);
  46. }
  47. };
  48. var d = {
  49. doing: function (e) {
  50. setTimeout(function () {
  51. if (e[0].userFlag == "0") {
  52. //首诊患者请到医院缴费并办理就诊卡
  53. 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");
  54. setTimeout(function () {
  55. window.location = "doctorCalendar.html?id=" + a.customerFamilyId
  56. }, 3000)
  57. } else {
  58. //进行发短信
  59. var s = {
  60. smsType: "appointSuc",
  61. orderId: e[0].orderId
  62. };
  63. hzAPI.sendData(window.apiUrl + "?c=Other&a=sendSmsInfo", s, false, null, null, null, null)
  64. setTimeout(function () {
  65. window.location = "cardPay.html?hospitalId=" + a.hospitalId + "&hospitalName=" + encodeURI(encodeURI(c("#hospitalName").text().trim())) + "&customerFamilyId=" + a.customerFamilyId
  66. }, 1000)
  67. }
  68. }, 2000)
  69. }
  70. };
  71. hzAPI.sendData(window.apiUrl + "?c=Other&a=appointsOrder", a, false, [null, "挂号成功"], null, s, d)
  72. });
  73. c("i.add").on("tap",
  74. function () {
  75. window.location = "familyDataAdd.html"
  76. });
  77. c(".hd .fr i").on("tap",
  78. function () {
  79. if (validate.check("#testForm")) {
  80. var d = {
  81. trueName: c("#trueName").val(),
  82. phone: c("#phone").val(),
  83. tel: c("#tel").val(),
  84. email: c("#email").val(),
  85. idNo: c("#idNo").val(),
  86. birthDay: c("#idNo").val().substr(6, 8).replace(/(.{4})(.{2})/, "$1-$2-"),
  87. address: c("#address").val(),
  88. sex: c("#sex").val(),
  89. nation: c("#nation").val(),
  90. province: null,
  91. city: null,
  92. area: null,
  93. ownership: c("#ownership").val()
  94. };
  95. hzAPI.sendData(window.apiUrl + "?c=Index&a=customerFamilyAdd", d, false, ["添加失败", "添加成功"], null, null, b)
  96. }
  97. })
  98. })(Zepto);