From c7bf6bd6b166afff549ee60b6a74b8355960ee4c Mon Sep 17 00:00:00 2001 From: yangzhe Date: Fri, 28 Nov 2025 16:05:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(home):=20=E5=AE=9E=E7=8E=B0=E7=83=AD?= =?UTF-8?q?=E9=97=A8=E9=97=AE=E9=A2=98=E5=B1=95=E7=A4=BA=E5=8F=8A=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/index/index.vue | 123 +++++++++++++++++++++++-------------- 1 file changed, 78 insertions(+), 45 deletions(-) diff --git a/pages/home/index/index.vue b/pages/home/index/index.vue index 41657c8..178005b 100644 --- a/pages/home/index/index.vue +++ b/pages/home/index/index.vue @@ -22,7 +22,7 @@ 大家都在问 - + - - + + @@ -444,7 +454,10 @@ export default { deep: true, }, }, - onLoad() {}, + onLoad() { + this.hotQARefresh(); // 获取热门聊天 + }, + methods: { async handleLeftClick() { await this.getChatHistoryList(); @@ -660,7 +673,6 @@ export default { this.handleGetConversationDetail(); }, - // 公共排序:按时间升序;时间相同,用户消息(interactMode=0)在前 sortMessages(list = []) { return (list || []).sort((a, b) => { @@ -694,7 +706,6 @@ export default { }); }, - // 刷新当前页数据;若当前页为空且页码>1,则自动回退上一页 refreshPageWithFallback() { const currentIndex = this.pageQuery.PageIndex || 1; @@ -837,7 +848,7 @@ export default { }, // 点击刷新 - handleRefresh() { + hotQARefresh() { console.log("刷新问题"); this.$u.api.GetHotQuestions({}).then((res) => { @@ -850,14 +861,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(); - }); + this.$u.api.ModifyStatus({ id: message.id, isHelp }).then((res) => { + if (!res.succeed) return; + this.$u.toast("操作成功"); + // 刷新当前页;若空则自动回退上一页并刷新 + this.refreshPageWithFallback(); + }); }, }, }; @@ -958,7 +967,7 @@ export default { .qa-question { font-size: 28rpx; - color: #333; + color: #333333; line-height: 1.5; } } @@ -1062,21 +1071,44 @@ export default { } .chat-card { + background-image: url("@/static/common/images/hot-question-bg2.png"); + background-repeat: no-repeat; + background-size: 100% 100%; + background-position: 0 0; // background-color: #ffffff; // border-radius: 16rpx; padding: 32rpx; - margin-bottom: 32rpx; + margin: 32rpx 0; - .chat-card-title { - font-family: DouyinSans; - font-weight: bold; - font-size: 36rpx; - color: #5255e6; - // line-height: 24rpx; - background: linear-gradient(-56deg, #4d50dd 0%, #3e6aff 100%); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - margin-bottom: 12rpx; + .chat-card-title-wrapper { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16rpx; + + .chat-card-title { + font-family: DouyinSans; + font-weight: bold; + font-size: 36rpx; + color: #5255e6; + // line-height: 24rpx; + background: linear-gradient(-56deg, #4d50dd 0%, #3e6aff 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + .more-link { + display: flex; + align-items: center; + .icon-refresh { + width: 36rpx; + height: 36rpx; + margin-right: 8rpx; + } + .more-text { + font-size: 26rpx; + color: #333; + } + } } .chat-card-desc { @@ -1088,15 +1120,16 @@ export default { margin-bottom: 12rpx; } - .chat-card-questions { - display: flex; - flex-direction: column; - gap: 16rpx; + .qa-list { + margin-top: 32rpx; + .qa-item { + margin-top: 16rpx; - .question-item { - font-size: 28rpx; - color: #333333; - line-height: 1.5; + .qa-question { + font-size: 28rpx; + color: #333333; + line-height: 1.5; + } } } }