Nav apraksta

Invitation.html 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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. <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  10. <script src="weChatShare.js?v=5"></script>
  11. <style type="text/css">
  12. body,html{font-size: 0.16rem;height: 100vh;}
  13. 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;}
  14. .success{margin: auto;text-align: center;border-bottom:0.005rem solid #707070;}
  15. .success p:nth-child(1){font-size: 0.18rem;color: #FB3D38;padding-top: 0.86rem;padding-bottom: 0.145rem;}
  16. .success p:nth-child(2){font-size: 0.12rem;color: #FB3D38;padding-bottom: 0.655rem;}
  17. .success p:nth-child(4){font-size: 0.14rem;color: #666666;padding-top: 0.215rem;padding-bottom: 0.595rem;}
  18. #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);}
  19. .download{}
  20. .download .tit{color:#3333333;font-size:0.18rem;text-align: center;padding-top: 0.62rem;padding-bottom: 0.455rem;}
  21. .download .leidou{padding-left: 0.16rem;padding-right: 0.15rem;}
  22. .download .leidou .liedouImg{width: 0.525rem;float: left;}
  23. .download .leidou .introduce{float: left;padding-left: 0.055rem;}
  24. .download .leidou .introduce span{width:1.36rem;font-size: 0.13rem;color: #333333;}
  25. .download .leidou .introduce img{width: 0.8rem;height: 0.195rem;padding-top: 0.06rem;padding-bottom: 0.1rem;}
  26. .download .leidou .down{float: right;width: 0.755rem;height: 0.23rem;color: #fff;font-size: 0.13rem;line-height: 0.24rem;margin-top: 0.28rem;text-align: center;background: #FB3D38;border-radius: 0.075rem;box-shadow: 0.02rem 0.045rem 0.05rem rgba(143,141,141,0.22);}
  27. .btom{clear: both;width: 100%;margin:auto;color:#FB3D38;font-size:0.14rem;text-align:center;padding-top: 0.5rem;padding-bottom: 0.56rem;}
  28. .shareMask{display: none;width: 100%;height: 100%;background: rgba(0,0,0,0.5036);position: absolute;top: 0;left: 0;}
  29. button{
  30. outline: none;
  31. }
  32. a, a:visited{
  33. text-decoration: none;
  34. }
  35. body{
  36. width: 100%;
  37. height: 100%;
  38. }
  39. .shareMask{
  40. display: none;
  41. width: 100%;
  42. height: 100%;
  43. background: rgba(0,0,0,0.5036);
  44. position: absolute;
  45. top: 0;
  46. left: 0;
  47. }
  48. .weixin{
  49. position: fixed;
  50. bottom: 0;
  51. background: #ffffff;
  52. width: 100%;
  53. }
  54. .weixins{
  55. background: rgba(216,216,216,0.2);
  56. width: 100%;
  57. display: -webkit-flex;
  58. display: -webkit-box;
  59. display: -moz-box;
  60. display: -ms-flexbox;
  61. display: flex;
  62. justify-content: space-around;
  63. }
  64. .weixins div{
  65. text-align: center;
  66. }
  67. .weixins div img{
  68. display: block;
  69. width: 0.44rem;
  70. height: 0.44rem;
  71. margin: auto;
  72. margin-top: 0.22rem;
  73. margin-bottom: 0.12rem;
  74. }
  75. .weixins div span{
  76. font-size: 0.12rem;
  77. line-height: 0.17rem;
  78. color: #555555;
  79. margin-bottom: 0.16rem;
  80. display: inline-block;
  81. }
  82. .cancel{
  83. line-height: 0.4rem;
  84. font-size: 0.15rem;
  85. color: #555555;
  86. text-align: center;
  87. }
  88. .alert-info {
  89. position: absolute;
  90. top: 1.74rem;
  91. right: 0;
  92. left: 0;
  93. bottom: 0;
  94. text-align: center;
  95. z-index: 99;
  96. }
  97. .alert-info p {
  98. display: inline-block;
  99. height: 0.38rem;
  100. color: #fff;
  101. font-size: 0.14rem;
  102. line-height: 0.38rem;
  103. padding: 0 0.10rem;
  104. background-color: rgba(0, 0, 0, 0.7);
  105. border-radius: 5px;
  106. }
  107. .shareWechat{width: 100%;height: 100%;position: fixed;top: 0;left: 0;background: rgba(0,0,0,0.7);display: none;}
  108. .shareWechatCon{width:2.5rem;background:#ffffff;border-radius:0.12rem;position: absolute;top: 2rem;left: 0;right: 0;margin: auto;}
  109. .shareWechat .wx_jiantou{width: 0.72rem;position: absolute;right: 0.15rem;top: 0.2rem;}
  110. .shareWechat .shareWechatCon h3{font-size: 0.16rem;color: #FF2E2E;text-align: center;padding-bottom: 0.15rem;padding-top: 0.3rem;}
  111. .shareWechat .shareWechatCon p{font-size: 0.14rem;color: #333333;text-align: center;padding-bottom: 0.3rem;}
  112. .shareWechat .shareWechatCon .cancel{width: 0.34rem;height: 0.34rem;position: absolute;left: 0;right: 0;bottom: -0.5rem;margin: auto;}
  113. </style>
  114. <script type="text/javascript">
  115. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  116. window.onresize = function(){
  117. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  118. }
  119. </script>
  120. </head>
  121. <body>
  122. <div class="success">
  123. <p>恭喜你,已复制淘口令</p>
  124. <p>请前往淘宝领取红包</p>
  125. <p id="share">分享</p>
  126. <p>分享给朋友,有奖一起分</p>
  127. </div>
  128. <div class="download">
  129. <p class="tit">获取更多大额红包,下载猎豆优选</p>
  130. <div class="leidou">
  131. <img src="images/liedou.png" class="liedouImg"/>
  132. <p class="introduce"><img src="images/logo.png" alt="" /><span>购物先领券,下单赚佣金</span></p>
  133. <a class="down" href="http://a.app.qq.com/o/simple.jsp?pkgname=com.kuxuan.coupon_liedou">下载APP</a>
  134. </div>
  135. </div>
  136. <div class="btom">在淘宝/天猫购物之前,先来“猎豆优选App”</div>
  137. <div class="shareMask">
  138. <div class="weixin">
  139. <div class="weixins">
  140. <div class="weixinShare" onclick="shareWeixin()">
  141. <img src="../H5/weixin.png" />
  142. <span>微信</span>
  143. </div>
  144. <div class="pengyouquan" onclick="sharePengyouquan()">
  145. <img src="../H5/weixinQuan.png"/>
  146. <span>朋友圈</span>
  147. </div>
  148. </div>
  149. <div class="cancel">取消分享</div>
  150. </div>
  151. </div>
  152. <div class="shareWechat">
  153. <img src="./images/wx_jiantou.png" class="wx_jiantou" />
  154. <div class="shareWechatCon">
  155. <h3>恭喜你,获得淘宝红包</h3>
  156. <p>分享给好友,有奖一起拿</p>
  157. <img class="cancel" src="./images/close.png"></img>
  158. </div>
  159. </div>
  160. <div class="alert-info" style="display: none;">
  161. <!-- tip提示,3s后消失 -->
  162. <p></p>
  163. </div>
  164. </body>
  165. </html>
  166. <script type="text/javascript" src="public/jquery-2.1.0.js"></script>
  167. <script type="text/javascript">
  168. var userId = null;
  169. // var activity_id = null;
  170. // var share_code = null;
  171. var str=location.href; //取得整个地址栏
  172. var num=str.indexOf("?");
  173. str=str.substr(num+1); //str得到?之后的字符串
  174. var brr=str.split("&");
  175. for(var i = 0 ; i<brr.length; i++){
  176. if(brr[i].indexOf('userId') != -1){
  177. userId = brr[i].split('=')[1];//用户id
  178. localStorage.setItem('userId', userId);
  179. }
  180. // if(brr[i].indexOf('activity_id') != -1){
  181. // activity_id = brr[i].split('=')[1];//活动id
  182. // localStorage.setItem('activity_id', activity_id);
  183. // }
  184. // if(brr[i].indexOf('share_code') != -1){
  185. // share_code = brr[i].split('=')[1];
  186. // }
  187. }
  188. $(".shareMask").click(function(e){
  189. $(".shareMask").css('display','none')
  190. })
  191. $(".weixins").click(function(e){
  192. e.preventDefault();
  193. return false
  194. })
  195. var jsons = {
  196. title:'@你,快来瓜分10000个红包!',
  197. desc:'福利放送!淘宝无门槛购物红包天天领!来看看你的手气~',
  198. url:'http://mzb.quyaqu.com/share/index.html?userId=' + userId
  199. };
  200. jsons = JSON.stringify(jsons);
  201. function shareWeixin () {
  202. if(navigator.userAgent.indexOf('Android') != -1){
  203. messageHandlers.shareWithWechatSession(jsons)
  204. }else{
  205. window.webkit.messageHandlers.shareWithWechatSession.postMessage(jsons)
  206. }
  207. }
  208. function sharePengyouquan () {
  209. if(navigator.userAgent.indexOf('Android') != -1){
  210. messageHandlers.shareWithWechatTimeline(jsons)
  211. }else{
  212. window.webkit.messageHandlers.shareWithWechatTimeline.postMessage(jsons)
  213. }
  214. }
  215. $("#share").click(function () {
  216. if(navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger"){
  217. //微信
  218. $(".shareWechat").css('display','block')
  219. shareFriend ();
  220. }else{
  221. // //app端
  222. $(".shareMask").css('display','block')
  223. }
  224. share();
  225. })
  226. $(".cancel").click(function () {
  227. $(".shareMask").css('display','none');
  228. $(".shareWechat").css('display','none')
  229. })
  230. var num = 0;
  231. //分享
  232. function share() {
  233. //分享统计
  234. $.ajax({
  235. type:"post",
  236. url:"/api/V2/share",
  237. data:{
  238. type:1,
  239. count: num
  240. },
  241. success: function (res) {
  242. var data =JSON.parse(res)
  243. num = data.res.count;
  244. }
  245. })
  246. }
  247. function shareFriend () {
  248. //微信sdk分享验证信息
  249. var url = 'http://mzb.quyaqu.com/share/index.html?userId=' + userId;
  250. url = encodeURIComponent(url);
  251. $.ajax({
  252. type:"post",
  253. url:"/api/V2/jsonConfig",
  254. dataType:"json",
  255. data:{
  256. url:url
  257. },
  258. success: function (res) {
  259. if(res && res.code == 0){
  260. wexinPay(res.res.url,'./hongbao.png',res.res,() => {
  261. showMsg("成功")
  262. },() => {
  263. showMsg("失败")
  264. })
  265. }
  266. }
  267. })
  268. }
  269. /**
  270. * [showMsg 提示各种错误信息,3s后消失]
  271. */
  272. function showMsg(msg) {
  273. var msgBox = $('.alert-info');
  274. msgBox.children('p').text(msg);
  275. msgBox.show();
  276. setTimeout(function() {
  277. msgBox.hide();
  278. }, 3000);
  279. }
  280. </script>