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
63803524
authored
Jul 19, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码评审】MALL:客服聊天
parent
e8a0eb08
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
src/views/mall/promotion/kefu/components/KeFuMessageList.vue
+3
-0
src/views/mall/promotion/kefu/index.vue
+2
-0
No files found.
src/views/mall/promotion/kefu/components/KeFuMessageList.vue
View file @
63803524
...
...
@@ -207,6 +207,7 @@ const refreshMessageList = async (message?: any) => {
}
pushMessage
(
message
)
}
else
{
// TODO @puhui999:不基于 page 做。而是流式分页;通过 createTime 排序查询;
queryParams
.
pageNo
=
1
await
getMessageList
()
}
...
...
@@ -220,6 +221,8 @@ const refreshMessageList = async (message?: any) => {
}
}
/** 获得新会话的消息列表 */
// TODO @puhui999:可优化:可以考虑本地做每个会话的消息 list 缓存;然后点击切换时,读取缓存;然后异步获取新消息,merge 下;
const
getNewMessageList
=
async
(
val
:
KeFuConversationRespVO
)
=>
{
// 会话切换,重置相关参数
queryParams
.
pageNo
=
1
...
...
src/views/mall/promotion/kefu/index.vue
View file @
63803524
...
...
@@ -64,6 +64,7 @@ watchEffect(() => {
// 2.2 消息类型:KEFU_MESSAGE_TYPE
if
(
type
===
WebSocketMessageTypeConstants
.
KEFU_MESSAGE_TYPE
)
{
// 刷新会话列表
// TODO @puhui999:不应该刷新列表,而是根据消息,本地 update 列表的数据;
getConversationList
()
// 刷新消息列表
keFuChatBoxRef
.
value
?.
refreshMessageList
(
JSON
.
parse
(
jsonMessage
.
content
))
...
...
@@ -72,6 +73,7 @@ watchEffect(() => {
// 2.3 消息类型:KEFU_MESSAGE_ADMIN_READ
if
(
type
===
WebSocketMessageTypeConstants
.
KEFU_MESSAGE_ADMIN_READ
)
{
// 刷新会话列表
// TODO @puhui999:不应该刷新列表,而是根据消息,本地 update 列表的数据;
getConversationList
()
}
}
catch
(
error
)
{
...
...
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