fix(mine): 拓展结余展示万级单位

This commit is contained in:
woody 2025-07-16 10:40:43 +08:00
parent c16f8eacf7
commit 81505df53f
1 changed files with 16 additions and 4 deletions

View File

@ -131,8 +131,9 @@
}"
></view>
<view class="cha">
左区 {{ totalBalanceProgress.leftValue || 0 }}/右区
{{ totalBalanceProgress.rightValue || 0 }}
左区
{{ totalBalanceFormat(totalBalanceProgress.leftValue) }}/右区
{{ totalBalanceFormat(totalBalanceProgress.rightValue) }}
</view>
</view>
</view>
@ -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)