修复再来一单问题

This commit is contained in:
2025-12-16 17:00:32 +08:00
parent 251490e3ab
commit 645122c182
9 changed files with 170 additions and 84 deletions

View File

@@ -1556,7 +1556,7 @@
}
}
let socketInitFinished = false
// 收到的消息变化
async function onMessage(Message) {
@@ -1588,9 +1588,33 @@
}
if (Message.operate_type == 'rottable_error') {
uni.showModal({
title: '提示',
content: Message.msg,
showCancel: true,
cancelText: '舍弃',
confirmText: '合并',
success(res) {
if (res.confirm) {
startUseTable({
is_hb: 2
})
} else {
startUseTable({
is_hb: 2,
give_up: 1
})
}
}
})
}
// 转桌成功
if (Message.operate_type == 'rottable' && Message.status == 1) {
if (Message.operate_type == 'rottable') {
console.log('转桌成功了');
console.log(Message);
// uni.showToast({
// title: '扫码成功,请下单',
@@ -1664,7 +1688,7 @@
}
// 提示
if (Message.status == 0 && Message.type != 'no_suit_num' && Message.type != 'time_discount') {
if (Message.status == 0 && Message.type != 'no_suit_num' && Message.type != 'time_discount'&&Message.operate_type != 'rottable_error') {
uni.showToast({
title: Message.msg,
icon: 'none'
@@ -2086,19 +2110,21 @@
}
// 开始换桌
function startUseTable() {
function startUseTable(par) {
tableShopInfo.value = uni.cache.get('shopInfo');
const oldTableCode = uni.cache.get('tableCode');
const cartIds = cartStore.carts.map((item) => item.id);
const data = {
is_hb: 1,
...par,
type: 'shopping',
operate_type: 'rottable',
account: tableShopInfo.value.phone,
table_code: oldTableCode,
new_table_code: uni.cache.get('shopTable').tableCode,
cart_id: cartIds,
shop_id: tableShopInfo.value.id
shop_id: tableShopInfo.value.id,
};
websocketsendMessage(data);
@@ -2186,12 +2212,12 @@
const res = await APIhistoryOrder({
tableCode: uni.cache.get('tableCode')
});
if(res&&res.id){
return uni.showModal({
title:'提示',
content:'目标台桌使用中无法转桌',
showCancel:false
if (res && res.id) {
return uni.showModal({
title: '提示',
content: '目标台桌使用中无法转桌',
showCancel: false
})
}
if (shopInfoRes.shopInfo.isTableFee === 1) {
@@ -2239,6 +2265,7 @@
if (e.one_more_order && e.order_id) {
extraInitPar.one_more_order = 1
extraInitPar.order_id = e.order_id
extraInitPar.user_id = uni.cache.get('userInfo').id||''
}
useSocket.connect({