|
|
@@ -8,11 +8,7 @@
|
|
|
<view class="chat-title-wrap" @click="onTitleClick">
|
|
|
<view class="chat-title-texts">
|
|
|
<text class="chat-title">{{ contactTitle }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="header-actions">
|
|
|
- <view class="header-icon" @click="onMore">
|
|
|
- <image class="header-icon-img" src="/static/icons/more.svg" mode="aspectFit" />
|
|
|
+ <text v-if="contactRemarks" class="chat-remarks">@{{ contactRemarks }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -113,6 +109,7 @@ import { fetchUnreadCountAndUpdateTabBar } from '../../composables/useUnreadBadg
|
|
|
|
|
|
const otherUserId = ref('')
|
|
|
const contactTitle = ref('会话')
|
|
|
+const contactRemarks = ref('')
|
|
|
const fallbackContactName = ref('')
|
|
|
const inputValue = ref('')
|
|
|
const scrollIntoView = ref('')
|
|
|
@@ -131,10 +128,12 @@ function syncContactTitle() {
|
|
|
const contact = (chatStore.contacts || []).find((c) => String(c.user_id || c.id) === String(otherUserId.value))
|
|
|
if (contact) {
|
|
|
contactTitle.value = (contact.app_name || contact.title || '会话')
|
|
|
+ contactRemarks.value = contact.remarks || ''
|
|
|
return
|
|
|
}
|
|
|
// 若会话列表未命中(例如从联系人详情进入,此时 chatStore.contacts 未包含该用户)
|
|
|
contactTitle.value = fallbackContactName.value || '会话'
|
|
|
+ contactRemarks.value = ''
|
|
|
}
|
|
|
|
|
|
const messageList = computed(() => {
|
|
|
@@ -356,13 +355,6 @@ function onTitleClick() {
|
|
|
// 可扩展:进入联系人详情或下拉菜单
|
|
|
}
|
|
|
|
|
|
-function onMore() {
|
|
|
- uni.showActionSheet({
|
|
|
- itemList: ['聊天信息', '查找聊天内容', '清空聊天记录'],
|
|
|
- success: (res) => {}
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
function onInputFocus() {
|
|
|
showPlusPanel.value = false
|
|
|
}
|
|
|
@@ -478,25 +470,30 @@ function onPlus() {
|
|
|
}
|
|
|
.chat-title-texts {
|
|
|
display: flex;
|
|
|
- flex-direction: column;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
justify-content: center;
|
|
|
+ max-width: 60vw;
|
|
|
}
|
|
|
.chat-title {
|
|
|
font-size: 34rpx;
|
|
|
font-weight: 600;
|
|
|
color: #111827;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ flex-shrink: 1;
|
|
|
+ min-width: 0;
|
|
|
}
|
|
|
-.header-actions {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- gap: 16rpx;
|
|
|
-}
|
|
|
-.header-icon {
|
|
|
- width: 56rpx;
|
|
|
- height: 56rpx;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
+.chat-remarks {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #d97706;
|
|
|
+ margin-left: 8rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ max-width: 40vw;
|
|
|
}
|
|
|
.message-list {
|
|
|
flex: 1;
|