Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9dfb869a
authored
Jul 09, 2024
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】mall 客服商品消息
parent
848bc606
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
0 deletions
+104
-0
src/views/mall/promotion/kefu/components/KeFuChatBox.vue
+3
-0
src/views/mall/promotion/kefu/components/message/ProductMessageItem.vue
+101
-0
No files found.
src/views/mall/promotion/kefu/components/KeFuChatBox.vue
View file @
9dfb869a
...
@@ -55,6 +55,8 @@
...
@@ -55,6 +55,8 @@
<TextMessageItem
:message=
"item"
/>
<TextMessageItem
:message=
"item"
/>
<!-- 图片消息 -->
<!-- 图片消息 -->
<ImageMessageItem
:message=
"item"
/>
<ImageMessageItem
:message=
"item"
/>
<!-- 商品消息 -->
<ProductMessageItem
:message=
"item"
/>
</div>
</div>
<el-avatar
<el-avatar
v-if=
"item.senderType === UserTypeEnum.ADMIN"
v-if=
"item.senderType === UserTypeEnum.ADMIN"
...
@@ -101,6 +103,7 @@ import EmojiSelectPopover from './tools/EmojiSelectPopover.vue'
...
@@ -101,6 +103,7 @@ import EmojiSelectPopover from './tools/EmojiSelectPopover.vue'
import
PictureSelectUpload
from
'./tools/PictureSelectUpload.vue'
import
PictureSelectUpload
from
'./tools/PictureSelectUpload.vue'
import
TextMessageItem
from
'./message/TextMessageItem.vue'
import
TextMessageItem
from
'./message/TextMessageItem.vue'
import
ImageMessageItem
from
'./message/ImageMessageItem.vue'
import
ImageMessageItem
from
'./message/ImageMessageItem.vue'
import
ProductMessageItem
from
'./message/ProductMessageItem.vue'
import
{
Emoji
}
from
'./tools/emoji'
import
{
Emoji
}
from
'./tools/emoji'
import
{
KeFuMessageContentTypeEnum
}
from
'./tools/constants'
import
{
KeFuMessageContentTypeEnum
}
from
'./tools/constants'
import
{
isEmpty
}
from
'@/utils/is'
import
{
isEmpty
}
from
'@/utils/is'
...
...
src/views/mall/promotion/kefu/components/message/ProductMessageItem.vue
0 → 100644
View file @
9dfb869a
<
template
>
<!-- 图片消息 -->
<template
v-if=
"KeFuMessageContentTypeEnum.PRODUCT === message.contentType"
>
<div
:class=
"[
message.senderType === UserTypeEnum.MEMBER
? `ml-10px`
: message.senderType === UserTypeEnum.ADMIN
? `mr-10px`
: ''
]"
>
<div
class=
"goods flex items-center"
>
<el-image
:src=
"getMessageContent.picUrl"
class=
"image"
fit=
"contain"
@
click=
"imagePreview(getMessageContent.picUrl)"
/>
<view
class=
"flex-1"
>
<view
class=
"title ss-line-2"
>
{{
getMessageContent
.
spuName
}}
</view>
<view
v-if=
"getMessageContent.introduction"
class=
"subtitle ss-line-1"
>
{{
getMessageContent
.
introduction
}}
</view>
<view
class=
"price mt-8px"
>
¥
{{
getMessageContent
.
price
}}
</view>
</view>
</div>
</div>
</
template
>
</template>
<
script
lang=
"ts"
setup
>
import
{
KeFuMessageContentTypeEnum
}
from
'../tools/constants'
import
{
UserTypeEnum
}
from
'@/utils/constants'
import
{
KeFuMessageRespVO
}
from
'@/api/mall/promotion/kefu/message'
import
{
createImageViewer
}
from
'@/components/ImageViewer'
defineOptions
({
name
:
'ImageMessageItem'
})
const
props
=
defineProps
<
{
message
:
KeFuMessageRespVO
}
>
()
const
getMessageContent
=
computed
(()
=>
JSON
.
parse
(
props
.
message
.
content
))
/** 图预览 */
const
imagePreview
=
(
imgUrl
:
string
)
=>
{
createImageViewer
({
urlList
:
[
imgUrl
]
})
}
</
script
>
<
style
lang=
"scss"
scoped
>
.goods
{
padding
:
20px
;
border-radius
:
12px
;
background-color
:
#e1e1e1
;
.ss-line
{
min-width
:
0
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-box-orient
:
vertical
;
&-1
{
-webkit-line-clamp
:
1
;
}
&
-2
{
-webkit-line-clamp
:
2
;
}
}
.image
{
width
:
116px
;
height
:
116px
;
flex-shrink
:
0
;
margin-right
:
20px
;
}
.title
{
height
:
64px
;
line-height
:
32px
;
font-size
:
26px
;
font-weight
:
500
;
color
:
#333
;
}
.subtitle
{
font-size
:
24px
;
font-weight
:
400
;
color
:
#999
;
}
.price
{
font-size
:
26px
;
font-weight
:
500
;
color
:
#ff3000
;
}
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment