添加草稿功能

This commit is contained in:
yi-ge 2020-09-16 23:35:24 +08:00
parent 35e5523b93
commit 24a603c755
8 changed files with 218 additions and 102 deletions

View File

@ -3,42 +3,58 @@
.articleContent(ref='articleImgs', v-if='Articels') .articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index') article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length') .articleImgs(v-if='post.postImages.length')
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
Swiper(:style="'height: ' + imageHeight + 'px'") Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for="(imgUrl, inx) in post.postImages" :key="inx") Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl') img(:src='imgUrl')
.articleAbstract .articleAbstract
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title') .articleTitle(v-html='post.post_title')
.articalMeta .articalMeta
ul ul
li li
Icon(:icon="['far', 'calendar-alt']") Icon(:icon='["far", "calendar-alt"]')
|   {{ post.post_date }} |   {{ post.post_date }}
li li
Icon(:icon="['far', 'bookmark']") Icon(:icon='["far", "bookmark"]')
nuxt-link(v-for='(relationships, idx) in post.term_relationships', :key='idx', v-if='relationships.term_taxonomy', :to="'/' + relationships.term_taxonomy.term.slug") nuxt-link(
v-for='(relationships, idx) in post.term_relationships',
:key='idx',
v-if='relationships.term_taxonomy',
:to='"/" + relationships.term_taxonomy.term.slug'
)
span span
|   {{ relationships.term_taxonomy.term.name }} |   {{ relationships.term_taxonomy.term.name }}
li(v-if='post.postmetum.meta_value !== 0') li(v-if='post.postmetum.meta_value !== 0')
Icon(:icon="['fas', 'thermometer-' + post.hotValue]") Icon(:icon='["fas", "thermometer-" + post.hotValue]')
|   {{ post.postmetum.meta_value }} |   {{ post.postmetum.meta_value }}
.articelAbstractContent(v-html='post.post_excerpt || post.post_content') .articelAbstractContent(
v-html='post.post_excerpt || post.post_content'
)
.readMore .readMore
nuxt-link.readMoreBtn(:to="'/post/' + post.ID") nuxt-link.readMoreBtn(:to='"/post/" + post.ID')
| READ MORE | READ MORE
.Info(v-if='Info') .Info(v-if='Info')
| {{ Info }} | {{ Info }}
nuxt-link(:to="nowPage > 2 ? nowPath + '/page/' + (nowPage - 1) : nowPath + '/'", :class="nowPage > 1 ? 'btn-footer btn-prev ' : 'btn-footer btn-prev btn-disable'") nuxt-link(
Icon(:icon="['fas', 'chevron-left']") :to='nowPage > 2 ? nowPath + "/page/" + (nowPage - 1) : nowPath + "/"',
:class='nowPage > 1 ? "btn-footer btn-prev " : "btn-footer btn-prev btn-disable"'
)
Icon(:icon='["fas", "chevron-left"]')
|   上一页 |   上一页
nuxt-link(:to="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? nowPath + '/page/' + (nowPage + 1) : '#'", :class="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? 'btn-footer btn-next' : 'btn-footer btn-next btn-disable'") nuxt-link(
:to='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? nowPath + "/page/" + (nowPage + 1) : "#"',
:class='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? "btn-footer btn-next" : "btn-footer btn-next btn-disable"'
)
| 下一页 &nbsp; | 下一页 &nbsp;
Icon(:icon="['fas', 'chevron-right']") Icon(:icon='["fas", "chevron-right"]')
</template> </template>
<script> <script>
export default { export default {
validate ({ params }) {
return (params && params.terms) !== '404'
},
async asyncData ({ app, params, $axios }) { async asyncData ({ app, params, $axios }) {
let Info = null let Info = null
let Articels = [] let Articels = []
@ -69,6 +85,8 @@ export default {
} }
} else if (data.status === 404) { } else if (data.status === 404) {
Info = '未找到文章。' Info = '未找到文章。'
// redirect('/404')
// return
} }
return { return {

View File

@ -3,38 +3,51 @@
.articleContent(ref='articleImgs', v-if='Articels') .articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index') article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length') .articleImgs(v-if='post.postImages.length')
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
Swiper(:style="'height: ' + imageHeight + 'px'") Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for="(imgUrl, inx) in post.postImages" :key="inx") Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl') img(:src='imgUrl')
.articleAbstract .articleAbstract
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title') .articleTitle(v-html='post.post_title')
.articalMeta .articalMeta
ul ul
li li
Icon(:icon="['far', 'calendar-alt']") Icon(:icon='["far", "calendar-alt"]')
| &nbsp; {{ post.post_date }} | &nbsp; {{ post.post_date }}
li li
Icon(:icon="['far', 'bookmark']") Icon(:icon='["far", "bookmark"]')
nuxt-link(v-for='(relationships, idx) in post.term_relationships', :key='idx', v-if='relationships.term_taxonomy', :to="'/' + relationships.term_taxonomy.term.slug") nuxt-link(
v-for='(relationships, idx) in post.term_relationships',
:key='idx',
v-if='relationships.term_taxonomy',
:to='"/" + relationships.term_taxonomy.term.slug'
)
span span
| &nbsp; {{ relationships.term_taxonomy.term.name }} | &nbsp; {{ relationships.term_taxonomy.term.name }}
li(v-if='post.postmetum.meta_value !== 0') li(v-if='post.postmetum.meta_value !== 0')
Icon(:icon="['fas', 'thermometer-' + post.hotValue]") Icon(:icon='["fas", "thermometer-" + post.hotValue]')
| &nbsp; {{ post.postmetum.meta_value }} | &nbsp; {{ post.postmetum.meta_value }}
.articelAbstractContent(v-html='post.post_excerpt || post.post_content') .articelAbstractContent(
v-html='post.post_excerpt || post.post_content'
)
.readMore .readMore
nuxt-link.readMoreBtn(:to="'/post/' + post.ID") nuxt-link.readMoreBtn(:to='"/post/" + post.ID')
| READ MORE | READ MORE
.Info(v-if='Info') .Info(v-if='Info')
| {{ Info }} | {{ Info }}
nuxt-link(:to="nowPage > 2 ? nowPath + '/page/' + (nowPage - 1) : nowPath + '/'", :class="nowPage > 1 ? 'btn-footer btn-prev' : 'btn-footer btn-prev btn-disable'") nuxt-link(
Icon(:icon="['fas', 'chevron-left']") :to='nowPage > 2 ? nowPath + "/page/" + (nowPage - 1) : nowPath + "/"',
:class='nowPage > 1 ? "btn-footer btn-prev" : "btn-footer btn-prev btn-disable"'
)
Icon(:icon='["fas", "chevron-left"]')
| &nbsp; 上一页 | &nbsp; 上一页
nuxt-link(:to="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? nowPath + '/page/' + (nowPage + 1) : ''", :class="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? 'btn-footer btn-next' : 'btn-footer btn-next btn-disable'") nuxt-link(
:to='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? nowPath + "/page/" + (nowPage + 1) : ""',
:class='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? "btn-footer btn-next" : "btn-footer btn-next btn-disable"'
)
| 下一页 &nbsp; | 下一页 &nbsp;
Icon(:icon="['fas', 'chevron-right']") Icon(:icon='["fas", "chevron-right"]')
</template> </template>
<script> <script>
@ -69,6 +82,8 @@ export default {
} }
} else if (data.status === 404) { } else if (data.status === 404) {
Info = '未找到文章。' Info = '未找到文章。'
// redirect('/404')
// return
} }
return { return {

View File

@ -3,38 +3,51 @@
.articleContent(ref='articleImgs', v-if='Articels') .articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index') article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length') .articleImgs(v-if='post.postImages.length')
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
Swiper(:style="'height: ' + imageHeight + 'px'") Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for="(imgUrl, inx) in post.postImages" :key="inx") Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl') img(:src='imgUrl')
.articleAbstract .articleAbstract
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title') .articleTitle(v-html='post.post_title')
.articalMeta .articalMeta
ul ul
li li
Icon(:icon="['far', 'calendar-alt']") Icon(:icon='["far", "calendar-alt"]')
| &nbsp; {{ post.post_date }} | &nbsp; {{ post.post_date }}
li li
Icon(:icon="['far', 'bookmark']") Icon(:icon='["far", "bookmark"]')
nuxt-link(v-for='(relationships, idx) in post.term_relationships', :key='idx', v-if='relationships.term_taxonomy', :to="'/' + relationships.term_taxonomy.term.slug") nuxt-link(
v-for='(relationships, idx) in post.term_relationships',
:key='idx',
v-if='relationships.term_taxonomy',
:to='"/" + relationships.term_taxonomy.term.slug'
)
span span
| &nbsp; {{ relationships.term_taxonomy.term.name }} | &nbsp; {{ relationships.term_taxonomy.term.name }}
li(v-if='post.postmetum.meta_value !== 0') li(v-if='post.postmetum.meta_value !== 0')
Icon(:icon="['fas', 'thermometer-' + post.hotValue]") Icon(:icon='["fas", "thermometer-" + post.hotValue]')
| &nbsp; {{ post.postmetum.meta_value }} | &nbsp; {{ post.postmetum.meta_value }}
.articelAbstractContent(v-html='post.post_excerpt || post.post_content') .articelAbstractContent(
v-html='post.post_excerpt || post.post_content'
)
.readMore .readMore
nuxt-link.readMoreBtn(:to="'/post/' + post.ID") nuxt-link.readMoreBtn(:to='"/post/" + post.ID')
| READ MORE | READ MORE
.Info(v-if='Info') .Info(v-if='Info')
| {{ Info }} | {{ Info }}
nuxt-link(:to="nowPage > 2 ? nowPath + '/page/' + (nowPage - 1) : nowPath + '/'", :class="nowPage > 1 ? 'btn-footer btn-prev ' : 'btn-footer btn-prev btn-disable'") nuxt-link(
Icon(:icon="['fas', 'chevron-left']") :to='nowPage > 2 ? nowPath + "/page/" + (nowPage - 1) : nowPath + "/"',
:class='nowPage > 1 ? "btn-footer btn-prev " : "btn-footer btn-prev btn-disable"'
)
Icon(:icon='["fas", "chevron-left"]')
| &nbsp; 上一页 | &nbsp; 上一页
nuxt-link(:to="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? nowPath + '/page/' + (nowPage + 1) : '#'", :class="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? 'btn-footer btn-next' : 'btn-footer btn-next btn-disable'") nuxt-link(
:to='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? nowPath + "/page/" + (nowPage + 1) : "#"',
:class='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? "btn-footer btn-next" : "btn-footer btn-next btn-disable"'
)
| 下一页 &nbsp; | 下一页 &nbsp;
Icon(:icon="['fas', 'chevron-right']") Icon(:icon='["fas", "chevron-right"]')
</template> </template>
<script> <script>
@ -70,6 +83,8 @@ export default {
} }
} else if (data.status === 404) { } else if (data.status === 404) {
Info = '未找到文章。' Info = '未找到文章。'
// redirect('/404')
// return
} }
return { return {

View File

@ -3,38 +3,51 @@
.articleContent(ref='articleImgs', v-if='Articels') .articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index') article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length') .articleImgs(v-if='post.postImages.length')
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
Swiper(:style="'height: ' + imageHeight + 'px'") Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for="(imgUrl, inx) in post.postImages" :key="inx") Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl') img(:src='imgUrl')
.articleAbstract .articleAbstract
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title') .articleTitle(v-html='post.post_title')
.articalMeta .articalMeta
ul ul
li li
Icon(:icon="['far', 'calendar-alt']") Icon(:icon='["far", "calendar-alt"]')
| &nbsp; {{ post.post_date }} | &nbsp; {{ post.post_date }}
li li
Icon(:icon="['far', 'bookmark']") Icon(:icon='["far", "bookmark"]')
nuxt-link(v-for='(relationships, idx) in post.term_relationships', :key='idx', v-if='relationships.term_taxonomy', :to="'/' + relationships.term_taxonomy.term.slug") nuxt-link(
v-for='(relationships, idx) in post.term_relationships',
:key='idx',
v-if='relationships.term_taxonomy',
:to='"/" + relationships.term_taxonomy.term.slug'
)
span span
| &nbsp; {{ relationships.term_taxonomy.term.name }} | &nbsp; {{ relationships.term_taxonomy.term.name }}
li(v-if='post.postmetum.meta_value !== 0') li(v-if='post.postmetum.meta_value !== 0')
Icon(:icon="['fas', 'thermometer-' + post.hotValue]") Icon(:icon='["fas", "thermometer-" + post.hotValue]')
| &nbsp; {{ post.postmetum.meta_value }} | &nbsp; {{ post.postmetum.meta_value }}
.articelAbstractContent(v-html='post.post_excerpt || post.post_content') .articelAbstractContent(
v-html='post.post_excerpt || post.post_content'
)
.readMore .readMore
nuxt-link.readMoreBtn(:to="'/post/' + post.ID") nuxt-link.readMoreBtn(:to='"/post/" + post.ID')
| READ MORE | READ MORE
.Info(v-if='Info') .Info(v-if='Info')
| {{ Info }} | {{ Info }}
nuxt-link(:to="nowPage > 2 ? nowPath + '/page/' + (nowPage - 1) : nowPath + '/'", :class="nowPage > 1 ? 'btn-footer btn-prev ' : 'btn-footer btn-prev btn-disable'") nuxt-link(
Icon(:icon="['fas', 'chevron-left']") :to='nowPage > 2 ? nowPath + "/page/" + (nowPage - 1) : nowPath + "/"',
:class='nowPage > 1 ? "btn-footer btn-prev " : "btn-footer btn-prev btn-disable"'
)
Icon(:icon='["fas", "chevron-left"]')
| &nbsp; 上一页 | &nbsp; 上一页
nuxt-link(:to="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? nowPath + '/page/' + (nowPage + 1) : '#'", :class="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? 'btn-footer btn-next' : 'btn-footer btn-next btn-disable'") nuxt-link(
:to='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? nowPath + "/page/" + (nowPage + 1) : "#"',
:class='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? "btn-footer btn-next" : "btn-footer btn-next btn-disable"'
)
| 下一页 &nbsp; | 下一页 &nbsp;
Icon(:icon="['fas', 'chevron-right']") Icon(:icon='["fas", "chevron-right"]')
</template> </template>
<script> <script>
@ -69,6 +82,8 @@ export default {
} }
} else if (data.status === 404) { } else if (data.status === 404) {
Info = '未找到文章。' Info = '未找到文章。'
// redirect('/404')
// return
} }
return { return {

View File

@ -161,7 +161,7 @@
Icon(:icon='["fas", "chevron-right"]') Icon(:icon='["fas", "chevron-right"]')
modal(name='setting') modal(name='setting')
div div
| ok | 此功能正在开发中敬请期待
.vue-module-buttons .vue-module-buttons
button.vue-module-button( button.vue-module-button(
type='button', type='button',
@ -175,8 +175,16 @@ import remark from 'remark'
import strip from 'strip-markdown' import strip from 'strip-markdown'
export default { export default {
async asyncData ({ route, app, $axios }) { async asyncData ({ route, app, $axios, redirect }) {
const data = await $axios.$get(`/public/article/details?id=${route.params.id}`) let draftStr = ''
if (route.query && route.query.draft === 'true') {
draftStr = '&draft=true'
}
const data = await $axios.$get(`/public/article/details?id=${route.params.id}${draftStr}`)
if (data.status === 404) {
redirect('/404')
return
}
const result = data.result const result = data.result
result.post_date = app.$moment(result.post_date).utc().format('lll')// result.post_date = app.$moment(result.post_date).utc().format('lll')//
// //

View File

@ -3,43 +3,56 @@
.articleContent(ref='articleImgs', v-if='Articels') .articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index') article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length') .articleImgs(v-if='post.postImages.length')
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
Swiper(:style="'height: ' + imageHeight + 'px'") Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for="(imgUrl, inx) in post.postImages" :key="inx") Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl') img(:src='imgUrl')
.articleAbstract .articleAbstract
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title') .articleTitle(v-html='post.post_title')
.articalMeta .articalMeta
ul ul
li li
Icon(:icon="['far', 'calendar-alt']") Icon(:icon='["far", "calendar-alt"]')
| &nbsp; {{ post.post_date }} | &nbsp; {{ post.post_date }}
li li
Icon(:icon="['far', 'bookmark']") Icon(:icon='["far", "bookmark"]')
nuxt-link(v-for='(relationships, idx) in post.term_relationships', :key='idx', v-if='relationships.term_taxonomy', :to="'/' + relationships.term_taxonomy.term.slug") nuxt-link(
v-for='(relationships, idx) in post.term_relationships',
:key='idx',
v-if='relationships.term_taxonomy',
:to='"/" + relationships.term_taxonomy.term.slug'
)
span span
| &nbsp; {{ relationships.term_taxonomy.term.name }} | &nbsp; {{ relationships.term_taxonomy.term.name }}
li(v-if='post.postmetum.meta_value !== 0') li(v-if='post.postmetum.meta_value !== 0')
Icon(:icon="['fas', 'thermometer-' + post.hotValue]") Icon(:icon='["fas", "thermometer-" + post.hotValue]')
| &nbsp; {{ post.postmetum.meta_value }} | &nbsp; {{ post.postmetum.meta_value }}
.articelAbstractContent(v-html='post.post_excerpt || post.post_content') .articelAbstractContent(
v-html='post.post_excerpt || post.post_content'
)
.readMore .readMore
nuxt-link.readMoreBtn(:to="'/post/' + post.ID") nuxt-link.readMoreBtn(:to='"/post/" + post.ID')
| READ MORE | READ MORE
.Info(v-if='Info') .Info(v-if='Info')
| {{ Info }} | {{ Info }}
nuxt-link(:to="nowPage > 2 ? nowPath + '/page/' + (nowPage - 1) : nowPath + '/'", :class="nowPage > 1 ? 'btn-footer btn-prev ' : 'btn-footer btn-prev btn-disable'") nuxt-link(
Icon(:icon="['fas', 'chevron-left']") :to='nowPage > 2 ? nowPath + "/page/" + (nowPage - 1) : nowPath + "/"',
:class='nowPage > 1 ? "btn-footer btn-prev " : "btn-footer btn-prev btn-disable"'
)
Icon(:icon='["fas", "chevron-left"]')
| &nbsp; 上一页 | &nbsp; 上一页
nuxt-link(:to="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? nowPath + '/page/' + (nowPage + 1) : '#'", :class="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? 'btn-footer btn-next' : 'btn-footer btn-next btn-disable'") nuxt-link(
:to='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? nowPath + "/page/" + (nowPage + 1) : "#"',
:class='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? "btn-footer btn-next" : "btn-footer btn-next btn-disable"'
)
| 下一页 &nbsp; | 下一页 &nbsp;
Icon(:icon="['fas', 'chevron-right']") Icon(:icon='["fas", "chevron-right"]')
</template> </template>
<script> <script>
export default { export default {
async asyncData ({ app, params, query, $axios }) { async asyncData ({ app, params, query, $axios, redirect }) {
let Info = null let Info = null
let Articels = [] let Articels = []
const nowPage = params.page ? parseInt(params.page) : 1 const nowPage = params.page ? parseInt(params.page) : 1
@ -69,6 +82,8 @@ export default {
} }
} else if (data.status === 404) { } else if (data.status === 404) {
Info = '未找到文章。' Info = '未找到文章。'
// redirect('/404')
// return
} }
return { return {

View File

@ -3,38 +3,51 @@
.articleContent(ref='articleImgs', v-if='Articels') .articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index') article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length') .articleImgs(v-if='post.postImages.length')
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
Swiper(:style="'height: ' + imageHeight + 'px'") Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for="(imgUrl, inx) in post.postImages" :key="inx") Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl') img(:src='imgUrl')
.articleAbstract .articleAbstract
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title') .articleTitle(v-html='post.post_title')
.articalMeta .articalMeta
ul ul
li li
Icon(:icon="['far', 'calendar-alt']") Icon(:icon='["far", "calendar-alt"]')
| &nbsp; {{ post.post_date }} | &nbsp; {{ post.post_date }}
li li
Icon(:icon="['far', 'bookmark']") Icon(:icon='["far", "bookmark"]')
nuxt-link(v-for='(relationships, idx) in post.term_relationships', :key='idx', v-if='relationships.term_taxonomy', :to="'/' + relationships.term_taxonomy.term.slug") nuxt-link(
v-for='(relationships, idx) in post.term_relationships',
:key='idx',
v-if='relationships.term_taxonomy',
:to='"/" + relationships.term_taxonomy.term.slug'
)
span span
| &nbsp; {{ relationships.term_taxonomy.term.name }} | &nbsp; {{ relationships.term_taxonomy.term.name }}
li(v-if='post.postmetum.meta_value !== 0') li(v-if='post.postmetum.meta_value !== 0')
Icon(:icon="['fas', 'thermometer-' + post.hotValue]") Icon(:icon='["fas", "thermometer-" + post.hotValue]')
| &nbsp; {{ post.postmetum.meta_value }} | &nbsp; {{ post.postmetum.meta_value }}
.articelAbstractContent(v-html='post.post_excerpt || post.post_content') .articelAbstractContent(
v-html='post.post_excerpt || post.post_content'
)
.readMore .readMore
nuxt-link.readMoreBtn(:to="'/post/' + post.ID") nuxt-link.readMoreBtn(:to='"/post/" + post.ID')
| READ MORE | READ MORE
.Info(v-if='Info') .Info(v-if='Info')
| {{ Info }} | {{ Info }}
nuxt-link(:to="nowPage > 2 ? nowPath + '/page/' + (nowPage - 1) : nowPath + '/'", :class="nowPage > 1 ? 'btn-footer btn-prev ' : 'btn-footer btn-prev btn-disable'") nuxt-link(
Icon(:icon="['fas', 'chevron-left']") :to='nowPage > 2 ? nowPath + "/page/" + (nowPage - 1) : nowPath + "/"',
:class='nowPage > 1 ? "btn-footer btn-prev " : "btn-footer btn-prev btn-disable"'
)
Icon(:icon='["fas", "chevron-left"]')
| &nbsp; 上一页 | &nbsp; 上一页
nuxt-link(:to="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? nowPath + '/page/' + (nowPage + 1) : '#'", :class="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? 'btn-footer btn-next' : 'btn-footer btn-next btn-disable'") nuxt-link(
:to='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? nowPath + "/page/" + (nowPage + 1) : "#"',
:class='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? "btn-footer btn-next" : "btn-footer btn-next btn-disable"'
)
| 下一页 &nbsp; | 下一页 &nbsp;
Icon(:icon="['fas', 'chevron-right']") Icon(:icon='["fas", "chevron-right"]')
</template> </template>
<script> <script>
@ -69,6 +82,8 @@ export default {
} }
} else if (data.status === 404) { } else if (data.status === 404) {
Info = '未找到文章。' Info = '未找到文章。'
// redirect('/404')
// return
} }
return { return {

View File

@ -3,38 +3,51 @@
.articleContent(ref='articleImgs', v-if='Articels') .articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index') article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length') .articleImgs(v-if='post.postImages.length')
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
Swiper(:style="'height: ' + imageHeight + 'px'") Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for="(imgUrl, inx) in post.postImages" :key="inx") Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl') img(:src='imgUrl')
.articleAbstract .articleAbstract
nuxt-link(:to="'/post/' + post.ID") nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title') .articleTitle(v-html='post.post_title')
.articalMeta .articalMeta
ul ul
li li
Icon(:icon="['far', 'calendar-alt']") Icon(:icon='["far", "calendar-alt"]')
| &nbsp; {{ post.post_date }} | &nbsp; {{ post.post_date }}
li li
Icon(:icon="['far', 'bookmark']") Icon(:icon='["far", "bookmark"]')
nuxt-link(v-for='(relationships, idx) in post.term_relationships', :key='idx', v-if='relationships.term_taxonomy', :to="'/' + relationships.term_taxonomy.term.slug") nuxt-link(
v-for='(relationships, idx) in post.term_relationships',
:key='idx',
v-if='relationships.term_taxonomy',
:to='"/" + relationships.term_taxonomy.term.slug'
)
span span
| &nbsp; {{ relationships.term_taxonomy.term.name }} | &nbsp; {{ relationships.term_taxonomy.term.name }}
li(v-if='post.postmetum.meta_value !== 0') li(v-if='post.postmetum.meta_value !== 0')
Icon(:icon="['fas', 'thermometer-' + post.hotValue]") Icon(:icon='["fas", "thermometer-" + post.hotValue]')
| &nbsp; {{ post.postmetum.meta_value }} | &nbsp; {{ post.postmetum.meta_value }}
.articelAbstractContent(v-html='post.post_excerpt || post.post_content') .articelAbstractContent(
v-html='post.post_excerpt || post.post_content'
)
.readMore .readMore
nuxt-link.readMoreBtn(:to="'/post/' + post.ID") nuxt-link.readMoreBtn(:to='"/post/" + post.ID')
| READ MORE | READ MORE
.Info(v-if='Info') .Info(v-if='Info')
| {{ Info }} | {{ Info }}
nuxt-link(:to="nowPage > 2 ? nowPath + '/page/' + (nowPage - 1) : nowPath + '/'", :class="nowPage > 1 ? 'btn-footer btn-prev ' : 'btn-footer btn-prev btn-disable'") nuxt-link(
Icon(:icon="['fas', 'chevron-left']") :to='nowPage > 2 ? nowPath + "/page/" + (nowPage - 1) : nowPath + "/"',
:class='nowPage > 1 ? "btn-footer btn-prev " : "btn-footer btn-prev btn-disable"'
)
Icon(:icon='["fas", "chevron-left"]')
| &nbsp; 上一页 | &nbsp; 上一页
nuxt-link(:to="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? nowPath + '/page/' + (nowPage + 1) : '#'", :class="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? 'btn-footer btn-next' : 'btn-footer btn-next btn-disable'") nuxt-link(
:to='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? nowPath + "/page/" + (nowPage + 1) : "#"',
:class='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? "btn-footer btn-next" : "btn-footer btn-next btn-disable"'
)
| 下一页 &nbsp; | 下一页 &nbsp;
Icon(:icon="['fas', 'chevron-right']") Icon(:icon='["fas", "chevron-right"]')
</template> </template>
<script> <script>
@ -69,6 +82,8 @@ export default {
} }
} else if (data.status === 404) { } else if (data.status === 404) {
Info = '未找到文章。' Info = '未找到文章。'
// redirect('/404')
// return
} }
return { return {