<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>半月谈时政百科试题库</title>
    <link rel="stylesheet" href="assets/css/common.css">
    <link rel="stylesheet" href="assets/css/swiper.css">
    <link rel="stylesheet" href="assets/font/iconfont.css">
    <link rel="stylesheet" href="assets/css/index.css?v=1">
    <style>
        .price-class .layui-layer {
            box-shadow: none;
        }
    </style>
</head>
<body>
<div class="index-header">
    <div class="header-top">
        <div class="bx-content header-top-con">
            <div class="floatR">
                <!--        <a href="" class="header-btn">百科使用指南</a>-->
                <a target="_blank" href="user/subscribe.html?page=1&status=bk"
                   class="header-btn yes-login">我的订阅</a>
                <a href="login/login.html" class="header-btn no-login">登录</a>
                <a href="login/register.html" class="header-btn no-login">注册</a>

                <a target="_blank" href="message/list.html?page=1" class="header-msg yes-login"><i
                        class="iconfont iconlingdang"></i>消息(<b>0</b>)</a>
                <a href="javascript:void 0" class="header-user yes-login" onclick="toUserIndex()"><img
                        src="assets/img/test.png" alt="">个人中心</a>
                <a href="javascript:void 0 " class="header-sginout yes-login" onclick="sginOutIndex()">退出</a>
            </div>
        </div>
    </div>
    <div class="bx-content index-search-all">
        <img src="assets/img/indexlogo.png" alt="" class="index-logo">
        <div class="index-search-box">
            <i class="iconfont iconsousuo"></i>
            <input type="text" placeholder="请输入要搜索的内容" id="search">
            <a href="javascript:void 0" onclick="toSearch()">搜 索</a>
        </div>
        <p id="reci"></p>
    </div>
</div>
<div class="bx-content">
    <div class="baike-box">
        <h3 class="index-info-title"><i class="iconfont iconshuxian"></i> 时政百科</h3>
        <div class="baike-list">
            <a target="_blank" href="baike/zhuanti.html?page=1" class="hals-right"><i
                    class="iconfont iconceping"></i>专题</a>
            <a target="_blank" href="baike/redian.html?page=1" class="hals-right"><i
                    class="iconfont iconhuo"></i>时政热点</a>
            <a target="_blank" href="baike/reci.html?page=1" class="hals-right"><i
                    class="iconfont iconyinliugongju-recisousuo"></i>热词</a>
            <a target="_blank" href="baike/jiangtang.html?page=1" class="hals-right"><i
                    class="iconfont iconEjiangtang"></i>时事讲堂</a>
            <a target="_blank" href="baike/shiji.html?page=1"><i class="iconfont icondashiji"></i>大事记</a>
        </div>
    </div>
    <div class="shiti-box">
        <h3 class="index-info-title"><i class="iconfont iconshuxian"></i> 时政试题</h3>
        <div class="shiti-list">
            <a target="_blank" href="shiti/ceping.html?page=1" class="hals-right"><i
                    class="iconfont iconceping1"></i>测评</a>
            <a target="_blank" href="shiti/lianxi.html" class="hals-right"><i
                    class="iconfont iconlianxi"></i>练习</a>
            <a target="_blank" href="shiti/zuti.html" class="hals-right"><i class="iconfont icontiku"></i>组题</a>
            <a target="_blank" href="shiti/jinsai.html"><i class="iconfont icondashiji"></i>竞赛</a>
        </div>
    </div>
    <div class="index-seiper">
        <div class="swiper-container">
            <div class="swiper-wrapper">

                <!--        <div class="swiper-slide">-->
                <!--          <a href="javascript:void 0"><img src="assets/img/banner2.png" alt=""></a>-->
                <!--        </div>-->
                <!--        <div class="swiper-slide">-->
                <!--          <a href="javascript:void 0"><img src="assets/img/banner2.png" alt=""></a>-->
                <!--        </div>-->
            </div>
            <!-- Add Pagination -->
            <div class="swiper-pagination"></div>
        </div>
    </div>
    <div class="ceshi-box">
        <h3 class="index-info-title"><i class="iconfont iconshuxian"></i> 每日一测</h3>
        <div class="ceshi-list">
            <div id="dailyBox">


            </div>
            <button class="index-submit" onclick="dailySubmit()">交卷</button>
        </div>
    </div>
    <div class="time-box">
        <a target="_blank" href="shijuan/week.html?page=1" class="hals-right">周考</a>
        <a target="_blank" href="shijuan/month.html?page=1" class="hals-right">月考</a>
        <a target="_blank" href="shijuan/year.html?page=1" class="hals-right">季考、年考</a>
        <a target="_blank" href="shijuan/ohter.html?page=1">专项答题</a>
    </div>
    <div class="dingyue-box">
        <a href="baike/dingyue.html" target="_blank"><img src="assets/img/dingyue.png" alt=""></a>
    </div>
</div>
<div class="index-other-shiti">
    <div class="bx-content other-shiti-box">
        <a target="_blank" href="shijuan/all.html?type=0" class="hals-right"><img src="assets/img/index1.png"
                                                                                  alt=""></a>
        <a target="_blank" href="shijuan/all.html?type=1" class="hals-right"><img src="assets/img/index2.png"
                                                                                  alt=""></a>
        <a target="_blank" href="shijuan/all.html?type=2" class="hals-right"><img src="assets/img/index3.png"
                                                                                  alt=""></a>
        <a target="_blank" href="shijuan/all.html?type=3"><img src="assets/img/index4.png" alt=""></a>
    </div>
</div>

<div class="bx-content">
    <div class="hot-box">
        <h3 class="index-info-title"><i class="iconfont iconshuxian"></i> 热门推荐</h3>
        <div class="hot-list">
            <!--      <a href="" class="hot-item hals-right">-->
            <!--        <div class="hot-img">-->
            <!--          <img src="assets/img/test.png" alt="">-->
            <!--        </div>-->
            <!--        <h4 class="hot-tit ovHide">凝聚起上下同心、团结奋进的磅礴力量</h4>-->
            <!--        <p class="hot-desc ovHide2">开学伊始，孩子们迎来了新学期，家长们也迎来了新挑战。</p>-->
            <!--        <div class="hot-label">-->
            <!--          <span>时政讲解</span>-->
            <!--        </div>-->
            <!--      </a>-->
            <!--  -->

        </div>
    </div>
</div>

<div class="index-footer">
    <div class="bx-content">
        <div class="footer-link">
            <a target="_blank" href="login/about.html">关于我们</a>
            <a target="_blank" href="login/lianxi.html">联系我们</a>
        </div>
        <p>主办：半月谈杂志社<span></span>互联网新闻信息服务许可证：1012014004<span></span>网站备案：京公网安备11010702001529号
        </p>
        <p>京ICP备16044242号<span></span>客服电话：010-63106792（9:00-18:00）
            <span></span>编辑信箱：bianji@banyuetan.org<span></span>举报电话：010-63072648
        </p>
        <p>Copyright (C) 半月谈杂志社 2010-2018, All Rights Reserved</p>
    </div>
</div>


<!--<div class="shade" >
<div class="shade-box" style="border:0;width:650px;padding:30px;position:relative">
    <h2 style="text-align: center;    margin-bottom: 40px;    color: #c71521;">系统通知</h2>
 <h3 class="shade-content">由于服务器更新，网站及小程序将于今天22点关闭，预计关闭时间1小时，给您带来的不便敬请谅解。</h3>
     <div class="shade-btn-box">
<a href="javascript:void 0" class="active" onclick="closeTips()">确定</a>
</div>
</div>
</div>-->

<script src="assets/lib/jquery-2.1.4.min.js"></script>
<script src="assets/lib/swiper.min.js"></script>
<script src="assets/lib/common.js"></script>
<script src="assets/js/index.js?v=1"></script>
<script src="assets/lib/layer/layer.js"></script>
<script>
    //function closeTips(){
    //	$('.shade').hide()
    //	window.localStorage.setItem('tips',1)
    //}


    $(function () {
        //var _num = window.localStorage.getItem('tips')
        //if(!_num){
        //	$('.shade').show()
        //}

        //layer.alert("兹定于2025年3月17日20:00至3月18日05:00对系统进行升级维护，维护期间暂停服务，给您带来的不便敬请谅解。",{title:"系统升级维护通知"})
        //showWj();


        if (Token) {
            $('.no-login').hide()
            $('.yes-login').show()
            if (headImg) {
                $('.header-user img').attr('src', headImg)
            } else {
                $('.header-user img').hide();
            }
            msg();
        } else {
            $('.no-login').show()
            $('.yes-login').hide()
        }

        getDaily(); //  每日一测
        getSwiper();
        getHot();
        reci();
        msg();


        // showMyPrice();
        // showMyPrice();
        // showJs();
        //showPriceAlert();
        // showMyPriceAlert();
    })


    var swiper = new Swiper('.swiper-container', {
        loop: true,
        autoplay: true, //等同于以下设置
        pagination: {
            el: '.swiper-pagination',
        },
    });

    /**
     * 显示竞赛弹出
     */
    function showJs() {
        // showAlert();
        // return;
        const today = new Date().toISOString().split('T')[0];
        const lastShownDate = window.localStorage.getItem('lastShownJsDate');
        if (!lastShownDate || lastShownDate !== today) {
            showAlert();
        }
    }


    function showWj(){

        // 每天弹出一次 点击关闭按钮后 今日不再弹出
        let today = new Date().toISOString().split('T')[0];
        // console.log(today)
        let lastShown = localStorage.getItem('wjLastShownDate');
        // console.log(lastShown)

        // 如果从未显示过，或上次显示日期不是今天
        if (!lastShown || lastShown !== today) {
            layer.ready(function () {
                layer.open({
                    type: 1,
                    skin: 'price-class',
                    title: false,
                    shadeClose: false,
                    shade: 0.2,
                    scrollbar: false,
                    area: ['500px', '500px'],
                    anim: 2,
                    content: '<img src="/assets/img/wj.png" width="500">',
                    cancel: function (index, layero) {
                        layer.close(index)

                        // 存储当前日期
                        const today = new Date().toISOString().split('T')[0];
                        localStorage.setItem('wjLastShownDate', today);

                        return false;
                    },
                    success: function (layero, index) {
                        layer.style(index, {
                            top: '50%',
                            transform: 'translateY(-50%)',
                            background: "transparent",
                            'box-shadow': 'none'
                        });
                    }
                });
            });
        }
    }


    // 名单
    function showPriceAlert() {
        // 是否登录 并且 未弹出过
        if (Token && !window.localStorage.getItem('priceAlert')) {
            showPrice();
        }
    }

    // 是否获奖
    function showMyPriceAlert(){

        if (Token && !window.localStorage.getItem('myPriceAlert')) {

            $.post(urlStr + '/foreRepo/contest/getPrizeMy', {
                token: Token,
                repoId: 32617
            }, function (res) {
                if (res.error == 0) {
                    if (res.row.isPrize == 1) {
                        showMyPrice()
                    }
                }
            }, 'json')
        }

    }


    function showMyPrice() {
        layer.ready(function () {
            layer.open({
                type: 2,
                skin: 'price-class',
                title: false,
                shadeClose: false,
                shade: 0.2,
                scrollbar: false,
                area: ['35%', '80%'],
                anim: 2,
                content: '/showMyPrice.html',
                cancel: function (index, layero) {
                    window.localStorage.setItem('myPriceAlert', 1);
                    layer.close(index)
                    return false;
                },
                success: function (layero, index) {
                    layer.style(index, {
                        top: '50%',
                        transform: 'translateY(-50%)',
                        background: "transparent",
                        'box-shadow': 'none'
                    });
                }
            });
        });
    }

    /**
     * 显示竞赛
     */
    function showPrice() {
        layer.ready(function () {
            // var index = layer.load(2);
            layer.open({
                type: 2,
                skin: 'price-class',
                title: false,
                shadeClose: false,
                shade: 0.2,
                scrollbar: false,
                // area: ['80%', 'auto'],
                area: ['60%', '745px'],
                anim: 2,
                content: '/showPrice.html',
                cancel: function (index, layero) {

                    window.localStorage.setItem('priceAlert', 1);

                    layer.close(index)
                    return false;

                },
                success: function (layero, index) {
                    layer.style(index, {
                        top: '50%',
                        transform: 'translateY(-50%)'
                    });
                }
            });
        });
    }


    function showAlert() {

        layer.ready(function () {
            // var index = layer.load(2);
            layer.open({
                type: 1,
                title: false,
                shadeClose: false,
                shade: 0.2,
                // scrollbar: false,
                // area: ['50%', '80%'],
                area: '50%',
                anim: 2,
                content: '<img src="http://image.bytapp.cn/js1024.png" width="100%" height="100%" title="竞赛">',
                // content: 'http://image.bytapp.cn/js1024.png',
                cancel: function (index, layero) {
                    const today = new Date().toISOString().split('T')[0];
                    window.localStorage.setItem('lastShownJsDate', today);
                    layer.close(index)
                    return false;
                },
                success: function (layero, index) {
                    layer.style(index, {
                        top: '50%',
                        transform: 'translateY(-50%)'
                    });
                }
            });
        });

    }
</script>
</body>
</html>
