feat(refund/detail): 退款金额保留两位小数

This commit is contained in:
woody 2025-07-05 16:08:44 +08:00
parent d7a22a9bb3
commit b97b5aecf5
1 changed files with 13 additions and 2 deletions

View File

@ -48,7 +48,9 @@
<view class="refund-content">
<view class="refund-amount">
<text class="amount-label">退款金额</text>
<text class="amount-value">¥{{ item.refundMoney }}</text>
<text class="amount-value"
>¥{{ stateFormat(item.refundMoney) }}</text
>
</view>
<view class="refund-time">
<text class="time-label">退款时间</text>
@ -178,7 +180,16 @@ export default {
uni.stopPullDownRefresh()
}
},
stateFormat(val) {
if (val) {
return Number(val)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
return $1 + ','
})
.replace(/\.$/, '')
}
},
//
loadMore() {
if (this.hasMore && !this.loading) {