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 @@