active.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <title>支付结果</title>
  8. <script type="text/javascript" charset="UTF-8"
  9. src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"></script>
  10. <script type="text/javascript" src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  11. <style>
  12. body {
  13. background-color: #efeff4;
  14. }
  15. * {
  16. padding: 0;
  17. margin: 0;
  18. }
  19. .app {
  20. width: 100%;
  21. height: 100vh;
  22. display: flex;
  23. flex-direction: column;
  24. justify-content: center;
  25. align-items: center;
  26. }
  27. .app img {
  28. width: 73px;
  29. display: block;
  30. }
  31. .app span {
  32. font-size: 11px;
  33. text-align: center;
  34. margin: 21px 42px 41px;
  35. line-height: 21px;
  36. }
  37. .button {
  38. background-color: #00AE75;
  39. border-radius: 13px;
  40. font-size: 13px;
  41. line-height: 27px;
  42. color: #FFFFFF;
  43. padding: 0 12px;
  44. text-align: center;
  45. position: relative;
  46. text-decoration:none;
  47. }
  48. </style>
  49. </head>
  50. <body>
  51. <div class="app">
  52. <img src="./icon-success.68ddda96.png" alt="" />
  53. <span id="msg">购买成功!<br />请耐心等待并关注活动变动</span>
  54. <a class="button" id="backHome" href="javascript:;">返回活动首页</a>
  55. </div>
  56. </body>
  57. <script type="text/javascript">
  58. function getQueryString(name) {
  59. var query = window.location.search.substring(1);
  60. var vars = query.split("&");
  61. for (var i = 0; i < vars.length; i++) {
  62. var pair = vars[i].split("=");
  63. if (pair[0] == name) {
  64. return pair[1];
  65. }
  66. }
  67. return null;
  68. };
  69. var order_id = getQueryString("order_id");
  70. window.onload = function () {
  71. var mchData = {action: 'onIframeReady', displayStyle: 'SHOW_CUSTOM_PAGE'}
  72. var postData = JSON.stringify(mchData)
  73. parent.postMessage(postData, 'https://payapp.weixin.qq.com')
  74. }
  75. var url = location.href;
  76. if (url.indexOf('uat.') != -1) {
  77. //var jump = 'http://learn.uat.churenyiliao.com/active/#/pages/activities/order/order?id=' + order_id;
  78. var jump = 'http://learn.uat.churenyiliao.com/active/';
  79. var back = 'http://guanli.uat.churenyiliao.com/learn/active/?l=api.getDesc';
  80. } else {
  81. //var jump = 'https://learn.churenyiliao.com/active/#/pages/activities/order/order?id=' + order_id;
  82. var jump = 'https://learn.churenyiliao.com/active/';
  83. var back = 'https://www.churenyiliao.com/learn/active/?l=api.getDesc';
  84. }
  85. if (!order_id) {
  86. $('#msg').html('购买失败!<br />请耐心等待并关注活动变动');
  87. function jumpOut() {
  88. location.href = jump;
  89. }
  90. } else {
  91. function jumpOut() {
  92. var mchData = {action: 'jumpOut', jumpOutUrl: jump}
  93. var postData = JSON.stringify(mchData)
  94. parent.postMessage(postData, 'https://payapp.weixin.qq.com')
  95. }
  96. $.ajax({
  97. type: "GET",
  98. url: back,
  99. data: {
  100. id: order_id,
  101. json : 1
  102. },
  103. dataType: "json",
  104. success: function (data) {
  105. if (data.status == 1) {
  106. if (data.data.info.status == 2) {
  107. $('#msg').html('购买成功!<br />请耐心等待并关注活动变动');
  108. $('#backHome').click(function() {
  109. jumpOut();
  110. });
  111. } else {
  112. $('#msg').html('购买失败!<br />请耐心等待并关注活动变动');
  113. $('#backHome').click(function() {
  114. location.href = jump;
  115. });
  116. }
  117. } else {
  118. alert(data.msg);
  119. }
  120. }
  121. });
  122. }
  123. </script>
  124. </html>