diff --git a/pages/mine/index.vue b/pages/mine/index.vue index a982548..92472a8 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -131,8 +131,9 @@ }" > - 左区 {{ totalBalanceProgress.leftValue || 0 }}/右区 - {{ totalBalanceProgress.rightValue || 0 }} + 左区 + {{ totalBalanceFormat(totalBalanceProgress.leftValue) }}/右区 + {{ totalBalanceFormat(totalBalanceProgress.rightValue) }} @@ -632,13 +633,24 @@ export default { return { leftProgress, rightProgress, - leftValue: leftValue.toFixed(0), - rightValue: rightValue.toFixed(0), + leftValue: leftValue, + rightValue: rightValue, } }, }, methods: { + totalBalanceFormat(value) { + const num = parseFloat(value) + if (isNaN(num)) { + return '0.0000万' + } + if (num >= 5000000) { + return '500万+' + } + const valueInWan = num / 10000 + return `${valueInWan.toFixed(4)}万` + }, getMemberBalance() { getMemberBalance().then(res => { console.log('🌈res', res)