@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
- </style>
228
+ .sdk-account-select.is-horizontal .sdk-account-select__item-name{
229
+ word-break: break-all;
230
+ }
231
+ </style>
@@ -932,6 +932,7 @@ export default {
932
932
  flex-direction: row;
933
933
  align-items: center;
934
934
  justify-content: space-between;
935
+ overflow: auto;
935
936
  }
936
937
  .sdk-chat-editor__toolbar.is-bottom {
937
938
  align-items: flex-end;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aochuang/client-sdk",
3
- "version": "1.0.292",
3
+ "version": "1.0.294",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -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 if (data.changeType === 2) {
913
- this.contacts.getRoom({
914
- wechatAccountId: data.wechatAccountId,
915
- wechatChatroomId: data.wechatChatroomId
916
- }).then(rs => {
917
- this.contacts.updateRoom(data.wechatChatroomId, rs.data)
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
  // 下载视频任务