<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>{{ RAW.title }}</title>
    <link href="../../assets/favicon.ico" rel="shortcut icon">
    <link type="text/css" rel="stylesheet" href="../../assets/css/base.css"/>
    <link type="text/css" rel="stylesheet" href="../../assets/css/article.css"/>
    <link type="text/css" rel="stylesheet" href="../../assets/css/comment.css"/>
    <link type="text/css" rel="stylesheet" href="../../assets/css/pager.min.css"/>
    <script type="text/javascript" src="../../assets/js/lazyload.min.js"></script>
    <script type="text/javascript">var lazyLoadInstance = new LazyLoad({});</script>
</head>
<body>
{% include 'parts/header.html' %}
<div id="main" class="main">
    <section class="clearfix area contentBottom wp">
        <div class="clearfix wp area head"></div>
        <div class="content wp clearfix area">
            <div class="fl" style="width:800px;">
                <section class="art-title">
                    <div class="art-title-head">
                        <div class="caption"><a id="srcUrl" href="https://www.acfun.cn/a/ac{{ v_num }}">{{ RAW.title }}</a></div>
                        <div class="art-title-census">
                            <div class="article-parent">
                                <a href="https://www.acfun.cn/v/list{{ RAW.channel.parentId }}/index.htm" target="_blank" class="art-channel">{{ RAW.channel.parentName }}</a>
                                <span>&nbsp;&gt;&nbsp;</span>
                                <a href="https://www.acfun.cn/v/list{{ RAW.channel.id }}/index.htm" target="_blank" class="sort-channel">{{ RAW.channel.name }}</a>
                                <span>&nbsp;&gt;&nbsp;</span>
                                <a href="https://www.acfun.cn/v/as{{ RAW.realm.realmId }}" target="_blank" class="sort-channel">{{ RAW.realm.realmName }}</a>
                            </div>
                            <div class="census-left">
                                <div class="viewcount"><span>阅读量: </span><span class="quanity">{{ RAW.formatViewCount }}</span></div>
                                <div class="comcount"><span>评论: </span><span class="quanity">{{ RAW.formatCommentCount }}</span></div>
                                <div class="cache"><span>缓存: </span><span class="quanity">{{ cache_date }}</span></div>
                            </div>
                            <div class="census-right">
                                <div class="likecount "><i class="icon"></i>
                                    <span title="{{ RAW.likeCount }}">{{ RAW.likeCountShow }}</span></div>
                                <div class="collectcount"><i class="icon"></i>
                                    <span title="{{ RAW.stowCount }}">{{ RAW.formatStowCount }}</span></div>
                                <div data-status="0" class="bananacount J_banana"><i class="icon"></i>
                                    <span class="Jba_num" title="{{ RAW.bananaCount }}">{{ RAW.formatBananaCount }}</span></div>
                                <div class="sharecount"><i class="icon"></i>
                                    <span class="Jba_num" title="{{ RAW.shareCount }}">{{ RAW.formatShareCount }}</span>
                                    <div class="sharehead">
                                        <div class="share-title">分享本文章给朋友吧</div>
                                        <div class="share-action-area bdsharebottom bdshare-button-style0-16">
                                            <div class="share-left-area">
                                                <div class="qrcode"><img src="data/share_qrcode.png"></div>
                                                <p class="scan">扫一扫</p><p>分享到微信/朋友圈</p>
                                            </div>
                                            <div class="share-right-area">
                                                <div class="share-type"></div>
                                                <div class="share-container">
                                                    <div id="share-component">
                                                        <div class="share-desc">获取原文章地址</div>
                                                        <div class="area-share clearfix">
                                                            <input id="videoUrl" class="ipt-url fl" type="text" readonly="readonly" value="https://www.acfun.cn/a/ac{{ v_num }}">
                                                            <span data-clipboard-target="#videoUrl" class="copy fl cp-url" onclick="copyText('https://www.acfun.cn/a/ac{{ v_num }}')">复制</span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                <section class="art-subject"><div id="filter" class="clearfix"></div></section>
                <section id="article-content">
                    <div id="article-up" class="article-up">
                        <a href="https://www.acfun.cn/u/{{ RAW.user.href }}" target="_blank">
                            <div style="background-image:url(../../member/{{ RAW.user.href }}_avatar)" class="up-cover live-avatar"></div>
                        </a>
                        <div class="up-abstract">
                            <div class="up-name">
                                <a href="https://www.acfun.cn/u/{{ RAW.user.href }}"{% if RAW.user.nameColor == 1 %} style="{{ RAW.user.nameStyle }}"{% endif %}
                                   target="_blank" class="upname" title="注册于 {{ up_reg_date }}">{{ RAW.user.name }}</a>
                                <div class="up-type">UP主</div>
                            </div>
                            <div class="up-time">{{ RAW.createTimeMillis|unix2datestr }}</div>
                        </div>
{#                            <div class="action-up"><a class="message-back">回复</a><a class="reportAction">举报</a></div>#}
                        <div id="article-answer"></div>
                        <div id="article-tags" class="clearfix">
                            {% if RAW.parts|length > 1 %}
                            <ul class="parts-container">
                            {% for part in RAW.parts %}
                                <li data-index="{{ loop.index }}" class="art-part{% if loop.first %} active{% endif %}">{{ part.title }}</li>
                            {% endfor %}
                            </ul>
                            <div class="showall">展开总共{{ parts|length }}Part</div>
                            {% endif %}
                        </div>
                        <div class="article-content">
                        {% for part in RAW.parts %}
                            <div id="content-part{{ loop.index }}" style="{% if not loop.first %}display: none{% endif %}">
                            {{ part.content|string|safe }}
                            </div>
                        {% endfor %}
                        </div>
                        <div id="article-operation" class="clearfix">
                            <div class="likecount "><i class="icon"></i>
                                <span title="{{ RAW.likeCount }}">{{ RAW.likeCountShow }}</span></div>
                            <div class="collectcount"><i class="icon"></i>
                                <span title="{{ RAW.stowCount }}">{{ RAW.formatStowCount }}</span></div>
                            <div data-status="0" class="bananacount J_banana"><i class="icon"></i>
                                <span class="Jba_num" title="{{ RAW.bananaCount }}">{{ RAW.formatBananaCount }}</span></div>
                            <div class="sharecount"><i class="icon"></i>
                                <span class="Jba_num" title="{{ RAW.shareCount }}">{{ RAW.formatShareCount }}</span>
                                <div class="sharehead">
                                    <div class="share-title">分享本文章给朋友吧</div>
                                    <div class="share-action-area bdsharebottom bdshare-button-style0-16">
                                        <div class="share-left-area">
                                            <div class="qrcode"><img src="data/share_qrcode.png"></div>
                                            <p class="scan">扫一扫</p><p>分享到微信/朋友圈</p>
                                        </div>
                                        <div class="share-right-area">
                                            <div class="share-type"></div>
                                            <div class="share-container">
                                                <div id="share-component">
                                                    <div class="share-desc">获取原文章地址</div>
                                                    <div class="area-share clearfix">
                                                        <input id="videoUrl" class="ipt-url fl" type="text" readonly="readonly" value="https://www.acfun.cn/a/ac{{ v_num }}">
                                                        <span data-clipboard-target="#videoUrl" class="copy fl cp-url" onclick="copyText('https://www.acfun.cn/a/ac{{ v_num }}')">复制</span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="bd_tag" class="tag clearfix">
                            {% for tag in RAW.tagList %}
                            <span class="tag-single fl">
                                <a href="https://www.acfun.cn/search?keyword={{ tag.name }}" data-tid="{{ tag.id }}" target="_blank" class="fl">{{ tag.name }}</a>
                            </span>
                            {% endfor %}
                        </div>
                    </div>
                </section>
                {% include "parts/comment.html" %}
            </div>
            <div class="fr" style="width:280px">
                <section id="up-info">
                    <div class="up-detail">
                        <a target="_blank" href="https://www.acfun.cn/u/{{ RAW.user.href }}">
                            <div class="upcover live-avatar" style="background-image:url(../../member/{{ RAW.user.href }}_avatar)"></div>
                        </a>
                        <div class="upname">
                            <a class="name float" href="https://www.acfun.cn/u/{{ RAW.user.href }}"
                               target="_blank"{% if up_data.nameColor == 1 %} style="{{ up_data.nameStyle }}"{% endif %}>{{ RAW.user.name }}</a>
                            {% if 1 in up_data.verifiedTypes %}
                            <span class="verified-icon monkey-verified-icon" title="AcFun管理员认证(签约)"></span>
                            {% endif %}
                            {% if 2 in up_data.verifiedTypes %}
                            <span class="verified-icon official-verified-icon" title="{{ "AcFun官方认证\n"|safe + up_data.verifiedText or '' }}"></span>
                            {% endif %}
                            {% if 5 in up_data.verifiedTypes %}
                            <span class="up-college-verified verified-icon">
                                <span class="verified-icon up-college-verified-icon"></span>
                                <span class="up-college-verified-content">
                                    <span class="up-college-verified-content-text">尊贵的阿普学院标志
                                        <a rel="noopener" class="link" href="//member.acfun.cn/academy" target="_blank">如何获得标志？</a>
                                    </span>
                                </span>
                            </span>
                            {% endif %}
                            <span class="verified-icon avi-verified-icon" title="AVI虚拟偶像标识" style="display: none;"></span>
                            <span class="verified-icon advanced-danmaku-verified-icon" title="高弹达人标识" style="display:none"></span>
                            <div class="desc">{{ up_data.signature }}</div>
                        </div>
                    </div>
                    <ul class="up-census">
                        <li class="vote"><div class="count" title="{{ RAW.user.contributeCountValue }}">{{ RAW.user.contributeCount }}</div><div class="type">投稿</div></li>
                        <li data-status="0" class="focus"><div class="count" title="{{ RAW.user.followingCountValue }}">{{ RAW.user.followingCount }}</div><div class="type">关注</div></li>
                        <li class="follow"><div class="count" title="{{ RAW.user.fanCountValue }}">{{ RAW.user.fanCount }}</div><div class="type">粉丝</div></li>
                    </ul>
                    <div class="up-operate">
                        <div data-uid="{{ RAW.user.href }}" class="focus">关注</div>
                        <a href="https://message.acfun.cn/im?targetid={{ RAW.user.href }}" target="_blank" class="mail">私信</a>
                    </div>
                </section>
                <section class="up-contributions">
                    <div class="ctb-head">
                        <h1 class="ctb-title">最新保存</h1>
                        <a href="../../index.html" target="_blank" class="showall">全部</a>
                    </div>
                </section>
                <div id="recommends"></div>
            </div>
        </div>
    </section>
</div>
{% include 'parts/toolbar.html' %}
{% include 'parts/footer.html' %}
<script type="text/javascript">
    const copyText = (text) => navigator.clipboard?.writeText && navigator.clipboard.writeText(text)
    document.querySelectorAll(".parts-container li.art-part").forEach(function (item) {
        item.addEventListener('click', function (ev) {
            if(!item.classList.contains('active')){
                let i = item.getAttribute('data-index');
                document.querySelectorAll(".parts-container li.art-part").forEach(function (it) {
                    it.setAttribute('class', 'art-part');
                })
                item.setAttribute('class', 'art-part active');
                document.querySelectorAll(".article-content > div").forEach(function (it) {
                    it.style = "display: none;"
                })
                document.querySelector("#content-part"+i).style = "";
            }
        });
    });
    function addRecommend(data) {
        let base = document.createElement('div'),
            title = document.createElement('p'),
            link = document.createElement('a'),
            info = document.createElement('div'),
            viewC = document.createElement('div'),
            viewIco = document.createElement('i'),
            viewNum = document.createElement('span'),
            commC = document.createElement('div'),
            commIco = document.createElement('i'),
            commNum = document.createElement('span');
        base.setAttribute('class', 'contribution weblog-item');
        title.setAttribute('class', 'contb-title tit');
        link.setAttribute('href', '../ac'+data.articleId+'/ac'+data.articleId+'.html');
        link.setAttribute('target', '_blank');
        link.innerHTML = data.title;
        title.append(link);
        base.append(title);
        info.setAttribute('class', 'contb-count');
        viewC.setAttribute('class', 'view-count');
        viewIco.setAttribute('class', 'view');
        viewNum.setAttribute('class', 'count num');
        viewNum.innerHTML = data.formatViewCount;
        viewC.append(viewIco);
        viewC.append(viewNum);
        info.append(viewC);
        commC.setAttribute('class', 'comm-count');
        commIco.setAttribute('class', 'comm');
        commNum.setAttribute('class', 'count num');
        commNum.innerHTML = data.commentCount;
        commC.append(commIco);
        commC.append(commNum);
        info.append(commC);
        base.append(info);
        document.getElementById('recommends').append(base);
    }
    function loadJs(path, callback) {
        let script = document.createElement('script');
        script.setAttribute('type', 'text/javascript');
        script.setAttribute('src', path);
        if (script.readyState) {  // only required for IE <9
            script.onreadystatechange = function () {
                if (script.readyState === "loaded" || script.readyState === "complete") {
                    script.onreadystatechange = null;
                    callback();
                }
            };
        } else {  //Others
            script.onload = function () {
                callback();
            };
        }
        document.body.append(script);
    }
</script>
<script type="text/javascript">
    let sourceId = "ac{{ v_num }}", articles = {}, articleLast = [], commentData=[];
</script>
<script type="text/javascript" src="../../assets/js/html2canvas.min.js"></script>
<script type="text/javascript" src="../../member/{{ RAW.user.id }}.js"></script>
<script type="text/javascript" src="data/ac{{ v_num }}.js"></script>
<script type="text/javascript" src="data/ac{{ v_num }}.comment.1.js"></script>
<script type="text/javascript" src="../leatest.js"></script>
<script type="text/javascript" src="../nums.js"></script>
<script type="text/javascript">
    let contentData = articles["ac{{ v_num }}"],
        commentCount = {{ RAW.commentCount }};
    articleLast.forEach(function (acNum) {
        if(acNum!==sourceId){
            loadJs('../'+acNum+'/data/'+acNum+'.js', function () {
                addRecommend(articles[acNum]);
            });
        }
    });
</script>
<script type="text/javascript" src="../../assets/js/comment.js"></script>
</body>
</html>
