Skip to content

Commit 1911ed9

Browse files
YunaiVgitee-org
authored andcommitted
!527 【功能优化】商城客服聊天相关优化
Merge pull request !527 from 卢越/master
2 parents b997004 + 075cf0c commit 1911ed9

File tree

5 files changed

+36
-12
lines changed

5 files changed

+36
-12
lines changed

src/api/mall/promotion/kefu/conversation/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ export const KeFuConversationApi = {
3030
},
3131
// 删除客服会话
3232
deleteConversation: async (id: number) => {
33-
return await request.get({ url: '/promotion/kefu-conversation/delete?id' + id })
33+
return await request.delete({ url: `/promotion/kefu-conversation/delete?id=${id}`})
3434
}
3535
}

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
<MessageItem :message="item">
7272
<ProductItem
7373
v-if="KeFuMessageContentTypeEnum.PRODUCT === item.contentType"
74+
:spuId="getMessageContent(item).spuId"
7475
:picUrl="getMessageContent(item).picUrl"
7576
:price="getMessageContent(item).price"
7677
:skuText="getMessageContent(item).introduction"
@@ -393,7 +394,7 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
393394
border-left: 5px solid transparent;
394395
border-bottom: 5px solid transparent;
395396
border-top: 5px solid transparent;
396-
border-right: 5px solid #ffffff;
397+
border-right: 5px solid var(--app-content-bg-color);
397398
}
398399
}
399400
}
@@ -412,7 +413,7 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
412413
right: -19px;
413414
top: calc(50% - 10px);
414415
position: absolute;
415-
border-left: 5px solid #ffffff;
416+
border-left: 5px solid var(--app-content-bg-color);
416417
border-bottom: 5px solid transparent;
417418
border-top: 5px solid transparent;
418419
border-right: 5px solid transparent;
@@ -422,17 +423,17 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
422423
423424
// 消息气泡
424425
.kefu-message {
425-
color: #333;
426+
color: #A9A9A9;
426427
border-radius: 5px;
427-
box-shadow: 3px 5px 15px rgba(0, 0, 0, 0.2);
428+
box-shadow: 3px 3px 5px rgba(220,220,220, 0.1);
428429
padding: 5px 10px;
429430
width: auto;
430431
max-width: 50%;
431432
text-align: left;
432433
display: inline-block !important;
433434
position: relative;
434435
word-break: break-all;
435-
background-color: #ffffff;
436+
background-color: var(--app-content-bg-color);
436437
transition: all 0.2s;
437438
438439
&:hover {
@@ -454,7 +455,7 @@ const showTime = computed(() => (item: KeFuMessageRespVO, index: number) => {
454455
455456
.chat-tools {
456457
width: 100%;
457-
border: #e4e0e0 solid 1px;
458+
border: var(--el-border-color) solid 1px;
458459
border-radius: 10px;
459460
height: 44px;
460461
}

src/views/mall/promotion/kefu/components/history/ProductBrowsingHistory.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<ProductItem
33
v-for="item in list"
4+
:spu-id="item.spuId"
45
:key="item.id"
56
:picUrl="item.picUrl"
67
:price="item.price"

src/views/mall/promotion/kefu/components/message/OrderItem.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div v-if="isObject(getMessageContent)">
2+
<div v-if="isObject(getMessageContent)" @click="openDetail(getMessageContent.id)" style="cursor: pointer;">
33
<div :key="getMessageContent.id" class="order-list-card-box mt-14px">
44
<div class="order-card-header flex items-center justify-between p-x-5px">
55
<div class="order-no">订单号:{{ getMessageContent.no }}</div>
@@ -9,6 +9,7 @@
99
</div>
1010
<div v-for="item in getMessageContent.items" :key="item.id" class="border-bottom">
1111
<ProductItem
12+
:spu-id="item.spuId"
1213
:num="item.count"
1314
:picUrl="item.picUrl"
1415
:price="item.price"
@@ -36,6 +37,8 @@ import { KeFuMessageRespVO } from '@/api/mall/promotion/kefu/message'
3637
import { isObject } from '@/utils/is'
3738
import ProductItem from '@/views/mall/promotion/kefu/components/message/ProductItem.vue'
3839
40+
const { push } = useRouter()
41+
3942
defineOptions({ name: 'OrderItem' })
4043
const props = defineProps<{
4144
message?: KeFuMessageRespVO
@@ -46,6 +49,12 @@ const getMessageContent = computed(() =>
4649
typeof props.message !== 'undefined' ? jsonParse(props!.message!.content) : props.order
4750
)
4851
52+
/** 查看订单详情 */
53+
const openDetail = (id: number) => {
54+
console.log(getMessageContent)
55+
push({ name: 'TradeOrderDetail', params: { id } })
56+
}
57+
4958
/**
5059
* 格式化订单状态的颜色
5160
*
@@ -97,7 +106,7 @@ function formatOrderStatus(order: any) {
97106
.order-list-card-box {
98107
border-radius: 10px;
99108
padding: 10px;
100-
border: 1px #6a6a6a solid;
109+
border: 1px var(--el-border-color) solid;
101110
background-color: var(--app-content-bg-color);
102111
103112
.order-card-header {

src/views/mall/promotion/kefu/components/message/ProductItem.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div>
2+
<div @click.stop="openDetail(props.spuId)" style="cursor: pointer;">
33
<div>
44
<slot name="top"></slot>
55
</div>
@@ -15,6 +15,7 @@
1515
class="order-img"
1616
fit="contain"
1717
preview-teleported
18+
@click.stop
1819
/>
1920
</div>
2021
<div
@@ -53,8 +54,14 @@
5354
<script lang="ts" setup>
5455
import { fenToYuan } from '@/utils'
5556
57+
const { push } = useRouter()
58+
5659
defineOptions({ name: 'ProductItem' })
5760
const props = defineProps({
61+
spuId: {
62+
type: Number,
63+
default: 0
64+
},
5865
picUrl: {
5966
type: String,
6067
default: 'https://img1.baidu.com/it/u=1601695551,235775011&fm=26&fmt=auto'
@@ -107,13 +114,19 @@ const skuString = computed(() => {
107114
}
108115
return props.skuText
109116
})
117+
118+
/** 查看商品详情 */
119+
const openDetail = (spuId: number) => {
120+
console.log(props.spuId)
121+
push({ name: 'ProductSpuDetail', params: { id: spuId } })
122+
}
110123
</script>
111124

112125
<style lang="scss" scoped>
113126
.ss-order-card-warp {
114127
padding: 20px;
115128
border-radius: 10px;
116-
border: 1px #6a6a6a solid;
129+
border: 1px var(--el-border-color) solid;
117130
background-color: var(--app-content-bg-color);
118131
119132
.img-box {
@@ -134,7 +147,7 @@ const skuString = computed(() => {
134147
135148
.tool-box {
136149
position: absolute;
137-
right: 0px;
150+
right: 0;
138151
bottom: -10px;
139152
}
140153
}

0 commit comments

Comments
 (0)