wapnationDayActivity.blade.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <!--
  2. /**
  3. * Created by PhpStorm.
  4. * User: z-yang
  5. * Date: 2019/9/25
  6. * Time: 15:38
  7. */
  8. -->
  9. <!DOCTYPE html>
  10. <html lang="en">
  11. <head>
  12. <meta charset="UTF-8" />
  13. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  14. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  15. <title>国庆特惠</title>
  16. <style>
  17. html,
  18. body {
  19. margin: 0 auto;
  20. padding: 0;
  21. max-width: 450px;
  22. font-size: 100px;
  23. background: #c9392e;
  24. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  25. height:100%;
  26. }
  27. .main_box {
  28. font-size: 0;
  29. position: relative;
  30. }
  31. .main_box img {
  32. width: 100%;
  33. }
  34. .container-wrap {
  35. position: absolute;
  36. width: 80%;
  37. top: 38%;
  38. left: 50%;
  39. -webkit-transform: translate(-50%, 0);
  40. transform: translate(-50%, 0);
  41. }
  42. .positon{
  43. top: 50%;
  44. }
  45. .recharge-wrap {
  46. margin-bottom: 0.2rem;
  47. }
  48. .recharge-wrap .recharge-item:not(:last-child) {
  49. margin-bottom: 0.2rem;
  50. }
  51. </style>
  52. </head>
  53. <body>
  54. <main class="main_box">
  55. <img src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/bg.jpg" alt="" />
  56. <div class="container-wrap {{$is_show_year_order? '':'positon'}}">
  57. <div class="recharge-wrap ">
  58. <div class="recharge-item">
  59. <img
  60. src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/1.png"
  61. data-src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/1.png"
  62. data-active="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/1_focus.png"
  63. data-active-status="0"
  64. data-href="{{$url[0]}}"
  65. alt=""
  66. />
  67. </div>
  68. <div class="recharge-item cur">
  69. <img
  70. src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/2_focus.png"
  71. data-src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/2.png"
  72. data-active="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/2_focus.png"
  73. data-active-status="1"
  74. data-href="{{$url[1]}}"
  75. alt=""
  76. />
  77. </div>
  78. @if($is_show_year_order)
  79. <div class="recharge-item">
  80. <img
  81. src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/3.png"
  82. data-src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/3.png"
  83. data-active="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/3_focus.png"
  84. data-active-status="0"
  85. data-href="{{$url[2]}}"
  86. alt=""
  87. />
  88. </div>
  89. @endif
  90. </div>
  91. <div class="to-recharge">
  92. @if($code == 1)
  93. <!-- 活动未开始 -->
  94. <img src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/undone.png" alt="" data-href="{{$url[1]}}" />
  95. @elseif($code == 0)
  96. <!-- 活动进行中 -->
  97. <img id="pay" src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/doing.png" alt="" data-href="{{$url[1]}}" />
  98. @elseif($code == 2)
  99. <!-- 活动结束 -->
  100. <img src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/over.png" alt="" data-href="{{$url[1]}}" />
  101. @endif
  102. </div>
  103. </div>
  104. </main>
  105. </body>
  106. <script src="//cdn-novel.iycdm.com/static/jquery-3.4.1.min.js"></script>
  107. <script>
  108. // 按钮点击
  109. $(".recharge-wrap").delegate("img", "click", function() {
  110. $(".recharge-item").removeClass("cur");
  111. $(this)
  112. .parent()
  113. .addClass("cur");
  114. var active = $(this).attr("data-active");
  115. var is_active = $(this).attr("data-active-status");
  116. if (!+is_active) {
  117. reset();
  118. $(this).attr("src", active);
  119. $(this).attr("data-active-status", 1);
  120. $("#pay").attr("data-href",$(this).attr("data-href"))
  121. }
  122. });
  123. // 重置
  124. function reset() {
  125. var imgs = $(".recharge-item img");
  126. for (var i = 0; i < imgs.length; i++) {
  127. (function(index) {
  128. var img = imgs[i];
  129. var src = $(img).attr("data-src");
  130. $(img).attr("src", src);
  131. $(img).attr("data-active-status", 0);
  132. })(i);
  133. }
  134. }
  135. // 重置
  136. $(".to-recharge").delegate("#pay", "click", function() {
  137. var url = $(this).attr("data-href");
  138. if(url){
  139. location.href=url
  140. }else{
  141. return false;
  142. }
  143. });
  144. </script>
  145. </html>