feat(home): 添加热门问题点击处理及优化反馈逻辑
This commit is contained in:
parent
70cbde0d11
commit
d78a71d09e
|
|
@ -36,6 +36,7 @@
|
||||||
class="qa-item"
|
class="qa-item"
|
||||||
v-for="(item, index) in hotQuestions"
|
v-for="(item, index) in hotQuestions"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
@click="handleQAClick(item)"
|
||||||
>
|
>
|
||||||
<text class="qa-question">{{ item.content }}</text>
|
<text class="qa-question">{{ item.content }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -793,7 +794,11 @@ export default {
|
||||||
console.log("触发上拉刷新");
|
console.log("触发上拉刷新");
|
||||||
|
|
||||||
// 如果已经没有更多数据或正在切换对话或当前对话为空(新建对话),不再触发上拉刷新
|
// 如果已经没有更多数据或正在切换对话或当前对话为空(新建对话),不再触发上拉刷新
|
||||||
if (this.noMoreData || this.isSwitchingConversation || !this.currentConversationId) {
|
if (
|
||||||
|
this.noMoreData ||
|
||||||
|
this.isSwitchingConversation ||
|
||||||
|
!this.currentConversationId
|
||||||
|
) {
|
||||||
return;
|
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() {
|
hotQARefresh() {
|
||||||
console.log("刷新问题");
|
console.log("刷新问题");
|
||||||
|
|
||||||
|
|
@ -860,13 +875,12 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 回答反馈:点赞/点踩(统一调用刷新&上一页回退逻辑)
|
// 点击热门问题
|
||||||
handleFeedback(message, isHelp) {
|
handleQAClick(item) {
|
||||||
this.$u.api.ModifyStatus({ id: message.id, isHelp }).then((res) => {
|
this.$u.api.GetHotQuestionsFromId({ id: item.id }).then((res) => {
|
||||||
if (!res.succeed) return;
|
if (res.succeed) {
|
||||||
this.$u.toast("操作成功");
|
console.log("hotQuestionsDetail.....", res.data);
|
||||||
// 刷新当前页;若空则自动回退上一页并刷新
|
}
|
||||||
this.refreshPageWithFallback();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue