代客下单更新
This commit is contained in:
@@ -448,21 +448,20 @@
|
|||||||
})
|
})
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if (res && res.content[0]) {
|
if (res && res.content[0]) {
|
||||||
// data.table=res.content[0]
|
data.table={...res.content[0],...data.table}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let $originGoods = []
|
let $originGoods = []
|
||||||
let $category = []
|
let $category = []
|
||||||
async function init() {
|
async function init() {
|
||||||
const masterRes = await getMasterId()
|
|
||||||
data.masterId = masterRes.masterId
|
|
||||||
const shopInfo = await tbShopInfo()
|
const shopInfo = await tbShopInfo()
|
||||||
$shop.value = shopInfo
|
$shop.value = shopInfo
|
||||||
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
|
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
|
||||||
uni.setStorageSync('useType', useType)
|
uni.setStorageSync('useType', useType)
|
||||||
console.log(shopInfo);
|
console.log(shopInfo);
|
||||||
getTableInfo()
|
await getTableInfo()
|
||||||
const categoryRes = await getCategory()
|
const categoryRes = await getCategory()
|
||||||
const category = categoryRes.content.reduce((prve, cur) => {
|
const category = categoryRes.content.reduce((prve, cur) => {
|
||||||
prve.push({
|
prve.push({
|
||||||
@@ -482,20 +481,32 @@
|
|||||||
return isShow;
|
return isShow;
|
||||||
});
|
});
|
||||||
$originGoods = goods
|
$originGoods = goods
|
||||||
// if (!data.table.tableId) {
|
console.log(option);
|
||||||
// //无桌台
|
if(option.type=='add'){
|
||||||
|
// await getTableInfo()
|
||||||
// setTabBar(category, goods, [])
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// const {
|
|
||||||
// masterId
|
|
||||||
// } = await getMasterId()
|
|
||||||
// data.masterId = masterId
|
|
||||||
if(data.table.tableId){
|
|
||||||
const masterRes = await getMasterId()
|
const masterRes = await getMasterId()
|
||||||
data.masterId = masterRes.masterId
|
data.masterId = masterRes.masterId
|
||||||
|
cars.length = 0
|
||||||
|
setTabBar(category, goods, [])
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
if (!data.table.tableId) {
|
||||||
|
const masterRes = await getMasterId()
|
||||||
|
data.masterId = masterRes.masterId
|
||||||
|
//无桌台
|
||||||
|
const cartRes = await getCart()
|
||||||
|
cars.length = 0
|
||||||
|
const cartArr = getNowCart(cartRes.records)
|
||||||
|
for (let i in cartArr) {
|
||||||
|
cars.push(cartArr[i])
|
||||||
|
}
|
||||||
|
setTabBar(category, goods, cars)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const {
|
||||||
|
masterId
|
||||||
|
} = await getMasterId()
|
||||||
|
data.masterId = masterId
|
||||||
const cartRes = await getCart()
|
const cartRes = await getCart()
|
||||||
cars.length = 0
|
cars.length = 0
|
||||||
const cartArr = getNowCart(cartRes.records)
|
const cartArr = getNowCart(cartRes.records)
|
||||||
@@ -1093,7 +1104,9 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
watch(() => data.table.tableId, (newval, oldval) => {
|
watch(() => data.table.tableId, (newval, oldval) => {
|
||||||
onSelTable()
|
if(option.type!='add'){
|
||||||
|
onSelTable()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
async function onSelTable() {
|
async function onSelTable() {
|
||||||
const {
|
const {
|
||||||
|
|||||||
Reference in New Issue
Block a user