已过滤工具类消息
This commit is contained in:
@@ -73,9 +73,9 @@
|
||||
<uni-icons type="chat-filled" size="26" color="#007aff"></uni-icons>
|
||||
</view>
|
||||
<view v-if="chat.agent_id">
|
||||
{{chat.agent_data.title}}
|
||||
{{truncateText(chat.agent_data?.title) || "加载中"}}
|
||||
</view>
|
||||
<view v-else>{{chat.title}}</view>
|
||||
<view v-else>{{truncateText(chat.title)}}</view>
|
||||
</view>
|
||||
<!-- 好友对话列表 -->
|
||||
<view v-if="chatType === 1" v-for="chat in UserConversations" :key="chat.sessionId"
|
||||
@@ -312,6 +312,12 @@
|
||||
const UserAvatar = ref('')
|
||||
const UserName = ref('')
|
||||
|
||||
// 文本截断方法,超过20字符显示省略号
|
||||
const truncateText = (text, maxLength = 20) => {
|
||||
if (!text) return ''
|
||||
return text.length > maxLength ? text.substring(0, maxLength) + '...' : text
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
UserToken.value = getToken()
|
||||
const UserInfo = await getUserInfo(UserToken.value)
|
||||
|
||||
Reference in New Issue
Block a user