From 800052a9007e4dcc3ad91834fb9be09aeb68c7b0 Mon Sep 17 00:00:00 2001 From: zoujing Date: Mon, 4 Aug 2025 21:41:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E6=8E=A8=E8=8D=90=E5=B8=96=E5=AD=90?= =?UTF-8?q?=20=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- constant/constant.js | 5 +- pages/chat/ChatMainList.vue | 9 ++- .../discovery/DiscoveryCardComponent.vue | 4 +- .../discovery/DiscoveryCradContentList.vue | 65 ------------------- pages/module/recommend/RecommendPostsList.vue | 13 +++- 5 files changed, 25 insertions(+), 71 deletions(-) delete mode 100644 pages/module/discovery/DiscoveryCradContentList.vue diff --git a/constant/constant.js b/constant/constant.js index 27a97f0..27d6b04 100644 --- a/constant/constant.js +++ b/constant/constant.js @@ -1,2 +1,5 @@ +// 滚动到底部 +export const SCROLL_TO_BOTTOM = 'SCROLL_TO_BOTTOM' -export const SCROLL_TO_BOTTOM = 'SCROLL_TO_BOTTOM' \ No newline at end of file +// 推荐帖子 +export const RECOMMEND_POSTS_TITLE = 'RECOMMEND_POSTS_TITLE' \ No newline at end of file diff --git a/pages/chat/ChatMainList.vue b/pages/chat/ChatMainList.vue index 5f1e981..38f174b 100644 --- a/pages/chat/ChatMainList.vue +++ b/pages/chat/ChatMainList.vue @@ -76,7 +76,7 @@ import { ref } from 'vue' import { defineEmits } from 'vue' import { onLoad } from '@dcloudio/uni-app'; - import { SCROLL_TO_BOTTOM } from '../../constant/constant' + import { SCROLL_TO_BOTTOM, RECOMMEND_POSTS_TITLE } from '@/constant/constant' import { MessageRole, MessageType, CompName } from '../../model/ChatModel'; import ChatTopWelcome from './ChatTopWelcome.vue'; @@ -231,6 +231,13 @@ scrollToBottom() }, 200) }) + + uni.$on(RECOMMEND_POSTS_TITLE, (value) => { + console.log('RECOMMEND_POSTS_TITLE:', value) + if(value && value.length > 0) { + handleReply(value) + } + }) } /// 获取最近一次的会话id diff --git a/pages/module/discovery/DiscoveryCardComponent.vue b/pages/module/discovery/DiscoveryCardComponent.vue index dd6cac7..39f5848 100644 --- a/pages/module/discovery/DiscoveryCardComponent.vue +++ b/pages/module/discovery/DiscoveryCardComponent.vue @@ -1,7 +1,7 @@ @@ -10,8 +10,8 @@ import { ref, nextTick } from 'vue' import { onMounted } from 'vue' import { discoveryCradComponent } from '@/request/api/MainPageDataApi' + import RecommendPostsList from '../recommend/RecommendPostsList.vue' import { SCROLL_TO_BOTTOM } from '@/constant/constant' - import DiscoveryCradContentList from './DiscoveryCradContentList.vue' const themeDTOList = ref([]) diff --git a/pages/module/discovery/DiscoveryCradContentList.vue b/pages/module/discovery/DiscoveryCradContentList.vue deleted file mode 100644 index 9b6ea16..0000000 --- a/pages/module/discovery/DiscoveryCradContentList.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/module/recommend/RecommendPostsList.vue b/pages/module/recommend/RecommendPostsList.vue index 8973bd0..4d37f57 100644 --- a/pages/module/recommend/RecommendPostsList.vue +++ b/pages/module/recommend/RecommendPostsList.vue @@ -2,9 +2,9 @@ - + - {{ item.topic }} + {{ item.topic }} dd @@ -12,6 +12,8 @@