|
@@ -1,30 +1,22 @@
|
|
|
<template>
|
|
|
<div class="w-full">
|
|
|
- <!-- <audio
|
|
|
- class="fixed top-0 left-0"
|
|
|
- ref="audioRef"
|
|
|
- :src="audioTips"
|
|
|
- style="opacity: 0; z-index: -1"
|
|
|
- ></audio>-->
|
|
|
-
|
|
|
- <!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh"> -->
|
|
|
<van-sticky :offset-top="50">
|
|
|
<div class="w-full text-xl font-semibold px-16 h-48 flex justify-start items-center bg-white">
|
|
|
<span
|
|
|
- @click="showPopover = true"
|
|
|
- v-if="showPopover"
|
|
|
- class="iconfont icon-plus text-[#FF9300]"
|
|
|
- style="font-size: 24px"
|
|
|
+ @click="showPopover = true"
|
|
|
+ v-if="showPopover"
|
|
|
+ class="iconfont icon-plus text-[#FF9300]"
|
|
|
+ style="font-size: 24px"
|
|
|
></span>
|
|
|
<span v-else class="iconfont icon-plus text-black" style="font-size: 24px"></span>
|
|
|
|
|
|
<van-popover
|
|
|
- v-model:show="showPopover"
|
|
|
- placement="bottom"
|
|
|
- theme="dark"
|
|
|
- :offset="[5,20]"
|
|
|
- :actions="actionsList"
|
|
|
- @select="onSelect"
|
|
|
+ v-model:show="showPopover"
|
|
|
+ placement="bottom"
|
|
|
+ theme="dark"
|
|
|
+ :offset="[5,20]"
|
|
|
+ :actions="actionsList"
|
|
|
+ @select="onSelect"
|
|
|
>
|
|
|
<template #reference>
|
|
|
<span :class="`${showPopover ? 'text-[#FF9300]' : 'text-black-3'}`">添加</span>
|
|
@@ -35,43 +27,43 @@
|
|
|
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
|
|
<div style="height: calc(100vh - 100px)" class="w-full">
|
|
|
<van-list
|
|
|
- ref="messageBoxRef"
|
|
|
- class="flex-1 overflow-y-auto flex flex-col"
|
|
|
- :finished="true"
|
|
|
- finished-text=""
|
|
|
+ ref="messageBoxRef"
|
|
|
+ class="flex-1 overflow-y-auto flex flex-col"
|
|
|
+ :finished="true"
|
|
|
+ finished-text=""
|
|
|
>
|
|
|
<div
|
|
|
- @click="
|
|
|
+ @click="
|
|
|
onChatPage('/profile/system-message', {
|
|
|
groupId: chatList[0]?.groupId
|
|
|
})
|
|
|
"
|
|
|
- class="w-full relative h-82 flex justify-start items-center px-16"
|
|
|
+ class="w-full relative h-82 flex justify-start items-center px-16"
|
|
|
>
|
|
|
<van-badge
|
|
|
- v-if="chatList[0]?.unreadMessageCount"
|
|
|
- v-bind="messageNumber(chatList[0]?.unreadMessageCount)"
|
|
|
- max="99"
|
|
|
+ v-if="chatList[0]?.unreadMessageCount"
|
|
|
+ v-bind="messageNumber(chatList[0]?.unreadMessageCount)"
|
|
|
+ max="99"
|
|
|
>
|
|
|
<div
|
|
|
- class="w-48 h-48 bg-[#0052D9] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
+ class="w-48 h-48 bg-[#0052D9] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
>
|
|
|
<img
|
|
|
- class="w-24 h-24 shrink-0 object-cover"
|
|
|
- src="~/assets/img/chat/remind.svg"
|
|
|
- alt=""
|
|
|
+ class="w-24 h-24 shrink-0 object-cover"
|
|
|
+ src="~/assets/img/chat/remind.svg"
|
|
|
+ alt=""
|
|
|
/>
|
|
|
</div>
|
|
|
</van-badge>
|
|
|
|
|
|
<div
|
|
|
- v-else
|
|
|
- class="w-48 h-48 bg-[#0052D9] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
+ v-else
|
|
|
+ class="w-48 h-48 bg-[#0052D9] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
>
|
|
|
<img
|
|
|
- class="w-24 h-24 shrink-0 object-cover"
|
|
|
- src="~/assets/img/chat/remind.svg"
|
|
|
- alt=""
|
|
|
+ class="w-24 h-24 shrink-0 object-cover"
|
|
|
+ src="~/assets/img/chat/remind.svg"
|
|
|
+ alt=""
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
@@ -82,8 +74,8 @@
|
|
|
<p class="line-clamp-1 h-20 text-sm text-black-6 leading-3xl">
|
|
|
{{
|
|
|
chatList[0]?.lastMessage
|
|
|
- ? messageContentParse(chatList[0]?.lastMessage?.messageContent)
|
|
|
- : ''
|
|
|
+ ? messageContentParse(chatList[0]?.lastMessage?.messageContent)
|
|
|
+ : ''
|
|
|
}}
|
|
|
</p>
|
|
|
</div>
|
|
@@ -92,8 +84,8 @@
|
|
|
<p class="text-black/[0.6] text-sm text-end">
|
|
|
{{
|
|
|
chatList[0]?.lastMessage
|
|
|
- ? createTimeSplit(chatList[0]?.lastMessage?.createTime)
|
|
|
- : ''
|
|
|
+ ? createTimeSplit(chatList[0]?.lastMessage?.createTime)
|
|
|
+ : ''
|
|
|
}}
|
|
|
</p>
|
|
|
</div>
|
|
@@ -101,39 +93,39 @@
|
|
|
</div>
|
|
|
<!-- navigateTo('/follow?listType=fans') -->
|
|
|
<div
|
|
|
- @click="
|
|
|
+ @click="
|
|
|
onChatPage('/follow', {
|
|
|
listType: 'fans',
|
|
|
groupId: chatList[1]?.groupId
|
|
|
})
|
|
|
"
|
|
|
- class="w-full relative h-82 flex justify-start items-center px-16"
|
|
|
+ class="w-full relative h-82 flex justify-start items-center px-16"
|
|
|
>
|
|
|
<van-badge
|
|
|
- v-if="chatList[1]?.unreadMessageCount"
|
|
|
- v-bind="messageNumber(chatList[1]?.unreadMessageCount)"
|
|
|
- max="99"
|
|
|
+ v-if="chatList[1]?.unreadMessageCount"
|
|
|
+ v-bind="messageNumber(chatList[1]?.unreadMessageCount)"
|
|
|
+ max="99"
|
|
|
>
|
|
|
<div
|
|
|
- class="w-48 h-48 bg-[#FF9300] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
+ class="w-48 h-48 bg-[#FF9300] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
>
|
|
|
<img
|
|
|
- class="w-24 h-24 shrink-0 object-cover"
|
|
|
- src="~/assets/img/chat/user.svg"
|
|
|
- alt=""
|
|
|
+ class="w-24 h-24 shrink-0 object-cover"
|
|
|
+ src="~/assets/img/chat/user.svg"
|
|
|
+ alt=""
|
|
|
/>
|
|
|
</div>
|
|
|
</van-badge>
|
|
|
|
|
|
<div
|
|
|
- v-else
|
|
|
- @click="navigateTo('/follow?listType=fans')"
|
|
|
- class="w-48 h-48 bg-[#FF9300] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
+ v-else
|
|
|
+ @click="navigateTo('/follow?listType=fans')"
|
|
|
+ class="w-48 h-48 bg-[#FF9300] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
>
|
|
|
<img
|
|
|
- class="w-24 h-24 shrink-0 object-cover"
|
|
|
- src="~/assets/img/chat/user.svg"
|
|
|
- alt=""
|
|
|
+ class="w-24 h-24 shrink-0 object-cover"
|
|
|
+ src="~/assets/img/chat/user.svg"
|
|
|
+ alt=""
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
@@ -144,8 +136,8 @@
|
|
|
<p class="line-clamp-1 h-20 text-sm text-black-6 leading-3xl">
|
|
|
{{
|
|
|
chatList[1]?.lastMessage
|
|
|
- ? messageShowName(chatList[1]?.lastMessage?.messageContent)
|
|
|
- : ''
|
|
|
+ ? messageShowName(chatList[1]?.lastMessage?.messageContent)
|
|
|
+ : ''
|
|
|
}}
|
|
|
</p>
|
|
|
</div>
|
|
@@ -154,8 +146,8 @@
|
|
|
<p class="text-black/[0.6] text-sm text-end">
|
|
|
{{
|
|
|
chatList[1]?.lastMessage
|
|
|
- ? createTimeSplit(chatList[1]?.lastMessage?.createTime)
|
|
|
- : ''
|
|
|
+ ? createTimeSplit(chatList[1]?.lastMessage?.createTime)
|
|
|
+ : ''
|
|
|
}}
|
|
|
</p>
|
|
|
</div>
|
|
@@ -163,37 +155,37 @@
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
- @click="
|
|
|
+ @click="
|
|
|
onChatPage('/profile/interaction-message', {
|
|
|
groupId: chatList[2]?.groupId
|
|
|
})
|
|
|
"
|
|
|
- class="w-full relative h-82 flex justify-start items-center px-16"
|
|
|
+ class="w-full relative h-82 flex justify-start items-center px-16"
|
|
|
>
|
|
|
<van-badge
|
|
|
- v-if="chatList[2]?.unreadMessageCount > 0"
|
|
|
- v-bind="messageNumber(chatList[2]?.unreadMessageCount)"
|
|
|
- max="99"
|
|
|
+ v-if="chatList[2]?.unreadMessageCount > 0"
|
|
|
+ v-bind="messageNumber(chatList[2]?.unreadMessageCount)"
|
|
|
+ max="99"
|
|
|
>
|
|
|
<div
|
|
|
- class="w-48 h-48 bg-[#FF476A] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
+ class="w-48 h-48 bg-[#FF476A] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
>
|
|
|
<img
|
|
|
- class="w-24 h-24 shrink-0 object-cover"
|
|
|
- src="~/assets/img/chat/weixin-shake.svg"
|
|
|
- alt=""
|
|
|
+ class="w-24 h-24 shrink-0 object-cover"
|
|
|
+ src="~/assets/img/chat/weixin-shake.svg"
|
|
|
+ alt=""
|
|
|
/>
|
|
|
</div>
|
|
|
</van-badge>
|
|
|
|
|
|
<div
|
|
|
- v-else
|
|
|
- class="w-48 h-48 bg-[#FF476A] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
+ v-else
|
|
|
+ class="w-48 h-48 bg-[#FF476A] rounded-full overflow-hidden flex justify-center items-center"
|
|
|
>
|
|
|
<img
|
|
|
- class="w-24 h-24 shrink-0 object-cover"
|
|
|
- src="~/assets/img/chat/weixin-shake.svg"
|
|
|
- alt=""
|
|
|
+ class="w-24 h-24 shrink-0 object-cover"
|
|
|
+ src="~/assets/img/chat/weixin-shake.svg"
|
|
|
+ alt=""
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
@@ -204,8 +196,8 @@
|
|
|
<p class="line-clamp-1 h-20 text-sm text-black-6 leading-3xl">
|
|
|
{{
|
|
|
chatList[2]?.lastMessage
|
|
|
- ? messageContentParse(chatList[2]?.lastMessage?.messageContent)
|
|
|
- : ''
|
|
|
+ ? messageContentParse(chatList[2]?.lastMessage?.messageContent)
|
|
|
+ : ''
|
|
|
}}
|
|
|
</p>
|
|
|
</div>
|
|
@@ -214,8 +206,8 @@
|
|
|
<p class="text-black/[0.6] text-sm text-end">
|
|
|
{{
|
|
|
chatList[2]?.lastMessage
|
|
|
- ? createTimeSplit(chatList[2]?.lastMessage?.createTime)
|
|
|
- : ''
|
|
|
+ ? createTimeSplit(chatList[2]?.lastMessage?.createTime)
|
|
|
+ : ''
|
|
|
}}
|
|
|
</p>
|
|
|
</div>
|
|
@@ -228,25 +220,25 @@
|
|
|
<template v-if="index > 2">
|
|
|
<!-- 群聊会话 -->
|
|
|
<ProfileNewsGroupChat
|
|
|
- v-if="item?.noticeType == 2"
|
|
|
- :item-data="{
|
|
|
+ v-if="item?.noticeType == 2"
|
|
|
+ :item-data="{
|
|
|
...item,
|
|
|
updateTime: item?.lastMessage
|
|
|
? createTimeSplit(item?.lastMessage?.updateTime)
|
|
|
: ''
|
|
|
}"
|
|
|
- @on-chat-page="
|
|
|
+ @on-chat-page="
|
|
|
onChatPage('/chat/group', { userId: user.userId, groupId: item?.groupId })
|
|
|
"
|
|
|
- @on-no-bother="noBother(item)"
|
|
|
- @on-is-top="onIsTop(item)"
|
|
|
- @on-conv-delete="onIsShow(item)"
|
|
|
+ @on-no-bother="noBother(item)"
|
|
|
+ @on-is-top="onIsTop(item)"
|
|
|
+ @on-conv-delete="onIsShow(item)"
|
|
|
/>
|
|
|
|
|
|
<!-- 单聊会话 -->
|
|
|
<ProfileNewsSingleChat
|
|
|
- v-if="item?.noticeType == 1"
|
|
|
- :item-data="{
|
|
|
+ v-if="item?.noticeType == 1"
|
|
|
+ :item-data="{
|
|
|
...item,
|
|
|
updateTime: item?.lastMessage
|
|
|
? createTimeSplit(item?.lastMessage?.updateTime)
|
|
@@ -263,40 +255,40 @@
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
- v-if="isTopList.length >= 6"
|
|
|
- @click="activeNames = !activeNames"
|
|
|
- class="flex justify-between items-center h-20 -mt-20 w-full p-16 box-border"
|
|
|
+ v-if="isTopList.length >= 6"
|
|
|
+ @click="activeNames = !activeNames"
|
|
|
+ class="flex justify-between items-center h-20 -mt-20 w-full p-16 box-border"
|
|
|
>
|
|
|
<div class="shrink-0 flex items-center">
|
|
|
- <van-icon name="bars" size="16" class="mr-5"/>
|
|
|
+ <van-icon name="bars" size="16" class="mr-5" />
|
|
|
<span class="text-sm">{{ collapseTitle }}</span>
|
|
|
</div>
|
|
|
<div class="w-16 h-16 shrink-0">
|
|
|
- <van-icon name="arrow" size="16"/>
|
|
|
+ <van-icon name="arrow" size="16" />
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 不置顶的会话列表 -->
|
|
|
<template v-for="(item, index) in pinnedList" :key="item?.id">
|
|
|
<ProfileNewsGroupChat
|
|
|
- v-if="item?.noticeType == 2"
|
|
|
- :item-data="{
|
|
|
+ v-if="item?.noticeType == 2"
|
|
|
+ :item-data="{
|
|
|
...item,
|
|
|
updateTime: item?.lastMessage ? createTimeSplit(item?.lastMessage?.updateTime) : ''
|
|
|
}"
|
|
|
- @on-chat-page="
|
|
|
+ @on-chat-page="
|
|
|
onChatPage('/chat/group', {
|
|
|
userId: userInfo.userId,
|
|
|
groupId: item?.groupId
|
|
|
})
|
|
|
"
|
|
|
- @on-no-bother="noBother(item)"
|
|
|
- @on-is-top="onIsTop(item)"
|
|
|
- @on-conv-delete="onIsShow(item)"
|
|
|
+ @on-no-bother="noBother(item)"
|
|
|
+ @on-is-top="onIsTop(item)"
|
|
|
+ @on-conv-delete="onIsShow(item)"
|
|
|
/>
|
|
|
<ProfileNewsSingleChat
|
|
|
- v-if="item?.noticeType == 1"
|
|
|
- :item-data="{
|
|
|
+ v-if="item?.noticeType == 1"
|
|
|
+ :item-data="{
|
|
|
...item,
|
|
|
updateTime: item?.lastMessage ? createTimeSplit(item?.lastMessage?.updateTime) : ''
|
|
|
}"
|
|
@@ -316,21 +308,21 @@
|
|
|
import comments from '~/assets/img/chat/comments-white.svg'
|
|
|
import plaza from '~/assets/img/chat/guangchang.svg'
|
|
|
import userAdd from '~/assets/img/chat/user-add.svg'
|
|
|
-import audioTips from '@/assets/audio/message.mp3'
|
|
|
-import {messageContentParse} from '~/utils/detalTime.js'
|
|
|
-import {XYWebSocket} from '~/utils/XYWebSocket.ts'
|
|
|
+
|
|
|
+import { messageContentParse } from '~/utils/detalTime.js'
|
|
|
+import { XYWebSocket } from '~/utils/XYWebSocket.ts'
|
|
|
|
|
|
const actionsList = [
|
|
|
- {text: '创建群聊', icon: comments},
|
|
|
- {text: '群聊广场', icon: plaza},
|
|
|
- {text: '加入群聊', icon: plaza},
|
|
|
- {text: '添加用户', icon: userAdd}
|
|
|
+ { text: '创建群聊', icon: comments },
|
|
|
+ { text: '群聊广场', icon: plaza },
|
|
|
+ { text: '加入群聊', icon: plaza },
|
|
|
+ { text: '添加用户', icon: userAdd }
|
|
|
]
|
|
|
const userInfoStore = useUserInfoStore()
|
|
|
-const {userInfo} = storeToRefs(userInfoStore)
|
|
|
+const { userInfo } = storeToRefs(userInfoStore)
|
|
|
|
|
|
const chatsStore = useChatsStore();
|
|
|
-const {chatList, chatListLoading} = storeToRefs(chatsStore)
|
|
|
+const { chatList, chatListLoading } = storeToRefs(chatsStore)
|
|
|
|
|
|
const showPopover = ref(false)
|
|
|
|
|
@@ -371,31 +363,30 @@ const onRefresh = () => {
|
|
|
|
|
|
// 打扰和免打扰得
|
|
|
const noBother = (parmas) => {
|
|
|
- handleBoolean({groupId: parmas.groupId, isNotDisturb: parmas.isNotDisturb})
|
|
|
+ handleBoolean({ groupId: parmas.groupId, isNotDisturb: parmas.isNotDisturb })
|
|
|
}
|
|
|
|
|
|
// 是否置顶
|
|
|
const onIsTop = (parmas) => {
|
|
|
- handleBoolean({groupId: parmas.groupId, isTop: parmas.isTop})
|
|
|
+ handleBoolean({ groupId: parmas.groupId, isTop: parmas.isTop })
|
|
|
}
|
|
|
|
|
|
// 是否显示会话
|
|
|
const onIsShow = (parmas) => {
|
|
|
- handleBoolean({groupId: parmas.groupId, isShow: parmas.isShow})
|
|
|
+ handleBoolean({ groupId: parmas.groupId, isShow: parmas.isShow })
|
|
|
}
|
|
|
|
|
|
// 是否免打扰和 是否置顶 公共
|
|
|
const handleBoolean = async (body) => {
|
|
|
try {
|
|
|
- let {data} = await request('/website/tourMember/updateSingleTourMember', {
|
|
|
+ let { data } = await request('/website/tourMember/updateSingleTourMember', {
|
|
|
method: 'post',
|
|
|
body
|
|
|
})
|
|
|
if (data) {
|
|
|
chatsStore.getChatList()
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
|
|
|
// 消息数量通知的展示 需要动态的展示
|