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

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

View File

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