@aochuang/client-sdk 1.0.318 → 1.0.320

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,12 +1,12 @@
1
1
  <template>
2
- <div class="sdk-chat-panel-box" :class="[dir ? 'is-dir-' + dir : '', {'is-blank': blank, 'is-recalled': recalled}]" @mouseenter="handleMouseEnter" @mouseleave="handleMouseLeave">
2
+ <div class="sdk-chat-panel-box" :class="[dir ? 'is-dir-' + dir : '', {'is-blank': blank, 'is-recalled': recalled}, {'has-user-name': !!showUserName}]" @mouseenter="handleMouseEnter" @mouseleave="handleMouseLeave">
3
3
  <div class="sdk-chat-panel-box__avatar" @contextmenu="handleUserAvatarContextmenu" @click="handleUserAvatarClick">
4
4
  <template v-if="userData && userData.avatar">
5
5
  <sdk-user-avatar :src="userData.avatar"></sdk-user-avatar>
6
6
  </template>
7
7
  </div>
8
8
  <div class="sdk-chat-panel-box__main">
9
- <div class="sdk-chat-panel-box__head" :class="{'has-user-name': !!showUserName}">
9
+ <div class="sdk-chat-panel-box__head">
10
10
  <template v-if="showUserName">
11
11
  <span class="sdk-chat-panel-box__name">
12
12
  {{ userData ? userData.name : '' }}
@@ -308,19 +308,22 @@ export default {
308
308
  }
309
309
  }
310
310
  .sdk-chat-panel-box__avatar{
311
- margin-top: 24px;
312
311
  width: 32px;
313
312
  height: 32px;
314
313
  background: #eee;
315
314
  border-radius: 3px;
315
+ margin-top: 8px;
316
316
  }
317
317
  .sdk-chat-panel-box__head{
318
318
  line-height: 24px;
319
319
  min-height: 24px;
320
320
  }
321
- .sdk-chat-panel-box__head:not(.has-user-name) {
321
+ .sdk-chat-panel-box:not(.has-user-name) .sdk-chat-panel-box__head {
322
322
  min-height: 6px;
323
323
  }
324
+ .sdk-chat-panel-box.has-user-name .sdk-chat-panel-box__avatar{
325
+ margin-top: 26px;
326
+ }
324
327
  .sdk-chat-panel-box__name{
325
328
  font-size: 12px;
326
329
  color: #888;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aochuang/client-sdk",
3
- "version": "1.0.318",
3
+ "version": "1.0.320",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -901,9 +901,11 @@ class ClientChat {
901
901
  rs[v.wechatAccountId] = true
902
902
  return rs
903
903
  }, {}))
904
+ const changeFriendMap = {}
904
905
  // 删除changeType为3移除的好友,例如转移的场景
905
906
  if (data.friends && data.friends.length) {
906
907
  data.friends.forEach(friend => {
908
+ changeFriendMap[friend.wechatFriendId] = friend
907
909
  if (friend.changeType === 3) {
908
910
  const removedFriend = this.contacts.removeFriend(friend.wechatFriendId)
909
911
  if (!removedFriend) {
@@ -924,6 +926,13 @@ class ClientChat {
924
926
  ps = this.account.reloadData()
925
927
  }
926
928
  }
929
+ // 这里还需要刷新一下当前会话选中的好友
930
+ if (this.sessionManage.currentSession && changeFriendMap[this.sessionManage.currentSession.targetId]) {
931
+ const sessionFriendId = this.sessionManage.currentSession.targetId
932
+ ps = ps.then(() => {
933
+ return this.contacts.getFriend(sessionFriendId, true)
934
+ })
935
+ }
927
936
  return ps.finally(() => {
928
937
  // 这里应该标记那些工作微信号的通讯录修改了,后面要在界面打个提示,告诉用户通讯录变化了,让手动刷新一下
929
938
  // 同时也将缓存都清理一下,例如工作微信号分组统计数量等