File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
src/views/mall/promotion/kefu Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ const refreshMessageList = async (message?: any) => {
207
207
}
208
208
pushMessage (message )
209
209
} else {
210
+ // TODO @puhui999:不基于 page 做。而是流式分页;通过 createTime 排序查询;
210
211
queryParams .pageNo = 1
211
212
await getMessageList ()
212
213
}
@@ -220,6 +221,8 @@ const refreshMessageList = async (message?: any) => {
220
221
}
221
222
}
222
223
224
+ /** 获得新会话的消息列表 */
225
+ // TODO @puhui999:可优化:可以考虑本地做每个会话的消息 list 缓存;然后点击切换时,读取缓存;然后异步获取新消息,merge 下;
223
226
const getNewMessageList = async (val : KeFuConversationRespVO ) => {
224
227
// 会话切换,重置相关参数
225
228
queryParams .pageNo = 1
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ watchEffect(() => {
64
64
// 2.2 消息类型:KEFU_MESSAGE_TYPE
65
65
if (type === WebSocketMessageTypeConstants .KEFU_MESSAGE_TYPE ) {
66
66
// 刷新会话列表
67
+ // TODO @puhui999:不应该刷新列表,而是根据消息,本地 update 列表的数据;
67
68
getConversationList ()
68
69
// 刷新消息列表
69
70
keFuChatBoxRef .value ?.refreshMessageList (JSON .parse (jsonMessage .content ))
@@ -72,6 +73,7 @@ watchEffect(() => {
72
73
// 2.3 消息类型:KEFU_MESSAGE_ADMIN_READ
73
74
if (type === WebSocketMessageTypeConstants .KEFU_MESSAGE_ADMIN_READ ) {
74
75
// 刷新会话列表
76
+ // TODO @puhui999:不应该刷新列表,而是根据消息,本地 update 列表的数据;
75
77
getConversationList ()
76
78
}
77
79
} catch (error ) {
You can’t perform that action at this time.
0 commit comments