cardPay.min.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. (function (e) {
  2. config.init();
  3. e("i.icon-arrow-left").on("tap",
  4. function () {
  5. window.location = "card.html"
  6. });
  7. e("#back").on("tap",
  8. function () {
  9. e("#popup_layer").removeClass("show")
  10. });
  11. e("#cancelFlag").on("tap",
  12. function () {
  13. if (!e(this).hasClass("disable")) {
  14. e("#popup_layer").removeClass("show");
  15. var g = {
  16. doing: function () {
  17. setTimeout(function () {
  18. window.location = "doctorCalendar.html"
  19. },
  20. 2000)
  21. }
  22. };
  23. if (a.payFlag == "0") {
  24. hzAPI.sendData(window.apiUrl + "?c=ReqHis&a=returnPay", e.extend(a, {
  25. payMode: 1,
  26. patientId: JSON.parse(e("ul.card a").attr("data")).patientId
  27. }), false, ["退费失败", "退费成功"], null, null, g)
  28. } else {
  29. hzAPI.sendData(window.apiUrl + "?c=ReqHis&a=cancelOrder", a, false, ["取消挂号失败", "取消挂号成功"], null, null, g)
  30. }
  31. }
  32. });
  33. e("#payFlag").on("tap",
  34. function () {
  35. if (!e(this).hasClass("disable")) {
  36. e("#popup_layer").removeClass("show");
  37. var g = {
  38. doing: function () {
  39. setTimeout(function () {
  40. //进行发短信
  41. var s = {
  42. smsType: "appointPay",
  43. orderId: d.orderId
  44. };
  45. hzAPI.sendData(window.apiUrl + "?c=Other&a=sendSmsInfo", s, false, null, null, null, null);
  46. c.doing();
  47. },
  48. 2000)
  49. }
  50. };
  51. hzAPI.sendData(window.apiUrl + "?c=ReqHis&a=payOrder", e.extend(a, {
  52. payMode: 1,
  53. payCardNum: JSON.parse(e("ul.card a").attr("data")).cardId,
  54. patientId: JSON.parse(e("ul.card a").attr("data")).patientId
  55. }), false, ["支付失败,请就诊当天到医院人工窗口取号", "支付成功"], null, null, g)
  56. }
  57. });
  58. var b = {
  59. doing: function () {
  60. hzAPI.scroll(window.apiUrl + "?c=Index&a=historyListForPay", f, "#list ul.historyList", 1, false);
  61. e("ul.historyList li a").on("tap",
  62. function () {
  63. a = JSON.parse(e(this).attr("data"));
  64. if (a.returnFlag == "0") {
  65. if (!e("#cancelFlag").hasClass("disable")) {
  66. e("#cancelFlag").addClass("disable");
  67. e("#cancelFlag i").addClass("disable");
  68. e("#payFlag").addClass("disable");
  69. e("#payFlag i").addClass("disable")
  70. }
  71. } else {
  72. if (a.payFlag == "0") {
  73. if (!e("#payFlag").hasClass("disable")) {
  74. e("#payFlag").addClass("disable");
  75. e("#payFlag i").addClass("disable")
  76. }
  77. } else {
  78. if (e("#payFlag").hasClass("disable")) {
  79. e("#payFlag").removeClass("disable");
  80. e("#payFlag i").removeClass("disable")
  81. }
  82. if (e("#cancelFlag").hasClass("disable")) {
  83. e("#cancelFlag").removeClass("disable");
  84. e("#cancelFlag i").removeClass("disable")
  85. }
  86. }
  87. }
  88. if (!e("#popup_layer").hasClass("show")) {
  89. e("#popup_layer").addClass("show")
  90. }
  91. })
  92. }
  93. };
  94. var f = {
  95. rowed: 0,
  96. pageSize: 5
  97. };
  98. var d = {
  99. doing: function () {
  100. var g = JSON.parse(e("ul.card a").attr("data"));
  101. e.extend(f, {
  102. payCardNum: g.cardId,
  103. hospitalId: g("#hospitalId").val()
  104. });
  105. hzAPI.getData(window.apiUrl + "?c=Index&a=historyListForPay", f, "#list ul.historyList", 1, true, null, false, "无未支付项目", b)
  106. }
  107. };
  108. var c = {
  109. doing: function () {
  110. hzAPI.getData(window.apiUrl + "?c=ReqHis&a=cardMoney", a, ".lists ul.card", 0, true, null, true, "未办理诊疗卡", d)
  111. }
  112. };
  113. var a = {
  114. customerFamilyId: Fx.getUrlParam("customerFamilyId"),
  115. hospitalId: Fx.getUrlParam("hospitalId"),
  116. hospitalName: decodeURI(decodeURI(Fx.getUrlParam("hospitalName")))
  117. };
  118. c.doing();
  119. icoNav.ton(".popup_layer li")
  120. })(Zepto);