feat(refund/detail): 退款金额保留两位小数
This commit is contained in:
parent
d7a22a9bb3
commit
b97b5aecf5
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue