Ei kuvausta

index.html 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
  7. <title>分享领红包</title>
  8. <link rel="stylesheet" type="text/css" href="public/public_css.css"/>
  9. <style type="text/css">
  10. body{ min-height:100vh;}
  11. .banner{width: 3.025rem;height: 1.15rem;margin: auto;padding-top: 0.11rem;}
  12. .banner img{width: 100%;}
  13. .red_packet{margin: auto;}
  14. .red_packet .click{font-size:0.18rem;color:#FB3D38;text-align: center;padding-top: 0.2rem;padding-bottom: 0.2rem;}
  15. .red_packet .copy{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);}
  16. .red_packet .con{font-size:0.14rem;color:#666666;padding-top: 0.2rem;padding-bottom: 0.345rem;text-align: center;}
  17. .already{height: 2rem;padding-left: 0.16rem;padding-right: 0.15rem;}
  18. .already .num{font-size:0.15rem;color:#FB3D38;padding-bottom: 0.175rem;}
  19. .already ul{height: 1.305rem;overflow-x:hidden;overflow-y: scroll;}
  20. .already ul li{float: left;padding-bottom: 0.08rem;color: #666666;line-height: 0.355rem;}
  21. .already ul li img{float: left;display: block;width: 0.355rem;height: 0.355rem;border:0;}
  22. .already ul li .username{ display: inline-block; float: left;padding-left: 0.075rem;width: 1.1rem;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
  23. .already ul li .ed{padding-right: 0.48rem;}
  24. .already ul li .username,.already ul li .ed{font-size: 0.14rem;}
  25. .already ul li .day,.already ul li .time{font-size: 0.12rem;}
  26. .already ul li .day{padding-right:0.08rem ;}
  27. .cooperation{width:2.54rem;height: 0.46rem;margin: auto;background: url(images/add.png) no-repeat 0.6rem 0.125rem,url(images/add.png) no-repeat 1.65rem 0.125rem; background-size:0.22rem 0.22rem ;}
  28. .cooperation img{float:left;width: 0.46rem;margin-right: 0.57rem;}
  29. .cooperation img:nth-child(3){margin-right: 0rem;}
  30. .bottom{margin: auto;color: #FB3D38;text-align: center;font-size: 0.14rem;}
  31. .bottom p:nth-child(1){padding-top: 0.185rem;padding-bottom: 0.205rem;font-size: 0.15rem;}
  32. .alert-info {position: absolute;top: 1.74rem;right: 0;left: 0;bottom: 0;text-align: center;}
  33. .alert-info p {display: inline-block;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;}
  34. .roll-wrap{height:1.305rem;overflow:hidden;}
  35. </style>
  36. <link rel="stylesheet" type="text/css" href="./index.css?v=6"/>
  37. <script type="text/javascript" src="../api-url.js"></script>
  38. <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  39. <script src="js/weChatShare.js?v=9"></script>
  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. </head>
  47. <body>
  48. <div id="index">
  49. <div class="banner">
  50. <img src="images/banner.png"/>
  51. </div>
  52. <div class="red_packet">
  53. <p>分享给好友后即可领取红包</p>
  54. <p class="copy shareHongbao">立即分享</p>
  55. </div>
  56. <div class="already">
  57. <p class="num"></p>
  58. <div class="roll-wrap" id="roll-wrap">
  59. <ul></ul>
  60. </div>
  61. </div>
  62. <div class="cooperation">
  63. <img src="https://adminsuishouji.oss-cn-beijing.aliyuncs.com/qianduologo.png" alt="" />
  64. <img src="images/taobao.png" alt="" />
  65. <img src="images/liedou.png" alt="" />
  66. </div>
  67. <div class="bottom">
  68. <p>联合送礼</p>
  69. <p>下载猎豆优选,大额红包拿到手软</p>
  70. </div>
  71. </div>
  72. <!--页面2-->
  73. <div id="invitation">
  74. <div class="success">
  75. <p class="shareSuccess">恭喜你,分享成功</p>
  76. <p class="copyTkl">点击下方复制淘口令,打开手机淘宝领取红包</p>
  77. <button class="share shareCopy" style="margin-bottom:0.4rem">一键复制</button>
  78. </div>
  79. <div class="download">
  80. <p class="tit">获取更多大额红包,下载猎豆优选</p>
  81. <div class="leidou">
  82. <img src="images/liedou.png" class="liedouImg"/>
  83. <p class="introduce"><img src="images/logo.png" alt="" /><span>购物先领券,下单赚佣金</span></p>
  84. <div class="down">
  85. <div onclick="downApp()">下载APP</div>
  86. <span>邀请码:666</span>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="btom">在淘宝/天猫购物之前,先来“猎豆优选App”</div>
  91. </div>
  92. <div class="shareMask">
  93. <div class="weixin">
  94. <div class="weixins">
  95. <div class="weixinShare" onclick="shareWeixin()">
  96. <img src="../H5/weixin.png" />
  97. <span>微信</span>
  98. </div>
  99. <div class="pengyouquan" onclick="sharePengyouquan()">
  100. <img src="../H5/weixinQuan.png"/>
  101. <span>朋友圈</span>
  102. </div>
  103. </div>
  104. <div class="cancel">取消分享</div>
  105. </div>
  106. </div>
  107. <div class="shareWechat">
  108. <img src="./images/wx_jiantou.png" class="wx_jiantou" />
  109. <div class="shareWechatCon">
  110. <h3>分享给朋友/群聊</h3>
  111. <p>分享后即可领取红包</p>
  112. <img class="cancel" src="./images/close.png"></img>
  113. </div>
  114. </div>
  115. <input id="copy_1" type="text" readOnly="true" value=""/>
  116. <div id="copy_2"></div>
  117. <text id="taokouling">€1Itabeg9EZP€</text>
  118. <div class="alert-info" style="display: none;">
  119. <!-- tip提示,3s后消失 -->
  120. <p></p>
  121. </div>
  122. </body>
  123. </html>
  124. <script type="text/javascript" src="public/jquery-2.1.0.js"></script>
  125. <script type="text/javascript">
  126. var user_id = 1;
  127. //页面加载,显示数据
  128. window.onload = function () {
  129. Lead() ;
  130. }
  131. //领红包
  132. function collarRed() {
  133. $.ajax({
  134. type:"post",
  135. url:"/api/V2/receiveRedPacket",
  136. data:{
  137. user_id:user_id
  138. },
  139. success: function (res) {
  140. var data =JSON.parse(res)
  141. console.log(data)
  142. if(data.code == 0){
  143. window.location.href = 'Invitation.html'
  144. }else if(data.code == 4003){
  145. console.log("领取失败")
  146. }
  147. }
  148. })
  149. }
  150. //已领红包
  151. function Lead() {
  152. $.ajax({
  153. type:"post",
  154. url:"/api/V2/returnRedPacket",
  155. success: function (res) {
  156. var data =JSON.parse(res)
  157. // console.log(data)
  158. if(data.code == 0){
  159. var dataArr = data.res.list,html = '',numHtml = '', name = '' , img = '';
  160. numHtml +='已有'+ data.res.count +'位用户领取红包';
  161. dataArr.forEach(function (item, index) {
  162. if(item.user_name){
  163. name = item.user_name;
  164. }else{
  165. name = '匿名';
  166. }
  167. if(item.user_img){
  168. img = item.user_img;
  169. }else{
  170. img = 'images/moren.png'
  171. }
  172. html += '<li><img src='+ img +' /><span class="username">'+ name +'</span><span class="ed">领取了红包</span><span class="day">'+ item.received_time +'</span></li>'
  173. })
  174. $('.num').html(numHtml);
  175. $('.roll-wrap ul').html(html)
  176. }
  177. new scrollTxt().init();
  178. }
  179. })
  180. }
  181. function scrollTxt(){
  182. var controls={},
  183. values={},
  184. t1=200, /*播放动画的时间*/
  185. t2=1500, /*播放时间间隔*/
  186. si;
  187. controls.rollWrap=$("#roll-wrap");
  188. controls.rollWrapUl=controls.rollWrap.children();
  189. controls.rollWrapLIs=controls.rollWrapUl.children();
  190. values.liNums=controls.rollWrapLIs.length;
  191. values.liHeight=controls.rollWrapLIs.eq(0).height();
  192. values.ulHeight=controls.rollWrap.height();
  193. this.init=function(){
  194. autoPlay();
  195. // pausePlay();
  196. }
  197. /*滚动*/
  198. function play(){
  199. controls.rollWrapUl.animate({"margin-top" : "-"+values.liHeight}, t1, function(){
  200. $(this).css("margin-top" , "0").children().eq(0).appendTo($(this));
  201. });
  202. }
  203. /*自动滚动*/
  204. function autoPlay(){
  205. /*如果所有li标签的高度和大于.roll-wrap的高度则滚动*/
  206. if(values.liHeight*values.liNums > values.ulHeight){
  207. si=setInterval(function(){
  208. play();
  209. },t2);
  210. }
  211. }
  212. /*鼠标经过ul时暂停滚动*/
  213. function pausePlay(){
  214. controls.rollWrapUl.on({
  215. "mouseenter":function(){
  216. clearInterval(si);
  217. }
  218. ,
  219. "mouseleave":function(){
  220. autoPlay();
  221. }
  222. });
  223. }
  224. }
  225. </script>
  226. <script type="text/javascript" src="js/index.js?v=3"></script>
  227. <script type="text/javascript" src="js/invitation.js?v=10"></script>