<!--
 * @Author: ZhengXiaowei
 * @Date: 2019-09-20 11:06:41
 * @LastEditors: ZhengXiaowei
 * @LastEditTime: 2019-09-20 11:57:13
 * @Description: file content
 -->
<!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" />
    <link rel="stylesheet" href="https://cdn-novel.iycdm.com/crm/activity/css/index.css" />
    <title>国庆活动</title>
</head>

<body>
    <main>
        <div class="main-wrap">
            <img class="bg" src="https://cdn-novel.iycdm.com/crm/activity/imgs/bg.jpg" alt="" />
            <div class="container">
                <div class="sign-list clearfix">
                    @foreach ($sign_configs as $item)
                    <div class="sign-item">
                        <p class="title">累计第{{$item['day']}}天</p>
                        <!-- 强提醒金额额外添加class strong -->
                        <p class="content {{$item['is_strong']?'strong':''}}"><i>{{$item['bonus']}}</i>书币</p>
                        <!-- 已领取显示图片 -->
                        @if ($item['is_get'])
                        <img src="https://cdn-novel.iycdm.com/crm/activity/imgs/get.png" alt="" />
                        @endif
                    </div>
                    @endforeach
                </div>
                <div class="special-charge">
                    <img src="https://cdn-novel.iycdm.com/crm/activity/imgs/10000.png" alt="" />
                    @if ($is_begin && !$is_end)
                    <a href="{{$pay_link}}" class="area-click"></a>
                    @endif
                </div>
                <div class="continue-read">
                    <a href="{{$continue_link}}">继续阅读</a>
                </div>
            </div>
        </div>
        <div class="repeat-bg"></div>
    </main>
    <div class="dialog-wrap" style="display:none">
        @if ($is_end || !$is_begin)
        <div class="dialog-content">
            <img src="https://cdn-novel.iycdm.com/crm/activity/imgs/end.png" alt="" />
            <span class="close-area"></span>
        </div>
        @else
        <div class="dialog-content">
            <img src="https://cdn-novel.iycdm.com/crm/activity/imgs/d_bg.png" alt="" />
            <p class="user-get">获得<i>{{$bonus}}</i>书币</p>
            <p class="notice">今日获重礼，明日亦继续</p>
            <span class="close-area"></span>
        </div>
        @endif
    </div>
</body>
<script>
    var doc = document;
    var bg_height = doc.querySelector(".main-wrap").clientHeight;
    // 背景填充
    var doc = document;
    var bg_image = doc.querySelector(".main-wrap .bg");
    bg_image.onload = function() {
      var bg_height = doc.querySelector(".main-wrap").clientHeight;
      var user_screen = 0;
      user_screen =
        window.screen.height ||
        window.innerHeight ||
        doc.documentElement.clientHeight;
      // 背景填充
      if (user_screen > bg_height) {
        doc.querySelector(".repeat-bg").style.height =
          user_screen - bg_height + "px";
      }
    };
    var is_sign = {{$is_sign?1:0}};
    var is_begin = {{$is_begin?1:0}}
    var is_end = {{$is_end?1:0}}
    setTimeout(() => {
        if(!is_begin||!is_sign || is_end)
        {
        doc.querySelector('.dialog-wrap').style.display='block';
        }
    }, 500);

    var close_btn = doc.querySelector(".close-area");
    var dialog_wrap = doc.querySelector(".dialog-wrap");
    close_btn.addEventListener(
        "click",
        function(e) {
            e.stopPropagation();
            dialog_wrap.style.display = "none";
        },
        false
    );
</script>

</html>