Feat:咨询观看量,点赞数显示调整

This commit is contained in:
LinCyJang
2026-01-31 14:39:41 +08:00
parent 285224284f
commit 2682ecaecd
14 changed files with 42 additions and 29 deletions
+13
View File
@@ -75,6 +75,18 @@ const force2Decimal = function change2Decimal(value) {
return forceToDecimal(value, 2)
}
const formatCount = function(value) {
if (!value) return 0;
const num = parseFloat(value);
if (isNaN(num)) return 0;
if (num >= 10000) {
let val = num / 10000;
val = parseFloat(val.toFixed(1));
return val + '万';
}
return num;
}
const toast = (title = '', position = 'center', success = function() {}) => {
uni.showToast({
title,
@@ -88,6 +100,7 @@ const toast = (title = '', position = 'center', success = function() {}) => {
Vue.prototype.$force2Decimal = force2Decimal
Vue.prototype.$forceToDecimal = forceToDecimal
Vue.prototype.$formatCount = formatCount
Vue.config.productionTip = false
App.mpType = 'app'