mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-26 08:45:08 +08:00
【新增】mall 客服消息下拉加载,有新消息提醒
This commit is contained in:
@ -74,7 +74,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { KeFuConversationApi, KeFuConversationRespVO } from '@/api/mall/promotion/kefu/conversation'
|
||||
import { useEmoji } from './tools/emoji'
|
||||
import { formatDate, getNowDateTime } from '@/utils/formatTime'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { KeFuMessageContentTypeEnum } from './tools/constants'
|
||||
|
||||
defineOptions({ name: 'KeFuConversationBox' })
|
||||
@ -84,24 +84,6 @@ const activeConversationIndex = ref(-1) // 选中的会话
|
||||
const conversationList = ref<KeFuConversationRespVO[]>([]) // 会话列表
|
||||
const getConversationList = async () => {
|
||||
conversationList.value = await KeFuConversationApi.getConversationList()
|
||||
// 测试数据
|
||||
for (let i = 0; i < 5; i++) {
|
||||
conversationList.value.push({
|
||||
id: 1,
|
||||
userId: 283,
|
||||
userAvatar:
|
||||
'https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKMezSxtOImrC9lbhwHiazYwck3xwrEcO7VJfG6WQo260whaeVNoByE5RreiaGsGfOMlIiaDhSaA991w/132',
|
||||
userNickname: '辉辉鸭' + i,
|
||||
lastMessageTime: getNowDateTime(),
|
||||
lastMessageContent:
|
||||
'[爱心][爱心]你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇你好哇',
|
||||
lastMessageContentType: 1,
|
||||
adminPinned: false,
|
||||
userDeleted: false,
|
||||
adminDeleted: false,
|
||||
adminUnreadMessageCount: i
|
||||
})
|
||||
}
|
||||
}
|
||||
defineExpose({ getConversationList })
|
||||
const emits = defineEmits<{
|
||||
@ -157,8 +139,7 @@ const updateConversationPinned = async (adminPinned: boolean) => {
|
||||
id: selectedConversation.value.id,
|
||||
adminPinned
|
||||
})
|
||||
// TODO puhui999: 快速操作两次提示只会提示一次看看怎么优雅解决
|
||||
message.success(adminPinned ? '置顶成功' : '取消置顶成功')
|
||||
message.notifySuccess(adminPinned ? '置顶成功' : '取消置顶成功')
|
||||
// 2. 关闭右键菜单,更新会话列表
|
||||
closeRightMenu()
|
||||
await getConversationList()
|
||||
|
Reference in New Issue
Block a user