diff --git a/pages/home/index/index.vue b/pages/home/index/index.vue index b413a80..79ea30b 100644 --- a/pages/home/index/index.vue +++ b/pages/home/index/index.vue @@ -151,7 +151,12 @@ src="/static/common/images/avatar_ai.png" mode="scaleToFill" /> - + @@ -161,6 +166,39 @@ + + + @@ -616,6 +654,12 @@ export default { this.isLoadingMore = false; this.noMoreData = false; + // 刷新当前对话的消息详情 + this.handleGetConversationDetail(); + }, + + // 刷新当前对话的消息详情 + handleGetConversationDetail() { this.$u.api .GetConversationDetail({ "Item1.Id": this.currentConversationId, @@ -770,6 +814,24 @@ export default { } }); }, + + // 回答反馈:点赞/点踩 + handleFeedback(message, isHelp) { + // 触发反馈事件,外部可根据id处理 + console.log("thumb-up", message.id); + this.$u.api + .ModifyStatus({ + id: message.id, + isHelp: isHelp, + }) + .then((res) => { + if (res.succeed) { + this.$u.toast("操作成功"); + // 刷新当前对话的消息详情 + this.handleGetConversationDetail(); + } + }); + }, }, }; @@ -1046,6 +1108,7 @@ export default { .message-left { justify-content: flex-start; + flex-wrap: wrap; /* 允许反馈区换行到消息下方 */ .ai-avatar { width: 64rpx; @@ -1058,7 +1121,7 @@ export default { .message-content { background-color: #ffffff; - max-width: 70%; + // width: 70%; padding: 20rpx 24rpx; border-radius: 0 16rpx 16rpx 16rpx; font-size: 28rpx; @@ -1137,6 +1200,44 @@ export default { } } } + + .message-content-width { + width: 70%; + } + + /* 回答反馈容器,跟随左侧消息,右下角对齐 */ + .feedback-container { + width: 70%; + margin-left: 80rpx; /* 头像宽度64rpx + 间距16rpx */ + display: flex; + justify-content: flex-end; + margin-top: 16rpx; + } + + .feedback-box { + display: flex; + align-items: center; + background-color: #ffffff; + padding: 4rpx 12rpx; + border-radius: 20rpx; + box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.08); + } + + .feedback-btn { + width: 60rpx; + height: 60rpx; + display: flex; + align-items: center; + justify-content: center; + } + + .feedback-divider { + width: 2rpx; + height: 36rpx; + margin: 0 8rpx; + background-color: #e9edf7; + border-radius: 2rpx; + } } .message-right {