Skip to content

Commit 5cdc153

Browse files
author
puhui999
committed
【功能完善】商城: 客服文本消息样式调整,内容居中
1 parent 64e2ddf commit 5cdc153

File tree

4 files changed

+40
-18
lines changed

4 files changed

+40
-18
lines changed

src/views/mall/promotion/kefu/components/KeFuConversationList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ onBeforeUnmount(() => {
200200

201201
<style lang="scss" scoped>
202202
.kefu {
203-
background-color: #fff;
203+
background-color: #e5e4e4;
204204
205205
&-conversation {
206206
height: 60px;

src/views/mall/promotion/kefu/components/KeFuMessageList.vue

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@
4646
:class="{
4747
'kefu-message': KeFuMessageContentTypeEnum.TEXT === item.contentType
4848
}"
49-
class="p-10px"
5049
>
5150
<!-- 文本消息 -->
5251
<MessageItem :message="item">
5352
<template v-if="KeFuMessageContentTypeEnum.TEXT === item.contentType">
5453
<div
5554
v-dompurify-html="replaceEmoji(getMessageContent(item).text || item.content)"
56-
class="flex items-center"
55+
class="flex items-center h-1/1"
5756
></div>
5857
</template>
5958
</MessageItem>
@@ -64,7 +63,7 @@
6463
:initial-index="0"
6564
:preview-src-list="[getMessageContent(item).picUrl || item.content]"
6665
:src="getMessageContent(item).picUrl || item.content"
67-
class="w-200px"
66+
class="w-200px mx-10px"
6867
fit="contain"
6968
preview-teleported
7069
/>
@@ -79,15 +78,15 @@
7978
:spuId="getMessageContent(item).spuId"
8079
:stock="getMessageContent(item).stock"
8180
:title="getMessageContent(item).spuName"
82-
class="max-w-300px"
81+
class="max-w-300px mx-10px"
8382
/>
8483
</MessageItem>
8584
<!-- 订单消息 -->
8685
<MessageItem :message="item">
8786
<OrderItem
8887
v-if="KeFuMessageContentTypeEnum.ORDER === item.contentType"
8988
:message="item"
90-
class="max-w-100%"
89+
class="max-w-100% mx-10px"
9190
/>
9291
</MessageItem>
9392
</div>
@@ -373,7 +372,7 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
373372

374373
<style lang="scss" scoped>
375374
.kefu {
376-
background-color: #fff;
375+
background-color: #f5f5f5;
377376
position: relative;
378377
width: calc(100% - 300px - 260px);
379378
@@ -389,12 +388,23 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
389388
}
390389
391390
.kefu-header {
392-
background: #fbfbfb;
393-
box-shadow: 0 0 0 0 #dcdfe6;
391+
background-color: #f5f5f5;
392+
position: relative;
394393
display: flex;
395394
align-items: center;
396395
justify-content: space-between;
397396
397+
&::before {
398+
content: '';
399+
position: absolute;
400+
bottom: 0;
401+
left: 0;
402+
width: 100%;
403+
height: 1px; /* 初始宽度 */
404+
background-color: var(--el-border-color);
405+
transform: scaleY(0.3); /* 缩小视觉高度 */
406+
}
407+
398408
&-title {
399409
font-size: 18px;
400410
font-weight: bold;
@@ -423,7 +433,7 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
423433
justify-content: flex-start;
424434
425435
.kefu-message {
426-
background-color: rgb(245, 245, 245);
436+
background-color: #fff;
427437
margin-left: 10px;
428438
margin-top: 3px;
429439
border-top-right-radius: 10px;
@@ -452,9 +462,9 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
452462
padding: 5px 10px;
453463
width: auto;
454464
max-width: 50%;
455-
text-align: left;
456-
display: inline-block !important;
457-
word-break: break-all;
465+
//text-align: left;
466+
//display: inline-block !important;
467+
//word-break: break-all;
458468
transition: all 0.2s;
459469
460470
&:hover {
@@ -468,7 +478,7 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
468478
background-color: rgba(0, 0, 0, 0.1);
469479
border-radius: 8px;
470480
padding: 0 5px;
471-
color: #999;
481+
color: #fff;
472482
font-size: 10px;
473483
}
474484
}
@@ -500,6 +510,7 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
500510
501511
::v-deep(textarea) {
502512
resize: none;
513+
background-color: #f5f5f5;
503514
}
504515
505516
:deep(.el-input__wrapper) {

src/views/mall/promotion/kefu/components/member/MemberInfo.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ const getUserData = async () => {
167167
.kefu {
168168
position: relative;
169169
width: 300px !important;
170-
background-color: #fff;
170+
background-color: #f5f5f5;
171171
172172
&::after {
173173
content: '';
@@ -181,12 +181,23 @@ const getUserData = async () => {
181181
}
182182
183183
&-header {
184-
background: #fbfbfb;
185-
box-shadow: 0 0 0 0 #dcdfe6;
184+
background-color: #f5f5f5;
185+
position: relative;
186186
display: flex;
187187
align-items: center;
188188
justify-content: space-around;
189189
190+
&::before {
191+
content: '';
192+
position: absolute;
193+
bottom: 0;
194+
left: 0;
195+
width: 100%;
196+
height: 1px; /* 初始宽度 */
197+
background-color: var(--el-border-color);
198+
transform: scaleY(0.3); /* 缩小视觉高度 */
199+
}
200+
190201
&-title {
191202
font-size: 18px;
192203
font-weight: bold;

src/views/mall/promotion/kefu/components/tools/emoji.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const useEmoji = () => {
9393
const emojiFile = getEmojiFileByName(item)
9494
newData = newData.replace(
9595
item,
96-
`<img class="chat-img" style="width: 24px;height: 24px;margin: 0 3px;" src="${emojiFile}" alt=""/>`
96+
`<img class="chat-img" style="width: 24px;height: 24px;margin: 0 3px;vertical-align: middle;" src="${emojiFile}" alt=""/>`
9797
)
9898
})
9999
}

0 commit comments

Comments
 (0)