文章阅读数支持显示单位K

This commit is contained in:
LingZhaoHui 2021-11-06 22:25:07 +08:00
parent f938f2c4c8
commit 8643be5617
3 changed files with 29 additions and 8 deletions

View File

@ -69,15 +69,21 @@
</h1> </h1>
<div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto"> <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
<div class="level-left"> <div class="level-left">
<!--<div class="level-item has-text-grey">
跟新于${article.articleUpdateDate?string("yyyy年MM月dd日")}
</div>
-->
<div class="level-item has-text-grey"> <div class="level-item has-text-grey">
创建于${article.articleCreateDate?string("yyyy年MM月dd日")} ${article.articleUpdateDate?string("yyyy.MM.dd")} 最后跟新
</div> </div>
<!--<div class="level-item has-text-grey">
${article.articleCreateDate?string("yyyy.MM.dd")} 创建
</div>-->
<div> <div>
<#assign viewCountStr=article.articleViewCount?string('#.###')/>
<#if viewCountStr?length gt 3>
<#assign viewCount=viewCountStr?number/>
<#assign viewCountK=viewCount/1000 />
${viewCountK?string('#.##')}K 浏览&nbsp;
<#else>
${article.articleViewCount} 浏览&nbsp; ${article.articleViewCount} 浏览&nbsp;
</#if>
</div> </div>
<div> <div>
<#if article.articleCommentCount != 0> <#if article.articleCommentCount != 0>

View File

@ -58,7 +58,14 @@
<div style="padding-top: 10px;"> <div style="padding-top: 10px;">
<div class="has-text-grey is-size-7 is-uppercase"> <div class="has-text-grey is-size-7 is-uppercase">
<#assign viewCountStr=article.articleViewCount?string('#.###')/>
<#if viewCountStr?length gt 3>
<#assign viewCount=viewCountStr?number/>
<#assign viewCountK=viewCount/1000 />
${viewCountK?string('#.##')}K 浏览
<#else>
${article.articleViewCount}浏览 ${article.articleViewCount}浏览
</#if>
</div> </div>
</div> </div>
<a href="${article.articlePermalink}" <a href="${article.articlePermalink}"

View File

@ -190,7 +190,15 @@
<div class="content"> <div class="content">
<div style="padding-top: 10px;"> <div style="padding-top: 10px;">
<div class="has-text-grey is-size-7 is-uppercase">${article.articleViewCount}浏览 <div class="has-text-grey is-size-7 is-uppercase">
<#assign viewCountStr=article.articleViewCount?string('#.###')/>
<#if viewCountStr?length gt 3>
<#assign viewCount=viewCountStr?number/>
<#assign viewCountK=viewCount/1000 />
${viewCountK?string('#.##')}K 浏览
<#else>
${article.articleViewCount}浏览
</#if>
</div> </div>
</div> </div>
<a href="${article.articlePermalink}" <a href="${article.articlePermalink}"