@aochuang/client-sdk 1.0.322 → 1.0.324
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<template v-if="item.msgType !== '_EMPTY_'">
|
|
8
8
|
<slot name="chat-prefix" :item="item"></slot>
|
|
9
9
|
</template>
|
|
10
|
-
<template v-if="[0, 2].includes(item.msgType)">
|
|
10
|
+
<template v-if="[0, 1, 2].includes(item.msgType)">
|
|
11
11
|
<sdk-chat-panel-box
|
|
12
12
|
:dir="dir"
|
|
13
13
|
:data="item"
|
package/package.json
CHANGED
|
@@ -150,10 +150,6 @@ export default class ClientChatContacts {
|
|
|
150
150
|
friendMap = {}
|
|
151
151
|
|
|
152
152
|
roomMap = {}
|
|
153
|
-
|
|
154
|
-
_cacheFriendGroupCountMap = {}
|
|
155
|
-
|
|
156
|
-
_cacheRoomGroupCountMap = {}
|
|
157
153
|
|
|
158
154
|
loadContactsRoomGroupDataMethod = null
|
|
159
155
|
|
|
@@ -730,6 +726,19 @@ export default class ClientChatContacts {
|
|
|
730
726
|
this.onLoadFriendGroupData && this.onLoadFriendGroupData()
|
|
731
727
|
return rs
|
|
732
728
|
})
|
|
729
|
+
if (!this.data.cacheFriendGroupCountMap) {
|
|
730
|
+
this.data.cacheFriendGroupCountMap = Vue.observable({})
|
|
731
|
+
}
|
|
732
|
+
Vue.set(this.data.cacheFriendGroupCountMap, 'all', this._cacheLoadFriendGroupPromise.then(rs => {
|
|
733
|
+
return {
|
|
734
|
+
data: (rs.data || []).map(v => {
|
|
735
|
+
return {
|
|
736
|
+
id: v.id,
|
|
737
|
+
num: v.num
|
|
738
|
+
}
|
|
739
|
+
})
|
|
740
|
+
}
|
|
741
|
+
}))
|
|
733
742
|
return this._cacheLoadFriendGroupPromise
|
|
734
743
|
}
|
|
735
744
|
|
|
@@ -750,27 +759,24 @@ export default class ClientChatContacts {
|
|
|
750
759
|
}, params)
|
|
751
760
|
const cacheKey = wechatAccountId || 'all'
|
|
752
761
|
if (!this.data.cacheFriendGroupCountMap) {
|
|
753
|
-
this.data.cacheFriendGroupCountMap = {}
|
|
762
|
+
this.data.cacheFriendGroupCountMap = Vue.observable({})
|
|
754
763
|
}
|
|
755
|
-
if (!this.
|
|
756
|
-
this._cacheFriendGroupCountMap = {}
|
|
757
|
-
}
|
|
758
|
-
if (!this._cacheFriendGroupCountMap[cacheKey]) {
|
|
764
|
+
if (!this.data.cacheFriendGroupCountMap[cacheKey]) {
|
|
759
765
|
const groupIds = (this.data.friendGroupData || []).map(v => v.id)
|
|
760
766
|
groupIds.forEach(id => {
|
|
761
767
|
Vue.set(this.data.refreshFriendGroupCountLoadingMap, id, true)
|
|
762
768
|
})
|
|
763
|
-
Vue.set(this.data.cacheFriendGroupCountMap, cacheKey,
|
|
764
|
-
this._cacheFriendGroupCountMap[cacheKey] = this.getContactsFriendGroupCountMethod(Object.assign({}, nextParams, {
|
|
769
|
+
Vue.set(this.data.cacheFriendGroupCountMap, cacheKey, this.getContactsFriendGroupCountMethod(Object.assign({}, nextParams, {
|
|
765
770
|
wechatAccountIds: wechatAccountId ? [wechatAccountId] : null,
|
|
766
771
|
groupIds
|
|
767
772
|
})).finally(() => {
|
|
768
773
|
groupIds.forEach(id => {
|
|
769
774
|
Vue.set(this.data.refreshFriendGroupCountLoadingMap, id, false)
|
|
770
775
|
})
|
|
771
|
-
})
|
|
776
|
+
}))
|
|
777
|
+
|
|
772
778
|
}
|
|
773
|
-
this.
|
|
779
|
+
this.data.cacheFriendGroupCountMap[cacheKey].then(rs => {
|
|
774
780
|
if (!rs || !rs.data || !rs.data.length) {
|
|
775
781
|
return
|
|
776
782
|
}
|
|
@@ -780,7 +786,7 @@ export default class ClientChatContacts {
|
|
|
780
786
|
})
|
|
781
787
|
})
|
|
782
788
|
})
|
|
783
|
-
return this.
|
|
789
|
+
return this.data.cacheFriendGroupCountMap[cacheKey]
|
|
784
790
|
}
|
|
785
791
|
|
|
786
792
|
// 标记所有好友分组修改
|
|
@@ -789,10 +795,6 @@ export default class ClientChatContacts {
|
|
|
789
795
|
if (!this.data.cacheFriendGroupCountMap) {
|
|
790
796
|
return
|
|
791
797
|
}
|
|
792
|
-
if (this._cacheFriendGroupCountMap) {
|
|
793
|
-
delete this._cacheFriendGroupCountMap[wechatAccountId]
|
|
794
|
-
delete this._cacheFriendGroupCountMap.all
|
|
795
|
-
}
|
|
796
798
|
Vue.delete(this.data.cacheFriendGroupCountMap, wechatAccountId)
|
|
797
799
|
Vue.delete(this.data.cacheFriendGroupCountMap, 'all')
|
|
798
800
|
}
|
|
@@ -806,6 +808,19 @@ export default class ClientChatContacts {
|
|
|
806
808
|
this.onLoadRoomGroupData && this.onLoadRoomGroupData()
|
|
807
809
|
return rs
|
|
808
810
|
})
|
|
811
|
+
if (!this.data.cacheRoomGroupCountMap) {
|
|
812
|
+
this.data.cacheRoomGroupCountMap = Vue.observable({})
|
|
813
|
+
}
|
|
814
|
+
Vue.set(this.data.cacheRoomGroupCountMap, 'all', this._cacheLoadRoomGroupPromise.then(rs => {
|
|
815
|
+
return {
|
|
816
|
+
data: (rs.data || []).map(v => {
|
|
817
|
+
return {
|
|
818
|
+
id: v.id,
|
|
819
|
+
num: v.num
|
|
820
|
+
}
|
|
821
|
+
})
|
|
822
|
+
}
|
|
823
|
+
}))
|
|
809
824
|
return this._cacheLoadRoomGroupPromise
|
|
810
825
|
}
|
|
811
826
|
|
|
@@ -821,28 +836,24 @@ export default class ClientChatContacts {
|
|
|
821
836
|
wechatAccountId: null
|
|
822
837
|
}, params)
|
|
823
838
|
if (!this.data.cacheRoomGroupCountMap) {
|
|
824
|
-
this.data.cacheRoomGroupCountMap = {}
|
|
825
|
-
}
|
|
826
|
-
if (!this._cacheRoomGroupCountMap) {
|
|
827
|
-
this._cacheRoomGroupCountMap = {}
|
|
839
|
+
this.data.cacheRoomGroupCountMap = Vue.observable({})
|
|
828
840
|
}
|
|
829
841
|
const cacheKey = wechatAccountId || 'all'
|
|
830
|
-
if (!this.
|
|
842
|
+
if (!this.data.cacheRoomGroupCountMap[cacheKey] || refresh === true) {
|
|
831
843
|
const groupIds = (this.data.roomGroupData || []).map(v => v.id)
|
|
832
844
|
groupIds.forEach(id => {
|
|
833
845
|
Vue.set(this.data.refreshRoomGroupCountLoadingMap, id, true)
|
|
834
846
|
})
|
|
835
|
-
Vue.set(this.data.cacheRoomGroupCountMap, cacheKey,
|
|
836
|
-
this._cacheRoomGroupCountMap[cacheKey] = this.getContactsRoomGroupCountMethod(Object.assign({}, nextParams, {
|
|
847
|
+
Vue.set(this.data.cacheRoomGroupCountMap, cacheKey, this.getContactsRoomGroupCountMethod(Object.assign({}, nextParams, {
|
|
837
848
|
wechatAccountIds: wechatAccountId ? [wechatAccountId] : null,
|
|
838
849
|
groupIds
|
|
839
850
|
})).finally(() => {
|
|
840
851
|
groupIds.forEach(id => {
|
|
841
852
|
Vue.set(this.data.refreshRoomGroupCountLoadingMap, id, false)
|
|
842
853
|
})
|
|
843
|
-
})
|
|
854
|
+
}))
|
|
844
855
|
}
|
|
845
|
-
this.
|
|
856
|
+
this.data.cacheRoomGroupCountMap[cacheKey].then(rs => {
|
|
846
857
|
if (!rs || !rs.data || !rs.data.length) {
|
|
847
858
|
return
|
|
848
859
|
}
|
|
@@ -852,17 +863,13 @@ export default class ClientChatContacts {
|
|
|
852
863
|
})
|
|
853
864
|
})
|
|
854
865
|
})
|
|
855
|
-
return this.
|
|
866
|
+
return this.data.cacheRoomGroupCountMap[cacheKey]
|
|
856
867
|
}
|
|
857
868
|
|
|
858
869
|
clearAllRoomGroupCountCache (wechatAccountId) {
|
|
859
870
|
if (!this.data.cacheRoomGroupCountMap) {
|
|
860
871
|
return
|
|
861
872
|
}
|
|
862
|
-
if (this._cacheRoomGroupCountMap) {
|
|
863
|
-
delete this._cacheRoomGroupCountMap[wechatAccountId]
|
|
864
|
-
delete this._cacheRoomGroupCountMap.all
|
|
865
|
-
}
|
|
866
873
|
Vue.delete(this.data.cacheRoomGroupCountMap, wechatAccountId)
|
|
867
874
|
Vue.delete(this.data.cacheRoomGroupCountMap, 'all')
|
|
868
875
|
}
|
|
@@ -1090,8 +1097,6 @@ export default class ClientChatContacts {
|
|
|
1090
1097
|
this.data.refreshFriendGroupCountLoadingMap = {}
|
|
1091
1098
|
this.data.cacheFriendGroupCountMap = null
|
|
1092
1099
|
this.data.cacheRoomGroupCountMap = null
|
|
1093
|
-
this._cacheFriendGroupCountMap = null
|
|
1094
|
-
this._cacheRoomGroupCountMap = null
|
|
1095
1100
|
if (this.cancelConnectRequest) {
|
|
1096
1101
|
this.cancelConnectRequest()
|
|
1097
1102
|
this.cancelConnectRequest = null
|