Skip to content

Commit b62a255

Browse files
committed
v4.38
1 parent 35c7ff3 commit b62a255

21 files changed

+331
-108
lines changed

archive.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
else $w = get_option('king_wor_cate');
1212
if (!get_option('king_per_page')) $p = '6';
1313
else $p = get_option('king_per_page');
14+
if (get_option('king_display_author') == '关闭') $a = false;
15+
else $a = true;
1416
?>
1517

1618
<div id="header_info">
@@ -66,17 +68,12 @@
6668
</li>
6769
<!-- 占位DIV -->
6870

69-
<li class="article-list-item reveal index-post-list" v-for="post in posts" :style="post.post_categories[0].term_id | link_style">
71+
<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">
7072

7173
<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; ?>">
72-
<em v-if="post.post_categories[0].term_id == <?php if (get_option('king_cate_cate')) {
73-
echo get_option('king_cate_cate');
74-
} else {
75-
echo '21213';
76-
} ?>" 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');
77-
else echo 'XX' ?>') }}</em>
74+
<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>
7875
<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>
79-
<div class="link-list-right">
76+
<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;'">
8077
<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">
8178
<h5 style="margin-top: 10px;" v-html="post.title.rendered"></h5>
8279
</a>
@@ -85,7 +82,11 @@
8582
</a>
8683
<p v-html="post.post_excerpt.nine"></p>
8784
<div class="article-list-footer">
88-
<span class="article-list-date" style="color: #ada8a8;">{{ post.post_categories[0].term_id | link_page }}{{ post.post_date }}</span>
85+
<?php if($a){ ?>
86+
<span class="article-list-date display-author" v-html="post.post_metas.author"></span>
87+
<span class="article-list-divider">-</span>
88+
<?php } ?>
89+
<span class="article-list-date">{{ post.post_categories[0].term_id | link_page }}{{ post.post_date }}</span>
8990
<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>
9091
<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>
9192
</div>
@@ -96,17 +97,19 @@
9697
<div class="article-list-img-else">
9798
<div class="article-list-img" :style="'background-image:url(' + post.post_img.url +')'"></div>
9899
<div class="article-list-img-right">
99-
<em v-if="post.post_categories[0].term_id === <?php if (get_option('king_cate_cate')) {
100-
echo get_option('king_cate_cate');
101-
} else {
102-
echo '0';
103-
} ?>" 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');
104-
else echo 'XX' ?>') }}</em>
100+
<!-- 置顶文章提示 -->
101+
<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>
102+
<!-- 置顶文章提示 -->
103+
<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>
105104
<a :href="post.link" style="text-decoration: none;">
106105
<h5 v-html="post.title.rendered" style="margin: 0px;padding: 0px;margin-top:15px"></h5>
107106
</a>
108107
<p v-html="post.post_excerpt.four" :id="post.id"></p>
109108
<div class="article-list-footer">
109+
<?php if($a){ ?>
110+
<span class="article-list-date display-author" v-html="post.post_metas.author"></span>
111+
<span class="article-list-divider">-</span>
112+
<?php } ?>
110113
<span class="article-list-date">{{ post.post_date }}</span>
111114
<span class="article-list-divider">-</span>
112115
<span v-if="post.post_metas.views !== ''" class="article-list-minutes">{{ post.post_metas.views }}&nbsp;Views</span>

dist/css/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/archive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
/*! no static exports found */
9494
/***/ (function(module, exports) {
9595

96-
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?");
96+
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?");
9797

9898
/***/ })
9999

0 commit comments

Comments
 (0)