paymentResult.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. var Request = GetRequest();
  2. var checktype=false;
  3. var loading = dialog({
  4. contentType: 'load',
  5. skin: 'bk-popup',
  6. });
  7. (function() {
  8. new Vue({
  9. el: "#app",
  10. data: {
  11. result:{},
  12. successResult:{
  13. status:"success-pay",
  14. msg:"恭喜您充值成功,您将享有医院在线的所有服务,以下为您的充值信息。",
  15. Img:"../images/jiaofeichengong_icon.png",
  16. txt:"充值成功",
  17. },
  18. synchronizationResult:{
  19. status:"synchronization-pay",
  20. msg:"系统繁忙,请重新充值缴费。",
  21. Img:"../images/jiaofeishibai_icon.png",
  22. txt:"充值失败",
  23. },
  24. failureResult:{
  25. status:"failure-pay",
  26. msg:"系统繁忙,请重新充值缴费。",
  27. Img:"../images/jiaofeishibai_icon.png",
  28. txt:"充值失败",
  29. },
  30. healthType:["","门诊缴费充值","住院缴费充值"],
  31. initdata:{seqNo:"","patientName":"","healthNo":"","healthType":1,"payAmount":"","createDate":"",},
  32. data:{},
  33. frompay:false,
  34. queryList:{
  35. month:"",
  36. healthNo:"",
  37. chargeType:"1", //1:门诊,2:住院,
  38. pageNo:1,
  39. pageSize:1,
  40. },
  41. payTypeList:[{},{type:"weixin",Img:"../images/weixinzhifu_icon.png",text:"微信支付"},{type:"xianjin",Img:"../images/xianjichongzhi_icon.png",text:"现金支付"},{type:"yinlian",Img:"../images/yinlianzhifu_icon.png",text:"银联支付"},{type:"zhifubao",Img:"../images/zhifubaozhifu_icon.png",text:"支付宝支付"}],
  42. },
  43. mounted: function() {
  44. var vm = this
  45. checkUserAgent();
  46. vm.checkType()
  47. },
  48. methods: {
  49. //获取数据
  50. getData:function(){
  51. var vm=this
  52. if(!Request.healthNo){
  53. vm.gerPayOrder() //从支付进入
  54. }else{
  55. vm.gerPayOrderList() //从缴费列表进入
  56. }
  57. },
  58. //从支付进入
  59. gerPayOrder:function(){
  60. var vm=this
  61. loading.showModal();
  62. sendPost("third/hy/pay/gerPayOrder", {seqNo:Request.seqNo}, "json", "get",function(){
  63. loading.close();
  64. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  65. }, function(res){
  66. loading.close();
  67. if(res.status == 200){
  68. vm.data=res.data
  69. if(vm.data.healthNo.length>13){
  70. vm.data.healthNo=vm.data.healthNo.substr(0,1)+"*******"+vm.data.healthNo.substr(vm.data.healthNo.length-4,4)
  71. }
  72. vm.filterData()
  73. }else{
  74. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
  75. }
  76. })
  77. },
  78. //从缴费列表进入
  79. gerPayOrderList:function(){
  80. var vm=this,healthNo=""
  81. healthNo=Request.healthNo
  82. if(Request.healthNo.length>13){
  83. healthNo=healthNo.substr(0,1)+"*******"+healthNo.substr(healthNo.length-4,4)
  84. }
  85. vm.data={seqNo:Request.seqNo,"patientName":getQueryString('patientName'),"healthNo":healthNo,"healthType":Request.healthType,"payAmount":Request.payAmount,"createDate":getQueryString('createDate'),"payStatus":Request.payStatus,"payType":Request.payType}
  86. vm.result=vm.successResult
  87. // if(Request.hyStatus==1){
  88. // vm.result=vm.successResult
  89. // }else{
  90. // vm.result=vm.synchronizationResult
  91. // }
  92. },
  93. filterData:function(){
  94. var vm=this
  95. if(!vm.data){vm.data=vm.initdata}
  96. if(Request.payStatus==1){ //充值状态,0未完成,1已完成,2失败
  97. vm.result=vm.successResult
  98. }else{
  99. // if(vm.data.wechatStatus==1){ //未同步
  100. // vm.result=vm.successResult
  101. // vm.data.hyStatus=0
  102. // }else{
  103. vm.result=vm.failureResult
  104. // }
  105. }
  106. },
  107. //
  108. backClick:function(){
  109. window.location.href='../../payment/html/paymentList.html?id='+Request.cardId; //充值查询页面
  110. },
  111. //就诊卡页面
  112. gotoPatientIDCard:function(){
  113. window.location.href='../../payment/html/patientIDCards-pay.html?id='+Request.cardId;
  114. },
  115. //判断是否验证登录通过
  116. checkType:function(){
  117. var vm=this
  118. var timer = setInterval(function(){
  119. if(checktype){
  120. clearInterval(timer);
  121. vm.getData()
  122. }
  123. },10);
  124. },
  125. },
  126. })
  127. })()
  128. function queryInit(){
  129. checktype=true
  130. }
  131. function getQueryString(name) {
  132. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  133. var r = window.location.search.substr(1).match(reg);
  134. if (r != null) return decodeURI(r[2]); return null;
  135. }