修复微信小程序上空值是undefined导致的台桌接口报错和确认订单商品不展示的问题

This commit is contained in:
YeMingfei666 2024-10-30 13:55:32 +08:00
parent 1791d5f3d8
commit 1f099e2174
2 changed files with 10 additions and 10 deletions

View File

@ -166,7 +166,7 @@
async function getTable() {
// let state=status.list[status.active].key
// state=state?(state=='all'?'':state):''
const areaId=area.list[area.defaultCateIndex].id
const areaId=area.list[area.defaultCateIndex].id||''
let {
content,total
} = await $table.get({...query,areaId,name:searchValue.value,state:'idle'})

View File

@ -340,7 +340,7 @@
//
const res = await Api.$choseCount({
masterId: option.masterId,
tableId: table.value.tableId,
tableId: table.value.tableId||'',
num: userNumbers.defaultCateIndex+1,
})
Object.assign($seatFee, res)
@ -369,7 +369,7 @@
isPack,
isGift,
masterId: option.masterId,
tableId: table.value.tableId,
tableId: table.value.tableId||'',
productId,
num: number,
skuId
@ -427,7 +427,7 @@
console.log(option);
const submitPar = {
masterId: option.masterId,
tableId: table.value.tableId,
tableId: table.value.tableId||"",
vipUserId: user.value.id ? user.value.id : '',
type: user.value.id ? 0 : 1 //0 1
}
@ -510,7 +510,7 @@
page: 0,
size: 300,
masterId: option.masterId,
tableId: table.value.tableId
tableId: table.value.tableId||''
}) {
const {
records,
@ -550,13 +550,13 @@
note: note.value,
postPay: true,
orderId: '',
tableId: table.value.tableId
tableId: table.value.tableId||''
}) {
if (!$shop.value.isTableFee) {
//
await Api.$choseCount({
masterId: option.masterId,
tableId: table.value.tableId,
tableId: table.value.tableId||"",
num: userNumbers.defaultCateIndex+1,
})
}
@ -616,7 +616,7 @@
cartId: cart.id,
productId: cart.productId,
skuId: cart.skuId,
tableId: option.tableId,
tableId: option.tableId||"",
note: e.remark,
num: cart.number // 0
})
@ -637,7 +637,7 @@
console.log(option,);
if (opt) {
table.value = {
tableId: opt.tableId,
tableId: opt.tableId||'',
name: opt.name
}
}
@ -673,7 +673,7 @@
}
const res = await Api.$changeUseType({
useType,
tableId,
tableId:tableId||'',
cartIds: goods.list.map((v) => v.id),
})
getCart()