代客下单更新

This commit is contained in:
2024-10-10 16:22:09 +08:00
parent efa346ade6
commit 0632e395ce
6 changed files with 61 additions and 23 deletions

View File

@@ -76,6 +76,9 @@
return []
}
},
isCreateOrderToDetail:{
type:Boolean,default:false
},
user:{
type: Object,
default: () => {
@@ -123,7 +126,7 @@
const {tableId,name,maxCapacity,status,type}=props.table
go.to('PAGES_CONFIRM_ORDER',{
masterId:props.masterId,type,
tableId,name,maxCapacity,status
tableId,name,maxCapacity,status,isCreateOrderToDetail:props.isCreateOrderToDetail
})
}

View File

@@ -97,7 +97,7 @@
</template>
<view class="bottom w-full">
<my-car @updateNumber="carsNumberChange" :user="data.vipUser" :masterId="data.masterId" :table="data.table"
<my-car :isCreateOrderToDetail="isCreateOrderToDetail" @updateNumber="carsNumberChange" :user="data.vipUser" :masterId="data.masterId" :table="data.table"
:data="cars" @clear="onClearCart"></my-car>
</view>
@@ -913,16 +913,29 @@
init()
})
onBeforeUnmount(() => {})
function watchUpdate() {
uni.$off('update:createOrderIndex')
uni.$on('update:createOrderIndex', (data) => {
console.log('update:createOrderIndex');
init()
})
}
onShow(() => {
// watchChooseuser()
watchChooseTable()
watchUpdate()
})
let isCreateOrderToDetail=ref(false)
onLoad((opt) => {
console.log(opt)
Object.assign(data.table, opt)
if(opt.useType){
uni.setStorageSync('useType',opt.useType)
}
if(JSON.stringify(opt)=='{}'){
isCreateOrderToDetail.value=true
}
// if (!opt.tableId) {
// infoBox.showErrorToast('暂不支持不选择桌台下载,请从桌台点餐')
// return setTimeout(() => {