@aochuang/client-sdk 1.0.376 → 1.0.378
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/chat-editor/chat-editor-suggestions/chat-editor-suggestions.vue +40 -4
- package/components/chat-editor/chat-editor.vue +75 -5
- package/components/index.js +1 -6
- package/components/session-select/session-select-item.vue +9 -8
- package/components/wechat-chat-control/location/location.vue +3 -3
- package/components/wework-chat-control/channel-live/channel-live.vue +2 -7
- package/components/wework-chat-control/company-card/company-card.vue +1 -1
- package/components/wework-chat-control/custom-expression/custom-expression.vue +1 -2
- package/components/wework-chat-control/file-url/file-url.vue +16 -34
- package/components/wework-chat-control/image/image.vue +2 -137
- package/components/wework-chat-control/index.js +7 -15
- package/components/wework-chat-control/location/location.vue +3 -3
- package/components/wework-chat-control/red-envelopes/red-envelopes.vue +2 -3
- package/components/wework-chat-control/text/text.vue +144 -24
- package/components/wework-chat-control/url/url-miniprogram.vue +7 -6
- package/components/wework-chat-control/url/url.vue +2 -26
- package/components/wework-chat-control/util.js +17 -26
- package/components/wework-chat-control/video/video.vue +2 -10
- package/components/wework-chat-control/voice/voice.vue +2 -9
- package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +36 -0
- package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/image/image.vue +36 -0
- package/components/wework-chat-panel/chat-panel-controls/index.js +35 -0
- package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +28 -0
- package/components/wework-chat-panel/chat-panel-controls/link/link.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/location/location.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/text/text.vue +43 -0
- package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +39 -0
- package/components/wework-chat-panel/chat-panel-controls/video/video.vue +37 -0
- package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +35 -0
- package/components/wework-chat-panel/chat-panel-item.vue +25 -56
- package/components/wework-chat-panel/chat-panel.vue +13 -96
- package/package.json +3 -10
- package/services/client-chat/client-chat-wechat/client-chat-message.js +15 -5
- package/services/client-chat/client-chat-wechat/client-chat-session.js +13 -50
- package/services/client-chat/client-chat-wechat/client-chat.js +4 -48
- package/services/client-chat/client-chat-wechat/docs//350/264/246/345/217/267/346/234/252/350/257/273/346/225/260/351/207/217/344/270/216/344/274/232/350/257/235/346/234/252/350/257/273/346/225/260/351/207/217/344/270/215/344/270/200/350/207/264/351/227/256/351/242/230/344/277/256/345/244/215.md +4 -2
- package/services/client-chat/client-chat-wework/client-chat-account.js +1 -84
- package/services/client-chat/client-chat-wework/client-chat-concats.js +17 -81
- package/services/client-chat/client-chat-wework/client-chat-message.js +5 -45
- package/services/client-chat/client-chat-wework/client-chat-session.js +4 -59
- package/services/client-chat/client-chat-wework/client-chat-socket.js +1 -13
- package/services/client-chat/client-chat-wework/client-chat.js +11 -320
- package/services/client-chat/client-chat-wework/utils.js +5 -5
- package/uni-common/account-portray/account-portray.vue +51 -0
- package/uni-common/account-select/account-select-item.vue +172 -0
- package/uni-common/account-select/account-select.vue +252 -0
- package/uni-common/all-friend-avatar/all-friend-avatar.vue +49 -0
- package/uni-common/friend-avatar/default.svg +1 -0
- package/uni-common/friend-avatar/friend-avatar.vue +27 -0
- package/uni-common/friend-avatar/index.js +3 -0
- package/uni-common/friend-loader/friend-loader.vue +53 -0
- package/uni-common/friend-portray/friend-portray.vue +56 -0
- package/uni-common/group-avatar/default.svg +1 -0
- package/uni-common/group-avatar/group-avatar.vue +18 -0
- package/uni-common/group-avatar/index.js +3 -0
- package/uni-common/room-avatar/default.svg +6 -0
- package/uni-common/room-avatar/index.js +3 -0
- package/uni-common/room-avatar/room-avatar.vue +27 -0
- package/uni-common/room-loader/room-loader.vue +53 -0
- package/uni-common/room-portray/room-portray.vue +56 -0
- package/uni-components/chat-control/calling/calling.vue +91 -0
- package/uni-components/chat-control/calling/phone-fill.svg +1 -0
- package/uni-components/chat-control/calling/vidicon-fill.svg +1 -0
- package/uni-components/chat-control/channel-video/channel-video.vue +89 -0
- package/uni-components/chat-control/channel-video-card/channel-video-card.vue +105 -0
- package/uni-components/chat-control/channel-video-live/channel-video-live.vue +92 -0
- package/uni-components/chat-control/chat-control-config-item/chat-control-config-item.vue +20 -0
- package/uni-components/chat-control/chat-control-config-item/index.js +3 -0
- package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-app.vue +25 -0
- package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-h5.vue +21 -0
- package/{components/wework-chat-control/wework-chat-control-config.vue → uni-components/chat-control/chat-control-config.vue} +13 -16
- package/uni-components/chat-control/chat-control.vue +218 -0
- package/uni-components/chat-control/company-card/company-card.vue +123 -0
- package/uni-components/chat-control/const.js +28 -0
- package/uni-components/chat-control/expression/expression.vue +41 -0
- package/uni-components/chat-control/image/image.vue +68 -0
- package/uni-components/chat-control/index.js +89 -0
- package/uni-components/chat-control/location/location.vue +110 -0
- package/uni-components/chat-control/member-change/member-change.vue +32 -0
- package/uni-components/chat-control/quote-message/quote-message.vue +216 -0
- package/uni-components/chat-control/real-time-position/real-time-position.vue +62 -0
- package/uni-components/chat-control/redpacket/red-envelope.svg +1 -0
- package/uni-components/chat-control/redpacket/redpacket.vue +75 -0
- package/uni-components/chat-control/share-card/share-card.vue +101 -0
- package/uni-components/chat-control/system/system.vue +69 -0
- package/uni-components/chat-control/system-batch-message/system-batch-message.vue +30 -0
- package/uni-components/chat-control/system-text/system-text.vue +32 -0
- package/uni-components/chat-control/text/text.vue +67 -0
- package/uni-components/chat-control/text-with-at/text-with-at.vue +51 -0
- package/uni-components/chat-control/transfer/red-transfer.svg +1 -0
- package/uni-components/chat-control/transfer/transfer.vue +80 -0
- package/uni-components/chat-control/unkonw/unkonw.vue +37 -0
- package/uni-components/chat-control/url/icons/file-excel-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-info-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-music-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-pdf-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-ppt-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-settings-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-text-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-unknow-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-word-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-zip-line.svg +1 -0
- package/uni-components/chat-control/url/icons/index.js +24 -0
- package/uni-components/chat-control/url/miniprogram.svg +1 -0
- package/uni-components/chat-control/url/url-miniprogram.vue +116 -0
- package/uni-components/chat-control/url/url.vue +306 -0
- package/uni-components/chat-control/url-new/icons/file-excel-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-info-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-music-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-pdf-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-ppt-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-settings-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-text-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-unknow-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-word-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-zip-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/index.js +24 -0
- package/uni-components/chat-control/url-new/url-new.vue +110 -0
- package/uni-components/chat-control/utils.js +12 -0
- package/uni-components/chat-control/video/video.vue +156 -0
- package/uni-components/chat-control/voice/voice.vue +166 -0
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-collect.vue +84 -0
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-system.vue +28 -0
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet.vue +85 -0
- package/uni-components/chat-editor/chat-editor-func/chat-editor-func.vue +157 -0
- package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at-panel.vue +158 -0
- package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at.vue +61 -0
- package/uni-components/chat-editor/chat-editor-func-button/chat-editor-func-button.vue +58 -0
- package/uni-components/chat-editor/chat-editor-func-file/chat-editor-func-file.vue +54 -0
- package/uni-components/chat-editor/chat-editor-func-image/chat-editor-func-image.vue +42 -0
- package/uni-components/chat-editor/chat-editor-func-video/chat-editor-func-video.vue +42 -0
- package/uni-components/chat-editor/chat-editor-func-voice/chat-editor-func-voice.vue +25 -0
- package/uni-components/chat-editor/chat-editor-message-send/chat-editor-message-send.vue +158 -0
- package/uni-components/chat-editor/chat-editor-quote/chat-editor-quote.vue +75 -0
- package/uni-components/chat-editor/chat-editor.vue +257 -0
- package/uni-components/chat-editor/index.js +10 -0
- package/uni-components/chat-editor/util.js +65 -0
- package/uni-components/chat-panel/chat-panel-chats-box.vue +238 -0
- package/uni-components/chat-panel/chat-panel-chats-forward/chat-panel-chats-forward.vue +273 -0
- package/uni-components/chat-panel/chat-panel-chats-item.vue +578 -0
- package/uni-components/chat-panel/chat-panel-chats-status/chat-panel-chats-status.vue +71 -0
- package/uni-components/chat-panel/chat-panel-chats.vue +368 -0
- package/uni-components/chat-panel/chat-panel.vue +227 -0
- package/uni-components/contacts-group-select/contacts-group-select-item.vue +85 -0
- package/uni-components/contacts-group-select/contacts-group-select-panel.vue +119 -0
- package/uni-components/contacts-group-select/contacts-group-select.vue +150 -0
- package/common/.DS_Store +0 -0
- package/components/.DS_Store +0 -0
- package/components/wechat-chat-control/.DS_Store +0 -0
- package/components/wechat-chat-control/transfer/.DS_Store +0 -0
- package/components/wechat-chat-control/url/.DS_Store +0 -0
- package/components/wechat-chat-control/voice/.DS_Store +0 -0
- package/components/wework-chat-control/channel-card/channel-card.vue +0 -144
- package/components/wework-chat-control/link/.DS_Store +0 -0
- package/components/wework-chat-control/merge-message/merge-message-panel.vue +0 -63
- package/components/wework-chat-control/merge-message/merge-message.vue +0 -84
- package/components/wework-chat-control/merge-message/util.js +0 -59
- package/components/wework-chat-control/metting/enterprise-wechat.png +0 -0
- package/components/wework-chat-control/metting/meeting-video.svg +0 -4
- package/components/wework-chat-control/metting/metting.vue +0 -181
- package/components/wework-chat-control/text/text-default.vue +0 -99
- package/components/wework-chat-control/text/text-quote.vue +0 -105
- package/components/wework-chat-control/url/url-channel-live.vue +0 -53
- package/components/wework-chat-control/video/.DS_Store +0 -0
- package/components/wework-chat-control/wework-chat-control-config-item.vue +0 -24
- package/components/wework-chat-control/wework-chat-control-config-msg.vue +0 -25
- package/components/wework-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +0 -73
- package/services/.DS_Store +0 -0
|
@@ -2,7 +2,6 @@ import Vue from 'vue'
|
|
|
2
2
|
import Event from '../../../utils/event.js'
|
|
3
3
|
import { unique } from '../../../utils/string.js'
|
|
4
4
|
import { formatDate } from '../../../utils/date.js'
|
|
5
|
-
import { createPromise } from '../../../utils/util'
|
|
6
5
|
|
|
7
6
|
export default class ClientChatMessage {
|
|
8
7
|
|
|
@@ -23,8 +22,6 @@ export default class ClientChatMessage {
|
|
|
23
22
|
})
|
|
24
23
|
|
|
25
24
|
messageMap = {}
|
|
26
|
-
tempMessageMap = {}
|
|
27
|
-
checkMessageSendResultTaskList = []
|
|
28
25
|
|
|
29
26
|
get messageData () {
|
|
30
27
|
return this.data.messageData
|
|
@@ -36,18 +33,15 @@ export default class ClientChatMessage {
|
|
|
36
33
|
queryMethod: null,
|
|
37
34
|
sortField: null, // 排序的字段,必须是唯一的,例如时间
|
|
38
35
|
groupField: null, // 分组的字段
|
|
39
|
-
checkMessageSendResultMethod: null,
|
|
40
36
|
onAddMessageSuccess: null // 新增消息成功回调事件
|
|
41
37
|
}, options)
|
|
42
38
|
if (!options.clientChat) {
|
|
43
39
|
throw new Error('必须将clientChat传递过来')
|
|
44
40
|
}
|
|
45
|
-
if (!options.checkMessageSendResultMethod) throw new Error('缺少checkMessageSendResultMethod配置')
|
|
46
41
|
this.queryMethod = options.queryMethod
|
|
47
42
|
this.clientChat = options.clientChat
|
|
48
43
|
this.groupField = options.groupField
|
|
49
44
|
this.sortField = options.sortField
|
|
50
|
-
this.checkMessageSendResultMethod = options.checkMessageSendResultMethod
|
|
51
45
|
this.onAddMessageSuccess = options.onAddMessageSuccess
|
|
52
46
|
this.event = new Event()
|
|
53
47
|
}
|
|
@@ -80,7 +74,7 @@ export default class ClientChatMessage {
|
|
|
80
74
|
* "msgSvrId": "4319123759514541049",
|
|
81
75
|
* "msgType": 1,
|
|
82
76
|
* "origin": "0",
|
|
83
|
-
* "
|
|
77
|
+
* "sendStatus": 0,
|
|
84
78
|
* "tenantId": "1761952223049924608",
|
|
85
79
|
* "wechatAccountId": "ad9d9ae2a8be4f27311312cdd4af3549dc8427ef",
|
|
86
80
|
* "wechatFriendId": "2089efcc7f8f40b00b7f05fa4c6dfd3bb642774d",
|
|
@@ -95,10 +89,6 @@ export default class ClientChatMessage {
|
|
|
95
89
|
if (this.messageMap[data.id]) {
|
|
96
90
|
return
|
|
97
91
|
}
|
|
98
|
-
if (this.tempMessageMap[data.id]) {
|
|
99
|
-
Object.assign(data, this.tempMessageMap[data.id])
|
|
100
|
-
delete this.tempMessageMap[data.id]
|
|
101
|
-
}
|
|
102
92
|
const groupField = data[this.groupField]
|
|
103
93
|
if (!this.data.messageData[groupField]) {
|
|
104
94
|
Vue.set(this.data.messageData, groupField, {})
|
|
@@ -115,7 +105,6 @@ export default class ClientChatMessage {
|
|
|
115
105
|
}
|
|
116
106
|
this.data.messageData[groupField][sortFields.day][sortFields.milliseconds].push(data)
|
|
117
107
|
this.messageMap[data.id] = data
|
|
118
|
-
if (data.isSend && data.status === 1 && !data._temp) this.addCheckMessageSendResultTask(data)
|
|
119
108
|
if (fireEvent !== false) {
|
|
120
109
|
this.event && this.event.emit('add-message', {
|
|
121
110
|
data
|
|
@@ -130,7 +119,6 @@ export default class ClientChatMessage {
|
|
|
130
119
|
if (!id) {
|
|
131
120
|
return
|
|
132
121
|
}
|
|
133
|
-
this.removeCheckMessageSendResultTask(id)
|
|
134
122
|
const message = this.messageMap[id]
|
|
135
123
|
if (!message) {
|
|
136
124
|
return
|
|
@@ -166,7 +154,6 @@ export default class ClientChatMessage {
|
|
|
166
154
|
updateMessage (id, props) {
|
|
167
155
|
const message = this.getMessage(id)
|
|
168
156
|
if (!message) {
|
|
169
|
-
this.tempMessageMap[id] = props
|
|
170
157
|
return
|
|
171
158
|
}
|
|
172
159
|
if (!props) {
|
|
@@ -228,11 +215,11 @@ export default class ClientChatMessage {
|
|
|
228
215
|
}, data, {
|
|
229
216
|
cmdType: 'CmdQwSendMessage'
|
|
230
217
|
})).then(({ data }) => {
|
|
231
|
-
if (data.
|
|
218
|
+
if (data.sendStatus === 0) {
|
|
232
219
|
// 发送成功
|
|
233
|
-
} else if (data.
|
|
220
|
+
} else if (data.sendStatus === 2) {
|
|
234
221
|
// 发送失败
|
|
235
|
-
} else if (data.
|
|
222
|
+
} else if (data.sendStatus === 1) {
|
|
236
223
|
// 发送中
|
|
237
224
|
}
|
|
238
225
|
// 如果返回的是对象,证明发送成功了
|
|
@@ -286,35 +273,8 @@ export default class ClientChatMessage {
|
|
|
286
273
|
this.clearMessage()
|
|
287
274
|
return this.loadMessageData(params)
|
|
288
275
|
}
|
|
289
|
-
|
|
290
|
-
addCheckMessageSendResultTask (message) {
|
|
291
|
-
if (this.checkMessageSendResultTaskList.some(v => v.id === message.id)) return
|
|
292
|
-
let timer
|
|
293
|
-
const task = { id: message.id, promise: createPromise(), check: () => {
|
|
294
|
-
if (message.status !== 1) return task.promise.resolve()
|
|
295
|
-
if (Date.now() - (message.createTime || message.sendTime) > 5 * 60 * 1000) return task.promise.resolve({status: 3, resultMsg: '消息发送超时'})
|
|
296
|
-
timer = setTimeout(() => {
|
|
297
|
-
Promise.resolve(this.checkMessageSendResultMethod({message})).then(rs => {
|
|
298
|
-
const data = rs && rs.data
|
|
299
|
-
if (data && data.status === 1) task.check()
|
|
300
|
-
else task.promise.resolve(data || {})
|
|
301
|
-
}, () => task.check())
|
|
302
|
-
}, 3000)
|
|
303
|
-
}, cancel: () => { clearTimeout(timer); task.promise.reject('reject') } }
|
|
304
|
-
this.checkMessageSendResultTaskList.push(task)
|
|
305
|
-
task.check()
|
|
306
|
-
task.promise.then(rs => this.updateMessage(message.id, rs || {})).finally(() => this.removeCheckMessageSendResultTask(message.id))
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
removeCheckMessageSendResultTask (id) {
|
|
310
|
-
const index = this.checkMessageSendResultTaskList.findIndex(v => v.id === id)
|
|
311
|
-
if (index >= 0) { this.checkMessageSendResultTaskList[index].cancel(); this.checkMessageSendResultTaskList.splice(index, 1) }
|
|
312
|
-
}
|
|
313
276
|
|
|
314
277
|
reset () {
|
|
315
|
-
this.checkMessageSendResultTaskList.forEach(task => task.cancel())
|
|
316
|
-
this.checkMessageSendResultTaskList = []
|
|
317
|
-
this.tempMessageMap = {}
|
|
318
278
|
this.data.messageData = {}
|
|
319
279
|
}
|
|
320
|
-
}
|
|
280
|
+
}
|
|
@@ -82,8 +82,7 @@ export default class ClientChatSession {
|
|
|
82
82
|
/**
|
|
83
83
|
* 删除会话
|
|
84
84
|
*/
|
|
85
|
-
deleteSessionMethod: null
|
|
86
|
-
modifiedAccountMap: {}
|
|
85
|
+
deleteSessionMethod: null
|
|
87
86
|
})
|
|
88
87
|
|
|
89
88
|
accountIds = []
|
|
@@ -120,23 +119,6 @@ export default class ClientChatSession {
|
|
|
120
119
|
return this.data.loading
|
|
121
120
|
}
|
|
122
121
|
|
|
123
|
-
isModify (qwAccountId) {
|
|
124
|
-
return !!(qwAccountId && this.data.modifiedAccountMap[qwAccountId])
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
markModify (qwAccountIds) {
|
|
128
|
-
const ids = Array.isArray(qwAccountIds) ? qwAccountIds : [qwAccountIds]
|
|
129
|
-
ids.filter(Boolean).forEach(id => {
|
|
130
|
-
Vue.set(this.data.modifiedAccountMap, id, true)
|
|
131
|
-
})
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
unmarkModify (qwAccountId) {
|
|
135
|
-
if (qwAccountId) {
|
|
136
|
-
Vue.delete(this.data.modifiedAccountMap, qwAccountId)
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
122
|
get loadAssignTaskSessioning () {
|
|
141
123
|
return this.data.loadAssignTaskSessioning
|
|
142
124
|
}
|
|
@@ -223,35 +205,6 @@ export default class ClientChatSession {
|
|
|
223
205
|
getSessionByLocal (sessionId) {
|
|
224
206
|
return this.sessionMap[sessionId]
|
|
225
207
|
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* 强制从服务端刷新会话,绕过本地缓存。
|
|
229
|
-
*/
|
|
230
|
-
refreshSession (sessionId) {
|
|
231
|
-
if (!sessionId) {
|
|
232
|
-
return Promise.reject('缺少会话id')
|
|
233
|
-
}
|
|
234
|
-
return this.getSessionMethod({
|
|
235
|
-
id: sessionId
|
|
236
|
-
}).then(rs => {
|
|
237
|
-
if (!rs || !rs.data) {
|
|
238
|
-
return Promise.reject('未找到会话' + sessionId)
|
|
239
|
-
}
|
|
240
|
-
// 事件计算出的 sessionId 是本地索引,始终保持与服务端返回对象一致。
|
|
241
|
-
const serverSession = Object.assign({}, rs.data, {
|
|
242
|
-
id: sessionId
|
|
243
|
-
})
|
|
244
|
-
const localSession = this.getSessionByLocal(sessionId)
|
|
245
|
-
if (localSession) {
|
|
246
|
-
this.updateSession(sessionId, serverSession)
|
|
247
|
-
} else {
|
|
248
|
-
this.addSession(serverSession)
|
|
249
|
-
}
|
|
250
|
-
return Object.assign({}, rs, {
|
|
251
|
-
data: serverSession
|
|
252
|
-
})
|
|
253
|
-
})
|
|
254
|
-
}
|
|
255
208
|
|
|
256
209
|
findSession (findFn) {
|
|
257
210
|
let result
|
|
@@ -465,9 +418,6 @@ export default class ClientChatSession {
|
|
|
465
418
|
}
|
|
466
419
|
}
|
|
467
420
|
delete this.sessionMap[id]
|
|
468
|
-
if (this.data.currentSessionId === id) {
|
|
469
|
-
this.data.currentSessionId = null
|
|
470
|
-
}
|
|
471
421
|
if (checkLastUpdateSession !== false) {
|
|
472
422
|
// todo 后面可能会删掉这块的逻辑,因为后端排序逻辑变了
|
|
473
423
|
this.checkAndUpdateLastUpdateSession()
|
|
@@ -612,9 +562,7 @@ export default class ClientChatSession {
|
|
|
612
562
|
return true
|
|
613
563
|
}
|
|
614
564
|
})
|
|
615
|
-
|
|
616
|
-
this.data.sessionGroupData[groupField][topField][oldSortFields.day][oldSortFields.milliseconds].splice(index, 1)
|
|
617
|
-
}
|
|
565
|
+
this.data.sessionGroupData[groupField][topField][oldSortFields.day][oldSortFields.milliseconds].splice(index, 1)
|
|
618
566
|
}
|
|
619
567
|
})
|
|
620
568
|
// 按照新的时间来分组排序
|
|
@@ -687,9 +635,7 @@ export default class ClientChatSession {
|
|
|
687
635
|
return true
|
|
688
636
|
}
|
|
689
637
|
})
|
|
690
|
-
|
|
691
|
-
this.data.sessionGroupData[groupField][topField][sortFields.day][sortFields.milliseconds].splice(index, 1)
|
|
692
|
-
}
|
|
638
|
+
this.data.sessionGroupData[groupField][topField][sortFields.day][sortFields.milliseconds].splice(index, 1)
|
|
693
639
|
}
|
|
694
640
|
})
|
|
695
641
|
// 所有的
|
|
@@ -969,7 +915,6 @@ export default class ClientChatSession {
|
|
|
969
915
|
this.data.sessionData = {}
|
|
970
916
|
this.data.sessionGroupData = {}
|
|
971
917
|
this.data.sessionMuteMap = {}
|
|
972
|
-
this.data.modifiedAccountMap = {}
|
|
973
918
|
// this.data.sessionUnreadCountMap = {}
|
|
974
919
|
this.sessionMap = {}
|
|
975
920
|
if (this.cancelLoadDataRequest) {
|
|
@@ -981,4 +926,4 @@ export default class ClientChatSession {
|
|
|
981
926
|
this.cancelRefreshRequest = null
|
|
982
927
|
}
|
|
983
928
|
}
|
|
984
|
-
}
|
|
929
|
+
}
|
|
@@ -15,16 +15,11 @@ export default class ClietChatSocket {
|
|
|
15
15
|
// 执行回调事件前的方法
|
|
16
16
|
beforeFireCallback: null,
|
|
17
17
|
onCmdQwNewMessage: null,
|
|
18
|
-
onCmdQwContactInfoChanged: null,
|
|
19
|
-
onCmdQwContactRequestChanged: null,
|
|
20
|
-
onCmdQwAcceptContactRequest: null,
|
|
21
|
-
onCmdQwRoomInfoChanged: null,
|
|
22
18
|
onCmdSendMessageResult: null,
|
|
23
19
|
onCmdFriendInfoChanged: null,
|
|
24
20
|
onCmdDownloadVideoResult: null,
|
|
25
21
|
onCmdChatroomInfoChanged: null,
|
|
26
22
|
onCmdChatroomInfoChangedBatch: null,
|
|
27
|
-
onHeartbeatSuccess: null,
|
|
28
23
|
onHeartbeatCheck: null
|
|
29
24
|
}, options)
|
|
30
25
|
if (!options.socket) {
|
|
@@ -32,13 +27,6 @@ export default class ClietChatSocket {
|
|
|
32
27
|
}
|
|
33
28
|
this.socket = options.socket
|
|
34
29
|
this.socket.event.on('onCmdQwNewMessage', options.onCmdQwNewMessage)
|
|
35
|
-
this.socket.event.on('onCmdQwContactInfoChanged', options.onCmdQwContactInfoChanged)
|
|
36
|
-
this.socket.event.on('onCmdQwContactRequestChanged', options.onCmdQwContactRequestChanged)
|
|
37
|
-
this.socket.event.on('onCmdQwAcceptContactRequest', options.onCmdQwAcceptContactRequest)
|
|
38
|
-
this.socket.event.on('onCmdQwRoomInfoChanged', options.onCmdQwRoomInfoChanged)
|
|
39
|
-
this.socket.event.on('onHeartbeatSuccess', (evt) => {
|
|
40
|
-
options.onHeartbeatSuccess && options.onHeartbeatSuccess(evt)
|
|
41
|
-
})
|
|
42
30
|
this.socket.event.on('onHeartbeatCheck', ({ mergeParams }) => {
|
|
43
31
|
options.onHeartbeatCheck && options.onHeartbeatCheck({
|
|
44
32
|
mergeParams
|
|
@@ -74,4 +62,4 @@ export default class ClietChatSocket {
|
|
|
74
62
|
setUrl (url) {
|
|
75
63
|
this.socket.setUrl(url)
|
|
76
64
|
}
|
|
77
|
-
}
|
|
65
|
+
}
|