好友
- [有人@我]
好友
{{ item.latestMessage.msg }}
diff --git a/src/views/im/Conversation/index.vue b/src/views/im/Conversation/index.vue
index c59a11ba..e78ef6b7 100644
--- a/src/views/im/Conversation/index.vue
+++ b/src/views/im/Conversation/index.vue
@@ -1,23 +1,14 @@
-
-
- 系统通知
-
-
-
diff --git a/src/views/im/Message/components/messageList/index.vue b/src/views/im/Message/components/messageList/index.vue
index 006830bc..3ca84165 100644
--- a/src/views/im/Message/components/messageList/index.vue
+++ b/src/views/im/Message/components/messageList/index.vue
@@ -2,6 +2,15 @@
import { formatDate } from '@/utils/formatTime'
/* 默认头像 */
import defaultAvatar from '@/assets/imgs/avatar.gif'
+import { useUserStore } from '@/store/modules/user'
+import avatarImg from '@/assets/imgs/avatar.gif'
+import paseLink from '@/utils/paseLink.ts'
+import fileSizeFormat from '@/utils/fileSizeFormat'
+import { messageType } from '@/constant/im'
+const { ALL_MESSAGE_TYPE, CUSTOM_TYPE } = messageType
+// 当前用户信息
+const userStore = useUserStore()
+const avatar = computed(() => userStore.user.avatar ?? avatarImg)
/* props */
const props = defineProps({
messageData: {
@@ -16,25 +25,14 @@ const props = defineProps({
})
const { nowPickInfo } = toRefs(props)
const { messageData } = toRefs(props)
-//消息类型
-const ALL_MESSAGE_TYPE = {
- TEXT: 'txt',
- IMAGE: 'img',
- AUDIO: 'audio',
- LOCAL: 'loc',
- VIDEO: 'video',
- FILE: 'file',
- CUSTOM: 'custom',
- CMD: 'cmd',
- INFORM: 'inform' //这个类型不在环信消息类型内,属于自己定义的一种系统通知类的消息。
-}
/* 处理时间显示间隔 */
const handleMsgTimeShow = (time, index) => {
console.log('>>>>>时间显示', time, index)
const msgList = Array.from(messageData.value)
if (index !== 0) {
const lastTime = msgList[index - 1].time
- return time - lastTime > 50000 ? formatDate(time, 'MM/DD/HH:mm') : false
+ console.log('>>>>>时间间隔', time - lastTime, time, lastTime)
+ return time - lastTime > 50000 ? formatDate(time, 'MM/DD/HH:mm') : ''
} else {
return formatDate(time, 'MM/DD/HH:mm')
}
@@ -43,9 +41,15 @@ const handleMsgTimeShow = (time, index) => {
const isMyself = (msgBody) => {
return msgBody.from === '1'
}
+/* 文本中是否包含link */
+const isLink = computed(() => {
+ return (msg) => {
+ return paseLink(msg).isLink
+ }
+})
/* 获取自己的用户信息 */
const loginUserInfo = {
- avatarurl: 'https://avatars.githubusercontent.com/u/1?v=4'
+ avatarurl: avatar.value
}
/* 获取他人的用户信息 */
const otherUserInfo = (from) => {
@@ -98,14 +102,14 @@ const startplayAudio = (msgBody) => {
>
- {{ handleMsgTimeShow(msgBody.time, index) || '' }}
+ {{ handleMsgTimeShow(msgBody.time, index) }}
{
>
{{ msgBody.msg }}
-
- (已编辑)
@@ -219,62 +217,10 @@ const startplayAudio = (msgBody) => {
-
-