123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta content="yes" name="apple-mobile-web-app-capable">
- <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no">
- <title>分享领红包</title>
- <link rel="stylesheet" type="text/css" href="public/public_css.css"/>
- <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
- <script src="weChatShare.js?v=5"></script>
- <style type="text/css">
- body,html{font-size: 0.16rem;height: 100vh;}
- 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;}
- .success{margin: auto;text-align: center;border-bottom:0.005rem solid #707070;}
- .success p:nth-child(1){font-size: 0.18rem;color: #FB3D38;padding-top: 0.86rem;padding-bottom: 0.145rem;}
- .success p:nth-child(2){font-size: 0.12rem;color: #FB3D38;padding-bottom: 0.655rem;}
- .success p:nth-child(4){font-size: 0.14rem;color: #666666;padding-top: 0.215rem;padding-bottom: 0.595rem;}
- #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);}
- .download{}
- .download .tit{color:#3333333;font-size:0.18rem;text-align: center;padding-top: 0.62rem;padding-bottom: 0.455rem;}
- .download .leidou{padding-left: 0.16rem;padding-right: 0.15rem;}
- .download .leidou .liedouImg{width: 0.525rem;float: left;}
- .download .leidou .introduce{float: left;padding-left: 0.055rem;}
- .download .leidou .introduce span{width:1.36rem;font-size: 0.13rem;color: #333333;}
- .download .leidou .introduce img{width: 0.8rem;height: 0.195rem;padding-top: 0.06rem;padding-bottom: 0.1rem;}
- .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);}
- .btom{clear: both;width: 100%;margin:auto;color:#FB3D38;font-size:0.14rem;text-align:center;padding-top: 0.5rem;padding-bottom: 0.56rem;}
- .shareMask{display: none;width: 100%;height: 100%;background: rgba(0,0,0,0.5036);position: absolute;top: 0;left: 0;}
- button{
- outline: none;
- }
- a, a:visited{
- text-decoration: none;
- }
- body{
- width: 100%;
- height: 100%;
- }
- .shareMask{
- display: none;
- width: 100%;
- height: 100%;
- background: rgba(0,0,0,0.5036);
- position: absolute;
- top: 0;
- left: 0;
- }
- .weixin{
- position: fixed;
- bottom: 0;
- background: #ffffff;
- width: 100%;
- }
- .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;
- }
- .weixins div{
- text-align: center;
- }
- .weixins div img{
- display: block;
- width: 0.44rem;
- height: 0.44rem;
- margin: auto;
- margin-top: 0.22rem;
- margin-bottom: 0.12rem;
- }
- .weixins div span{
- font-size: 0.12rem;
- line-height: 0.17rem;
- color: #555555;
- margin-bottom: 0.16rem;
- display: inline-block;
- }
- .cancel{
- line-height: 0.4rem;
- font-size: 0.15rem;
- color: #555555;
- text-align: center;
- }
- .alert-info {
- position: absolute;
- top: 1.74rem;
- right: 0;
- left: 0;
- bottom: 0;
- text-align: center;
- z-index: 99;
- }
-
- .alert-info p {
- display: inline-block;
- height: 0.38rem;
- color: #fff;
- font-size: 0.14rem;
- line-height: 0.38rem;
- padding: 0 0.10rem;
- background-color: rgba(0, 0, 0, 0.7);
- border-radius: 5px;
- }
- .shareWechat{width: 100%;height: 100%;position: fixed;top: 0;left: 0;background: rgba(0,0,0,0.7);display: none;}
- .shareWechatCon{width:2.5rem;background:#ffffff;border-radius:0.12rem;position: absolute;top: 2rem;left: 0;right: 0;margin: auto;}
- .shareWechat .wx_jiantou{width: 0.72rem;position: absolute;right: 0.15rem;top: 0.2rem;}
- .shareWechat .shareWechatCon h3{font-size: 0.16rem;color: #FF2E2E;text-align: center;padding-bottom: 0.15rem;padding-top: 0.3rem;}
- .shareWechat .shareWechatCon p{font-size: 0.14rem;color: #333333;text-align: center;padding-bottom: 0.3rem;}
- .shareWechat .shareWechatCon .cancel{width: 0.34rem;height: 0.34rem;position: absolute;left: 0;right: 0;bottom: -0.5rem;margin: auto;}
- </style>
- <script type="text/javascript">
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- window.onresize = function(){
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- }
- </script>
- </head>
- <body>
- <div class="success">
- <p>恭喜你,已复制淘口令</p>
- <p>请前往淘宝领取红包</p>
- <p id="share">分享</p>
- <p>分享给朋友,有奖一起分</p>
- </div>
- <div class="download">
- <p class="tit">获取更多大额红包,下载猎豆优选</p>
- <div class="leidou">
- <img src="images/liedou.png" class="liedouImg"/>
- <p class="introduce"><img src="images/logo.png" alt="" /><span>购物先领券,下单赚佣金</span></p>
- <a class="down" href="http://a.app.qq.com/o/simple.jsp?pkgname=com.kuxuan.coupon_liedou">下载APP</a>
- </div>
- </div>
- <div class="btom">在淘宝/天猫购物之前,先来“猎豆优选App”</div>
-
- <div class="shareMask">
- <div class="weixin">
- <div class="weixins">
- <div class="weixinShare" onclick="shareWeixin()">
- <img src="../H5/weixin.png" />
- <span>微信</span>
- </div>
- <div class="pengyouquan" onclick="sharePengyouquan()">
- <img src="../H5/weixinQuan.png"/>
- <span>朋友圈</span>
- </div>
- </div>
- <div class="cancel">取消分享</div>
- </div>
- </div>
-
- <div class="shareWechat">
- <img src="./images/wx_jiantou.png" class="wx_jiantou" />
- <div class="shareWechatCon">
- <h3>恭喜你,获得淘宝红包</h3>
- <p>分享给好友,有奖一起拿</p>
- <img class="cancel" src="./images/close.png"></img>
- </div>
- </div>
-
- <div class="alert-info" style="display: none;">
- <!-- tip提示,3s后消失 -->
- <p></p>
- </div>
- </body>
- </html>
- <script type="text/javascript" src="public/jquery-2.1.0.js"></script>
- <script type="text/javascript">
- var userId = null;
- // var activity_id = null;
- // var share_code = null;
- var str=location.href; //取得整个地址栏
- var num=str.indexOf("?");
- str=str.substr(num+1); //str得到?之后的字符串
- var brr=str.split("&");
- for(var i = 0 ; i<brr.length; i++){
- if(brr[i].indexOf('userId') != -1){
- userId = brr[i].split('=')[1];//用户id
- localStorage.setItem('userId', userId);
- }
- // if(brr[i].indexOf('activity_id') != -1){
- // activity_id = brr[i].split('=')[1];//活动id
- // localStorage.setItem('activity_id', activity_id);
- // }
- // if(brr[i].indexOf('share_code') != -1){
- // share_code = brr[i].split('=')[1];
- // }
- }
-
-
- $(".shareMask").click(function(e){
- $(".shareMask").css('display','none')
- })
-
- $(".weixins").click(function(e){
- e.preventDefault();
- return false
- })
-
-
- var jsons = {
- title:'@你,快来瓜分10000个红包!',
- desc:'福利放送!淘宝无门槛购物红包天天领!来看看你的手气~',
- url:'http://mzb.quyaqu.com/share/index.html?userId=' + userId
- };
- jsons = JSON.stringify(jsons);
- function shareWeixin () {
- if(navigator.userAgent.indexOf('Android') != -1){
- messageHandlers.shareWithWechatSession(jsons)
- }else{
- window.webkit.messageHandlers.shareWithWechatSession.postMessage(jsons)
- }
- }
-
- function sharePengyouquan () {
- if(navigator.userAgent.indexOf('Android') != -1){
- messageHandlers.shareWithWechatTimeline(jsons)
- }else{
- window.webkit.messageHandlers.shareWithWechatTimeline.postMessage(jsons)
- }
- }
-
- $("#share").click(function () {
- if(navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger"){
- //微信
- $(".shareWechat").css('display','block')
- shareFriend ();
- }else{
- // //app端
- $(".shareMask").css('display','block')
- }
- share();
- })
- $(".cancel").click(function () {
- $(".shareMask").css('display','none');
- $(".shareWechat").css('display','none')
- })
-
- var num = 0;
- //分享
- function share() {
- //分享统计
- $.ajax({
- type:"post",
- url:"/api/V2/share",
- data:{
- type:1,
- count: num
- },
- success: function (res) {
- var data =JSON.parse(res)
- num = data.res.count;
- }
- })
- }
- function shareFriend () {
- //微信sdk分享验证信息
- var url = 'http://mzb.quyaqu.com/share/index.html?userId=' + userId;
- url = encodeURIComponent(url);
- $.ajax({
- type:"post",
- url:"/api/V2/jsonConfig",
- dataType:"json",
- data:{
- url:url
- },
- success: function (res) {
- if(res && res.code == 0){
- wexinPay(res.res.url,'./hongbao.png',res.res,() => {
- showMsg("成功")
- },() => {
- showMsg("失败")
- })
- }
- }
- })
- }
- /**
- * [showMsg 提示各种错误信息,3s后消失]
- */
- function showMsg(msg) {
- var msgBox = $('.alert-info');
- msgBox.children('p').text(msg);
- msgBox.show();
-
- setTimeout(function() {
- msgBox.hide();
- }, 3000);
- }
- </script>
|