yearactivity.blade.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>七月年中大回馈-全站小说随心看</title>
  8. <style>
  9. html,
  10. body {
  11. margin: 0 auto;
  12. padding: 0;
  13. max-width: 450px;
  14. font-size: 100px;
  15. }
  16. p {
  17. margin: 0;
  18. padding: 0;
  19. text-align: center;
  20. }
  21. .main_box {
  22. font-size: 0;
  23. position: relative;
  24. }
  25. .main_box img {
  26. width: 100%;
  27. }
  28. .main_box .intro {
  29. font-size: 0.18rem;
  30. line-height: 0.22rem;
  31. color: #612e24;
  32. text-indent: 2em;
  33. margin: 0.1rem;
  34. /*font-weight: 600;*/
  35. text-align: left;
  36. }
  37. .main_box .coupon {
  38. width: 90%;
  39. margin: 0 auto;
  40. }
  41. .main_box .coupon img{
  42. pointer-events: none;
  43. }
  44. .main_box .gray {
  45. color: #b4b4b4;
  46. font-size: 0.14rem;
  47. }
  48. .main_box .gray span {
  49. color: #ff3728;
  50. font-weight: bolder;
  51. }
  52. .purchase {
  53. display: block;
  54. width: 90%;
  55. margin: 0 auto 0.2rem;
  56. }
  57. .main_box .strong {
  58. font-size: 0.16rem;
  59. font-weight: 800;
  60. color: #fe7b27;
  61. margin: 0.1rem;
  62. }
  63. .book-list {
  64. padding: 0.2rem 0;
  65. background: #fff5f4;
  66. }
  67. .book-list h3 {
  68. font-size: 0.16rem;
  69. color: #000;
  70. display: flex;
  71. justify-content: flex-start;
  72. align-items: center;
  73. }
  74. h3::before {
  75. content: "";
  76. display: inline-block;
  77. vertical-align: sup;
  78. width: 0.04rem;
  79. height: 0.16rem;
  80. border-radius: 4px;
  81. background: #ff7326;
  82. margin-right: 0.1rem;
  83. }
  84. h3 span {
  85. font-size: 0.14rem;
  86. color: #fe4c3f;
  87. margin-left: 0.1rem
  88. }
  89. .book-list__container {
  90. display: flex;
  91. justify-content: space-between;
  92. align-items: center;
  93. flex-flow: row wrap;
  94. padding: 0 0.1rem;
  95. }
  96. .book-item {
  97. width: 28%;
  98. margin-bottom: 0.1rem;
  99. }
  100. .book-item span {
  101. background: #ffe0e1;
  102. color: #ff7474;
  103. font-size: 0.12rem;
  104. margin-right: 0.05rem;
  105. padding: 0.02rem 0.06rem;
  106. border-radius: 20px;
  107. display: inline-block;
  108. margin-top: 0.1rem;
  109. }
  110. </style>
  111. </head>
  112. <body>
  113. <main class="main_box">
  114. <div class="banner">
  115. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/banner.jpg" alt="">
  116. </div>
  117. <p class="intro">
  118. 365天内,全站小说任你畅读!一站式阅读所有小说,无需额外付费!不是每个人都像你这么幸运哦,时间有限,快使用优惠券成为最尊贵的VIP吧~
  119. </p>
  120. <input type="hidden" name="is_get" value="{{$is_get}}">
  121. @if($code == 0 && isset($is_get) && !empty($is_get))
  122. <div class="coupon" data-active="1">
  123. <!-- 已领取领取 -->
  124. @if($discount == 50)
  125. {{--//http://zhuishuyun.oss-cn-hangzhou.aliyuncs.com/h5/activity-2018-05-25/2.png--}}
  126. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/2.png" alt="">
  127. @elseif($discount == 80)
  128. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/5.png" alt="">
  129. @else
  130. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/2.png" alt="">
  131. @endif
  132. </div>
  133. @elseif($code == 3 && isset($is_get) && !empty($is_get))
  134. <div class="coupon" data-active="1">
  135. <!-- 已领取领取 -->
  136. @if($discount == 50)
  137. {{--//http://zhuishuyun.oss-cn-hangzhou.aliyuncs.com/h5/activity-2018-05-25/2.png--}}
  138. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/2.png" alt="">
  139. @elseif($discount == 80)
  140. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/5.png" alt="">
  141. @else
  142. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/2.png" alt="">
  143. @endif
  144. </div>
  145. @elseif($code == 0)
  146. <div class="coupon" data-active="0">
  147. <!-- 待领取 -->
  148. @if($discount == 50)
  149. {{--//http://zhuishuyun.oss-cn-hangzhou.aliyuncs.com/h5/activity-2018-05-25/2.png--}}
  150. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/1.png" alt="">
  151. @elseif($discount == 80)
  152. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/4.png" alt="">
  153. @else
  154. <img src="https://cdn-novel.iycdm.com/h5/year_coupon_unpick_change.png" alt="">
  155. @endif
  156. </div>
  157. @else
  158. <div class="coupon" data-active="1">
  159. <!-- 待领取 -->
  160. @if($discount == 50)
  161. {{--//http://zhuishuyun.oss-cn-hangzhou.aliyuncs.com/h5/activity-2018-05-25/2.png--}}
  162. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/1.png" alt="">
  163. @elseif($discount == 80)
  164. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/4.png" alt="">
  165. @else
  166. <img src="https://cdn-novel.iycdm.com/h5/year_coupon_unpick_change.png" alt="">
  167. @endif
  168. </div>
  169. @endif
  170. @if($discount == 50)
  171. <p class="gray">原价365元,领券立减50元,仅需<span>315</span>元</p>
  172. <p class="strong">每天0.8元,全年免费看</p>
  173. @elseif($discount == 80)
  174. <p class="gray">原价365元,领券立减80元,仅需<span>285</span>元</p>
  175. <p class="strong">每天0.7元,全年免费看</p>
  176. @endif
  177. <div>
  178. @if($code == 0)
  179. <!-- 活动进行中 -->
  180. <a class="purchase doing" href="{{$url}}" id="js-purchase-doing">
  181. {{-- <img src="https://cdn-novel.iycdm.com/h5/year_doing.png" alt="">--}}
  182. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-09-14/button.png" alt="">
  183. </a>
  184. @elseif($code == 1)
  185. <!-- 活动未开始 -->
  186. <a class="purchase undone " href="#">
  187. <img src="https://cdn-novel.iycdm.com/h5/year_undone.png" alt="">
  188. </a>
  189. @elseif($code == 2)
  190. <!-- 活动结束 -->
  191. <a class="purchase over " href="#">
  192. <img src="https://cdn-novel.iycdm.com/h5/year_over.png" alt="">
  193. </a>
  194. @elseif($code == 3)
  195. <!-- 已订购 -->
  196. <a class="purchase done " href="#">
  197. <img src="https://cdn-novel.iycdm.com/h5/year_done.png" alt="">
  198. </a>
  199. @endif
  200. </div>
  201. <div class="book-list">
  202. <h3>榜单精选
  203. <span>海量小说任意看</span>
  204. </h3>
  205. <div class="book-list__container">
  206. @foreach($books as $book)
  207. <a class="book-item" href="/detail?id={{$book['book_id']}}">
  208. <img src="{{$book['cover_url']}}" alt="">
  209. <span>{{$book['book_category']}}</span>
  210. </a>
  211. @endforeach
  212. </div>
  213. </div>
  214. </main>
  215. </body>
  216. <script src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  217. <script>
  218. var is_get = {{$is_get}};
  219. $('#js-purchase-doing').on('click',function () {
  220. if(is_get != 1){
  221. alert('亲还未领取50元书券哦,领券支付更优惠!');
  222. return false;
  223. }
  224. })
  225. var coupon = document.querySelector('.coupon');
  226. coupon.addEventListener('click', function () {
  227. _this = this
  228. var active = parseInt(this.getAttribute('data-active'));
  229. if (!active) {
  230. $.ajax({
  231. 'url':'/api/activity/getCoupons',
  232. 'type':'post',
  233. 'data':{'activity_id':"{{$activity_id}}"},
  234. 'success':function(res){
  235. var type = {{$discount}}
  236. if(type == 50){
  237. _this.children[0].setAttribute('src', 'https://cdn-novel.iycdm.com/h5/activity-2018-09-14/2.png');
  238. }else{
  239. _this.children[0].setAttribute('src', 'https://cdn-novel.iycdm.com/h5/activity-2018-09-14/5.png');
  240. }
  241. _this.setAttribute('data-active', 1);
  242. is_get = 1;
  243. $('#js-purchase-doing').attr('href',"{!! $coupons_url !!}");
  244. //location.reload()
  245. }
  246. });
  247. }
  248. }, false)
  249. </script>
  250. </html>