diff --git a/src/model/ChatModel.js b/src/model/ChatModel.js index 6a0bace..4211797 100644 --- a/src/model/ChatModel.js +++ b/src/model/ChatModel.js @@ -48,7 +48,7 @@ export const CompName = { /// 发送的指令类型 export const Command = { // 通知消息 - welcome: "Command.welcome", + messageInit: "Command.init", // 快速预定 quickBooking: "Command.quickBooking", // 探索发现 diff --git a/src/pages/index/components/chat/ChatMainList/index.vue b/src/pages/index/components/chat/ChatMainList/index.vue index 13d2daf..c404855 100644 --- a/src/pages/index/components/chat/ChatMainList/index.vue +++ b/src/pages/index/components/chat/ChatMainList/index.vue @@ -9,7 +9,7 @@ - + @@ -135,7 +135,6 @@ const statusBarHeight = ref(20); const inputAreaRef = ref(null); const topNavBarRef = ref(); const welcomeRef = ref(); -const welcomeMessage = ref(""); const notitceConent = ref(null); @@ -426,11 +425,11 @@ const initWebSocket = async () => { // 连接成功后发送 welcome 消息 (messageType=4) try { // fire-and-forget, sendWebSocketMessage 会处理重连与队列 - sendWebSocketMessage(MessageType.notice, Command.welcome, { tryReconnect: true, messageId:IdUtils.generateMessageId() }).catch((e) => { - console.warn('发送 Command.welcome 消息失败:', e); + sendWebSocketMessage(MessageType.notice, Command.messageInit, { tryReconnect: true, messageId:IdUtils.generateMessageId() }).catch((e) => { + console.warn('发送 Command.messageInit 消息失败:', e); }); } catch (e) { - console.warn('发送 Command.welcome 消息时异常:', e); + console.warn('发送 Command.messageInit 消息时异常:', e); } }, @@ -488,15 +487,6 @@ const handleWebSocketMessage = (data) => { return; } - // Welcome 消息 (messageType=4):用于更新顶部欢迎栏内容 - if (data.messageType && data.messageType === 'text') { - console.log("收到 welcome 类型消息:", data); - if (data.content) { - welcomeMessage.value = data.content; - } - return; - } - if (data.messageType && data.messageType === 'broadcast') { console.log("收到 welcome 类型消息:", data); if (data.content) { diff --git a/src/pages/index/components/chat/ChatTopWelcome/index.vue b/src/pages/index/components/chat/ChatTopWelcome/index.vue index a559aa2..200b823 100644 --- a/src/pages/index/components/chat/ChatTopWelcome/index.vue +++ b/src/pages/index/components/chat/ChatTopWelcome/index.vue @@ -7,7 +7,7 @@ v :frameHeight="spriteStyle.frameHeight" :totalFrames="spriteStyle.totalFrames" :columns="spriteStyle.columns" :displayWidth="spriteStyle.displayWidth" :fps="16" /> - {{ props.welcomeMessage || welcomeContent }} + {{ welcomeContent }} @@ -23,10 +23,6 @@ import ChatMoreTips from "../ChatMoreTips/index.vue"; import SpriteAnimator from "@/components/Sprite/SpriteAnimator.vue"; const props = defineProps({ - welcomeMessage: { - type: String, - default: "", - }, mainPageDataModel: { type: Object, default: () => {