paymentResult.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. failureResult:{
  19. status:"failure-pay",
  20. msg:"系统繁忙,请重新充值缴费。",
  21. Img:"../images/jiaofeishibai_icon.png",
  22. txt:"缴费失败",
  23. },
  24. healthType:["","就诊卡缴费充值","住院缴费充值"],
  25. initdata:{seqNo:"","patientName":"","healthNo":"","healthType":1,"payAmount":"","payTimeStart":"",},
  26. data:{},
  27. frompay:false,
  28. },
  29. mounted: function() {
  30. var vm = this
  31. checkUserAgent();
  32. vm.checkType()
  33. },
  34. methods: {
  35. //获取数据
  36. getData:function(){
  37. var vm=this
  38. loading.showModal();
  39. sendPost("third/hy/pay/gerPayOrder", {seqNo:Request.seqNo}, "json", "get",function(){
  40. loading.close();
  41. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  42. }, function(res){
  43. loading.close();
  44. if(res.status == 200){
  45. vm.data=res.data
  46. if(!vm.data){vm.data=vm.initdata}
  47. if(vm.data.payStatus==1){ //充值状态,0未完成,1已完成,2失败
  48. vm.result=vm.successResult
  49. }else{
  50. vm.result=vm.failureResult
  51. }
  52. }else{
  53. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  54. }
  55. })
  56. },
  57. //
  58. backClick:function(){
  59. window.history.back();
  60. },
  61. //判断是否验证登录通过
  62. checkType:function(){
  63. var vm=this
  64. var timer = setInterval(function(){
  65. if(checktype){
  66. clearInterval(timer);
  67. vm.getData()
  68. }
  69. },10);
  70. },
  71. },
  72. })
  73. })()
  74. function queryInit(){
  75. checktype=true
  76. }