@aochuang/client-sdk 1.0.344 → 1.0.346
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/index.js +1 -6
- package/components/session-select/session-select-item.vue +9 -8
- package/components/wechat-chat-control/calling/calling.vue +3 -0
- package/components/wechat-chat-control/voice/voice.vue +4 -0
- package/components/wework-chat-control/company-card/company-card.vue +1 -1
- package/components/wework-chat-control/file-url/file-url.vue +5 -2
- package/components/wework-chat-control/image/image.vue +2 -137
- package/components/wework-chat-control/index.js +6 -6
- package/components/wework-chat-control/text/text.vue +3 -22
- package/components/wework-chat-control/util.js +6 -12
- package/components/wework-chat-control/video/video.vue +2 -10
- package/components/wework-chat-control/voice/voice.vue +1 -1
- 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 +35 -12
- package/components/wework-chat-panel/chat-panel.vue +12 -95
- package/package.json +3 -10
- package/services/client-chat/client-chat-wechat/client-chat-session.js +19 -6
- package/services/client-chat/client-chat-wechat/client-chat.js +87 -25
- 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 -5
- package/services/client-chat/client-chat-wework/client-chat-session.js +2 -50
- package/services/client-chat/client-chat-wework/client-chat-socket.js +1 -9
- package/services/client-chat/client-chat-wework/client-chat.js +11 -278
- 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/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
|
@@ -15,7 +15,7 @@ const CONNECT_STATUS = {
|
|
|
15
15
|
Normal: 'normal',
|
|
16
16
|
Loading: 'loading',
|
|
17
17
|
Complete: 'complete'
|
|
18
|
-
}
|
|
18
|
+
}
|
|
19
19
|
|
|
20
20
|
function getAtMessageContent (data) {
|
|
21
21
|
if (!data || data.isSend || !data.content) {
|
|
@@ -423,22 +423,45 @@ class ClientChat {
|
|
|
423
423
|
rs.data.lastUpdateTime = data.updateDate
|
|
424
424
|
}
|
|
425
425
|
return rs
|
|
426
|
-
}
|
|
426
|
+
}, ({ session }) => {
|
|
427
427
|
// 更新账号未读消息数量
|
|
428
|
-
this.account.updateAccountUnreadMessageNum(
|
|
429
|
-
if (
|
|
428
|
+
this.account.updateAccountUnreadMessageNum(session.wechatAccountId, ({ unreadMesasgeNum, unreadMessageMuteNum }) => {
|
|
429
|
+
if (session.mute) {
|
|
430
430
|
return {
|
|
431
|
-
num: (unreadMesasgeNum || 0) + (
|
|
432
|
-
muteNum: (unreadMessageMuteNum || 0) + (
|
|
431
|
+
num: (unreadMesasgeNum || 0) + (session.unreadMsgCount || 0),
|
|
432
|
+
muteNum: (unreadMessageMuteNum || 0) + (session.unreadMsgCount || 0)
|
|
433
433
|
}
|
|
434
434
|
} else {
|
|
435
435
|
return {
|
|
436
|
-
num: (unreadMesasgeNum || 0) + (
|
|
436
|
+
num: (unreadMesasgeNum || 0) + (session.unreadMsgCount || 0),
|
|
437
437
|
muteNum: unreadMessageMuteNum
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
})
|
|
441
|
-
}, (
|
|
441
|
+
}, false).then((rs => {
|
|
442
|
+
// 前面更新未读消息数量只是处理会话的时候,因为getSession是异步的,会导致addMessage多次执行到这里,不会倒下面更新会话的逻辑
|
|
443
|
+
// 比如连续发了3条消息,然后getSession后端返回可能只会返回2条未读数,所以这里还需要补偿一下
|
|
444
|
+
const session = rs.data || {}
|
|
445
|
+
const isNewerMessage = data.wechatTime > (session.lastMsgTime || 0)
|
|
446
|
+
if (!data.isSend && isNewerMessage) {
|
|
447
|
+
if (!(this.sessionManage.currentSession && this.sessionManage.currentSession.conversationId === sessionId && this.shouldMarkCurrentSessionRead(sessionId, data))) {
|
|
448
|
+
// 更新账号未读消息数量
|
|
449
|
+
this.account.updateAccountUnreadMessageNum(session.wechatAccountId, ({ unreadMesasgeNum, unreadMessageMuteNum }) => {
|
|
450
|
+
if (session.mute) {
|
|
451
|
+
return {
|
|
452
|
+
num: (unreadMesasgeNum || 0) + 1,
|
|
453
|
+
muteNum: (unreadMessageMuteNum || 0) + 1
|
|
454
|
+
}
|
|
455
|
+
} else {
|
|
456
|
+
return {
|
|
457
|
+
num: (unreadMesasgeNum || 0) + 1,
|
|
458
|
+
muteNum: unreadMessageMuteNum
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
})
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}), (error) => {
|
|
442
465
|
this.socket.addLog({
|
|
443
466
|
group: 'client-chat-message:onAddMessageSuccess',
|
|
444
467
|
content: {
|
|
@@ -452,9 +475,15 @@ class ClientChat {
|
|
|
452
475
|
}
|
|
453
476
|
})
|
|
454
477
|
})
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
478
|
+
} else {
|
|
479
|
+
this.session.updateSession(sessionId, ({ session }) => {
|
|
480
|
+
// listChange/getSession may already include this message in unreadMsgCount.
|
|
481
|
+
// Only count messages newer than the session watermark.
|
|
482
|
+
const isNewerMessage = data.wechatTime > (session.lastMsgTime || 0)
|
|
483
|
+
if (!isNewerMessage) {
|
|
484
|
+
return {}
|
|
485
|
+
}
|
|
486
|
+
const nextSession = {
|
|
458
487
|
lastMsgContent: data.content,
|
|
459
488
|
lastMsgType: data.msgType,
|
|
460
489
|
lastMsgTime: data.wechatTime,
|
|
@@ -462,7 +491,7 @@ class ClientChat {
|
|
|
462
491
|
lastUpdateTime: data.updateDate,
|
|
463
492
|
unreadMsgCount: session.unreadMsgCount
|
|
464
493
|
}
|
|
465
|
-
if (!data.isSend) {
|
|
494
|
+
if (!data.isSend && isNewerMessage) {
|
|
466
495
|
if (this.sessionManage.currentSession && this.sessionManage.currentSession.conversationId === sessionId && this.shouldMarkCurrentSessionRead(sessionId, data)) {
|
|
467
496
|
// 标记已读
|
|
468
497
|
this.session.setSessionRead(sessionId)
|
|
@@ -565,21 +594,44 @@ class ClientChat {
|
|
|
565
594
|
rs.data.lastAtMsgContent = appendLastAtMsgContent(rs.data.lastAtMsgContent, atMessage)
|
|
566
595
|
}
|
|
567
596
|
return rs
|
|
568
|
-
}
|
|
597
|
+
}, ({ session }) => {
|
|
569
598
|
// 更新账号未读消息数量
|
|
570
|
-
this.account.updateAccountUnreadMessageNum(
|
|
571
|
-
if (
|
|
599
|
+
this.account.updateAccountUnreadMessageNum(session.wechatAccountId, ({ unreadMesasgeNum, unreadMessageMuteNum }) => {
|
|
600
|
+
if (session.mute) {
|
|
572
601
|
return {
|
|
573
|
-
num: (unreadMesasgeNum || 0) + (
|
|
574
|
-
muteNum: (unreadMessageMuteNum || 0) + (
|
|
602
|
+
num: (unreadMesasgeNum || 0) + (session.unreadMsgCount || 0),
|
|
603
|
+
muteNum: (unreadMessageMuteNum || 0) + (session.unreadMsgCount || 0)
|
|
575
604
|
}
|
|
576
605
|
} else {
|
|
577
606
|
return {
|
|
578
|
-
num: (unreadMesasgeNum || 0) + (
|
|
607
|
+
num: (unreadMesasgeNum || 0) + (session.unreadMsgCount || 0),
|
|
579
608
|
muteNum: unreadMessageMuteNum
|
|
580
609
|
}
|
|
581
610
|
}
|
|
582
611
|
})
|
|
612
|
+
}, false).then(rs => {
|
|
613
|
+
// 前面更新未读消息数量只是处理会话的时候,因为getSession是异步的,会导致addMessage多次执行到这里,不会倒下面更新会话的逻辑
|
|
614
|
+
// 比如连续发了3条消息,然后getSession后端返回可能只会返回2条未读数,所以这里还需要补偿一下
|
|
615
|
+
const session = rs.data || {}
|
|
616
|
+
const isNewerMessage = data.wechatTime > (session.lastMsgTime || 0)
|
|
617
|
+
if (!data.isSend && isNewerMessage) {
|
|
618
|
+
if (!(this.sessionManage.currentSession && this.sessionManage.currentSession.conversationId === sessionId && this.shouldMarkCurrentSessionRead(sessionId, data))) {
|
|
619
|
+
// 更新账号未读消息数量
|
|
620
|
+
this.account.updateAccountUnreadMessageNum(session.wechatAccountId, ({ unreadMesasgeNum, unreadMessageMuteNum }) => {
|
|
621
|
+
if (session.mute) {
|
|
622
|
+
return {
|
|
623
|
+
num: (unreadMesasgeNum || 0) + 1,
|
|
624
|
+
muteNum: (unreadMessageMuteNum || 0) + 1
|
|
625
|
+
}
|
|
626
|
+
} else {
|
|
627
|
+
return {
|
|
628
|
+
num: (unreadMesasgeNum || 0) + 1,
|
|
629
|
+
muteNum: unreadMessageMuteNum
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
})
|
|
633
|
+
}
|
|
634
|
+
}
|
|
583
635
|
}, (error) => {
|
|
584
636
|
this.socket.addLog({
|
|
585
637
|
group: 'client-chat-message:onAddMessageSuccess',
|
|
@@ -594,9 +646,15 @@ class ClientChat {
|
|
|
594
646
|
}
|
|
595
647
|
})
|
|
596
648
|
})
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
649
|
+
} else {
|
|
650
|
+
this.session.updateSession(sessionId, ({ session }) => {
|
|
651
|
+
// listChange/getSession may already include this message in unreadMsgCount.
|
|
652
|
+
// Only count messages newer than the session watermark.
|
|
653
|
+
const isNewerMessage = data.wechatTime > (session.lastMsgTime || 0)
|
|
654
|
+
if (!isNewerMessage) {
|
|
655
|
+
return {}
|
|
656
|
+
}
|
|
657
|
+
const nextSession = {
|
|
600
658
|
lastMsgContent: data.content,
|
|
601
659
|
lastMsgType: data.msgType,
|
|
602
660
|
lastMsgTime: data.wechatTime,
|
|
@@ -604,7 +662,7 @@ class ClientChat {
|
|
|
604
662
|
lastUpdateTime: data.updateDate,
|
|
605
663
|
unreadMsgCount: session.unreadMsgCount
|
|
606
664
|
}
|
|
607
|
-
|
|
665
|
+
if (!data.isSend && isNewerMessage) {
|
|
608
666
|
if (this.sessionManage.currentSession && this.sessionManage.currentSession.conversationId === sessionId && this.shouldMarkCurrentSessionRead(sessionId, data)) {
|
|
609
667
|
// 标记已读
|
|
610
668
|
this.session.setSessionRead(sessionId)
|
|
@@ -1082,9 +1140,13 @@ class ClientChat {
|
|
|
1082
1140
|
onCmdFriendAccepted: ({ data }) => {
|
|
1083
1141
|
// 刷新指定微信号请求数量
|
|
1084
1142
|
if (data.wechatAccountId) {
|
|
1085
|
-
this.account.
|
|
1086
|
-
|
|
1087
|
-
}
|
|
1143
|
+
if (!this.account.accountMap[data.wechatAccountId]) {
|
|
1144
|
+
this.account.reloadData()
|
|
1145
|
+
} else {
|
|
1146
|
+
this.account.getAccountGreetingUnreadMsgCount({
|
|
1147
|
+
wechatAccountId: data.wechatAccountId
|
|
1148
|
+
})
|
|
1149
|
+
}
|
|
1088
1150
|
}
|
|
1089
1151
|
// 刷新所有微信号请求数量
|
|
1090
1152
|
this.account.getAccountGreetingUnreadMsgCount()
|
|
@@ -126,7 +126,11 @@ export default class ClientChatContacts {
|
|
|
126
126
|
*/
|
|
127
127
|
roomBindMemberMap: {},
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
/**
|
|
130
|
+
* 标记通讯录是否修改了
|
|
131
|
+
* 如果修改了,比如接收到了分配好友的会话时,一定通讯录变了,变了的时候界面需要根据这个状态刷新通讯录
|
|
132
|
+
*/
|
|
133
|
+
isModify: false
|
|
130
134
|
})
|
|
131
135
|
|
|
132
136
|
friendMap = {}
|
|
@@ -233,6 +237,10 @@ export default class ClientChatContacts {
|
|
|
233
237
|
return this.data.roomGroupData
|
|
234
238
|
}
|
|
235
239
|
|
|
240
|
+
get isModify () {
|
|
241
|
+
return this.data.isModify
|
|
242
|
+
}
|
|
243
|
+
|
|
236
244
|
setRoomGroup (data) {
|
|
237
245
|
this.data.roomGroupData = []
|
|
238
246
|
if (data && data.length) {
|
|
@@ -483,10 +491,10 @@ export default class ClientChatContacts {
|
|
|
483
491
|
}
|
|
484
492
|
}
|
|
485
493
|
const qwAccountId = this.roomMap[id].qwAccountId
|
|
486
|
-
if (qwAccountId && this.data.
|
|
487
|
-
const bindIndex = this.data.
|
|
494
|
+
if (qwAccountId && this.data.accountBindFriendMap[qwAccountId] && this.data.accountBindFriendMap[qwAccountId][groupId]) {
|
|
495
|
+
const bindIndex = this.data.accountBindFriendMap[qwAccountId][groupId].indexOf(this.roomMap[id])
|
|
488
496
|
if (bindIndex >= 0) {
|
|
489
|
-
this.data.
|
|
497
|
+
this.data.accountBindFriendMap[qwAccountId][groupId].splice(bindIndex, 1)
|
|
490
498
|
}
|
|
491
499
|
}
|
|
492
500
|
})
|
|
@@ -620,37 +628,6 @@ export default class ClientChatContacts {
|
|
|
620
628
|
return rs
|
|
621
629
|
})
|
|
622
630
|
}
|
|
623
|
-
|
|
624
|
-
/**
|
|
625
|
-
* 强制从服务端刷新好友资料,绕过本地缓存。
|
|
626
|
-
*/
|
|
627
|
-
refreshFriend (friendId) {
|
|
628
|
-
if (!friendId) {
|
|
629
|
-
return Promise.reject('缺少好友id')
|
|
630
|
-
}
|
|
631
|
-
if (!this.getContactsFriendMethod) {
|
|
632
|
-
return Promise.reject(new Error('getContactsFriendMethod未定义'))
|
|
633
|
-
}
|
|
634
|
-
return this.getContactsFriendMethod({
|
|
635
|
-
id: friendId
|
|
636
|
-
}).then(rs => {
|
|
637
|
-
if (!rs || !rs.data) {
|
|
638
|
-
return Promise.reject('未找到好友' + friendId)
|
|
639
|
-
}
|
|
640
|
-
if (this.friendMap[friendId]) {
|
|
641
|
-
const nextKeys = Object.keys(rs.data)
|
|
642
|
-
Object.keys(this.friendMap[friendId]).forEach(key => {
|
|
643
|
-
if (!nextKeys.includes(key)) {
|
|
644
|
-
Vue.delete(this.friendMap[friendId], key)
|
|
645
|
-
}
|
|
646
|
-
})
|
|
647
|
-
this.updateFriend(friendId, rs.data)
|
|
648
|
-
} else {
|
|
649
|
-
this.addFriend(rs.data)
|
|
650
|
-
}
|
|
651
|
-
return rs
|
|
652
|
-
})
|
|
653
|
-
}
|
|
654
631
|
|
|
655
632
|
setRoomMemberData (roomId, data) {
|
|
656
633
|
if (!roomId) {
|
|
@@ -761,52 +738,12 @@ export default class ClientChatContacts {
|
|
|
761
738
|
})
|
|
762
739
|
}
|
|
763
740
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
return Promise.reject('缺少群id')
|
|
767
|
-
}
|
|
768
|
-
if (!this.getContactsRoomMethod) {
|
|
769
|
-
return Promise.reject(new Error('getContactsRoomMethod未定义'))
|
|
770
|
-
}
|
|
771
|
-
return this.getContactsRoomMethod({
|
|
772
|
-
id
|
|
773
|
-
}).then(rs => {
|
|
774
|
-
if (!rs || !rs.data) {
|
|
775
|
-
return Promise.reject('未找到群' + id)
|
|
776
|
-
}
|
|
777
|
-
const localRoom = this.roomMap[id]
|
|
778
|
-
if (localRoom) {
|
|
779
|
-
this.removeRoom(id)
|
|
780
|
-
const nextKeys = Object.keys(rs.data)
|
|
781
|
-
Object.keys(localRoom).forEach(key => {
|
|
782
|
-
if (!nextKeys.includes(key)) {
|
|
783
|
-
Vue.delete(localRoom, key)
|
|
784
|
-
}
|
|
785
|
-
})
|
|
786
|
-
Object.keys(rs.data).forEach(key => {
|
|
787
|
-
Vue.set(localRoom, key, rs.data[key])
|
|
788
|
-
})
|
|
789
|
-
}
|
|
790
|
-
this.addRoom(localRoom || rs.data)
|
|
791
|
-
return rs
|
|
792
|
-
})
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
isModify (qwAccountId) {
|
|
796
|
-
return !!(qwAccountId && this.data.modifiedAccountMap[qwAccountId])
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
markModify (qwAccountIds) {
|
|
800
|
-
const ids = Array.isArray(qwAccountIds) ? qwAccountIds : [qwAccountIds]
|
|
801
|
-
ids.filter(Boolean).forEach(id => {
|
|
802
|
-
Vue.set(this.data.modifiedAccountMap, id, true)
|
|
803
|
-
})
|
|
741
|
+
markModify () {
|
|
742
|
+
this.data.isModify = true
|
|
804
743
|
}
|
|
805
744
|
|
|
806
|
-
unmarkModify (
|
|
807
|
-
|
|
808
|
-
Vue.delete(this.data.modifiedAccountMap, qwAccountId)
|
|
809
|
-
}
|
|
745
|
+
unmarkModify () {
|
|
746
|
+
this.data.isModify = false
|
|
810
747
|
}
|
|
811
748
|
|
|
812
749
|
reset () {
|
|
@@ -821,7 +758,6 @@ export default class ClientChatContacts {
|
|
|
821
758
|
this.data.groupBindRoomMap = {}
|
|
822
759
|
this.data.accountBindFriendMap = {}
|
|
823
760
|
this.data.accountBindRoomMap = {}
|
|
824
|
-
this.data.modifiedAccountMap = {}
|
|
825
761
|
this._cacheFriendGroupCountMap = null
|
|
826
762
|
this._cacheRoomGroupCountMap = null
|
|
827
763
|
if (this.cancelConnectRequest) {
|
|
@@ -833,4 +769,4 @@ export default class ClientChatContacts {
|
|
|
833
769
|
this.cancelRefreshRequest = null
|
|
834
770
|
}
|
|
835
771
|
}
|
|
836
|
-
}
|
|
772
|
+
}
|
|
@@ -74,7 +74,7 @@ export default class ClientChatMessage {
|
|
|
74
74
|
* "msgSvrId": "4319123759514541049",
|
|
75
75
|
* "msgType": 1,
|
|
76
76
|
* "origin": "0",
|
|
77
|
-
* "
|
|
77
|
+
* "sendStatus": 0,
|
|
78
78
|
* "tenantId": "1761952223049924608",
|
|
79
79
|
* "wechatAccountId": "ad9d9ae2a8be4f27311312cdd4af3549dc8427ef",
|
|
80
80
|
* "wechatFriendId": "2089efcc7f8f40b00b7f05fa4c6dfd3bb642774d",
|
|
@@ -215,11 +215,11 @@ export default class ClientChatMessage {
|
|
|
215
215
|
}, data, {
|
|
216
216
|
cmdType: 'CmdQwSendMessage'
|
|
217
217
|
})).then(({ data }) => {
|
|
218
|
-
if (data.
|
|
218
|
+
if (data.sendStatus === 0) {
|
|
219
219
|
// 发送成功
|
|
220
|
-
} else if (data.
|
|
220
|
+
} else if (data.sendStatus === 2) {
|
|
221
221
|
// 发送失败
|
|
222
|
-
} else if (data.
|
|
222
|
+
} else if (data.sendStatus === 1) {
|
|
223
223
|
// 发送中
|
|
224
224
|
}
|
|
225
225
|
// 如果返回的是对象,证明发送成功了
|
|
@@ -277,4 +277,4 @@ export default class ClientChatMessage {
|
|
|
277
277
|
reset () {
|
|
278
278
|
this.data.messageData = {}
|
|
279
279
|
}
|
|
280
|
-
}
|
|
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
|
|
@@ -962,7 +915,6 @@ export default class ClientChatSession {
|
|
|
962
915
|
this.data.sessionData = {}
|
|
963
916
|
this.data.sessionGroupData = {}
|
|
964
917
|
this.data.sessionMuteMap = {}
|
|
965
|
-
this.data.modifiedAccountMap = {}
|
|
966
918
|
// this.data.sessionUnreadCountMap = {}
|
|
967
919
|
this.sessionMap = {}
|
|
968
920
|
if (this.cancelLoadDataRequest) {
|
|
@@ -974,4 +926,4 @@ export default class ClientChatSession {
|
|
|
974
926
|
this.cancelRefreshRequest = null
|
|
975
927
|
}
|
|
976
928
|
}
|
|
977
|
-
}
|
|
929
|
+
}
|
|
@@ -15,14 +15,11 @@ export default class ClietChatSocket {
|
|
|
15
15
|
// 执行回调事件前的方法
|
|
16
16
|
beforeFireCallback: null,
|
|
17
17
|
onCmdQwNewMessage: null,
|
|
18
|
-
onCmdQwContactInfoChanged: null,
|
|
19
|
-
onCmdQwRoomInfoChanged: null,
|
|
20
18
|
onCmdSendMessageResult: null,
|
|
21
19
|
onCmdFriendInfoChanged: null,
|
|
22
20
|
onCmdDownloadVideoResult: null,
|
|
23
21
|
onCmdChatroomInfoChanged: null,
|
|
24
22
|
onCmdChatroomInfoChangedBatch: null,
|
|
25
|
-
onHeartbeatSuccess: null,
|
|
26
23
|
onHeartbeatCheck: null
|
|
27
24
|
}, options)
|
|
28
25
|
if (!options.socket) {
|
|
@@ -30,11 +27,6 @@ export default class ClietChatSocket {
|
|
|
30
27
|
}
|
|
31
28
|
this.socket = options.socket
|
|
32
29
|
this.socket.event.on('onCmdQwNewMessage', options.onCmdQwNewMessage)
|
|
33
|
-
this.socket.event.on('onCmdQwContactInfoChanged', options.onCmdQwContactInfoChanged)
|
|
34
|
-
this.socket.event.on('onCmdQwRoomInfoChanged', options.onCmdQwRoomInfoChanged)
|
|
35
|
-
this.socket.event.on('onHeartbeatSuccess', (evt) => {
|
|
36
|
-
options.onHeartbeatSuccess && options.onHeartbeatSuccess(evt)
|
|
37
|
-
})
|
|
38
30
|
this.socket.event.on('onHeartbeatCheck', ({ mergeParams }) => {
|
|
39
31
|
options.onHeartbeatCheck && options.onHeartbeatCheck({
|
|
40
32
|
mergeParams
|
|
@@ -70,4 +62,4 @@ export default class ClietChatSocket {
|
|
|
70
62
|
setUrl (url) {
|
|
71
63
|
this.socket.setUrl(url)
|
|
72
64
|
}
|
|
73
|
-
}
|
|
65
|
+
}
|