Authored by yyq

widget btn number

... ... @@ -14,7 +14,7 @@
<WidgetFav
class="comment-fav"
:comment-id="parentComment.id"
:num="parentComment.praiseTotal"
:num="praiseTotal"
:option="favOption"></WidgetFav>
</div>
</div>
... ... @@ -102,6 +102,15 @@ export default {
},
replyMoreText() {
return this.isShowAllReply ? '收起' : `查看${this.moreReplyNum}条回复`;
},
praiseTotal() {
let praiseTotal = this.parentComment.praiseTotal || 0;
if (praiseTotal > 999) {
return Math.floor(praiseTotal / 1000) + 'k';
}
return praiseTotal;
}
},
methods: {
... ... @@ -191,9 +200,13 @@ export default {
}
.comment-nav-right {
width: 90px;
display: flex;
align-items: center;
padding-right: 20px;
.comment-fav {
position: absolute;
}
}
.comment-cont {
... ...
... ... @@ -7,7 +7,7 @@
</div>
</i>
<p v-if="viewText" class="icon-btn-text" :style="textStyle">
<span class="view-text">{{Number(viewText) > 0 ? viewText : ''}}</span>
<span class="view-text">{{viewText}}</span>
<span class="placeholder-text">{{placText}}</span>
</p>
</div>
... ... @@ -153,7 +153,13 @@ export default {
return style;
},
viewText() {
return `${(this.editText === null ? this.text : this.editText)}`;
let text = (this.editText === null ? this.text : this.editText);
if (!isNaN(Number(text))) {
text = text > 0 ? text : '';
}
return text;
},
placText() {
if (!isNaN(Number(this.text)) && this.viewText.length) {
... ...