me_invite.jsp 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() + path+"/";
  8. request.setAttribute("contextPath", basePath);
  9. String redirectUrl= request.getParameter("redirectUrl");
  10. request.setAttribute("redirectUrl", redirectUrl);
  11. %>
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. <head>
  15. <meta charset="UTF-8">
  16. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  17. <meta name="apple-mobile-web-app-capable" content="yes">
  18. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  19. <meta name="format-detection" content="telephone=no">
  20. <title>邀请好友</title>
  21. <%-- <script type="text/javascript" src="${contextPath }res/js/jquery.min.js"></script> --%>
  22. <script src="${contextPath }app/lib/flexible.js"></script>
  23. <link rel="stylesheet" href="${contextPath }app/lib/flexible.css">
  24. <link rel="stylesheet" href="${contextPath }app/css/basem.css">
  25. <link rel="stylesheet" href="${contextPath }app/css/logome.css">
  26. <link rel="stylesheet" href="${contextPath }app/css/share.min.css">
  27. <style type="text/css">
  28. .social-share .social-share-icon {
  29. width:1.2rem;
  30. height:1.2rem;
  31. font-size:0.8rem;
  32. line-height:1.2rem;
  33. }
  34. </style>
  35. </head>
  36. <body>
  37. <input type="hidden" id="invitecode" name="invitecode" style="visibility:hidden">${USER.invitecode}</input>
  38. <div class="titbox blubg">
  39. <a class="titreturn left" href="${contextPath }web/meWebCtl/me.cs"><img src="${contextPath }app/img/fanhui16@2x.png" alt=""></a>
  40. <h1>邀请好友</h1>
  41. </div>
  42. <div class="meinvibox top50">
  43. <div class="meinvitit">
  44. <h2 class="whtxt">我的二维码</h2>
  45. <img src="${contextPath }app/img/xianm@2x.png" alt="">
  46. </div>
  47. <div class="merweima">
  48. <img src="${IMG_URL}" alt="">
  49. </div>
  50. <h2 class="whtxt">分享二维码</h2>
  51. <ul class="meinviul">
  52. <li class="row">
  53. <div id="share-2"></div>
  54. </li>
  55. </ul>
  56. </div>
  57. <div id="weixin-tip" style="display:none;position:fixed;left:0;top:0;background: rgba(0,0,0,0.8);filter: alpha(opacity=80);width: 100%;height: 100%;z-index: 100;">
  58. <p style="text-align: center;margin-top: 10%;padding: 0 5%;position: relative;">
  59. <img src="${contextPath }app/img/live_weixin.png" width="100%" alt="微信打开" style=" vertical-align: middle;">
  60. <span id="close" style="opacity: .2;float: right;color: #FFFFFF;font-size: 40px; padding: 5px;font: bold 20px/24px simsun;text-shadow: 0 1px 0 #ddd;position: absolute;top: 0;left: 5%;" class="close">&nbsp;×</span>
  61. </p>
  62. </div>
  63. <script src="http://apps.bdimg.com/libs/jquery/1.8.2/jquery.js"></script>
  64. <script src="${contextPath }app/js/jquery.share.js"></script>
  65. <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  66. <script type="text/javascript">
  67. //一键分享相关配置
  68. var $config = {
  69. url :'<%=basePath%>app/login/register.jsp?code=${USER.invitecode}',// 网址,默认使用 window.location.href
  70. source : '<%=basePath%>app/login/register.jsp?code=${USER.invitecode}', // 来源(QQ空间会用到), 默认读取head标签:<meta name="site" content="http://overtrue" />
  71. title : '我在东旭通,喊您来加入!', // 标题,默认读取 document.title 或者 <meta name="title" content="share.js" />
  72. description : '下载东旭通,共享179.5亿品牌价值,成交赚取高额佣金,尊享超级VIP服务。', // 描述, 默认读取head标签:<meta name="description" content="PHP弱类型的实现原理分析" />
  73. image : '', // 图片, 默认取网页中第一个img标签
  74. sites : ['qzone', 'qq', 'weibo','wechat'], // 启用的站点
  75. disabled : ['google', 'facebook', 'twitter'], // 禁用的站点
  76. wechatQrcodeTitle : '微信扫一扫:分享', // 微信二维码提示文字
  77. wechatQrcodeHelper : '<p>微信里点“发现”,扫一下</p><p>二维码便可将本文分享至朋友圈。</p>',
  78. target : '_blank' //打开方式
  79. };
  80. $('#share-2').share($config);//{sites: ['qzone', 'qq', 'weibo','wechat']}
  81. </script>
  82. <script type="text/javascript">
  83. $(function() {
  84. //判断是否是外部浏览器还是内部浏览器
  85. //如果是外部浏览器支付宝支付如果是内部浏览器支付宝确认支付按钮跳出
  86. var wechatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i) ;
  87. //外部浏览器
  88. if(wechatInfo ) {
  89. if ( wechatInfo[1] < "5.0" ) {
  90. alert("仅支持微信5.0以上版本") ;
  91. }else{
  92. //微信浏览器提示tip
  93. $(".wechat-qrcode").remove();
  94. }
  95. }
  96. $('#close').click(function() {
  97. $("#weixin-tip").hide();
  98. });
  99. $('.icon-wechat').click(function() {
  100. //判断是否是外部浏览器还是内部浏览器
  101. //如果是外部浏览器支付宝支付如果是内部浏览器支付宝确认支付按钮跳出
  102. var wechatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i) ;
  103. //外部浏览器
  104. if(wechatInfo) {
  105. if ( wechatInfo[1] < "5.0" ) {
  106. alert("仅支持微信5.0以上版本") ;
  107. }else{
  108. //微信浏览器提示tip
  109. $("#weixin-tip").show();
  110. }
  111. }
  112. });
  113. // 微信分享函数
  114. $.ajax({ url:"<%=basePath%>web/wx_share/getwxconfig.cs",
  115. data:{signaurl:location.href},
  116. dataType:'json',
  117. type:'post',
  118. success:function(data){
  119. wx.config({
  120. debug: false,
  121. appId:data.appid,
  122. timestamp:data.timestamp,
  123. nonceStr:data.noncestr,
  124. signature:data.signature,
  125. jsApiList:['checkJsApi','onMenuShareTimeline','onMenuShareAppMessage']
  126. });
  127. wx.ready(function(){
  128. //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口
  129. wx.onMenuShareTimeline({
  130. title: "我在东旭通,喊您来加入!", // 分享标题
  131. link:"<%=basePath%>app/login/register.jsp?code=${USER.invitecode}", // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  132. imgUrl:"${contextPath }app/img/logo@2x.png", // 分享图标
  133. success: function () {
  134. window.location.href=window.location.href;
  135. },
  136. cancel: function () {
  137. // 用户取消分享后执行的回调函数
  138. }
  139. });
  140. //获取“分享给朋友”按钮点击状态及自定义分享内容接口
  141. wx.onMenuShareAppMessage({
  142. title: "我在东旭通,喊您来加入!", // 分享标题
  143. desc: "下载东旭通,共享179.5亿品牌价值,成交赚取高额佣金,尊享超级VIP服务。", // 分享描述
  144. link:"<%=basePath%>app/login/register.jsp?code=${USER.invitecode}", // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  145. imgUrl: "${contextPath }app/img/logo@2x.png", // 分享图标
  146. type: '', // 分享类型,music、video或link,不填默认为link
  147. dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
  148. success: function () {
  149. // 用户确认分享后执行的回调函数
  150. window.location.href=window.location.href;
  151. },
  152. cancel: function () {
  153. // 用户取消分享后执行的回调函数
  154. }
  155. });
  156. });
  157. }
  158. });
  159. })
  160. </script>
  161. </body>
  162. </html>