优化代客下单选择用户重复连接ws的问题

This commit is contained in:
gyq
2025-11-18 16:14:26 +08:00
parent 70f46a61c1
commit 606d0da349
2 changed files with 8 additions and 5 deletions

View File

@@ -841,8 +841,6 @@ export const useCartsStore = defineStore("carts", () => {
$initParams = initParams;
}
concocatSocket($initParams);
}
@@ -971,7 +969,12 @@ export const useCartsStore = defineStore("carts", () => {
if (msg.operate_type === "bulk_edit") {
msg.operate_type = 'manage_' + msg.operate_type;
concocatSocket({ ...$initParams, table_code: table_code.value });
console.log('WebSocketManager.connected===', WebSocketManager.connected);
if (WebSocketManager.connected) {
WebSocketManager.sendMessage({ ...$initParams, table_code: table_code.value })
} else {
concocatSocket({ ...$initParams, table_code: table_code.value });
}
}
});
}

View File

@@ -81,10 +81,10 @@
</div>
</div>
<div class="btn-group" v-if="isXianFuKuan">
<el-button type="primary" size="large" :disabled="!carts.isLinkFinshed" @click="createOrder('wx-aiplay')">
<el-button type="primary" size="large" :disabled="disabledMorePay" @click="createOrder('wx-aiplay')">
微信/支付宝
</el-button>
<el-button type="primary" size="large" :disabled="!carts.isLinkFinshed" @click="createOrder('cash')">
<el-button type="primary" size="large" :disabled="disabledMorePay" @click="createOrder('cash')">
现金
</el-button>
<el-button type="primary" size="large" :disabled="disabledMorePay" @click="createOrder('more-pay')">