Nessuna descrizione

Invitation.html 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta content="yes" name="apple-mobile-web-app-capable">
  6. <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no">
  7. <title>分享领红包</title>
  8. <link rel="stylesheet" type="text/css" href="public/public_css.css"/>
  9. <style type="text/css">
  10. body,html{font-size: 0.16rem;height: 100vh;}
  11. body, div, button, h3, h6, span, ul, li, p, a,input{font-family: -apple-system,SF UI Text,Helvetica Neue,Helvetica,Arial,sans-serif;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding: 0; margin: 0; box-sizing: inherit; font-weight: normal;}
  12. .success{margin: auto;text-align: center;border-bottom:0.005rem solid #707070;}
  13. .success p:nth-child(1){font-size: 0.18rem;color: #FB3D38;padding-top: 0.86rem;padding-bottom: 0.145rem;}
  14. .success p:nth-child(2){font-size: 0.14rem;color: #FB3D38;padding-bottom: 0.655rem;}
  15. .success p:nth-child(4){font-size: 0.14rem;color: #666666;padding-top: 0.215rem;padding-bottom: 0.595rem;}
  16. #share{width: 0.94rem;height: 0.26rem;margin:auto;color:#FFF;font-size:0.15rem;line-height: 0.26rem;text-align:center;background:#FB3D38;border-radius:0.075rem;box-shadow:0.02rem 0.045rem 0.05rem rgba(143,141,141,0.22);}
  17. .download{}
  18. .download .tit{color:#3333333;font-size:0.18rem;text-align: center;padding-top: 0.62rem;padding-bottom: 0.455rem;}
  19. .download .leidou{padding-left: 0.16rem;padding-right: 0.15rem;}
  20. .download .leidou .liedouImg{width: 0.525rem;float: left;}
  21. .download .leidou .introduce{float: left;padding-left: 0.055rem;}
  22. .download .leidou .introduce span{width:1.36rem;font-size: 0.13rem;color: #333333;}
  23. .download .leidou .introduce img{width: 0.8rem;height: 0.195rem;padding-top: 0.06rem;padding-bottom: 0.1rem;}
  24. .download .leidou .invitation{display: block;float: right;font-size: 0.13rem;color: #333333;}
  25. .download .leidou .down{float: right;width: 0.755rem;height: 0.23rem;color: #fff;font-size: 0.13rem;line-height: 0.24rem;margin-top: 0.08rem;text-align: center;background: #FB3D38;border-radius: 0.075rem;box-shadow: 0.02rem 0.045rem 0.05rem rgba(143,141,141,0.22);}
  26. .btom{clear: both;width: 100%;margin:auto;color:#FB3D38;font-size:0.14rem;text-align:center;padding-top: 0.5rem;padding-bottom: 0.56rem;}
  27. .shareMask{display: none;width: 100%;height: 100%;background: rgba(0,0,0,0.5036);position: absolute;top: 0;left: 0;}
  28. button{outline: none;}
  29. a, a:visited{text-decoration: none;}
  30. body{width: 100%;height: 100%;}
  31. .shareMask{display: none;width: 100%;height: 100%;background: rgba(0,0,0,0.5036);position: absolute;top: 0;left: 0;}
  32. .weixin{position: fixed;bottom: 0;background: #ffffff;width: 100%;}
  33. .weixins{background: rgba(216,216,216,0.2);width: 100%;display: -webkit-flex;display: -webkit-box;display: -moz-box;display: -ms-flexbox;display: flex;justify-content: space-around; }
  34. .weixins div{text-align: center;}
  35. .weixins div img{display: block;width: 0.44rem;height: 0.44rem;margin: auto;margin-top: 0.22rem;margin-bottom: 0.12rem;}
  36. .weixins div span{font-size: 0.12rem;line-height: 0.17rem;color: #555555;margin-bottom: 0.16rem;display: inline-block;}
  37. .cancel{line-height: 0.4rem;font-size: 0.15rem;color: #555555;text-align: center;}
  38. #copy_1,#copy_2,#taokouling{position: absolute;left: -1000rem;}
  39. </style>
  40. <script type="text/javascript">
  41. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  42. window.onresize = function(){
  43. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  44. }
  45. </script>
  46. <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  47. </head>
  48. <body>
  49. <div class="success">
  50. <p>恭喜你,获得淘宝无门槛购物红包</p>
  51. <p>分享给好友后即可领取</p>
  52. <p id="share">分享</p>
  53. <p>分享给朋友,有奖一起分</p>
  54. </div>
  55. <input id="copy_1" type="text" readOnly="true" value=""/>
  56. <div id="copy_2"></div>
  57. <text id="taokouling">€WVXSb1pT51S€</text>
  58. <div class="download">
  59. <p class="tit">获取更多大额红包,下载猎豆优选</p>
  60. <div class="leidou">
  61. <img src="images/liedou.png" class="liedouImg"/>
  62. <p class="introduce"><img src="images/logo.png" alt="" /><span>购物先领券,下单赚佣金</span></p>
  63. <p class="invitation">邀请码: 666</p>
  64. <a class="down" href="http://a.app.qq.com/o/simple.jsp?pkgname=com.kuxuan.coupon_liedou">下载APP</a>
  65. </div>
  66. </div>
  67. <div class="btom">在淘宝/天猫购物之前,先来“猎豆优选App”</div>
  68. <div class="shareMask">
  69. <div class="weixin">
  70. <div class="weixins">
  71. <div class="weixinShare" onclick="shareWeixin()">
  72. <img src="../H5/weixin.png" />
  73. <span>微信</span>
  74. </div>
  75. <div class="pengyouquan" onclick="sharePengyouquan()">
  76. <img src="../H5/weixinQuan.png"/>
  77. <span>朋友圈</span>
  78. </div>
  79. </div>
  80. <div class="cancel">取消分享</div>
  81. </div>
  82. </div>
  83. </body>
  84. </html>
  85. <script type="text/javascript" src="public/jquery-2.1.0.js"></script>
  86. <script type="text/javascript">
  87. var userId = null;
  88. var activity_id = null;
  89. var share_code = null;
  90. var str=location.href; //取得整个地址栏
  91. var num=str.indexOf("?");
  92. str=str.substr(num+1); //str得到?之后的字符串
  93. var brr=str.split("&");
  94. for(var i = 0 ; i<brr.length; i++){
  95. if(brr[i].indexOf('userId') != -1){
  96. userId = brr[i].split('=')[1];//用户id
  97. localStorage.setItem('userId', userId);
  98. }
  99. if(brr[i].indexOf('activity_id') != -1){
  100. activity_id = brr[i].split('=')[1];//活动id
  101. localStorage.setItem('activity_id', activity_id);
  102. }
  103. if(brr[i].indexOf('share_code') != -1){
  104. share_code = brr[i].split('=')[1];
  105. }
  106. }
  107. $(".shareMask").click(function(e){
  108. $(".shareMask").css('display','none')
  109. })
  110. $(".weixins").click(function(e){
  111. e.preventDefault();
  112. return false
  113. })
  114. var jsons = {
  115. title:'@你,快来瓜分10000个红包!',
  116. desc:'福利放送!淘宝无门槛购物红包天天领!来看看你的手气~',
  117. url:'http://mzb.quyaqu.com/share/index.html?userId=' + userId
  118. };
  119. jsons = JSON.stringify(jsons);
  120. function shareWeixin () {
  121. if(navigator.userAgent.indexOf('Android') != -1){
  122. messageHandlers.shareWithWechatSession(jsons)
  123. }else{
  124. window.webkit.messageHandlers.shareWithWechatSession.postMessage(jsons)
  125. }
  126. }
  127. function sharePengyouquan () {
  128. if(navigator.userAgent.indexOf('Android') != -1){
  129. messageHandlers.shareWithWechatTimeline(jsons)
  130. }else{
  131. window.webkit.messageHandlers.shareWithWechatTimeline.postMessage(jsons)
  132. }
  133. }
  134. $("#share").click(function () {
  135. $(".shareMask").css('display','block')
  136. copyPassword();
  137. share();
  138. })
  139. $(".cancel").click(function () {
  140. $(".shareMask").css('display','none')
  141. })
  142. var num = 0;
  143. //分享
  144. function share() {
  145. $.ajax({
  146. type:"post",
  147. url:"/api/V2/share",
  148. data:{
  149. type:1,
  150. count: num
  151. },
  152. success: function (res) {
  153. var data =JSON.parse(res)
  154. num = data.res.count;
  155. }
  156. })
  157. }
  158. function copyPassword() {
  159. var data=document.getElementById("taokouling").innerHTML;
  160. copy_2.innerHTML = data;
  161. copy_1.value = data;
  162. if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
  163. //区分iPhone设备
  164. window.getSelection().removeAllRanges();//这段代码必须放在前面否则无效
  165. var Url2=document.getElementById("copy_2");//要复制文字的节点
  166. var range = document.createRange();
  167. // 选中需要复制的节点
  168. range.selectNode(Url2);
  169. // 执行选中元素
  170. window.getSelection().addRange(range);
  171. // 执行 copy 操作
  172. var successful = document.execCommand('copy');
  173. // 移除选中的元素
  174. window.getSelection().removeAllRanges();
  175. }else{
  176. var Url2=document.getElementById("copy_1");//要复制文字的节点
  177. Url2.select(); // 选择对象
  178. document.execCommand("Copy"); // 执行浏览器复制命令
  179. }
  180. }
  181. var wxUrl = window.location.href
  182. console.log(wxUrl)
  183. </script>