评论:修正好评率,舍弃小数

pull/2/head
owen 2023-09-24 23:26:57 +08:00
parent 380b47e371
commit 52f8e217f3
2 changed files with 2 additions and 2 deletions

View File

@ -640,7 +640,7 @@
getProductReplyCount: function() {
ProductCommentApi.getCommentStatistics(this.activity.spuId).then(res => {
const count = res.data.goodCount + res.data.mediocreCount + res.data.negativeCount;
this.$set(this, 'replyChance', 100.0 * res.data.goodCount / count);
this.$set(this, 'replyChance', (100.0 * res.data.goodCount / count).toFixed(0));
this.$set(this, 'replyCount', count);
});
},

View File

@ -778,7 +778,7 @@
getProductReplyCount: function() {
ProductCommentApi.getCommentStatistics(this.id).then(res => {
const count = res.data.goodCount + res.data.mediocreCount + res.data.negativeCount;
this.$set(this, 'replyChance', 100.0 * res.data.goodCount / count);
this.$set(this, 'replyChance', (100.0 * res.data.goodCount / count).toFixed(0));
this.$set(this, 'replyCount', count);
});
},