@aochuang/client-sdk 1.0.279 → 1.0.281

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.
@@ -13,7 +13,7 @@
13
13
  {{title}}
14
14
  </div>
15
15
  <div class="sdk-chat-panel-control-url-miniprogram__content">
16
- <div v-if="cover" :style="{width: '100%', height: '100%', background: 'url('+ cover +')', 'background-size': 'cover'}"></div>
16
+ <div v-if="cover" :style="{width: '100%', height: '100%', 'background-image': 'url('+ cover +')'}"></div>
17
17
  </div>
18
18
  </div>
19
19
  <div class="sdk-chat-panel-control-url-miniprogram__foot">小程序</div>
@@ -44,7 +44,7 @@
44
44
  {{title}}
45
45
  </div>
46
46
  <div class="sdk-chat-panel-control-url-miniprogram__content">
47
- <div v-if="cover" :style="{width: '100%', height: '100%', background: 'url('+ cover +')', 'background-size': 'cover'}"></div>
47
+ <div v-if="cover" :style="{width: '100%', height: '100%', 'background-image': 'url('+ cover +')'}"></div>
48
48
  </div>
49
49
  </template>
50
50
  </div>
@@ -102,7 +102,7 @@ export default {
102
102
  return desc
103
103
  },
104
104
  cover () {
105
- let cover = this.miniprogramData.msg && this.miniprogramData.msg.appmsg ? (this.miniprogramData.msg.appmsg.thumburl || this.content.previewImage) : ''
105
+ let cover = this.miniprogramData.msg && this.miniprogramData.msg.appmsg ? (this.miniprogramData.msg.appmsg.thumburl || this.content.previewImage || this.icon) : ''
106
106
  if (cover) {
107
107
  cover = formatOssPath(cover)
108
108
  }
@@ -149,6 +149,13 @@ export default {
149
149
  .sdk-chat-panel-control-url-miniprogram__content{
150
150
  height: 150px;
151
151
  background-color: #f1f0f5;
152
+ div {
153
+ height: 150px;
154
+ background-position: 50% 50%;
155
+ background-repeat: no-repeat;
156
+ background-size: contain;
157
+ background-color: #ffffff;
158
+ }
152
159
  }
153
160
  .sdk-chat-panel-control-url-miniprogram__desc{
154
161
  color: #888;
@@ -243,14 +250,13 @@ export default {
243
250
  background: url('./miniprogram.svg') no-repeat 50% 50%;
244
251
  background-size: cover;
245
252
  }
246
- .sdk-chat-panel-control-url-miniprogram__content {
253
+ .sdk-chat-panel-control-url-miniprogram__content div {
247
254
  width: 52px;
248
255
  height: 52px;
249
256
  min-width: 52px;
250
257
  background-position: 50% 50%;
251
258
  background-repeat: no-repeat;
252
259
  background-size: cover;
253
- background-color: rgba(0,0,0,.1);
254
260
  }
255
261
  .sdk-chat-panel-control-url-miniprogram__title{
256
262
  margin-right: 6px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aochuang/client-sdk",
3
- "version": "1.0.279",
3
+ "version": "1.0.281",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -388,9 +388,9 @@ export default class ClientChatAccount {
388
388
  return new Error('getAccountGreetingUnreadMsgCountMethod未定义')
389
389
  }
390
390
  return this.getAccountGreetingUnreadMsgCountMethod({
391
- wechatAccountId: params.wechatAccountId
391
+ wechatAccountId: (params || {}).wechatAccountId
392
392
  }).then(rs => {
393
- Vue.set(this.accountGreetingUnreadMsgCountData, params.wechatAccountId || 'all', (rs || {}).data || 0)
393
+ Vue.set(this.accountGreetingUnreadMsgCountData, (params || {}).wechatAccountId || 'all', (rs || {}).data || 0)
394
394
  })
395
395
  }
396
396
 
@@ -27,6 +27,7 @@ export default class Websocket {
27
27
  onCmdChatroomInvite: null,
28
28
  onCmdNewGreetingMsg: null,
29
29
  onCmdNewFriendRequest: null,
30
+ onCmdFriendAccepted: null,
30
31
  onHeartbeatCheck: null,
31
32
  onHeartbeatSuccess: null,
32
33
  onSendMessage: null,
@@ -110,6 +111,11 @@ export default class Websocket {
110
111
  options.onCmdNewFriendRequest(evt)
111
112
  }
112
113
  })
114
+ this.socket.event.on('onCmdFriendAccepted', (evt) => {
115
+ if (!options.checkSocketEventNotifyMethod || options.checkSocketEventNotifyMethod(evt) !== false) {
116
+ options.onCmdFriendAccepted(evt)
117
+ }
118
+ })
113
119
  this.socket.event.on('onCmdMessageRecalled', options.onCmdMessageRecalled)
114
120
  this.socket.event.on('onHeartbeatCheck', ({ mergeParams }) => {
115
121
  options.onHeartbeatCheck && options.onHeartbeatCheck({
@@ -931,7 +931,7 @@ class ClientChat {
931
931
  }
932
932
  },
933
933
  // 打招呼有变化
934
- onCmdNewGreetingMsg: ({ data }) => {
934
+ onCmdNewGreetingMsg: ({ data }) => {
935
935
  // {
936
936
  // "cmdType": "CmdNewGreetingMsg",
937
937
  // "seq": 440013669,
@@ -945,10 +945,24 @@ class ClientChat {
945
945
  })
946
946
  },
947
947
  onCmdNewFriendRequest: ({ data }) => {
948
- // 刷新未读
949
- this.account.getAccountGreetingUnreadMsgCount({
950
- wechatAccountId: data.wechatAccountId
951
- })
948
+ // 刷新指定微信号请求数量
949
+ if (data.wechatAccountId) {
950
+ this.account.getAccountGreetingUnreadMsgCount({
951
+ wechatAccountId: data.wechatAccountId
952
+ })
953
+ }
954
+ // 刷新所有微信号请求数量
955
+ this.account.getAccountGreetingUnreadMsgCount()
956
+ },
957
+ onCmdFriendAccepted: ({ data }) => {
958
+ // 刷新指定微信号请求数量
959
+ if (data.wechatAccountId) {
960
+ this.account.getAccountGreetingUnreadMsgCount({
961
+ wechatAccountId: data.wechatAccountId
962
+ })
963
+ }
964
+ // 刷新所有微信号请求数量
965
+ this.account.getAccountGreetingUnreadMsgCount()
952
966
  },
953
967
  onHeartbeatCheck: ({ mergeParams }) => {
954
968
  const ids = this.account.getAccountData().map(v => v.id)