newUserOtherActivity.blade.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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. height: 100%;
  11. background: linear-gradient(to bottom, #ff933c 0%, #ff0000 100%);
  12. overflow: hidden;
  13. position: fixed;
  14. }
  15. html,
  16. body {
  17. margin: 0 auto;
  18. padding: 0;
  19. max-width: 450px;
  20. font-size: 100px;
  21. }
  22. a {
  23. color: currentColor;
  24. text-decoration: none;
  25. }
  26. p {
  27. margin: 0;
  28. }
  29. .main_box {
  30. font-size: 0;
  31. /* position: relative; */
  32. height: 100%;
  33. }
  34. .main_box img {
  35. width: 100%;
  36. }
  37. .recharge-list {
  38. position: absolute;
  39. width: 90%;
  40. top: 22%;
  41. left: 50%;
  42. transform: translateX(-50%);
  43. background: white;
  44. padding: 0.1rem 0;
  45. height: 10rem;
  46. border-radius: 0.15rem;
  47. }
  48. .active-time {
  49. font-size: 0.13rem;
  50. color: #ff6060;
  51. font-weight: bold;
  52. text-align: center;
  53. padding: 0.15rem 0;
  54. }
  55. .recharge-item-box {
  56. display: flex;
  57. }
  58. .recharge-item {
  59. margin-bottom: 0.2rem;
  60. display: block;
  61. color: #1b5c00;
  62. width: 100%;
  63. height: 0.75rem;
  64. background: center / contain url(https://cdn-novel.iycdm.com/h5/activity-newuserv2/btn1.png) no-repeat;
  65. -webkit-tap-highlight-color: transparent;
  66. }
  67. .small-bt-left {
  68. margin-left: 0.15rem;
  69. margin-right: 0.05rem;
  70. }
  71. .small-bt-right {
  72. margin-right: 0.15rem;
  73. margin-left: 0.05rem;
  74. }
  75. .item2 {
  76. background-image: url(https://cdn-novel.iycdm.com/h5/activity-newuserv2/btn2.png);
  77. }
  78. .item3 {
  79. background-image: url(https://cdn-novel.iycdm.com/h5/activity-newuserv2/btn3.png);
  80. }
  81. .item4 {
  82. background-image: url(https://cdn-novel.iycdm.com/h5/activity-newuserv2/btn4.png);
  83. }
  84. .item1.cur {
  85. background-image: url(https://cdn-novel.iycdm.com/h5/activity-newuserv2/btn1-active.png);
  86. }
  87. .item2.cur {
  88. background-image: url(https://cdn-novel.iycdm.com/h5/activity-newuserv2/btn2-active.png);
  89. }
  90. .item3.cur {
  91. background-image: url(https://cdn-novel.iycdm.com/h5/activity-newuserv2/btn3-active.png);
  92. }
  93. .item4.cur {
  94. background-image: url(https://cdn-novel.iycdm.com/h5/activity-newuserv2/btn4-active.png);
  95. }
  96. .item5 {
  97. background-image: url(https://cdn-novel.iycdm.com/h5/activity-newuserv2/btn5.png);
  98. }
  99. .item5.cur {
  100. background-image: url(https://cdn-novel.iycdm.com/h5/activity-newuserv2/btn5-active.png);
  101. }
  102. .recharge-item span {
  103. color: #ff6000;
  104. }
  105. .recharge-now {
  106. margin: 0 auto;
  107. margin-top: 0.4rem;
  108. width: 100%;
  109. }
  110. .recharge-operator {
  111. font-size: 0.2rem;
  112. display: flex;
  113. justify-content: space-between;
  114. align-items: center;
  115. }
  116. .recharge-operator a {
  117. color: #0f5eba;
  118. font-size: 0.16rem;
  119. border-radius: 0.4rem;
  120. border: 2px solid #0f5eba;
  121. padding: 0.1rem 0.2rem;
  122. text-align: center;
  123. width: 33%;
  124. }
  125. .recharge-operator .to-read {
  126. background: #0f5eba;
  127. color: #fff;
  128. }
  129. .tips-box {
  130. position: absolute;
  131. width: 100%;
  132. top: 24%;
  133. left: 50%;
  134. transform: translateX(-50%);
  135. font-weight: bold;
  136. }
  137. .tips-box .tips-time,
  138. .tips-box .no-first {
  139. font-size: 0.14rem;
  140. text-align: center;
  141. margin-top: 5px;
  142. color: #183c6e;
  143. }
  144. .bottom-tips {
  145. color: #183c6e;
  146. font-size: 0.14rem;
  147. text-align: center;
  148. display: flex;
  149. align-items: center;
  150. justify-content: center;
  151. }
  152. .bottom-tips .tips-title {
  153. margin: 0px 10px;
  154. }
  155. .bottom-tips:before {
  156. content: "";
  157. display: block;
  158. width: 35px;
  159. height: 2px;
  160. background: #183c6e;
  161. }
  162. .bottom-tips:after {
  163. content: "";
  164. display: block;
  165. width: 35px;
  166. height: 2px;
  167. background: #183c6e;
  168. }
  169. .notice {
  170. font-size: 0.12rem;
  171. color: #fcd7a1;
  172. text-align: center;
  173. }
  174. .notice .surplus-time {
  175. font-size: 0.14rem;
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. }
  180. .surplus-time span {
  181. color: #ffb73a;
  182. font-size: 0.18rem;
  183. font-weight: bolder;
  184. margin: 0 0.05rem;
  185. }
  186. .d-none {
  187. display: none;
  188. }
  189. </style>
  190. </head>
  191. <body>
  192. <main class="main_box">
  193. <img src="https://cdn-novel.iycdm.com/h5/activity-newuserv2/beij2.png" alt="" />
  194. <div class="recharge-list">
  195. <div class="active-time">有效时间:{{$start_time}}至{{$end_time}}</div>
  196. <div class="recharge-item-box">
  197. <div class="small-bt-left recharge-item item1" data-href="{{$url['charge'][0]['url']}}"></div>
  198. <div class="small-bt-right recharge-item item2 cur" data-href="{{$url['charge'][1]['url']}}"></div>
  199. </div>
  200. <div class="recharge-item-box">
  201. <div class="small-bt-left recharge-item item3" data-href="{{$url['charge'][2]['url']}}"></div>
  202. <div class="small-bt-right recharge-item item4" data-href="{{$url['charge'][3]['url']}}"></div>
  203. </div>
  204. @if(isset($url['year']))
  205. <div style="padding: 0 .1rem">
  206. <div class="recharge-item item5" data-href="{{$url['year']['url']}}"></div>
  207. </div>
  208. @endif
  209. <div class="recharge-now">
  210. @if($code == 0)
  211. <a href="{{$url['charge'][1]['url']}}" id="pay" class="pay">
  212. <img src="https://cdn-novel.iycdm.com/h5/new-user-20180816/doing.png" alt="">
  213. </a>
  214. @else
  215. <a href="#" id="over" class="over">
  216. <img src="https://cdn-novel.iycdm.com/h5/new-user-20180816/over.png" alt="">
  217. </a>
  218. @endif
  219. </div>
  220. </div>
  221. <input type="hidden" name="" id="cssurl" value="https://cdn-novel.iycdm.com/h5/activity-newuserv2">
  222. </main>
  223. </body>
  224. <script>
  225. var utils = {
  226. hasClass(el, className) {
  227. var reg = new RegExp("(^|\\s)" + className + "(\\s|$)");
  228. return reg.test(el.className);
  229. },
  230. addClass(el, className) {
  231. if (this.hasClass(el, className)) {
  232. return;
  233. }
  234. var newClass = el.className.split(" ");
  235. newClass.push(className);
  236. el.className = newClass.join(" ");
  237. },
  238. removeClass(el, className) {
  239. if (!this.hasClass(el, className)) {
  240. return;
  241. }
  242. var reg = new RegExp("(^|\\s)" + className + "(\\s|$)", "g");
  243. el.className = el.className.replace(reg, " ");
  244. }
  245. };
  246. function clearSelect(target) {
  247. for (var i = 0; i < target.length; i++) {
  248. utils.removeClass(target[i], "cur");
  249. }
  250. }
  251. // 选中点击的充值项
  252. function rechargeSelect() {
  253. var items = document.querySelectorAll(".recharge-item");
  254. for (var i = 0; i < items.length; i++) {
  255. (function(index) {
  256. items[index].addEventListener(
  257. "click",
  258. function() {
  259. clearSelect(items);
  260. utils.addClass(this, "cur");
  261. // 返回点击的index 根据这个index做对应的充值操作吧
  262. var href = this.getAttribute("data-href");
  263. document.querySelector("#pay").setAttribute("href", href);
  264. },
  265. false
  266. );
  267. })(i);
  268. }
  269. }
  270. function init() {
  271. rechargeSelect();
  272. }
  273. function preImage() {
  274. var prefix = document.querySelector("#cssurl").value;
  275. for (var i = 0; i < 5; i++) {
  276. new Image().src = prefix + "/btn" + (i + 1) + ".png";
  277. new Image().src = prefix + "/btn" + (i + 1) + "-active.png";
  278. }
  279. }
  280. preImage();
  281. init();
  282. </script>
  283. </html>