No Description

inviteWeixinSuccess.html 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>江湖抢单宝</title>
  8. <link rel="stylesheet" href="./common/reset.css">
  9. <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  10. <script src="./js/weChatShare.js?v=1.0.2"></script>
  11. <script src="./common/jquery-2.1.0.js"></script>
  12. <script>
  13. var viewport = document.querySelector("meta[name=viewport]")
  14. if (window.devicePixelRatio == 1) {
  15. viewport.setAttribute('content', 'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no')
  16. }
  17. if (window.devicePixelRatio == 2) {
  18. viewport.setAttribute('content', 'width=device-width, initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no')
  19. }
  20. if (window.devicePixelRatio == 3) {
  21. viewport.setAttribute('content', 'width=device-width, initial-scale=0.333333333, maximum-scale=0.333333333, minimum-scale=0.333333333, user-scalable=no')
  22. }
  23. document.documentElement.style.fontSize=document.documentElement.clientWidth/375*100+"px";
  24. window.onresize=function(){
  25. document.documentElement.style.fontSize=document.documentElement.clientWidth/375*100+"px";
  26. }
  27. </script>
  28. <style>
  29. body{
  30. width: 100%;min-height: 100vh;
  31. background:rgba(33, 146, 254) url(./img/inviteWeixinSuccessBg.png) no-repeat;
  32. background-size:100%;
  33. }
  34. #bgImgBottom{
  35. width: 100%;position: absolute;bottom: 0;left: 0;
  36. }
  37. .button{
  38. position: absolute;top: 4.2rem;left: 0;right: 0;margin: auto;width: 2.39rem;
  39. }
  40. .button button{
  41. width: 100%;height: 0.58rem;border: none;
  42. }
  43. #ios{
  44. background: url(./img/iosDownLoad.png) no-repeat;background-size: 100%;
  45. }
  46. #android{
  47. background: url(./img/androidDownLoad.png) no-repeat;background-size: 100%;margin-top: 0.1rem;
  48. }
  49. </style>
  50. </head>
  51. <body>
  52. <img id="bgImgBottom" src="img/inviteWeixinSuccessBottom.png" />
  53. <div class="button">
  54. <button id="ios"></button>
  55. <button id="android"></button>
  56. </div>
  57. <div class="alert-info" style="display: none;">
  58. <p></p>
  59. </div>
  60. </body>
  61. </html>
  62. <script>
  63. var qs=parseQueryString(location.href);
  64. var source = '',user_id = '';
  65. $().ready(function(){
  66. getSignPackage();//过微信审核用
  67. if(qs.user_id){user_id = qs.user_id}
  68. if(qs.source){source = qs.source}
  69. })
  70. $("#ios").click(function () {
  71. window.location.href='https://apps.apple.com/cn/app/%E6%B1%9F%E6%B9%96%E6%8A%A2%E5%8D%95%E5%AE%9D-%E7%BB%8F%E7%90%86%E6%8A%A2%E5%8D%95%E7%A5%9E%E5%99%A8/id1467877890'
  72. })
  73. $("#android").click(function () {
  74. window.location.href='https://a.app.qq.com/o/simple.jsp?pkgname=com.riversbaby.money'
  75. })
  76. // 展示错误提示信息
  77. function showMsg(msg) {
  78. $(".alert-info").show();
  79. $(".alert-info p").text(msg);
  80. setTimeout(function() {
  81. $(".alert-info").hide();
  82. }, 1000);
  83. }
  84. // 微信过审用
  85. function getSignPackage () {
  86. //过微信审核用
  87. var _this = this;
  88. $.ajax({
  89. url:'/user/jsonConfig',
  90. type:'get',
  91. data:{
  92. url:getLocation()+"/inviteWeixin.html?user_id=" + user_id + '&source=' + source,//详情链接
  93. },
  94. success: function (res) {
  95. console.log(res)
  96. wexinPay(location.href,res.rst,function() {
  97. // 分享成功
  98. showMsg("分享成功")
  99. },function() {
  100. //分享失败
  101. showMsg("分享失败")
  102. },function() {
  103. //微信审核为通过
  104. })
  105. }
  106. })
  107. }
  108. // 获取上级地址
  109. function getLocation() {
  110. var upper=window.location.href.split("/")[window.location.href.split("/").length-1]
  111. return window.location.href.replace(upper,"");
  112. }
  113. //获取地址栏参数
  114. function parseQueryString(url) {
  115. var urlObj = {};
  116. var reg = /([^?=&]+)=([^?=&]+)/g;
  117. url.replace(reg, function($0, $1, $2) {
  118. urlObj[$1] = decodeURIComponent($2);
  119. })
  120. return urlObj;
  121. }
  122. </script>