【功能完善】商城: 客服动态计算消息最后发送时间距离现在过去了多久

This commit is contained in:
YunaiV 2024-11-21 10:00:19 +08:00
parent fc5df39b1a
commit 7895d184e8

View File

@ -89,14 +89,15 @@ const { replaceEmoji } = useEmoji()
const activeConversationId = ref(-1) // const activeConversationId = ref(-1) //
const collapse = computed(() => appStore.getCollapse) // const collapse = computed(() => appStore.getCollapse) //
const lastMessageTimeMap = ref<Map<number, string>>(new Map<number, string>())
/** 计算消息最后发送时间距离现在过去了多久 */ /** 计算消息最后发送时间距离现在过去了多久 */
const lastMessageTimeMap = ref<Map<number, string>>(new Map<number, string>())
const calculationLastMessageTime = () => { const calculationLastMessageTime = () => {
kefuStore.getConversationList?.forEach((item) => { kefuStore.getConversationList?.forEach((item) => {
lastMessageTimeMap.value.set(item.id, formatPast(item.lastMessageTime, 'YYYY-MM-DD')) lastMessageTimeMap.value.set(item.id, formatPast(item.lastMessageTime, 'YYYY-MM-DD'))
}) })
} }
defineExpose({ calculationLastMessageTime }) defineExpose({ calculationLastMessageTime })
/** 打开右侧的消息列表 */ /** 打开右侧的消息列表 */
const emits = defineEmits<{ const emits = defineEmits<{
(e: 'change', v: KeFuConversationRespVO): void (e: 'change', v: KeFuConversationRespVO): void