【新增】:mall 客服消息样式设计

pull/468/head
puhui999 2024-07-01 17:16:48 +08:00
parent 7a6f5c2db8
commit 3d5cb15eae
1 changed files with 155 additions and 16 deletions

View File

@ -63,7 +63,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { KeFuMessageApi, KeFuMessageRespVO } from '@/api/mall/promotion/kefu/message' import { KeFuMessageRespVO } from '@/api/mall/promotion/kefu/message'
import { KeFuConversationRespVO } from '@/api/mall/promotion/kefu/conversation' import { KeFuConversationRespVO } from '@/api/mall/promotion/kefu/conversation'
import { UserTypeEnum } from '@/utils/constants' import { UserTypeEnum } from '@/utils/constants'
import { replaceEmoji } from '@/views/mall/promotion/kefu/components/emoji' import { replaceEmoji } from '@/views/mall/promotion/kefu/components/emoji'
@ -77,10 +77,143 @@ const keFuConversation = ref<KeFuConversationRespVO>({} as KeFuConversationRespV
// //
const getMessageList = async (conversation: KeFuConversationRespVO) => { const getMessageList = async (conversation: KeFuConversationRespVO) => {
keFuConversation.value = conversation keFuConversation.value = conversation
const { list } = await KeFuMessageApi.getKeFuMessagePage({ // const { list } = await KeFuMessageApi.getKeFuMessagePage({
pageNo: 1, // pageNo: 1,
conversationId: conversation.id // conversationId: conversation.id
}) // })
// TODO puhui999: 便
const list = [
{
id: 19,
conversationId: 1,
senderId: 283,
senderAvatar: null,
senderType: 2,
receiverId: null,
receiverType: null,
contentType: 1,
content: '[爱心][爱心][坏笑][坏笑][天使][天使]',
readStatus: false,
createTime: 1718616705000
},
{
id: 18,
conversationId: 1,
senderId: 283,
senderAvatar: null,
senderType: 1,
receiverId: null,
receiverType: null,
contentType: 1,
content: '[瞌睡][瞌睡]',
readStatus: false,
createTime: 1718616690000
},
{
id: 17,
conversationId: 1,
senderId: 283,
senderAvatar: null,
senderType: 1,
receiverId: null,
receiverType: null,
contentType: 1,
content: '[冷酷][冷酷]',
readStatus: false,
createTime: 1718616350000
},
{
id: 16,
conversationId: 1,
senderId: 283,
senderAvatar: null,
senderType: 1,
receiverId: null,
receiverType: null,
contentType: 1,
content: '[天使]',
readStatus: false,
createTime: 1718615505000
},
{
id: 15,
conversationId: 1,
senderId: 283,
senderAvatar: null,
senderType: 2,
receiverId: null,
receiverType: null,
contentType: 1,
content: '[天使]',
readStatus: false,
createTime: 1718615485000
},
{
id: 14,
conversationId: 1,
senderId: 283,
senderAvatar: null,
senderType: 2,
receiverId: null,
receiverType: null,
contentType: 1,
content: '[心碎][心碎]',
readStatus: false,
createTime: 1718615453000
},
{
id: 13,
conversationId: 1,
senderId: 283,
senderAvatar: null,
senderType: 2,
receiverId: null,
receiverType: null,
contentType: 1,
content: '[心碎][心碎]',
readStatus: false,
createTime: 1718615430000
},
{
id: 12,
conversationId: 1,
senderId: 283,
senderAvatar: null,
senderType: 1,
receiverId: null,
receiverType: null,
contentType: 1,
content: '[心碎][心碎]',
readStatus: false,
createTime: 1718615425000
},
{
id: 11,
conversationId: 1,
senderId: 283,
senderAvatar: null,
senderType: 1,
receiverId: null,
receiverType: null,
contentType: 1,
content: '[困~][困~]',
readStatus: false,
createTime: 1718615413000
},
{
id: 10,
conversationId: 1,
senderId: 283,
senderAvatar: null,
senderType: 1,
receiverId: null,
receiverType: null,
contentType: 1,
content: '[睡着][睡着]',
readStatus: false,
createTime: 1718615407000
}
]
messageList.value = list messageList.value = list
} }
defineExpose({ getMessageList }) defineExpose({ getMessageList })
@ -122,20 +255,26 @@ const showChatBox = computed(() => !isEmpty(keFuConversation.value))
.ss-row-right { .ss-row-right {
justify-content: flex-end; justify-content: flex-end;
.kefu-message::after { .kefu-message {
content: ''; margin-right: 20px;
width: 10px; position: relative;
height: 10px;
right: -19px; &::after {
top: calc(50% - 10px); content: '';
position: absolute; width: 10px;
border-left: 5px solid #ffffff; height: 10px;
border-bottom: 5px solid transparent; right: -19px;
border-top: 5px solid transparent; top: calc(50% - 10px);
border-right: 5px solid transparent; position: absolute;
border-left: 5px solid #ffffff;
border-bottom: 5px solid transparent;
border-top: 5px solid transparent;
border-right: 5px solid transparent;
}
} }
} }
//
.kefu-message { .kefu-message {
color: #333; color: #333;
border-radius: 5px; border-radius: 5px;