代客下单更新

This commit is contained in:
2024-10-12 10:23:44 +08:00
parent d03a8ea542
commit dd2776fe13
3 changed files with 27 additions and 16 deletions

View File

@@ -523,6 +523,7 @@
}
// updateChoseCount()
const res = await Api.$createOrder(par)
uni.$emit('update:createOrderIndex')
console.log($shop.value);
console.log(res);
if ($shop.value.registerType == 'munchies') {
@@ -534,11 +535,14 @@
)
} else {
//后付
if (option.isCreateOrderToDetail) {
console.log(option.isCreateOrderToDetail);
if (option.isCreateOrderToDetail!='0') {
console.log('PAGES_ORDER_DETAIL');
go.to('PAGES_ORDER_DETAIL', {
id: res.id
},'redirect')
} else {
console.log('back');
uni.navigateBack({
delta: 2
})
@@ -584,9 +588,8 @@
}
onLoad((opt) => {
console.log('opt');
console.log(opt);
Object.assign(option, opt)
console.log(option,);
if (opt) {
table.value = {
tableId: opt.tableId,

View File

@@ -126,7 +126,7 @@
const {tableId,name,maxCapacity,status,type}=props.table
go.to('PAGES_CONFIRM_ORDER',{
masterId:props.masterId,type,
tableId,name,maxCapacity,status,isCreateOrderToDetail:props.isCreateOrderToDetail
tableId,name,maxCapacity,status,isCreateOrderToDetail:props.isCreateOrderToDetail?1:0
})
}

View File

@@ -1,18 +1,21 @@
<template>
<view class="u-wrap">
<view class="top bg-fff w-full">
<view class="u-flex u-row-between choose-user" @tap="chooseTable">
<view>
<view v-if="!data.table.tableId">选择桌台</view>
<view class="u-flex" v-else>
<view class="u-m-l-20">{{data.table.name}}</view>
<template v-if="option.type!='add'">
<view class="u-flex u-row-between choose-user" @tap="chooseTable">
<view>
<view v-if="!data.table.tableId">选择桌台</view>
<view class="u-flex" v-else>
<view class="u-m-l-20">{{data.table.name}}</view>
</view>
</view>
<view class="u-flex">
<uni-icons type="right" size="20" color="#999"></uni-icons>
</view>
</view>
<view class="u-flex">
<uni-icons type="right" size="20" color="#999"></uni-icons>
</view>
</view>
</template>
<!-- <view class="u-flex u-row-between choose-user" @tap="chooseUser">
<view>
<view v-if="!data.vipUser.id">选择用户</view>
@@ -374,8 +377,8 @@
await clearCart()
cars.length = 0
for (let i in data.tabbar) {
for (let k in data.tabbar[i].fgoods) {
data.tabbar[i].fgoods[k].chooseNumber = 0
for (let k in data.tabbar[i].foods) {
data.tabbar[i].foods[k].chooseNumber = 0
}
}
}
@@ -997,12 +1000,17 @@
watchUpdate()
})
let isCreateOrderToDetail = ref(false)
let option={type:''}
onLoad((opt) => {
console.log(opt)
option=opt
Object.assign(data.table, opt)
if (opt.useType) {
uni.setStorageSync('useType', opt.useType)
}
uni.setNavigationBarTitle({
title:(opt&&opt.type=='add')?'顾客加菜':'代客下单'
})
if (JSON.stringify(opt) == '{}') {
isCreateOrderToDetail.value = true
}