订单详情页面总技保持两位小数

This commit is contained in:
2024-10-11 17:52:46 +08:00
parent 0cfc3aebc7
commit f439dca343
2 changed files with 41 additions and 7 deletions

View File

@@ -106,7 +106,7 @@
<view></view>
<view>
<text>总计</text>
<text class="font-bold u-font-32">{{allPrice*1+seatFeePrice*1}}</text>
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1) }}</text>
</view>
</view>
<view class="u-m-t-30">
@@ -122,7 +122,14 @@
} from 'vue';
import color from '@/commons/color.js'
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
function to2(n){
if(!n){
return 0
}
return n.toFixed(2)
}
function tuicai(item, index) {
emits('tuicai', item, index)
}