修复微信小程序上空值是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() { async function getTable() {
// let state=status.list[status.active].key // let state=status.list[status.active].key
// state=state?(state=='all'?'':state):'' // state=state?(state=='all'?'':state):''
const areaId=area.list[area.defaultCateIndex].id const areaId=area.list[area.defaultCateIndex].id||''
let { let {
content,total content,total
} = await $table.get({...query,areaId,name:searchValue.value,state:'idle'}) } = await $table.get({...query,areaId,name:searchValue.value,state:'idle'})

View File

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