This commit is contained in:
yangzhe 2025-12-16 15:37:49 +08:00
commit 2a7aee3614
1 changed files with 20 additions and 19 deletions

View File

@ -62,7 +62,7 @@ export default {
PageHeader, PageHeader,
}, },
computed: { computed: {
// 使 // 便使
displayChatList() { displayChatList() {
return (this.chatList || []).map((item) => ({ return (this.chatList || []).map((item) => ({
...item, ...item,
@ -102,9 +102,15 @@ export default {
// //
openChat(item) { openChat(item) {
console.log('打开聊天:', item); // console.log(':', item);
uni.navigateTo({ // uni.navigateTo({
url: `/pages/chat/chat-detail?userId=${item.userId}&name=${item.name}` // url: `/pages/chat/chat-detail?userId=${item.userId}&name=${item.name}`
// });
const dialogueManagementId = item.dialogueManagementId
const receiverId = item.receiverId
this.$store.dispatch("selectTeacherChatItem", {
dialogueManagementId,
receiverId,
}); });
}, },
@ -137,7 +143,6 @@ export default {
// //
normalizeDialogueList(list = []) { normalizeDialogueList(list = []) {
//
return list.map((item, index) => { return list.map((item, index) => {
const unread = const unread =
typeof item?.unReadCount === "number" typeof item?.unReadCount === "number"
@ -264,23 +269,19 @@ export default {
/* ===== 聊天列表项 ===== */ /* ===== 聊天列表项 ===== */
.chat-item { .chat-item {
display: flex; display: flex;
align-items: center; padding: 15px;
padding: 14px 16px; background: #fff;
background-color: #fff; border-bottom: 1rpx solid #f0f0f0;
border-bottom: 1rpx solid #f1f1f1;
transition: background-color 0.2s; transition: background-color 0.2s;
} }
.chat-item:active { .chat-item:active {
background-color: #f8f8f8; background-color: #f5f5f5;
} }
.chat-avatar-wrapper { .chat-avatar-wrapper {
position: relative; position: relative;
margin-right: 12px; margin-right: 12px;
width: 50px;
height: 50px;
flex-shrink: 0;
} }
.chat-avatar { .chat-avatar {
@ -324,8 +325,8 @@ export default {
.chat-name { .chat-name {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #1f1f1f; color: #333;
max-width: 70%; max-width: 200px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@ -333,7 +334,7 @@ export default {
.chat-time { .chat-time {
font-size: 12px; font-size: 12px;
color: #9b9b9b; color: #999;
flex-shrink: 0; flex-shrink: 0;
} }
@ -344,7 +345,7 @@ export default {
.preview-text { .preview-text {
font-size: 13px; font-size: 13px;
color: #9b9b9b; color: #999;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;