<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
        name="viewport">
    <title>
            {% if post.seotitle %} {{post.title}} {% else %} {{post.title}}_{{'CMS_WEBNAME'|sysconfig}} {% endif %}
    </title>
    <meta name="keywords" content="{{post.keywords}}" />
    <meta name="description" content="{{post.description}}" />
    <link rel="stylesheet" href="{{'CMS_BASEHOST'|sysconfig}}/static/css/style.css" media="all">
    <script type="text/javascript" src="{{'CMS_BASEHOST'|sysconfig}}/static/js/ad.js"></script>
    <script type="text/javascript" src="{{'CMS_BASEHOST'|sysconfig}}/static/js/jquery.min.js"></script>

</head>

<body>
    <script>
        site();
    </script>
    {% include "/index/common/header.html" %}<div id="tad">
    <script>
        tjs();
    </script>
    </div>

    <div class="box mt10">
        <div class="fl_640">
            <div class="bread" style="padding:12px 20px;"><a href="/">{{'CMS_INDEXNAME'|sysconfig}}</a> >
                {{bread|safe}}</div>
            <h1 class="arct" style="padding-left:20px;padding-right:20px;">{{post.title}}</h1>
                <script>
                    djs1();
                </script>
            <div class="content">
                {{post.content|safe}}
                <div class="dad2">
                    <script>
                        djs2();
                    </script>
                </div>
                <div class="dinfo">
                    <span class="fr">下一篇：{% if previous_article %}
                        <a
                            href="/p/{{previous_article.id}}">{{previous_article.title}}</a>{% else %} 没有了 {% endif %}</span>
                    <div class="cl"></div>
                </div>
            </div>
            <div class="dad3">
                <script>
                    djs3({{post.id}});
                </script>
            </div>
        </div><!-- fl_640 end -->

        <div class="fr_300">
            <div id="rad1">
                <script>
                    rjs1();
                </script>
            </div>
            <div class="side">
                <div class="stit">
                    <h2>推荐阅读</h2><a
                        href="javascript:getmore({limit:5,type_id:{{post.id}},tuijian:1,mode:1,orderby:'rand'});"
                        class="more">换一换</a>
                    <div class="cl"></div>
                </div>
                <ul class="uli chs" id="xglist">{% for row in relate_zuixin_list %}
                    <li><a
                            href="{{row.id|getArticleDetailUrl}}">{{row.title}}</a>
                    </li>{% endfor %}</ul>
                <div class="cl"></div>
            </div>

            <div id="rad3">
                <script>
                    rjs3();
                </script>
            </div>

             <div class="side">
                <div class="stit">
                    <h2>猜你喜欢</h2><a href="javascript:getmore({limit:5,mode:2,orderby:'rand'});" class="more">换一换</a>
                    <div class="cl"></div>
                </div>
                <div class="uli2" id="xglike">{% for row in relate_rand_list %}
                    <div class="suli">
                        {% if row.litpic %}
                        <a class="limg" href="{{row.id|getArticleDetailUrl}}">
                            <img alt="{{row.title}}" src="/static{{row.litpic}}">
                        </a>
                        {% endif %}
                        <a  href="{{row.id|getArticleDetailUrl}}">{{row.title}}</a>
                        <div class="sulii">
                            {% if row.writer %}
                            <span class="time">{{row.writer}}</span>
                            {% elif row.source %} 
                            <span class="time">{{row.source}}</span>
                            {% endif %} 
                            阅读({{ row.click}})</div>
                        <div class="cl"></div>
                    </div>{% endfor %}
                </div>
            </div>
    

            <div id="rad2">
                <script>
                    rjs2();
                </script>
            </div>
        </div><!-- fr_300 end -->
    </div><!-- box end -->
    <script>
        function getmore(condition) {
            var url = "{{'CMS_BASEHOST'|sysconfig}}/api/article/index";
            //var typeid = "";
            $.post(url, condition, function (res) {
                if (res.code == 0) {
                    var json = res.data.list; //数组
                    var str = '';
                    console.log(res.data)
                    $.each(json, function (index) {
                        //循环获取数据
                        //var title = json[index].title;
                        if (condition.mode == 1) {
                            str = str +
                                '<li><a href=" {{getArticleDetailUrl}}' +
                                json[index].id + '">' + json[index].title + '</a></li>';
                        } else if (condition.mode == 2) {
                            var litpic = '';
                            if (json[index].litpic !== '') {
                                litpic =
                                    '<a class="limg" href="{{getArticleDetailUrl}}' +
                                    json[index].id + '"><img alt="' + json[index].title + '" src="/static' +
                                    json[index].litpic + '"></a>';
                            }
                            str = str + '<div class="suli">' + litpic +
                                '<a href="{{getArticleDetailUrl}}' +
                                json[index].id + '">' + json[index].title +
                                '</a><div class="sulii">阅读(' + json[index].click +
                                ')</div><div class="cl"></div></div>';
                        }
                    });

                    if (str != '' && str != null && condition.mode == 1) {
                        $('#xglist').html(str);
                    } else if (str != '' && str != null && condition.mode == 2) {
                        $('#xglike').html(str);
                    }
                } else {

                }
            }, 'json');
        }
    </script>
    {% include "/index/common/footer.html" %}
</body>

</html>