将所有eval in template转移到computed
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div style="flex-direction: row; margin-left: 23px; margin-top: 5px">
|
||||
<text class="userstat_text">
|
||||
粉丝数: {{ this.$app.$def.tools.formatNumber(user.fans) }}
|
||||
粉丝数: {{ fans }}
|
||||
</text>
|
||||
<text style="margin-left: 15px" class="userstat_text">
|
||||
投稿数: {{ user.videos }}
|
||||
@@ -36,6 +36,11 @@
|
||||
<script>
|
||||
export default {
|
||||
props: ["user"],
|
||||
computed: {
|
||||
fans(){
|
||||
return this.$app.$def.tools.formatNumber(this.user.fans)
|
||||
}
|
||||
},
|
||||
onInit(){
|
||||
if(!(this.user.upic.includes("http://") || this.user.upic.includes("https://"))){
|
||||
this.user.upic = "https:" + this.user.upic
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="stat_view">
|
||||
<image class="stat_view_img" src="/common/playcounticon.png"></image>
|
||||
<text class="stat_view_text">
|
||||
{{ this.$app.$def.tools.formatNumber(video.stat.view) }}
|
||||
{{ stat_view }}
|
||||
</text>
|
||||
</div>
|
||||
</div>
|
||||
@@ -37,6 +37,11 @@ export default {
|
||||
onlineimg_width: "160",
|
||||
onlineimg_height: "100"
|
||||
},
|
||||
computed: {
|
||||
stat_view(){
|
||||
return this.$app.$def.tools.formatNumber(this.video.stat.view)
|
||||
}
|
||||
},
|
||||
OpenVideo(bvid) {
|
||||
router.push({
|
||||
uri: "pages/video/videodetail",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<image src="/common/article_clock.png" static></image>
|
||||
<text class="infofield_text" static>预计阅读用时</text>
|
||||
<text class="pinknum" style="margin-left: 5px">
|
||||
{{ this.$app.$def.articletools.estimateReadingTime(article.readInfo.content) }}
|
||||
{{ readingTime }}
|
||||
</text>
|
||||
<text class="infofield_text" style="margin-left: 5px" static>分钟</text>
|
||||
</div>
|
||||
@@ -48,6 +48,11 @@ export default {
|
||||
show_loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
readingTime(){
|
||||
return this.$app.$def.articletools.estimateReadingTime(this.article.readInfo.content)
|
||||
}
|
||||
},
|
||||
SplitArticle(arr, split_count) {
|
||||
let result = [];
|
||||
for (let i = 0; i < arr.length; i += split_count) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.replylist {
|
||||
width: 77%;
|
||||
height: 77%;
|
||||
height: 79%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="stat">
|
||||
<image class="statimg" src="/common/playcounticon.png" style="width: 23px; height: 25px; margin-top: 2px">
|
||||
</image>
|
||||
<text class="statext">{{ this.$app.$def.tools.formatNumber(vid.stat.view) }}</text>
|
||||
<text class="statext">{{ stat_view }}</text>
|
||||
</div>
|
||||
<div class="stat" style="margin-left: 10px">
|
||||
<image class="statimg" src="/common/uploadericon.png" style="width: 27px; height: 29px"></image>
|
||||
@@ -23,16 +23,16 @@
|
||||
<scroll scroll-x="true" class="vidtoolbar" style="margin-top: 25px" bounces="true">
|
||||
<div class="vidtool" style="margin-left: 0px" @click="LikeClick()" @longpress="PowerIt()">
|
||||
<image class="vidtoolimg" src="{{likesrc}}"></image>
|
||||
<text class="vidtooltext">{{ this.$app.$def.tools.formatNumber(vid.stat.like) }}</text>
|
||||
<text class="vidtooltext">{{ stat_like }}</text>
|
||||
</div>
|
||||
<div class="vidtool" @click="CoinClick()">
|
||||
<image class="vidtoolimg" src="{{coinsrc}}"></image>
|
||||
<text class="vidtooltext">{{ this.$app.$def.tools.formatNumber(vid.stat.coin) }}</text>
|
||||
<text class="vidtooltext">{{ stat_coin }}</text>
|
||||
</div>
|
||||
<div class="vidtool" @click="AddToFav()">
|
||||
<image class="vidtoolimg" src="{{starsrc}}"></image>
|
||||
<text class="vidtooltext">
|
||||
{{ this.$app.$def.tools.formatNumber(vid.stat.favorite) }}
|
||||
{{ stat_favorite }}
|
||||
</text>
|
||||
</div>
|
||||
<div class="vidtool" @click="AISummary()">
|
||||
@@ -80,6 +80,20 @@ export default {
|
||||
replymode: false,
|
||||
renderingCover: false
|
||||
},
|
||||
computed: {
|
||||
stat_view(){
|
||||
return this.$app.$def.tools.formatNumber(this.vid.stat.view)
|
||||
},
|
||||
stat_like(){
|
||||
return this.$app.$def.tools.formatNumber(this.vid.stat.like)
|
||||
},
|
||||
stat_coin(){
|
||||
return this.$app.$def.tools.formatNumber(this.vid.stat.coin)
|
||||
},
|
||||
stat_favorite(){
|
||||
return this.$app.$def.tools.formatNumber(this.vid.stat.favorite)
|
||||
}
|
||||
},
|
||||
onInit() {
|
||||
global.logger.log("[videodetail] load bvid: " + this.bvid);
|
||||
this.GetVideoDetail()
|
||||
|
||||
Reference in New Issue
Block a user