fix(mine): 拓展结余展示万级单位
This commit is contained in:
parent
c16f8eacf7
commit
81505df53f
|
@ -131,8 +131,9 @@
|
||||||
}"
|
}"
|
||||||
></view>
|
></view>
|
||||||
<view class="cha">
|
<view class="cha">
|
||||||
左区 {{ totalBalanceProgress.leftValue || 0 }}/右区
|
左区
|
||||||
{{ totalBalanceProgress.rightValue || 0 }}
|
{{ totalBalanceFormat(totalBalanceProgress.leftValue) }}/右区
|
||||||
|
{{ totalBalanceFormat(totalBalanceProgress.rightValue) }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -632,13 +633,24 @@ export default {
|
||||||
return {
|
return {
|
||||||
leftProgress,
|
leftProgress,
|
||||||
rightProgress,
|
rightProgress,
|
||||||
leftValue: leftValue.toFixed(0),
|
leftValue: leftValue,
|
||||||
rightValue: rightValue.toFixed(0),
|
rightValue: rightValue,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
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() {
|
||||||
getMemberBalance().then(res => {
|
getMemberBalance().then(res => {
|
||||||
console.log('🌈res', res)
|
console.log('🌈res', res)
|
||||||
|
|
Loading…
Reference in New Issue