123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- <!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>
- <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;
- }
- button{
- outline: none;
- }
- a, a:visited{
- text-decoration: none;
- }
- body{
- width: 100%;
- height: 100%;
- background: #FFFAE6;
- }
- .bg{
- background: url(../H5/invitationBg.png) no-repeat;
- background-size: 100%;
- width: 100%;
- height: 100%;
- }
- .invitation{
- width: 2rem;
- height: 0.4rem;
- line-height: 0.4rem;
- text-align: center;
- background: url(../H5/recordBg.png) no-repeat;
- background-size: 100%;
- position: absolute;
- top: 2.67rem;
- left: 0;
- right: 0;
- margin: auto;
- border: none;
- border-radius: 0.2rem;
- }
- .invitationRecord{
- text-align: center;
- color: #333333;
- font-size: 0.12rem;
- line-height: 0.17rem;
- position: absolute;
- top: 3.22rem;
- left: 0;
- right: 0;
- margin: auto;
- }
- .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;
- }
- </style>
- </head>
- <body>
- <div class="bg">
- <button class="invitation"></button>
- <a class="invitationRecord" href="../InvitationRecord/InvitaionRecord.html">邀请记录 ></a>
- </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>
- </body>
- </html>
- <script type="text/javascript" src="../jquery-2.1.0.js"></script>
- <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";
- }
-
-
- 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:'金牛记账',
- desc:'每个月都不知道钱花哪里了?金牛记账一款能赚会省的记账软件,我只告诉你,快来和我一起记账吧!',
- url:'http://bill.h5.726p.com/register/register.html?share_code=' + share_code
- };
- 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)
- }
- }
-
- $(".invitation").click(function () {
- $(".shareMask").css('display','block')
- })
- $(".cancel").click(function () {
- $(".shareMask").css('display','none')
- })
- </script>
|