From 3e572052e8e81d5596351802af97496723421a45 Mon Sep 17 00:00:00 2001 From: zoujing Date: Wed, 29 Apr 2026 16:31:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E4=BA=86=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E7=9A=84=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constant/constant.js | 6 ++++ src/model/ChatModel.js | 12 +++++++ src/pages/ChatMain/ChatMainList/index.vue | 9 +++++ src/pages/Discovery/index.vue | 42 +++++++++++++++++++++-- 4 files changed, 66 insertions(+), 3 deletions(-) diff --git a/src/constant/constant.js b/src/constant/constant.js index 3f8c3cc..8c26898 100644 --- a/src/constant/constant.js +++ b/src/constant/constant.js @@ -11,3 +11,9 @@ export const SEND_MESSAGE_CONTENT_TEXT = "SEND_MESSAGE_CONTENT_TEXT"; // 发送消息命令类型 export const SEND_MESSAGE_COMMAND_TYPE = "SEND_MESSAGE_COMMAND_TYPE"; + +// 切换到伴游tab +export const SWITCH_TO_COMPANION_TAB = "SWITCH_TO_COMPANION_TAB"; + +// 切换到发现tab +export const SWITCH_TO_DISCOVERY_TAB = "SWITCH_TO_DISCOVERY_TAB"; \ No newline at end of file diff --git a/src/model/ChatModel.js b/src/model/ChatModel.js index 4211797..28c4311 100644 --- a/src/model/ChatModel.js +++ b/src/model/ChatModel.js @@ -21,6 +21,18 @@ export const MessageType = { notice: 4, }; +/// 跳转类型: 0商品 1提示词 2链接 3组件指令 +export const JumpType = { + // 商品 + commodity: 0, + // 提示词 + prompt: 1, + // 链接 + link: 2, + // 组件指令 + command: 3, +}; + /// 组件的名称 export const CompName = { // 快速预定卡片 diff --git a/src/pages/ChatMain/ChatMainList/index.vue b/src/pages/ChatMain/ChatMainList/index.vue index 6e40348..f428cb9 100644 --- a/src/pages/ChatMain/ChatMainList/index.vue +++ b/src/pages/ChatMain/ChatMainList/index.vue @@ -196,6 +196,7 @@ import { onMounted, nextTick, onUnmounted, ref } from "vue"; import { onLoad } from "@dcloudio/uni-app"; import { + SWITCH_TO_COMPANION_TAB, SCROLL_TO_BOTTOM, SEND_MESSAGE_CONTENT_TEXT, SEND_MESSAGE_COMMAND_TYPE, @@ -463,6 +464,14 @@ const addNoticeListener = () => { handleReplyInstruct(item); } }); + + uni.$on(SWITCH_TO_COMPANION_TAB, () => { + tabIndex.value = 1; + }); + + uni.$on(SWITCH_TO_DISCOVERY_TAB, () => { + tabIndex.value = 0; + }); }; /// =============生命周期函数↓================ diff --git a/src/pages/Discovery/index.vue b/src/pages/Discovery/index.vue index b77cab3..00c2f02 100644 --- a/src/pages/Discovery/index.vue +++ b/src/pages/Discovery/index.vue @@ -20,6 +20,11 @@