yearactivityV2.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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 .coupon-box {
  29. background: #fff5f4;
  30. }
  31. .main_box .intro {
  32. font-size: 0.12rem;
  33. line-height: 0.2rem;
  34. color: #c9391c;
  35. text-indent: 2em;
  36. padding: 0.1rem;
  37. text-align: center;
  38. margin-bottom: 0.1rem;
  39. }
  40. .intro span {
  41. font-size: 0.16rem;
  42. display: block;
  43. }
  44. .intro span.weight {
  45. font-weight: bolder;
  46. margin-top: 0.05rem;
  47. }
  48. .main_box .coupon {
  49. width: 90%;
  50. margin: 0 auto;
  51. }
  52. .main_box .gray {
  53. color: #b4b4b4;
  54. font-size: 0.14rem;
  55. }
  56. .main_box .gray span {
  57. color: #ff3728;
  58. font-weight: bolder;
  59. }
  60. .purchase {
  61. display: block;
  62. width: 90%;
  63. margin: 0 auto 0.2rem;
  64. }
  65. .main_box .strong {
  66. font-size: 0.16rem;
  67. font-weight: 800;
  68. color: #fe7b27;
  69. margin: 0.1rem;
  70. }
  71. .book-list {
  72. padding: 0.1rem 0;
  73. background: #fff;
  74. }
  75. .book-list .book-list__title {
  76. font-size: 0.16rem;
  77. color: #000;
  78. display: flex;
  79. justify-content: flex-start;
  80. align-items: center;
  81. padding: 0 0.1rem;
  82. }
  83. .book-list__title::before {
  84. content: "";
  85. display: inline-block;
  86. vertical-align: sup;
  87. width: 0.04rem;
  88. height: 0.16rem;
  89. border-radius: 4px;
  90. background: #ff7326;
  91. margin-right: 0.1rem;
  92. }
  93. .book-list__title span {
  94. font-size: 0.14rem;
  95. color: #fe4c3f;
  96. margin-left: 0.1rem
  97. }
  98. .book-list__container {
  99. padding: 0 0.1rem;
  100. font-size: 0.14rem;
  101. }
  102. .book-item {
  103. margin-bottom: 0.1rem;
  104. }
  105. .book-item h3 {
  106. font-weight: normal;
  107. font-size: 0.16rem;
  108. }
  109. .book-item span {
  110. background: #ffe0e1;
  111. color: #ff7474;
  112. font-size: 0.12rem;
  113. margin-right: 0.05rem;
  114. padding: 0.02rem 0.06rem;
  115. border-radius: 4px;
  116. display: inline-block;
  117. margin-top: 0.1rem;
  118. }
  119. .book-item .book-intro {
  120. text-align: left;
  121. color: #999;
  122. text-overflow: ellipsis;
  123. overflow: hidden;
  124. white-space: nowrap;
  125. }
  126. .jiezhang {
  127. height: 0.8rem;
  128. }
  129. .jiezhang-box {
  130. position: fixed;
  131. bottom: 0;
  132. left: 0;
  133. width: 100%;
  134. height: 0.6rem;
  135. background: #fff;
  136. font-size: 0.14rem;
  137. display: flex;
  138. justify-content: space-between;
  139. align-items: center;
  140. z-index: 9;
  141. }
  142. .jiezhang-box .pay-money {
  143. flex: 1;
  144. display: flex;
  145. justify-content: space-around;
  146. align-items: center;
  147. border-top: 1px solid #d7d7d7;
  148. }
  149. .pay-money .m {
  150. font-size: 0.2rem;
  151. font-weight: bold;
  152. color: #ff4a27;
  153. }
  154. .pay-money .u {
  155. color: #999;
  156. }
  157. .pay-money i {
  158. font-style: normal;
  159. color: #ff4a27;
  160. font-weight: bold;
  161. }
  162. .pay-money .m span {
  163. font-size: 0.14rem;
  164. margin-right: 0.05rem;
  165. }
  166. .pay-money .u span {
  167. width: 0.18rem;
  168. height: 0.18rem;
  169. display: inline-block;
  170. border: 1px solid #ff4a27;
  171. border-radius: 50%;
  172. position: relative;
  173. vertical-align: text-bottom;
  174. }
  175. .pay-money .u span.cur:after {
  176. content: "";
  177. position: absolute;
  178. top: 50%;
  179. left: 50%;
  180. transform: translate(-50%, -50%);
  181. width: 0.14rem;
  182. height: 0.14rem;
  183. border-radius: 50%;
  184. background: #ff3728;
  185. }
  186. .pay-money,
  187. .pay {
  188. height: inherit;
  189. }
  190. .jiezhang-box .pay {
  191. width: 30%;
  192. background: #ff4a27;
  193. color: #fff;
  194. font-size: 0.16rem;
  195. font-weight: bold;
  196. display: flex;
  197. flex-direction: column;
  198. justify-content: center;
  199. align-items: center;
  200. }
  201. .pay span {
  202. font-size: 0.12rem;
  203. border: 1px solid #fff;
  204. border-radius: 20px;
  205. padding: 0 0.1rem;
  206. }
  207. .coupon-dialog {
  208. position: fixed;
  209. top: 0;
  210. bottom: 0;
  211. left: 0;
  212. right: 0;
  213. background: rgba(0, 0, 0, 0.3);
  214. overflow: hidden;
  215. z-index: 99;
  216. }
  217. .dialog-box {
  218. position: absolute;
  219. width: 90%;
  220. top: 50%;
  221. left: 50%;
  222. transform: translate(-50%, -50%);
  223. }
  224. .dialog-box img {
  225. width: 100%;
  226. }
  227. .dialog-box .close {
  228. background: url(https://cdn-novel.iycdm.com/h5/activity-2018-10-26/close.png) center / contain no-repeat;
  229. width: 0.32rem;
  230. height: 0.32rem;
  231. margin: 0 auto;
  232. }
  233. .book-item__multi {
  234. display: flex;
  235. justify-content: flex-start;
  236. align-items: flex-start;
  237. border-bottom: 1px solid #d7d7d7;
  238. padding: 0 0 0.2rem;
  239. }
  240. .book-item__multi img {
  241. width: 30%;
  242. }
  243. .book-item__multi .book-intro__multi {
  244. padding-left: 0.2rem;
  245. }
  246. .book-item__multi .multi-intro {
  247. line-height: 1.6;
  248. -webkit-line-clamp: 3;
  249. display: -webkit-box;
  250. -webkit-box-orient: vertical;
  251. overflow: hidden;
  252. color: #999;
  253. }
  254. .d-none {
  255. display: none;
  256. }
  257. </style>
  258. </head>
  259. <body>
  260. <main class="main_box">
  261. <div class="banner">
  262. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-10-26/banner.jpg" alt="">
  263. </div>
  264. <div class="coupon-box">
  265. <p class="intro">
  266. <span>原价365,领券立减50元,仅需315元</span>
  267. <span class="weight">每天0.8元,全年免费看</span>
  268. </p>
  269. <div class="coupon" data-value="{{$discount}}">
  270. @if($discount == 50)
  271. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-10-26/coupon_pick.png" alt="">
  272. @else
  273. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-10-26/coupon_pick_80.png" alt="">
  274. @endif
  275. </div>
  276. </div>
  277. <div class="coupon-box">
  278. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-10-26/banner2.png" alt="" style="padding-bottom:0.2rem">
  279. </div>
  280. <div class="book-list">
  281. <h3 class="book-list__title">榜单精选
  282. <span>海量小说任意看</span>
  283. </h3>
  284. <div class="book-list__container">
  285. <div class="book-item book-item__multi">
  286. <img src="{{$books[0]['cover_url']}}" alt="">
  287. <div class="book-intro__multi">
  288. <h3>{{$books[0]['book_name']}}</h3>
  289. <p class="multi-intro">
  290. {{$books[0]['book_summary']}}
  291. </p>
  292. </div>
  293. </div>
  294. @foreach($books as $k=>$v)
  295. @if($k>=1)
  296. <div class="book-item">
  297. <h3><span>{{$v['book_category']}}</span>{{$v['book_name']}}</h3>
  298. <p class="book-intro">{{$v['book_summary']}}</p>
  299. </div>
  300. @endif
  301. @endforeach
  302. </div>
  303. </div>
  304. <div class="jiezhang">
  305. <div class="jiezhang-box">
  306. <div class="pay-money">
  307. <p class="m"><span>¥</span>365</p>
  308. <p class="u"><span></span> 使用<i>{{$discount}}</i>元优惠券</p>
  309. </div>
  310. <div class="pay">
  311. <p>立即订购</p>
  312. </div>
  313. </div>
  314. </div>
  315. </main>
  316. <div class="coupon-dialog" style="display:none">
  317. <div class="dialog-box">
  318. @if($discount == 80)
  319. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-10-26/dialog80.png" alt="">
  320. @else
  321. <img src="https://cdn-novel.iycdm.com/h5/activity-2018-10-26/dialog50.png" alt="">
  322. @endif
  323. <div class="close"></div>
  324. </div>
  325. </div>
  326. </body>
  327. <script>
  328. var isget = {{$is_get}}
  329. isget = parseInt(isget)
  330. var doc = document
  331. var d = doc.querySelector('.coupon-dialog')
  332. var c = doc.querySelector('.close')
  333. var m = doc.querySelector('.m')
  334. var v = doc.querySelector('.coupon')
  335. var u = doc.querySelector('.u')
  336. var e = doc.querySelector('.u span')
  337. var p = doc.querySelector('.pay')
  338. c.addEventListener('click', function (e) {
  339. e.stopPropagation()
  340. d.style.display = 'none'
  341. closeDialog()
  342. }, false)
  343. // 是否使用优惠券
  344. u.addEventListener('click', function () {
  345. if (e.classList.value) {
  346. e.classList = ''
  347. m.innerHTML = '<span>¥</span>365'
  348. } else {
  349. e.classList = 'cur'
  350. var l = 365 - v.getAttribute('data-value')
  351. m.innerHTML = '<span>¥</span>' + l
  352. }
  353. }, false)
  354. // 订购
  355. p.addEventListener('click', function () {
  356. if (e.classList.value) {
  357. // 使用优惠券
  358. var url = "{!! $coupons_url !!}"
  359. if(url){
  360. location.href = url;
  361. }
  362. console.log('use')
  363. } else {
  364. // 不使用优惠券
  365. var url = "{!! $url !!}"
  366. if(url){
  367. location.href = url;
  368. }
  369. console.log('dont')
  370. }
  371. }, false)
  372. function showDialog() {
  373. var s = document.body.style
  374. s.overflow = 'hidden'
  375. d.style.display = 'block'
  376. // ajax 自动打开领取框
  377. }
  378. function closeDialog() {
  379. document.body.style.overflow = ''
  380. }
  381. if(!isget){
  382. showDialog()
  383. }
  384. </script>
  385. </html>