Skip to content

Commit

Permalink
v4.38
Browse files Browse the repository at this point in the history
  • Loading branch information
ttttonyhe committed Jan 1, 2020
1 parent 35c7ff3 commit b62a255
Show file tree
Hide file tree
Showing 21 changed files with 331 additions and 108 deletions.
33 changes: 18 additions & 15 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
else $w = get_option('king_wor_cate');
if (!get_option('king_per_page')) $p = '6';
else $p = get_option('king_per_page');
if (get_option('king_display_author') == '关闭') $a = false;
else $a = true;
?>

<div id="header_info">
Expand Down Expand Up @@ -66,17 +68,12 @@
</li>
<!-- 占位DIV -->

<li class="article-list-item reveal index-post-list" v-for="post in posts" :style="post.post_categories[0].term_id | link_style">
<li :class="'article-list-item reveal index-post-list ' + (post.sticky ? 'sticky-one' : '')" v-for="post in posts" :style="post.post_categories[0].term_id | link_style">

<template v-if="post.post_img.url == false || post.post_categories[0].term_id == <?php echo $f; ?> || post.post_categories[0].term_id == <?php echo $w; ?>">
<em v-if="post.post_categories[0].term_id == <?php if (get_option('king_cate_cate')) {
echo get_option('king_cate_cate');
} else {
echo '21213';
} ?>" class="article-list-type1">{{ post.post_categories[0].name + ' | ' + (post.post_metas.tag_name ? post.post_metas.tag_name.toUpperCase() : '<?php if (get_option('king_cate_cate_ph')) echo get_option('king_cate_cate_ph');
else echo 'XX' ?>') }}</em>
<em v-if="post.post_categories[0].term_id == <?php tony_func('echo_s_cate'); ?>" class="article-list-type1">{{ post.post_categories[0].name + ' | ' + (post.post_metas.tag_name ? post.post_metas.tag_name.toUpperCase() : '<?php tony_func('echo_ph_cate'); ?>') }}</em>
<div v-if="post.post_categories[0].term_id == <?php echo $f; ?> || post.post_categories[0].term_id == <?php echo $w; ?>" class="link-list-left"><img :src="post.post_metas.img[0]" class="link-list-img"></div>
<div class="link-list-right">
<div class="link-list-right" :style="(post.post_categories[0].term_id == <?php echo $f; ?> || post.post_categories[0].term_id == <?php echo $w; ?> || post.post_categories[0].term_id == <?php tony_func('echo_s_cate'); ?>) ? '' : 'margin-top: -10px;'">
<a v-if="post.post_categories[0].term_id == <?php echo $f; ?> || post.post_categories[0].term_id == <?php echo $w; ?>" :href="post.post_metas.link" style="text-decoration: none;" target="_blank">
<h5 style="margin-top: 10px;" v-html="post.title.rendered"></h5>
</a>
Expand All @@ -85,7 +82,11 @@
</a>
<p v-html="post.post_excerpt.nine"></p>
<div class="article-list-footer">
<span class="article-list-date" style="color: #ada8a8;">{{ post.post_categories[0].term_id | link_page }}{{ post.post_date }}</span>
<?php if($a){ ?>
<span class="article-list-date display-author" v-html="post.post_metas.author"></span>
<span class="article-list-divider">-</span>
<?php } ?>
<span class="article-list-date">{{ post.post_categories[0].term_id | link_page }}{{ post.post_date }}</span>
<span class="article-list-divider" v-if="post.post_categories[0].term_id !== <?php echo $f; ?> && post.post_categories[0].term_id !== <?php echo $w; ?>">-</span>
<span class="article-list-minutes" v-if="post.post_categories[0].term_id !== <?php echo $f; ?> && post.post_categories[0].term_id !== <?php echo $w; ?>">{{ post.post_metas.views }}&nbsp;Views</span>
</div>
Expand All @@ -96,17 +97,19 @@
<div class="article-list-img-else">
<div class="article-list-img" :style="'background-image:url(' + post.post_img.url +')'"></div>
<div class="article-list-img-right">
<em v-if="post.post_categories[0].term_id === <?php if (get_option('king_cate_cate')) {
echo get_option('king_cate_cate');
} else {
echo '0';
} ?>" class="article-list-type1">{{ post.post_categories[0].name + ' | ' + (post.post_metas.tag_name ? post.post_metas.tag_name.toUpperCase() : '<?php if (get_option('king_cate_cate_ph')) echo get_option('king_cate_cate_ph');
else echo 'XX' ?>') }}</em>
<!-- 置顶文章提示 -->
<em class="article-list-type1 sticky-one-tag" v-if="post.sticky"><i class="czs-arrow-up-l" style="font-size: 14px;font-weight: 600;"></i> 置顶</em>
<!-- 置顶文章提示 -->
<em v-if="post.post_categories[0].term_id === <?php tony_func('echo_s_cate'); ?>" class="article-list-type1">{{ post.post_categories[0].name + ' | ' + (post.post_metas.tag_name ? post.post_metas.tag_name.toUpperCase() : '<?php tony_func('echo_ph_cate'); ?>') }}</em>
<a :href="post.link" style="text-decoration: none;">
<h5 v-html="post.title.rendered" style="margin: 0px;padding: 0px;margin-top:15px"></h5>
</a>
<p v-html="post.post_excerpt.four" :id="post.id"></p>
<div class="article-list-footer">
<?php if($a){ ?>
<span class="article-list-date display-author" v-html="post.post_metas.author"></span>
<span class="article-list-divider">-</span>
<?php } ?>
<span class="article-list-date">{{ post.post_date }}</span>
<span class="article-list-divider">-</span>
<span v-if="post.post_metas.views !== ''" class="article-list-minutes">{{ post.post_metas.views }}&nbsp;Views</span>
Expand Down
2 changes: 1 addition & 1 deletion dist/css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/style.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
/*! no static exports found */
/***/ (function(module, exports) {

eval("$(document).ready(function() { //避免爆代码\n\n var click = 0; //初始化加载次数\n var paged = 1; //获取当前页数\n var incate = window.cate_id;\n var name = window.cate_name;\n var des = window.cate_des;\n\n /* 展现内容(避免爆代码) */\n $('.article-list').css('opacity', '1');\n $('.top1').html(name);\n $('.top2').html(des);\n $('.cat-real').attr('style', 'display:inline-block');\n /* 展现内容(避免爆代码) */\n\n new Vue({ //axios获取顶部信息\n el: '#grid-cell',\n data() {\n return {\n\n site_url : window.site_url,\n\n exclude_option: window.cate_exclude_option,\n cate_exclude: window.cate_exclude,\n exclude_params: '',\n\n pages: window.index_p,\n cate_fre: window.cate_fre,\n cate_wor: window.cate_fre,\n\n posts: null,\n cates: null,\n des: null,\n loading: true, //v-if判断显示占位符\n loading_des: true,\n errored: true,\n loading_css: 'loading-line'\n }\n },\n mounted() {\n //分类排除参数获取\n if(this.cate_exclude == 'true'){\n this.exclude_params = '?exclude=' + this.exclude_option;\n }\n\n //获取分类\n axios.get(this.site_url + '/wp-json/wp/v2/categories' + this.exclude_params)\n .then(response => {\n this.des = response.data;\n }).then(() => {\n this.loading_des = false;\n });\n\n //获取文章列表\n axios.get(this.site_url + '/wp-json/wp/v2/posts?per_page='+ this.pages +'&page=' + paged + '&categories=' + incate)\n .then(response => {\n this.posts = response.data\n })\n .catch(e => {\n this.errored = false\n })\n .then(() => {\n this.loading = false;\n paged++; //加载完1页后累加页数\n //加载完文章列表后监听滑动事件\n $(window).scroll(function() {\n var scrollTop = $(window).scrollTop();\n var scrollHeight = $('.bottom').offset().top - 500;\n if (scrollTop >= scrollHeight) {\n if (click == 0) { //接近底部加载一次新文章\n $('#scoll_new_list').click();\n click++; //加载次数计次\n }\n }\n });\n\n })\n },\n methods: { //定义方法\n new_page: function() { //加载下一页文章列表\n $('#view-text').html('-&nbsp;加载中&nbsp;-');\n axios.get(this.site_url + '/wp-json/wp/v2/posts?per_page=' + this.pages + '&page=' + paged + '&categories=' + incate)\n .then(response => {\n if (!!response.data.length && response.data.length !== 0) { //判断是否最后一页\n $('#view-text').html('-&nbsp;文章列表&nbsp;-');\n this.posts.push.apply(this.posts, response.data); //拼接在上一页之后\n click = 0;\n paged++;\n } else {\n this.loading_css = '';\n $('#view-text').html('-&nbsp;全部文章&nbsp;-');\n $('.bottom h5').html('暂无更多文章了 O__O \"…').css({\n 'background': '#fff',\n 'color': '#999'\n });\n }\n }).catch(e => {\n this.loading_css = '';\n $('#view-text').html('-&nbsp;所有文章&nbsp;-');\n $('.bottom h5').html('暂无更多文章了 O__O \"…').css({\n 'background': '#fff',\n 'color': '#999'\n });\n })\n }\n },\n filters: {\n link_page: function(cate_id) {\n if (cate_id == this.cate_fre) {\n return '添加于 ';\n } else if (cate_id == this.cate_wor) {\n return '创造于 ';\n } else {\n return '';\n }\n },\n link_style: function(cate_id) {\n if (cate_id == this.cate_fre || cate_id == this.cate_wor) {\n return 'display: flex;';\n } else {\n return '';\n }\n }\n }\n });\n\n\n})\n\n//# sourceURL=webpack:///./src/archive.js?");
eval("$(document).ready(function() { //避免爆代码\n\n var click = 0; //初始化加载次数\n var paged = 1; //获取当前页数\n var incate = window.cate_id;\n var name = window.cate_name;\n var des = window.cate_des;\n\n /* 展现内容(避免爆代码) */\n $('.article-list').css('opacity', '1');\n $('.top1').html(name);\n $('.top2').html(des);\n $('.cat-real').attr('style', 'display:inline-block');\n /* 展现内容(避免爆代码) */\n\n new Vue({ //axios获取顶部信息\n el: '#grid-cell',\n data() {\n return {\n\n site_url : window.site_url,\n\n exclude_option: window.cate_exclude_option,\n cate_exclude: window.cate_exclude,\n exclude_params: '',\n\n pages: window.index_p,\n cate_fre: window.cate_fre,\n cate_wor: window.cate_fre,\n\n posts: null,\n posts_id_sticky: '',\n cates: null,\n des: null,\n loading: true, //v-if判断显示占位符\n loading_des: true,\n errored: true,\n loading_css: 'loading-line'\n }\n },\n mounted() {\n //分类排除参数获取\n if(this.cate_exclude == 'true'){\n this.exclude_params = '?exclude=' + this.exclude_option;\n }\n\n //获取分类\n axios.get(this.site_url + '/wp-json/wp/v2/categories' + this.exclude_params)\n .then(response => {\n this.des = response.data;\n }).then(() => {\n this.loading_des = false;\n });\n\n\n /*\n * 获取文章列表\n * 得到顶置文章后拼接其余文章\n */\n\n //获取顶置文章\n axios.get(this.site_url + '/wp-json/wp/v2/posts?sticky=1&categories=' + incate)\n .then(res_sticky => {\n this.posts = res_sticky.data;\n\n //获取顶置文章 IDs 以在获取其余文章时排除\n for(var s = 0;s< this.posts.length; ++s){\n this.posts_id_sticky += (',' + this.posts[s].id); \n }\n this.posts_id_sticky = this.posts_id_sticky.substr(1);\n\n axios.get(this.site_url + '/wp-json/wp/v2/posts?sticky=0&categories=' + incate + '&exclude='+ this.posts_id_sticky + '&per_page=' + this.pages + '&page=' + paged)\n .then(res_normal => {\n //拼接其余文章\n this.posts = this.posts.concat(res_normal.data);\n })\n })\n .catch(e => {\n this.errored = false\n })\n .then(() => {\n this.loading = false;\n paged++; //加载完1页后累加页数\n //加载完文章列表后监听滑动事件\n $(window).scroll(function() {\n var scrollTop = $(window).scrollTop();\n var scrollHeight = $('.bottom').offset().top - 500;\n if (scrollTop >= scrollHeight) {\n if (click == 0) { //接近底部加载一次新文章\n $('#scoll_new_list').click();\n click++; //加载次数计次\n }\n }\n });\n\n })\n },\n methods: { //定义方法\n new_page: function() { //加载下一页文章列表\n $('#view-text').html('-&nbsp;加载中&nbsp;-');\n axios.get(this.site_url + '/wp-json/wp/v2/posts?sticky=0&exclude='+ this.posts_id_sticky + '&per_page=' + this.pages + '&page=' + paged + '&categories=' + incate)\n .then(response => {\n if (!!response.data.length && response.data.length !== 0) { //判断是否最后一页\n $('#view-text').html('-&nbsp;文章列表&nbsp;-');\n this.posts.push.apply(this.posts, response.data); //拼接在上一页之后\n click = 0;\n paged++;\n } else {\n this.loading_css = '';\n $('#view-text').html('-&nbsp;全部文章&nbsp;-');\n $('.bottom h5').html('暂无更多文章了 O__O \"…').css({\n 'background': '#fff',\n 'color': '#999'\n });\n }\n }).catch(e => {\n this.loading_css = '';\n $('#view-text').html('-&nbsp;所有文章&nbsp;-');\n $('.bottom h5').html('暂无更多文章了 O__O \"…').css({\n 'background': '#fff',\n 'color': '#999'\n });\n })\n }\n },\n filters: {\n link_page: function(cate_id) {\n if (cate_id == this.cate_fre) {\n return '添加于 ';\n } else if (cate_id == this.cate_wor) {\n return '创造于 ';\n } else {\n return '';\n }\n },\n link_style: function(cate_id) {\n if (cate_id == this.cate_fre || cate_id == this.cate_wor) {\n return 'display: flex;';\n } else {\n return '';\n }\n }\n }\n });\n\n\n})\n\n//# sourceURL=webpack:///./src/archive.js?");

/***/ })

Expand Down
Loading

0 comments on commit b62a255

Please sign in to comment.