代客下单修改,增加线上店铺装修页面

This commit is contained in:
2025-02-22 10:00:04 +08:00
parent e0ae1cca67
commit 504aa80c9e
16 changed files with 1371 additions and 45 deletions

View File

@@ -58,11 +58,23 @@ class WebSocketManager {
this.client.onopen = () => {
this.connected = true;
console.log("WebSocket 连接已建立");
ElNotification.success('WebSocket 连接已建立')
this.sendMessage(this.initParams)
};
this.client.onclose = () => {
if (!this.connected) {
ElMessageBox.alert('WebSocket 连接已断开', 'Title', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: '立即重连',
callback: () => {
this.sendMessage(this.initParams)
},
})
}
this.connected = false;
console.log("WebSocket 连接已断开");
};
this.client.onerror = (error) => {
console.error("WebSocket 发生错误:", error);
@@ -71,6 +83,14 @@ class WebSocketManager {
message: "WebSocket 发生错误",
type: "error",
});
ElMessageBox.alert('WebSocket 发生错误', 'Title', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: '立即重连',
callback: () => {
this.sendMessage(this.initParams)
},
})
};
this.client.onmessage = (event) => {
const message = event.data;