@aochuang/client-sdk 1.0.310 → 1.0.313

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.
@@ -36,16 +36,114 @@
36
36
  </div>
37
37
  </template>
38
38
  <script>
39
- import UiContextMenuBox from './context-menu-box'
40
- import UiContextMenuGroup from './context-menu-group'
41
- import UiContextMenuItem from './context-menu-item'
39
+ import UiContextMenuBox from './context-menu-box'
40
+ import UiContextMenuGroup from './context-menu-group'
41
+ import UiContextMenuItem from './context-menu-item'
42
+ import { isMobile } from '@aochuang/common/utils/browse.js'
42
43
 
43
- import {
44
- getOptimalCoordinate,
45
- getWindowRect,
46
- createRectByXY,
47
- getElementRect
48
- } from './utils.js'
44
+ import {
45
+ getOptimalCoordinate,
46
+ getWindowRect,
47
+ createRectByXY,
48
+ getElementRect
49
+ } from './utils.js'
50
+
51
+ let mobileContextMenuMountCount = 0
52
+ let longPressTimer = null
53
+ let longPressStart = null
54
+ let longPressTriggered = false
55
+
56
+ function clearLongPressTimer () {
57
+ clearTimeout(longPressTimer)
58
+ longPressTimer = null
59
+ }
60
+
61
+ function handleDocumentTouchStart (event) {
62
+ if (event.touches.length !== 1) {
63
+ clearLongPressTimer()
64
+ return
65
+ }
66
+ const touch = event.touches[0]
67
+ longPressStart = {
68
+ target: event.target,
69
+ clientX: touch.clientX,
70
+ clientY: touch.clientY
71
+ }
72
+ longPressTriggered = false
73
+ clearLongPressTimer()
74
+ longPressTimer = setTimeout(() => {
75
+ if (!longPressStart || !longPressStart.target) {
76
+ return
77
+ }
78
+ longPressTriggered = true
79
+ longPressStart.target.dispatchEvent(new MouseEvent('contextmenu', {
80
+ bubbles: true,
81
+ cancelable: true,
82
+ clientX: longPressStart.clientX,
83
+ clientY: longPressStart.clientY
84
+ }))
85
+ }, 500)
86
+ }
87
+
88
+ function handleDocumentTouchMove (event) {
89
+ const touch = event.touches[0]
90
+ if (!longPressStart || !touch) {
91
+ return
92
+ }
93
+ if (Math.abs(touch.clientX - longPressStart.clientX) > 10 || Math.abs(touch.clientY - longPressStart.clientY) > 10) {
94
+ clearLongPressTimer()
95
+ longPressStart = null
96
+ }
97
+ }
98
+
99
+ function handleDocumentTouchEnd (event) {
100
+ clearLongPressTimer()
101
+ longPressStart = null
102
+ if (longPressTriggered) {
103
+ event.preventDefault()
104
+ longPressTriggered = false
105
+ }
106
+ }
107
+
108
+ function handleDocumentTouchCancel () {
109
+ clearLongPressTimer()
110
+ longPressStart = null
111
+ longPressTriggered = false
112
+ }
113
+
114
+ function handleDocumentContextMenu (event) {
115
+ event.preventDefault()
116
+ }
117
+
118
+ function addMobileContextMenuListeners () {
119
+ mobileContextMenuMountCount++
120
+ if (mobileContextMenuMountCount !== 1) {
121
+ return
122
+ }
123
+ window.document.addEventListener('touchstart', handleDocumentTouchStart, { passive: true })
124
+ window.document.addEventListener('touchmove', handleDocumentTouchMove, { passive: true })
125
+ window.document.addEventListener('touchend', handleDocumentTouchEnd, { passive: false })
126
+ window.document.addEventListener('touchcancel', handleDocumentTouchCancel, { passive: true })
127
+ window.document.addEventListener('contextmenu', handleDocumentContextMenu)
128
+ window.document.documentElement.classList.add('ui-context-menu-mobile')
129
+ }
130
+
131
+ function removeMobileContextMenuListeners () {
132
+ mobileContextMenuMountCount--
133
+ if (mobileContextMenuMountCount > 0) {
134
+ return
135
+ }
136
+ mobileContextMenuMountCount = 0
137
+ clearLongPressTimer()
138
+ longPressStart = null
139
+ longPressTriggered = false
140
+ window.document.removeEventListener('touchstart', handleDocumentTouchStart)
141
+ window.document.removeEventListener('touchmove', handleDocumentTouchMove)
142
+ window.document.removeEventListener('touchend', handleDocumentTouchEnd)
143
+ window.document.removeEventListener('touchcancel', handleDocumentTouchCancel)
144
+ window.document.removeEventListener('contextmenu', handleDocumentContextMenu)
145
+ window.document.documentElement.classList.remove('ui-context-menu-mobile')
146
+ }
49
147
 
50
148
  export default {
51
149
  name: 'UiContextMenu',
@@ -93,10 +191,12 @@ export default {
93
191
  return this.innerData.filter(v => !v.divided)
94
192
  }
95
193
  },
96
- mounted () {
97
- window.document.addEventListener('mousewheel', this.handleDocumentMouseWheel)
98
- window.document.addEventListener('mousedown', this.handleDocumentMouseDown)
99
- // window.document.addEventListener('contextmenu', this.handleDocumentContextMenu)
194
+ mounted () {
195
+ window.document.addEventListener('mousewheel', this.handleDocumentMouseWheel)
196
+ window.document.addEventListener('mousedown', this.handleDocumentMouseDown)
197
+ if (isMobile()) {
198
+ addMobileContextMenuListeners()
199
+ }
100
200
  },
101
201
  watch: {
102
202
  value: {
@@ -105,9 +205,9 @@ export default {
105
205
  val ? this.open(this.left, this.top) : this.close()
106
206
  }
107
207
  }
108
- },
109
- methods: {
110
- handleGroupClick () {
208
+ },
209
+ methods: {
210
+ handleGroupClick () {
111
211
  this.close()
112
212
  },
113
213
  handleGroupItemClick ({ item }) {
@@ -175,16 +275,21 @@ export default {
175
275
  this.activeSubItem = null
176
276
  this.$emit('input', false)
177
277
  }
178
- },
179
- beforeUnmount () {
180
- window.document.removeEventListener('mousewheel', this.handleDocumentMouseWheel)
181
- window.document.removeEventListener('mousedown', this.handleDocumentMouseDown)
182
- // window.document.removeEventListener('contextmenu', this.handleDocumentContextMenu)
183
- }
184
- }
278
+ },
279
+ beforeDestroy () {
280
+ window.document.removeEventListener('mousewheel', this.handleDocumentMouseWheel)
281
+ window.document.removeEventListener('mousedown', this.handleDocumentMouseDown)
282
+ if (isMobile()) {
283
+ removeMobileContextMenuListeners()
284
+ }
285
+ }
286
+ }
185
287
  </script>
186
- <style>
187
- .ui-context-menu * {
288
+ <style>
289
+ .ui-context-menu-mobile {
290
+ -webkit-touch-callout: none;
291
+ }
292
+ .ui-context-menu * {
188
293
  box-sizing: content-box;
189
294
  }
190
295
  .ui-context-menu{
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <ui-tooltip :disabled="!tips" :content="tips">
2
+ <ui-tooltip :disabled="!tips || isMobile" :content="tips">
3
3
  <div class="sdk-chat-editor-button" :class="{'is-active': active}" @click.stop="handleClick">
4
4
  <template v-if="loading">
5
5
  <ui-loading size="mini"></ui-loading>
@@ -18,6 +18,7 @@
18
18
  </template>
19
19
  <script>
20
20
  import { Tooltip as UiTooltip, Loading as UiLoading } from '@aochuang/common/components'
21
+ import { isMobile } from '@aochuang/common/utils/browse.js'
21
22
 
22
23
  export default {
23
24
  name: 'SdkChatEditorButton',
@@ -25,6 +26,11 @@ export default {
25
26
  UiLoading,
26
27
  UiTooltip
27
28
  },
29
+ data () {
30
+ return {
31
+ isMobile: isMobile()
32
+ }
33
+ },
28
34
  props: {
29
35
  tips: {
30
36
  type: String
@@ -75,4 +81,4 @@ export default {
75
81
  height: 100%;
76
82
  vertical-align: top;
77
83
  }
78
- </style>
84
+ </style>
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="sdk-chat-editor-suggestions"
4
+ :class="{'is-mobile': isMobile}"
4
5
  v-if="isShow"
5
6
  >
6
7
  <div class="sdk-chat-editor-suggestions__head">
@@ -49,6 +50,7 @@
49
50
  </template>
50
51
  <script>
51
52
  import { Loading as UiLoading } from '@aochuang/common/components'
53
+ import { isMobile } from '@aochuang/common/utils/browse.js'
52
54
 
53
55
  export default {
54
56
  name: 'SdkChatEditorSuggestions',
@@ -73,7 +75,8 @@ export default {
73
75
  data () {
74
76
  return {
75
77
  closed: false,
76
- focusId: null
78
+ focusId: null,
79
+ isMobile: isMobile()
77
80
  }
78
81
  },
79
82
  computed: {
@@ -227,6 +230,18 @@ export default {
227
230
  display: flex;
228
231
  flex-direction: column;
229
232
  }
233
+ .sdk-chat-editor-suggestions.is-mobile {
234
+ box-sizing: border-box;
235
+ width: 100%;
236
+ min-width: 0;
237
+ max-width: none;
238
+ }
239
+ .sdk-chat-editor-suggestions.is-mobile .sdk-chat-editor-suggestions__body {
240
+ overflow-x: hidden;
241
+ }
242
+ .sdk-chat-editor-suggestions.is-mobile .sdk-chat-editor-suggestions__foot {
243
+ flex-wrap: wrap;
244
+ }
230
245
  .sdk-chat-editor-suggestions__head{
231
246
  line-height: 24px;
232
247
  padding: 4px 12px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aochuang/client-sdk",
3
- "version": "1.0.310",
3
+ "version": "1.0.313",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -83,7 +83,6 @@ export default class ClientChatContacts {
83
83
  */
84
84
  roomData: [],
85
85
 
86
-
87
86
  /**
88
87
  * {
89
88
  * groupId: [{
@@ -135,12 +134,26 @@ export default class ClientChatContacts {
135
134
  * 标记通讯录是否修改了
136
135
  * 如果修改了,比如接收到了分配好友的会话时,一定通讯录变了,变了的时候界面需要根据这个状态刷新通讯录
137
136
  */
138
- isModify: false
137
+ isModify: false,
138
+
139
+ /**
140
+ * 缓存的好友分组统计数量
141
+ */
142
+ cacheFriendGroupCountMap: {},
143
+
144
+ /**
145
+ * 缓存的群聊分组统计数量
146
+ */
147
+ cacheRoomGroupCountMap: {}
139
148
  })
140
149
 
141
150
  friendMap = {}
142
151
 
143
152
  roomMap = {}
153
+
154
+ _cacheFriendGroupCountMap = {}
155
+
156
+ _cacheRoomGroupCountMap = {}
144
157
 
145
158
  loadContactsRoomGroupDataMethod = null
146
159
 
@@ -246,10 +259,18 @@ export default class ClientChatContacts {
246
259
  return this.data.friendGroupData
247
260
  }
248
261
 
262
+ get cacheFriendGroupCountMap () {
263
+ return this.data.cacheFriendGroupCountMap
264
+ }
265
+
249
266
  get roomGroupData () {
250
267
  return this.data.roomGroupData
251
268
  }
252
269
 
270
+ get cacheRoomGroupCountMap () {
271
+ return this.data.cacheRoomGroupCountMap
272
+ }
273
+
253
274
  get isModify () {
254
275
  return this.data.isModify
255
276
  }
@@ -589,10 +610,10 @@ export default class ClientChatContacts {
589
610
  }
590
611
  }
591
612
  const wechatAccountId = this.roomMap[id].wechatAccountId
592
- if (wechatAccountId && this.data.accountBindFriendMap[wechatAccountId] && this.data.accountBindFriendMap[wechatAccountId][groupId]) {
593
- const bindIndex = this.data.accountBindFriendMap[wechatAccountId][groupId].indexOf(this.roomMap[id])
613
+ if (wechatAccountId && this.data.accountBindRoomMap[wechatAccountId] && this.data.accountBindRoomMap[wechatAccountId][groupId]) {
614
+ const bindIndex = this.data.accountBindRoomMap[wechatAccountId][groupId].indexOf(this.roomMap[id])
594
615
  if (bindIndex >= 0) {
595
- this.data.accountBindFriendMap[wechatAccountId][groupId].splice(bindIndex, 1)
616
+ this.data.accountBindRoomMap[wechatAccountId][groupId].splice(bindIndex, 1)
596
617
  }
597
618
  }
598
619
  })
@@ -720,15 +741,20 @@ export default class ClientChatContacts {
720
741
  const { wechatAccountId, ...nextParams } = Object.assign({
721
742
  wechatAccountId: null
722
743
  }, params)
744
+ const cacheKey = wechatAccountId || 'all'
745
+ if (!this.data.cacheFriendGroupCountMap) {
746
+ this.data.cacheFriendGroupCountMap = {}
747
+ }
723
748
  if (!this._cacheFriendGroupCountMap) {
724
749
  this._cacheFriendGroupCountMap = {}
725
750
  }
726
- if (!this._cacheFriendGroupCountMap[wechatAccountId]) {
751
+ if (!this._cacheFriendGroupCountMap[cacheKey]) {
727
752
  const groupIds = (this.data.friendGroupData || []).map(v => v.id)
728
753
  groupIds.forEach(id => {
729
754
  Vue.set(this.data.refreshFriendGroupCountLoadingMap, id, true)
730
755
  })
731
- this._cacheFriendGroupCountMap[wechatAccountId] = this.getContactsFriendGroupCountMethod(Object.assign({}, nextParams, {
756
+ Vue.set(this.data.cacheFriendGroupCountMap, cacheKey, true)
757
+ this._cacheFriendGroupCountMap[cacheKey] = this.getContactsFriendGroupCountMethod(Object.assign({}, nextParams, {
732
758
  wechatAccountIds: wechatAccountId ? [wechatAccountId] : null,
733
759
  groupIds
734
760
  })).finally(() => {
@@ -737,7 +763,7 @@ export default class ClientChatContacts {
737
763
  })
738
764
  })
739
765
  }
740
- this._cacheFriendGroupCountMap[wechatAccountId].then(rs => {
766
+ this._cacheFriendGroupCountMap[cacheKey].then(rs => {
741
767
  if (!rs || !rs.data || !rs.data.length) {
742
768
  return
743
769
  }
@@ -747,7 +773,21 @@ export default class ClientChatContacts {
747
773
  })
748
774
  })
749
775
  })
750
- return this._cacheFriendGroupCountMap[wechatAccountId]
776
+ return this._cacheFriendGroupCountMap[cacheKey]
777
+ }
778
+
779
+ // 标记所有好友分组修改
780
+ // 需要清理缓存
781
+ clearAllFriendGroupCountCache (wechatAccountId) {
782
+ if (!this.data.cacheFriendGroupCountMap) {
783
+ return
784
+ }
785
+ if (this._cacheFriendGroupCountMap) {
786
+ delete this._cacheFriendGroupCountMap[wechatAccountId]
787
+ delete this._cacheFriendGroupCountMap.all
788
+ }
789
+ Vue.delete(this.data.cacheFriendGroupCountMap, wechatAccountId)
790
+ Vue.delete(this.data.cacheFriendGroupCountMap, 'all')
751
791
  }
752
792
 
753
793
  loadRoomGroupData () {
@@ -773,15 +813,20 @@ export default class ClientChatContacts {
773
813
  const { wechatAccountId, ...nextParams } = Object.assign({
774
814
  wechatAccountId: null
775
815
  }, params)
816
+ if (!this.data.cacheRoomGroupCountMap) {
817
+ this.data.cacheRoomGroupCountMap = {}
818
+ }
776
819
  if (!this._cacheRoomGroupCountMap) {
777
820
  this._cacheRoomGroupCountMap = {}
778
821
  }
779
- if (!this._cacheRoomGroupCountMap[wechatAccountId] || refresh === true) {
822
+ const cacheKey = wechatAccountId || 'all'
823
+ if (!this._cacheRoomGroupCountMap[cacheKey] || refresh === true) {
780
824
  const groupIds = (this.data.roomGroupData || []).map(v => v.id)
781
825
  groupIds.forEach(id => {
782
826
  Vue.set(this.data.refreshRoomGroupCountLoadingMap, id, true)
783
827
  })
784
- this._cacheRoomGroupCountMap[wechatAccountId] = this.getContactsRoomGroupCountMethod(Object.assign({}, nextParams, {
828
+ Vue.set(this.data.cacheRoomGroupCountMap, cacheKey, true)
829
+ this._cacheRoomGroupCountMap[cacheKey] = this.getContactsRoomGroupCountMethod(Object.assign({}, nextParams, {
785
830
  wechatAccountIds: wechatAccountId ? [wechatAccountId] : null,
786
831
  groupIds
787
832
  })).finally(() => {
@@ -790,7 +835,7 @@ export default class ClientChatContacts {
790
835
  })
791
836
  })
792
837
  }
793
- this._cacheRoomGroupCountMap[wechatAccountId].then(rs => {
838
+ this._cacheRoomGroupCountMap[cacheKey].then(rs => {
794
839
  if (!rs || !rs.data || !rs.data.length) {
795
840
  return
796
841
  }
@@ -800,7 +845,19 @@ export default class ClientChatContacts {
800
845
  })
801
846
  })
802
847
  })
803
- return this._cacheRoomGroupCountMap[wechatAccountId]
848
+ return this._cacheRoomGroupCountMap[cacheKey]
849
+ }
850
+
851
+ clearAllRoomGroupCountCache (wechatAccountId) {
852
+ if (!this.data.cacheRoomGroupCountMap) {
853
+ return
854
+ }
855
+ if (this._cacheRoomGroupCountMap) {
856
+ delete this._cacheRoomGroupCountMap[wechatAccountId]
857
+ delete this._cacheRoomGroupCountMap.all
858
+ }
859
+ Vue.delete(this.data.cacheRoomGroupCountMap, wechatAccountId)
860
+ Vue.delete(this.data.cacheRoomGroupCountMap, 'all')
804
861
  }
805
862
 
806
863
  getFriend (friendId, refresh) {
@@ -1001,11 +1058,13 @@ export default class ClientChatContacts {
1001
1058
  }
1002
1059
 
1003
1060
  markModify () {
1004
- this.data.isModify = true
1061
+ // this.data.isModify = true
1062
+ console.warn('[ClientChat]markModify已过期')
1005
1063
  }
1006
1064
 
1007
1065
  unmarkModify () {
1008
- this.data.isModify = false
1066
+ // this.data.isModify = false
1067
+ console.warn('[ClientChat]markModify已过期')
1009
1068
  }
1010
1069
 
1011
1070
  reset () {
@@ -1022,6 +1081,8 @@ export default class ClientChatContacts {
1022
1081
  this.data.accountBindRoomMap = {}
1023
1082
  this.data.refreshRoomGroupCountLoadingMap = {}
1024
1083
  this.data.refreshFriendGroupCountLoadingMap = {}
1084
+ this.data.cacheFriendGroupCountMap = null
1085
+ this.data.cacheRoomGroupCountMap = null
1025
1086
  this._cacheFriendGroupCountMap = null
1026
1087
  this._cacheRoomGroupCountMap = null
1027
1088
  if (this.cancelConnectRequest) {
@@ -747,17 +747,17 @@ class ClientChat {
747
747
  this.socket.doHeartbeat()
748
748
  },
749
749
  onCurrentAccountChange: ({ currentAccount }) => {
750
- // 如果群分组数据加载了再去刷成员数量,这样可以做到按需
751
- if (this.contacts.friendGroupData && this.contacts.friendGroupData.length) {
752
- this.contacts.refreshAllFriendGroupCount({
753
- wechatAccountId: currentAccount ? currentAccount.id : null
754
- })
755
- }
756
- if (this.contacts.roomGroupData && this.contacts.roomGroupData.length) {
757
- this.contacts.refreshAllRoomGroupCount({
758
- wechatAccountId: currentAccount ? currentAccount.id : null
759
- })
760
- }
750
+ // // 如果群分组数据加载了再去刷成员数量,这样可以做到按需
751
+ // if (this.contacts.friendGroupData && this.contacts.friendGroupData.length) {
752
+ // this.contacts.refreshAllFriendGroupCount({
753
+ // wechatAccountId: currentAccount ? currentAccount.id : null
754
+ // })
755
+ // }
756
+ // if (this.contacts.roomGroupData && this.contacts.roomGroupData.length) {
757
+ // this.contacts.refreshAllRoomGroupCount({
758
+ // wechatAccountId: currentAccount ? currentAccount.id : null
759
+ // })
760
+ // }
761
761
  },
762
762
  onUnreadMessageNumChange: ({ accountId, unreadMessageNum }) => {
763
763
  if (unreadMessageNum === 0) {
@@ -876,28 +876,31 @@ class ClientChat {
876
876
  rs[v.wechatAccountId] = true
877
877
  return rs
878
878
  }, {}))
879
- if (!wechatAccountIds || !wechatAccountIds.length) {
880
- return
879
+ // 删除changeType为3移除的好友,例如转移的场景
880
+ if (data.wechatFriendIds && data.wechatFriendIds.length) {
881
+ data.wechatFriendIds.forEach(friend => {
882
+ if (friend.changeType === 3) {
883
+ this.contacts.removeFriend(friend.wechatFriendId)
884
+ }
885
+ })
881
886
  }
882
- // 统计任务返回的会话数据来按需刷新分组数量
883
- // 更新当前微信号分组统计数量
884
- return Promise.all([].concat(wechatAccountIds.reduce((rs, v) => {
885
- rs.push(
886
- this.contacts.refreshAllRoomGroupCount({
887
- wechatAccountId: v
888
- }, true)
889
- )
890
- rs.push(
891
- this.contacts.refreshAllFriendGroupCount({
892
- wechatAccountId: v
893
- }, true)
894
- )
895
- return rs
896
- }, [
897
- // 刷新一下微信号
898
- this.account.reloadData()
899
- ]))).then(() => {
887
+ let ps = Promise.resolve()
888
+ if (wechatAccountIds && wechatAccountIds.length) {
889
+ // 只要有一个不在现在的accountData里面,就需要重新加载微信号数据
890
+ if (wechatAccountIds.some(v => !this.account.accountMap[v])) {
891
+ ps = this.account.reloadData()
892
+ }
893
+ }
894
+ return ps.finally(() => {
895
+ // 这里应该标记那些工作微信号的通讯录修改了,后面要在界面打个提示,告诉用户通讯录变化了,让手动刷新一下
896
+ // 同时也将缓存都清理一下,例如工作微信号分组统计数量等
900
897
  this.contacts.markModify() // 标记通讯录修改
898
+ // 标记工作微信号所有好友分组修改
899
+ if (data.wechatAccountIds && data.wechatAccountIds) {
900
+ data.wechatAccountIds.forEach(wechatAccountId => {
901
+ this.contacts.clearAllFriendGroupCountCache(wechatAccountId)
902
+ })
903
+ }
901
904
  })
902
905
  })
903
906
  }
@@ -928,11 +931,41 @@ class ClientChat {
928
931
  onCmdChatroomInfoChanged: ({ data }) => {
929
932
  // 配分群聊
930
933
  if (data.changeType === 4) {
931
- // 增量拉取通讯录
932
- // this.contacts.refresh().then(() => {
933
- // // 增量拉取会话
934
- // this.session.refresh()
935
- // })
934
+ // 增量拉取分配产生的会话
935
+ return this.session.loadAssignTaskSessionData({
936
+ taskId: data.taskId
937
+ }).then((rs) => {
938
+ const wechatAccountIds = Object.keys((rs || []).reduce((rs, v) => {
939
+ rs[v.wechatAccountId] = true
940
+ return rs
941
+ }, {}))
942
+ // 删除changeType为3移除的好友,例如转移的场景
943
+ if (data.wechatChatroomIds && data.wechatChatroomIds.length) {
944
+ data.wechatChatroomIds.forEach(room => {
945
+ if (room.changeType === 3) {
946
+ this.contacts.removeRoom(room.wechatChatroomId)
947
+ }
948
+ })
949
+ }
950
+ let ps = Promise.resolve()
951
+ if (wechatAccountIds && wechatAccountIds.length) {
952
+ // 只要有一个不在现在的accountData里面,就需要重新加载微信号数据
953
+ if (wechatAccountIds.some(v => !this.account.accountMap[v])) {
954
+ ps = this.account.reloadData()
955
+ }
956
+ }
957
+ return ps.finally(() => {
958
+ // 这里应该标记那些工作微信号的通讯录修改了,后面要在界面打个提示,告诉用户通讯录变化了,让手动刷新一下
959
+ // 同时也将缓存都清理一下,例如工作微信号分组统计数量等
960
+ this.contacts.markModify() // 标记通讯录修改
961
+ // 标记工作微信号所有好友分组修改,标记修改后后面不会走缓存
962
+ if (data.wechatAccountIds && data.wechatAccountIds) {
963
+ data.wechatAccountIds.forEach(wechatAccountId => {
964
+ this.contacts.clearAllRoomGroupCountCache(wechatAccountId)
965
+ })
966
+ }
967
+ })
968
+ })
936
969
  }
937
970
  // 删除群聊
938
971
  else if (data.changeType === 3) {