Feat:咨询观看量,点赞数显示调整
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user