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

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)
}

View File

@@ -125,11 +125,13 @@
let option = {isNowPay:false}
let payFinish=ref(false)
onBackPress(() => {
if (option.isNowPay&&!payFinish.value) {
infoBox.showToast('先付费模式,请先结算订单')
return true
}
return false
console.log('onBackPress');
uni.$emit('update:createOrderIndex')
// if (option.isNowPay&&!payFinish.value) {
// infoBox.showToast('先付费模式,请先结算订单')
// return true
// }
// return false
})
let payStatus = ref(null) //loading success
@@ -158,6 +160,31 @@
selIndex: 0
}
})
function chooseUser() {
go.to('PAGES_CHOOSE_USER')
}
//更新选择用户
function setUser(par) {
console.log(option);
const submitPar = {
masterId: option.masterId,
tableId: table.value.tableId,
vipUserId: user.value.id ? user.value.id : '',
type: user.value.id ? 0 : 1 //0 设置 1 取消
}
Object.assign(submitPar, par)
return Api.$setUser(submitPar)
}
function watchChooseuser() {
uni.$off('choose-user')
uni.$on('choose-user', (data) => {
console.log(data);
user.value = data
setUser()
})
}
watch(() => pays.selIndex, (newval) => {
clearInterval(timer)