@aochuang/client-sdk 1.0.292 → 1.0.294
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="sdk-account-select">
|
|
2
|
+
<div class="sdk-account-select" :class="['is-' + direction]">
|
|
3
3
|
<template v-if="loading">
|
|
4
4
|
<account-select-skeleton></account-select-skeleton>
|
|
5
5
|
</template>
|
|
@@ -84,6 +84,13 @@ export default {
|
|
|
84
84
|
},
|
|
85
85
|
queryMethod: {
|
|
86
86
|
type: Function
|
|
87
|
+
},
|
|
88
|
+
direction: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: 'horizontal',
|
|
91
|
+
validator (value) {
|
|
92
|
+
return ['vertical', 'horizontal'].indexOf(value) >= 0
|
|
93
|
+
}
|
|
87
94
|
}
|
|
88
95
|
},
|
|
89
96
|
data () {
|
|
@@ -126,6 +133,9 @@ export default {
|
|
|
126
133
|
box-sizing: border-box;
|
|
127
134
|
word-break: break-all;
|
|
128
135
|
}
|
|
136
|
+
.sdk-account-select.is-horizontal{
|
|
137
|
+
word-break: normal;
|
|
138
|
+
}
|
|
129
139
|
.sdk-account-select__item{
|
|
130
140
|
display: flex;
|
|
131
141
|
flex-direction: row;
|
|
@@ -184,6 +194,19 @@ export default {
|
|
|
184
194
|
height: 100%;
|
|
185
195
|
border-radius: 3px;
|
|
186
196
|
}
|
|
197
|
+
.sdk-account-select.is-vertical .sdk-account-select__item{
|
|
198
|
+
flex-direction: column;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
text-align: center;
|
|
201
|
+
}
|
|
202
|
+
.sdk-account-select.is-vertical .sdk-account-select__item-avatar{
|
|
203
|
+
margin-right: 0;
|
|
204
|
+
margin-bottom: 4px;
|
|
205
|
+
}
|
|
206
|
+
.sdk-account-select.is-vertical .sdk-account-select__item-main{
|
|
207
|
+
width: 100%;
|
|
208
|
+
min-width: 0;
|
|
209
|
+
}
|
|
187
210
|
.sdk-account-select__empty{
|
|
188
211
|
color: #999;
|
|
189
212
|
font-size: 12px;
|
|
@@ -202,4 +225,7 @@ export default {
|
|
|
202
225
|
overflow: hidden;
|
|
203
226
|
text-overflow: ellipsis;
|
|
204
227
|
}
|
|
205
|
-
|
|
228
|
+
.sdk-account-select.is-horizontal .sdk-account-select__item-name{
|
|
229
|
+
word-break: break-all;
|
|
230
|
+
}
|
|
231
|
+
</style>
|
package/package.json
CHANGED
|
@@ -152,6 +152,23 @@ class ClientChat {
|
|
|
152
152
|
} else {
|
|
153
153
|
this.sessionUnread.updateSession(session.conversationId, session)
|
|
154
154
|
}
|
|
155
|
+
// 更新账号未读消息数量
|
|
156
|
+
this.account.updateAccountUnreadMessageNum(session.wechatAccountId, ({ unreadMesasgeNum, unreadMessageMuteNum }) => {
|
|
157
|
+
const beforeUnreadMsgCount = changeProps.unreadMsgCount.before || 0
|
|
158
|
+
const afterUnreadMsgCount = changeProps.unreadMsgCount.after || 0
|
|
159
|
+
const nextUnreadMessageNum = Math.max(0, (unreadMesasgeNum || 0) - beforeUnreadMsgCount) + afterUnreadMsgCount
|
|
160
|
+
if (session.mute) {
|
|
161
|
+
return {
|
|
162
|
+
num: nextUnreadMessageNum,
|
|
163
|
+
muteNum: Math.max(0, (unreadMessageMuteNum || 0) - beforeUnreadMsgCount) + afterUnreadMsgCount
|
|
164
|
+
}
|
|
165
|
+
} else {
|
|
166
|
+
return {
|
|
167
|
+
num: nextUnreadMessageNum,
|
|
168
|
+
muteNum: unreadMessageMuteNum || 0
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
})
|
|
155
172
|
}
|
|
156
173
|
const sessionInstances = this.sessionManage.getSessionInstacesBySessionId(session.conversationId)
|
|
157
174
|
sessionInstances.forEach(sessionInstance => {
|
|
@@ -775,21 +792,6 @@ class ClientChat {
|
|
|
775
792
|
}))
|
|
776
793
|
}
|
|
777
794
|
},
|
|
778
|
-
// 群聊有变化,如分配的情况
|
|
779
|
-
onCmdChatroomInfoChanged: ({ data }) => {
|
|
780
|
-
// 移除群聊
|
|
781
|
-
if (data.changeType === 3) {
|
|
782
|
-
this.contacts.removeRoom(data.wechatChatroomId)
|
|
783
|
-
} else {
|
|
784
|
-
// 其他情况就重新刷新一下群信息
|
|
785
|
-
if (this.sessionManage.currentSession && this.sessionManage.currentSession.targetId === data.wechatChatroomId) {
|
|
786
|
-
this.contacts.getRoom(data.wechatChatroomId, true) // 强制刷新群数据
|
|
787
|
-
this.contacts.loadRoomMemberData(data.wechatChatroomId, { // 强制刷新群成员数据,因为有可能群主变化了
|
|
788
|
-
wechatChatroomId: data.wechatChatroomId
|
|
789
|
-
}, true)
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
},
|
|
793
795
|
onCmdChatroomMemberInfoChanged: ({ data }) => {
|
|
794
796
|
// 如果没有changeType的时候,目前看应该是群成员或者群信息变化了,需要重新刷新一下群成员和群信息
|
|
795
797
|
if (this.sessionManage.currentSession && this.sessionManage.currentSession.targetId === data.wechatChatroomId) {
|
|
@@ -905,17 +907,18 @@ class ClientChat {
|
|
|
905
907
|
if (session) {
|
|
906
908
|
this.session.removeSession(session.conversationId)
|
|
907
909
|
}
|
|
908
|
-
//
|
|
910
|
+
// 删除群聊
|
|
909
911
|
this.contacts.removeRoom(data.wechatChatroomId)
|
|
910
912
|
}
|
|
911
|
-
//
|
|
912
|
-
else
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
913
|
+
// 更新群聊
|
|
914
|
+
else {
|
|
915
|
+
// 其他情况就重新刷新一下群信息
|
|
916
|
+
if (this.sessionManage.currentSession && this.sessionManage.currentSession.targetId === data.wechatChatroomId) {
|
|
917
|
+
this.contacts.getRoom(data.wechatChatroomId, true) // 强制刷新群数据
|
|
918
|
+
this.contacts.loadRoomMemberData(data.wechatChatroomId, { // 强制刷新群成员数据,因为有可能群主变化了
|
|
919
|
+
wechatChatroomId: data.wechatChatroomId
|
|
920
|
+
}, true)
|
|
921
|
+
}
|
|
919
922
|
}
|
|
920
923
|
},
|
|
921
924
|
// 下载视频任务
|