123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- <!--
- /**
- * Created by PhpStorm.
- * User: z-yang
- * Date: 2019/9/25
- * Time: 15:38
- */
- -->
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
- <meta http-equiv="X-UA-Compatible" content="ie=edge" />
- <title>国庆特惠</title>
- <style>
- html,
- body {
- margin: 0 auto;
- padding: 0;
- max-width: 450px;
- font-size: 100px;
- background: #c9392e;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- height:100%;
- }
- .main_box {
- font-size: 0;
- position: relative;
- }
- .main_box img {
- width: 100%;
- }
- .container-wrap {
- position: absolute;
- width: 80%;
- top: 38%;
- left: 50%;
- -webkit-transform: translate(-50%, 0);
- transform: translate(-50%, 0);
- }
- .positon{
- top: 50%;
- }
- .recharge-wrap {
- margin-bottom: 0.2rem;
- }
- .recharge-wrap .recharge-item:not(:last-child) {
- margin-bottom: 0.2rem;
- }
- </style>
- </head>
- <body>
- <main class="main_box">
- <img src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/bg.jpg" alt="" />
- <div class="container-wrap {{$is_show_year_order? '':'positon'}}">
- <div class="recharge-wrap ">
- <div class="recharge-item">
- <img
- src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/1.png"
- data-src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/1.png"
- data-active="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/1_focus.png"
- data-active-status="0"
- data-href="{{$url[0]}}"
- alt=""
- />
- </div>
- <div class="recharge-item cur">
- <img
- src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/2_focus.png"
- data-src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/2.png"
- data-active="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/2_focus.png"
- data-active-status="1"
- data-href="{{$url[1]}}"
- alt=""
- />
- </div>
- @if($is_show_year_order)
- <div class="recharge-item">
- <img
- src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/3.png"
- data-src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/3.png"
- data-active="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/3_focus.png"
- data-active-status="0"
- data-href="{{$url[2]}}"
- alt=""
- />
- </div>
- @endif
- </div>
- <div class="to-recharge">
- @if($code == 1)
- <!-- 活动未开始 -->
- <img src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/undone.png" alt="" data-href="{{$url[1]}}" />
- @elseif($code == 0)
- <!-- 活动进行中 -->
- <img id="pay" src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/doing.png" alt="" data-href="{{$url[1]}}" />
- @elseif($code == 2)
- <!-- 活动结束 -->
- <img src="https://cdn-novel.iycdm.com/h5/activity-2019-09-25/over.png" alt="" data-href="{{$url[1]}}" />
- @endif
- </div>
- </div>
- </main>
- </body>
- <script src="//cdn-novel.iycdm.com/static/jquery-3.4.1.min.js"></script>
- <script>
- // 按钮点击
- $(".recharge-wrap").delegate("img", "click", function() {
- $(".recharge-item").removeClass("cur");
- $(this)
- .parent()
- .addClass("cur");
- var active = $(this).attr("data-active");
- var is_active = $(this).attr("data-active-status");
- if (!+is_active) {
- reset();
- $(this).attr("src", active);
- $(this).attr("data-active-status", 1);
- $("#pay").attr("data-href",$(this).attr("data-href"))
- }
- });
- // 重置
- function reset() {
- var imgs = $(".recharge-item img");
- for (var i = 0; i < imgs.length; i++) {
- (function(index) {
- var img = imgs[i];
- var src = $(img).attr("data-src");
- $(img).attr("src", src);
- $(img).attr("data-active-status", 0);
- })(i);
- }
- }
- // 重置
- $(".to-recharge").delegate("#pay", "click", function() {
- var url = $(this).attr("data-href");
- if(url){
- location.href=url
- }else{
- return false;
- }
- });
- </script>
- </html>
|