!598 商城客服优化

Merge pull request !598 from puhui999/dev
pull/599/MERGE
芋道源码 2024-11-25 01:18:43 +00:00 committed by Gitee
commit 8e5a4d09d2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
8 changed files with 130 additions and 40 deletions

View File

@ -1,5 +1,5 @@
<template>
<el-aside class="kefu p-5px h-100%" width="260px">
<el-aside class="kefu pt-5px h-100%" width="260px">
<div class="color-[#999] font-bold my-10px">
会话记录({{ kefuStore.getConversationList.length }})
</div>
@ -7,7 +7,7 @@
v-for="item in kefuStore.getConversationList"
:key="item.id"
:class="{ active: item.id === activeConversationId, pinned: item.adminPinned }"
class="kefu-conversation flex items-center"
class="kefu-conversation px-10px flex items-center"
@click="openRightMessage(item)"
@contextmenu.prevent="rightClick($event as PointerEvent, item)"
>
@ -200,7 +200,7 @@ onBeforeUnmount(() => {
<style lang="scss" scoped>
.kefu {
background-color: #fff;
background-color: #e5e4e4;
&-conversation {
height: 60px;
@ -210,26 +210,24 @@ onBeforeUnmount(() => {
.username {
min-width: 0;
max-width: 60%;
}
.last-message {
font-size: 13px;
}
.last-message,
.username {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
}
.last-message {
font-size: 13px;
width: 200px;
overflow: hidden; //
white-space: nowrap; //
text-overflow: ellipsis; //
}
}
.active,
.pinned {
.active {
background-color: rgba(128, 128, 128, 0.5); //
border-radius: 8px;
}
.right-menu-ul {

View File

@ -46,14 +46,13 @@
:class="{
'kefu-message': KeFuMessageContentTypeEnum.TEXT === item.contentType
}"
class="p-10px"
>
<!-- 文本消息 -->
<MessageItem :message="item">
<template v-if="KeFuMessageContentTypeEnum.TEXT === item.contentType">
<div
v-dompurify-html="replaceEmoji(getMessageContent(item).text || item.content)"
class="flex items-center"
class="flex items-center h-1/1"
></div>
</template>
</MessageItem>
@ -64,7 +63,7 @@
:initial-index="0"
:preview-src-list="[getMessageContent(item).picUrl || item.content]"
:src="getMessageContent(item).picUrl || item.content"
class="w-200px"
class="w-200px mx-10px"
fit="contain"
preview-teleported
/>
@ -79,7 +78,7 @@
:spuId="getMessageContent(item).spuId"
:stock="getMessageContent(item).stock"
:title="getMessageContent(item).spuName"
class="max-w-300px"
class="max-w-300px mx-10px"
/>
</MessageItem>
<!-- 订单消息 -->
@ -87,7 +86,7 @@
<OrderItem
v-if="KeFuMessageContentTypeEnum.ORDER === item.contentType"
:message="item"
class="max-w-100%"
class="max-w-100% mx-10px"
/>
</MessageItem>
</div>
@ -373,17 +372,39 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
<style lang="scss" scoped>
.kefu {
background-color: #fff;
background-color: #f5f5f5;
position: relative;
width: calc(100% - 300px - 260px);
border-left: var(--el-border-color) solid 1px;
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 1px; /* 实际宽度 */
height: 100%;
background-color: var(--el-border-color);
transform: scaleX(0.3); /* 缩小宽度 */
}
.kefu-header {
background: #fbfbfb;
box-shadow: 0 0 0 0 #dcdfe6;
background-color: #f5f5f5;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
&::before {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 1px; /* 初始宽度 */
background-color: var(--el-border-color);
transform: scaleY(0.3); /* 缩小视觉高度 */
}
&-title {
font-size: 18px;
font-weight: bold;
@ -412,7 +433,7 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
justify-content: flex-start;
.kefu-message {
background-color: rgb(245, 245, 245);
background-color: #fff;
margin-left: 10px;
margin-top: 3px;
border-top-right-radius: 10px;
@ -441,9 +462,9 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
padding: 5px 10px;
width: auto;
max-width: 50%;
text-align: left;
display: inline-block !important;
word-break: break-all;
//text-align: left;
//display: inline-block !important;
//word-break: break-all;
transition: all 0.2s;
&:hover {
@ -457,18 +478,29 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
background-color: rgba(0, 0, 0, 0.1);
border-radius: 8px;
padding: 0 5px;
color: #999;
color: #fff;
font-size: 10px;
}
}
.kefu-footer {
position: relative;
display: flex;
flex-direction: column;
height: auto;
margin: 0;
padding: 0;
border-top: var(--el-border-color) solid 1px;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 1px; /* 初始宽度 */
background-color: var(--el-border-color);
transform: scaleY(0.3); /* 缩小视觉高度 */
}
.chat-tools {
width: 100%;
@ -478,6 +510,7 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
::v-deep(textarea) {
resize: none;
background-color: #f5f5f5;
}
:deep(.el-input__wrapper) {

View File

@ -165,17 +165,39 @@ const getUserData = async () => {
<style lang="scss" scoped>
.kefu {
position: relative;
width: 300px !important;
background-color: #fff;
border-left: var(--el-border-color) solid 1px;
background-color: #f5f5f5;
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 1px; /* 实际宽度 */
height: 100%;
background-color: var(--el-border-color);
transform: scaleX(0.3); /* 缩小宽度 */
}
&-header {
background: #fbfbfb;
box-shadow: 0 0 0 0 #dcdfe6;
background-color: #f5f5f5;
position: relative;
display: flex;
align-items: center;
justify-content: space-around;
&::before {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 1px; /* 初始宽度 */
background-color: var(--el-border-color);
transform: scaleY(0.3); /* 缩小视觉高度 */
}
&-title {
font-size: 18px;
font-weight: bold;

View File

@ -112,7 +112,7 @@ function formatOrderStatus(order: any) {
border-radius: 10px;
padding: 10px;
border: 1px var(--el-border-color) solid;
background-color: rgba(128, 128, 128, 0.5); //
background-color: #fff; //
.order-card-header {
height: 28px;
@ -136,7 +136,6 @@ function formatOrderStatus(order: any) {
.pay-box {
padding-top: 10px;
color: #fff;
font-weight: bold;
.discounts-title {

View File

@ -77,7 +77,7 @@ const openDetail = (spuId: number) => {
.product-warp {
width: 100%;
background-color: rgba(128, 128, 128, 0.5); //
background-color: #fff;
border-radius: 8px;
display: flex;
align-items: center;

View File

@ -93,7 +93,7 @@ export const useEmoji = () => {
const emojiFile = getEmojiFileByName(item)
newData = newData.replace(
item,
`<img class="chat-img" style="width: 24px;height: 24px;margin: 0 3px;" src="${emojiFile}" alt=""/>`
`<img class="chat-img" style="width: 24px;height: 24px;margin: 0 3px;vertical-align: middle;" src="${emojiFile}" alt=""/>`
)
})
}

View File

@ -1,5 +1,5 @@
<template>
<el-descriptions :column="column">
<el-descriptions :class="{ 'kefu-descriptions': column === 1 }" :column="column">
<el-descriptions-item>
<template #label>
<descriptions-item-label icon="svg-icon:member_level" label=" 等级 " />
@ -62,4 +62,23 @@ withDefaults(defineProps<{ user: UserApi.UserVO; wallet: WalletApi.WalletVO; col
.cell-item::after {
content: ':';
}
.kefu-descriptions {
::v-deep(.el-descriptions__cell) {
display: flex;
align-items: center;
justify-content: space-between;
.el-descriptions__label {
width: 120px;
display: block;
text-align: left;
}
.el-descriptions__content {
flex: 1;
text-align: end;
}
}
}
</style>

View File

@ -68,7 +68,7 @@
</el-row>
<template v-if="mode === 'kefu'">
<ElAvatar :size="140" :src="user.avatar || undefined" shape="square" />
<el-descriptions :column="1">
<el-descriptions :column="1" class="kefu-descriptions">
<el-descriptions-item>
<template #label>
<descriptions-item-label icon="ep:user" label="用户名" />
@ -81,7 +81,7 @@
</template>
{{ user.nickname }}
</el-descriptions-item>
<el-descriptions-item label="手机号">
<el-descriptions-item>
<template #label>
<descriptions-item-label icon="ep:phone" label="手机号" />
</template>
@ -143,4 +143,23 @@ withDefaults(defineProps<{ user: UserApi.UserVO; mode?: string }>(), {
justify-content: space-between;
align-items: center;
}
::v-deep(.kefu-descriptions) {
.el-descriptions__cell {
display: flex;
align-items: center;
justify-content: space-between;
.el-descriptions__label {
width: 120px;
display: block;
text-align: left;
}
.el-descriptions__content {
flex: 1;
text-align: end;
}
}
}
</style>