cardPay.min.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. c.doing()
  41. },
  42. 2000)
  43. }
  44. };
  45. hzAPI.sendData(window.apiUrl+"?c=ReqHis&a=payOrder", e.extend(a, {
  46. payMode: 1,
  47. payCardNum: JSON.parse(e("ul.card a").attr("data")).cardId,
  48. patientId: JSON.parse(e("ul.card a").attr("data")).patientId
  49. }), false, ["支付失败,请就诊当天到医院人工窗口取号", "支付成功"], null, null, g)
  50. }
  51. });
  52. var b = {
  53. doing: function () {
  54. hzAPI.scroll(window.apiUrl+"?c=Index&a=historyListForPay", f, "#list ul.historyList", 1, false);
  55. e("ul.historyList li a").on("tap",
  56. function () {
  57. a = JSON.parse(e(this).attr("data"));
  58. if (a.returnFlag == "0") {
  59. if (!e("#cancelFlag").hasClass("disable")) {
  60. e("#cancelFlag").addClass("disable");
  61. e("#cancelFlag i").addClass("disable");
  62. e("#payFlag").addClass("disable");
  63. e("#payFlag i").addClass("disable")
  64. }
  65. } else {
  66. if (a.payFlag == "0") {
  67. if (!e("#payFlag").hasClass("disable")) {
  68. e("#payFlag").addClass("disable");
  69. e("#payFlag i").addClass("disable")
  70. }
  71. } else {
  72. if (e("#payFlag").hasClass("disable")) {
  73. e("#payFlag").removeClass("disable");
  74. e("#payFlag i").removeClass("disable")
  75. }
  76. if (e("#cancelFlag").hasClass("disable")) {
  77. e("#cancelFlag").removeClass("disable");
  78. e("#cancelFlag i").removeClass("disable")
  79. }
  80. }
  81. }
  82. if (!e("#popup_layer").hasClass("show")) {
  83. e("#popup_layer").addClass("show")
  84. }
  85. })
  86. }
  87. };
  88. var f = {
  89. rowed: 0,
  90. pageSize: 5
  91. };
  92. var d = {
  93. doing: function () {
  94. var g = JSON.parse(e("ul.card a").attr("data"));
  95. e.extend(f, {
  96. payCardNum: g.cardId,
  97. hospitalId: g("#hospitalId").val()
  98. });
  99. hzAPI.getData(window.apiUrl+"?c=Index&a=historyListForPay", f, "#list ul.historyList", 1, true, null, false, "无未支付项目", b)
  100. }
  101. };
  102. var c = {
  103. doing: function () {
  104. hzAPI.getData(window.apiUrl+"?c=ReqHis&a=cardMoney", a, ".lists ul.card", 0, true, null, true, "未办理诊疗卡", d)
  105. }
  106. };
  107. var a = {
  108. customerFamilyId: Fx.getUrlParam("customerFamilyId"),
  109. hospitalId: Fx.getUrlParam("hospitalId"),
  110. hospitalName: decodeURI(decodeURI(Fx.getUrlParam("hospitalName")))
  111. };
  112. c.doing();
  113. icoNav.ton(".popup_layer li")
  114. })(Zepto);