From d78a71d09ed1e13f76e984fd4ff4fabf175a4332 Mon Sep 17 00:00:00 2001 From: yangzhe Date: Mon, 1 Dec 2025 09:20:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(home):=20=E6=B7=BB=E5=8A=A0=E7=83=AD?= =?UTF-8?q?=E9=97=A8=E9=97=AE=E9=A2=98=E7=82=B9=E5=87=BB=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=8F=8A=E4=BC=98=E5=8C=96=E5=8F=8D=E9=A6=88=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/index/index.vue | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/pages/home/index/index.vue b/pages/home/index/index.vue index cf38f46..4b0cfe0 100644 --- a/pages/home/index/index.vue +++ b/pages/home/index/index.vue @@ -36,6 +36,7 @@ class="qa-item" v-for="(item, index) in hotQuestions" :key="index" + @click="handleQAClick(item)" > {{ item.content }} @@ -793,7 +794,11 @@ export default { console.log("触发上拉刷新"); // 如果已经没有更多数据或正在切换对话或当前对话为空(新建对话),不再触发上拉刷新 - if (this.noMoreData || this.isSwitchingConversation || !this.currentConversationId) { + if ( + this.noMoreData || + this.isSwitchingConversation || + !this.currentConversationId + ) { return; } @@ -848,7 +853,17 @@ export default { }); }, - // 点击刷新 + // 回答反馈:点赞/点踩(统一调用刷新&上一页回退逻辑) + handleFeedback(message, isHelp) { + this.$u.api.ModifyStatus({ id: message.id, isHelp }).then((res) => { + if (!res.succeed) return; + this.$u.toast("操作成功"); + // 刷新当前页;若空则自动回退上一页并刷新 + this.refreshPageWithFallback(); + }); + }, + + // 获取热门问题 hotQARefresh() { console.log("刷新问题"); @@ -860,13 +875,12 @@ export default { }); }, - // 回答反馈:点赞/点踩(统一调用刷新&上一页回退逻辑) - handleFeedback(message, isHelp) { - this.$u.api.ModifyStatus({ id: message.id, isHelp }).then((res) => { - if (!res.succeed) return; - this.$u.toast("操作成功"); - // 刷新当前页;若空则自动回退上一页并刷新 - this.refreshPageWithFallback(); + // 点击热门问题 + handleQAClick(item) { + this.$u.api.GetHotQuestionsFromId({ id: item.id }).then((res) => { + if (res.succeed) { + console.log("hotQuestionsDetail.....", res.data); + } }); }, },