activity.blade.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>新用户大礼包</title>
  8. <style>
  9. * {
  10. padding: 0;
  11. margin: 0;
  12. }
  13. html,
  14. body {
  15. height: 100%;
  16. -webkit-background-size: cover;
  17. -moz-background-size: cover;
  18. -o-background-size: cover;
  19. background-size: cover;
  20. position: relative;
  21. background-color:#fedf46;
  22. }
  23. .button{
  24. -webkit-tap-highlight-color: transparent;
  25. -webkit-touch-callout: none;
  26. -webkit-user-select: none;
  27. text-decoration:none;
  28. display:block;
  29. position:absolute;
  30. width:380px;
  31. height:100px;
  32. left:0;
  33. top:0;
  34. }
  35. </style>
  36. </head>
  37. <body>
  38. <div class="page">
  39. <img src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/h5/new_user_privilege.jpg" style="width:100%;display:block">
  40. <a href="{{$url}}" class="button" ></a>
  41. </div>
  42. </body>
  43. <script>
  44. window.onload=function(){
  45. var oImg = document.querySelector('.page img');
  46. var oImgHeight = oImg.offsetHeight;
  47. var oImgWidth = oImg.offsetWidth;
  48. var aHref = document.querySelector('.button');
  49. aHref.style.top = (oImgHeight*0.83)+'px';
  50. aHref.style.left = (oImgWidth-380)/2+'px';
  51. document.querySelector('.button').addEventListener('touchstart',function(e){
  52. e.preventDefault();
  53. var href= this.attributes['href'].value;
  54. if(href == ''){
  55. alert('暂无活动');
  56. location.href = '/'
  57. }else{
  58. location.href = href;
  59. }
  60. return false;
  61. },false);
  62. }
  63. </script>
  64. </html>