springactivity2019.blade.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta
  6. name="viewport"
  7. content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
  8. />
  9. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  10. <link rel=icon type=image/png href="data:image/png;base64,iVBORw0KGgo=">
  11. <title>金猪贺岁-送平安如意红包</title>
  12. <style>
  13. html,
  14. body {
  15. margin: 0 auto;
  16. padding: 0;
  17. max-width: 450px;
  18. font-size: 100px;
  19. }
  20. p {
  21. padding: 0;
  22. margin: 0;
  23. }
  24. html {
  25. background: #c41f30;
  26. }
  27. .main_box,
  28. .activity_one {
  29. font-size: 0;
  30. position: relative;
  31. }
  32. .main_box img {
  33. width: 100%;
  34. }
  35. .recharge-item {
  36. font-size: 0;
  37. width: 90%;
  38. margin: 0.3rem auto;
  39. }
  40. .list-item__top {
  41. margin-bottom: 0.15rem;
  42. }
  43. .recharge_box {
  44. width: 80%;
  45. margin: 0 auto;
  46. position: absolute;
  47. left: 50%;
  48. transform: translateX(-50%);
  49. top: 48%;
  50. }
  51. .list {
  52. margin-bottom: 0.15rem;
  53. }
  54. .list .list-item__flex {
  55. display: flex;
  56. justify-content: space-between;
  57. align-items: center;
  58. margin-bottom: 0.2rem;
  59. }
  60. .list-item__flex .list-item {
  61. width: 48%;
  62. }
  63. .main_box img,
  64. a {
  65. -webkit-tap-highlight-color: transparent;
  66. text-decoration: none;
  67. color: currentColor;
  68. }
  69. .recharge_box a {
  70. width: 100%;
  71. display: block;
  72. margin: 0 auto;
  73. }
  74. .recharge_box .beginning img {
  75. width: 100%;
  76. }
  77. .to-activity__two {
  78. position: absolute;
  79. bottom: 0.6rem;
  80. right: 0;
  81. width: 1rem;
  82. }
  83. .activity_two__intro {
  84. font-size: 0.12rem;
  85. padding: 0 0.2rem;
  86. color: #fff;
  87. line-height: 1.5;
  88. }
  89. .activity_two__intro p {
  90. margin-bottom: 0.1rem;
  91. }
  92. .activity_two__intro i {
  93. font-style: normal;
  94. color: #ffdc6e;
  95. }
  96. .d_none {
  97. display: none;
  98. }
  99. </style>
  100. </head>
  101. <body>
  102. <main class="main_box">
  103. <div class="activity_one">
  104. <img src="https://cdn-novel.iycdm.com/h5/activity-2019-01-25/bg.jpg" alt="" />
  105. <div class="recharge_box">
  106. <div class="list">
  107. <div class="list-item__flex">
  108. <div class="list-item">
  109. <img
  110. src="https://cdn-novel.iycdm.com/h5/activity-2019-01-25/btn1-active.png"
  111. data-active-src="https://cdn-novel.iycdm.com/h5/activity-2019-01-25/btn1-active.png"
  112. data-src="https://cdn-novel.iycdm.com/h5/activity-2019-01-25/btn1.png"
  113. data-focus="1"
  114. data-href="{{$url[0]}}"
  115. alt=""
  116. />
  117. </div>
  118. <div class="list-item">
  119. <img
  120. src="https://cdn-novel.iycdm.com/h5/activity-2019-01-25/btn2.png"
  121. data-active-src="https://cdn-novel.iycdm.com/h5/activity-2019-01-25/btn2-active.png"
  122. data-src="https://cdn-novel.iycdm.com/h5/activity-2019-01-25/btn2.png"
  123. data-focus="0"
  124. data-href="{{$url[1]}}"
  125. alt=""
  126. />
  127. </div>
  128. </div>
  129. </div>
  130. @if($code == -1)
  131. <!-- 活动未开始 -->
  132. <a href="javascript:void(0)" class="un_begin">
  133. <img src="https://cdn-novel.iycdm.com/h5/activity-2019-01-25/undone.png" alt="" />
  134. </a>
  135. @elseif($code == 0)
  136. <!-- 活动进行中 -->
  137. <a href="{{$url[0]}}" class="beginning" id="paying">
  138. <img src="https://cdn-novel.iycdm.com/h5/activity-2019-01-25/doing.png" alt="" />
  139. </a>
  140. @elseif($code == -2)
  141. <!-- 活动结束 -->
  142. <a href="javascript:void(0)" class="over">
  143. <img src="https://cdn-novel.iycdm.com/h5/activity-2019-01-25/over.png" alt="" />
  144. </a>
  145. @endif
  146. </div>
  147. </div>
  148. </main>
  149. </body>
  150. <script>
  151. var d = document;
  152. var imgs = d.querySelectorAll(".list-item img");
  153. var pay = d.querySelector('#paying');
  154. var key = 0;
  155. for (var i = 0; i < imgs.length; i++) {
  156. (function(index) {
  157. imgs[index].addEventListener(
  158. "click",
  159. function() {
  160. reset();
  161. var active = this.getAttribute("data-active-src");
  162. var un_active = this.getAttribute("data-src");
  163. var is_active = this.getAttribute("data-focus");
  164. var href = this.getAttribute("data-href");
  165. if (is_active === "0") {
  166. // 未勾选
  167. this.setAttribute("data-focus", "1");
  168. this.setAttribute("src", active);
  169. if(pay){
  170. pay.setAttribute('href',href);
  171. }
  172. }
  173. key = index;
  174. },
  175. false
  176. );
  177. })(i);
  178. }
  179. function reset() {
  180. for (var i = 0; i < imgs.length; i++) {
  181. (function(index) {
  182. imgs[index].setAttribute("src", imgs[index].getAttribute("data-src"));
  183. imgs[index].setAttribute("data-focus", "0");
  184. })(i);
  185. }
  186. }
  187. </script>
  188. </html>