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); + } }); }, },