@aochuang/client-sdk 1.0.278

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.
Files changed (366) hide show
  1. package/README.md +93 -0
  2. package/common/avatar/avatar.vue +86 -0
  3. package/common/avatar/index.js +3 -0
  4. package/common/badge/badge.vue +105 -0
  5. package/common/badge/index.js +3 -0
  6. package/common/context-menu/context-menu-box.vue +61 -0
  7. package/common/context-menu/context-menu-group.vue +162 -0
  8. package/common/context-menu/context-menu-item.vue +179 -0
  9. package/common/context-menu/context-menu.vue +201 -0
  10. package/common/context-menu/index.js +3 -0
  11. package/common/context-menu/utils.js +138 -0
  12. package/common/friend-avatar/default.svg +1 -0
  13. package/common/friend-avatar/friend-avatar.vue +29 -0
  14. package/common/friend-avatar/index.js +3 -0
  15. package/common/image/index.js +3 -0
  16. package/common/index.js +17 -0
  17. package/common/room-avatar/default.svg +6 -0
  18. package/common/room-avatar/index.js +3 -0
  19. package/common/room-avatar/room-avatar.vue +29 -0
  20. package/common/scroll-load-more/index.js +3 -0
  21. package/common/scroll-load-more/scroll-load-more.vue +195 -0
  22. package/common/user-avatar/default.svg +1 -0
  23. package/common/user-avatar/index.js +3 -0
  24. package/common/user-avatar/user-avatar.vue +29 -0
  25. package/components/account-select/account-select-skeleton.vue +56 -0
  26. package/components/account-select/account-select.vue +205 -0
  27. package/components/account-select/all.svg +1 -0
  28. package/components/account-select/index.js +3 -0
  29. package/components/chat-editor/MENTION_TOKEN_SUMMARY.md +74 -0
  30. package/components/chat-editor/chat-editor-button/chat-editor-button.vue +78 -0
  31. package/components/chat-editor/chat-editor-suggestions/chat-editor-suggestions.vue +329 -0
  32. package/components/chat-editor/chat-editor-toolbar/chat-editor-toolbar-item.vue +28 -0
  33. package/components/chat-editor/chat-editor-toolbar/chat-editor-toolbar.vue +17 -0
  34. package/components/chat-editor/chat-editor.vue +933 -0
  35. package/components/chat-editor/index.js +12 -0
  36. package/components/chat-editor/utils.js +189 -0
  37. package/components/chat-friend-profile/chat-friend-profile.vue +118 -0
  38. package/components/chat-friend-profile/index.js +3 -0
  39. package/components/chat-layout/chat-layout.vue +71 -0
  40. package/components/chat-layout/index.js +3 -0
  41. package/components/chat-panel/chat-panel-box.vue +350 -0
  42. package/components/chat-panel/chat-panel-chat.vue +121 -0
  43. package/components/chat-panel/chat-panel-chats.vue +674 -0
  44. package/components/chat-panel/chat-panel-empty.vue +32 -0
  45. package/components/chat-panel/chat-panel-increment.vue +80 -0
  46. package/components/chat-panel/chat-panel-inner-msg.vue +25 -0
  47. package/components/chat-panel/chat-panel-loading.vue +29 -0
  48. package/components/chat-panel/chat-panel-nearest.vue +136 -0
  49. package/components/chat-panel/chat-panel.vue +292 -0
  50. package/components/chat-panel/index.js +3 -0
  51. package/components/chat-panel/util.js +83 -0
  52. package/components/chat-room-profile/chat-room-profile.vue +103 -0
  53. package/components/chat-room-profile/index.js +3 -0
  54. package/components/contacts-friend-select/contacts-friend-select-skeleton.vue +41 -0
  55. package/components/contacts-friend-select/contacts-friend-select.vue +204 -0
  56. package/components/contacts-friend-select/index.js +3 -0
  57. package/components/contacts-group-select/contacts-group-select-item.vue +98 -0
  58. package/components/contacts-group-select/contacts-group-select-skeleton.vue +81 -0
  59. package/components/contacts-group-select/contacts-group-select.vue +396 -0
  60. package/components/contacts-group-select/index.js +3 -0
  61. package/components/contacts-room-select/contacts-room-select-skeleton.vue +41 -0
  62. package/components/contacts-room-select/contacts-room-select.vue +208 -0
  63. package/components/contacts-room-select/index.js +3 -0
  64. package/components/index.js +43 -0
  65. package/components/layout/index.js +3 -0
  66. package/components/layout/layout.vue +70 -0
  67. package/components/session-select/index.js +11 -0
  68. package/components/session-select/session-select-item-skeleton.vue +59 -0
  69. package/components/session-select/session-select-item.vue +190 -0
  70. package/components/session-select/session-select.vue +386 -0
  71. package/components/wechat-chat-control/calling/calling.vue +227 -0
  72. package/components/wechat-chat-control/calling/phone-fill.svg +1 -0
  73. package/components/wechat-chat-control/calling/vidicon-fill.svg +1 -0
  74. package/components/wechat-chat-control/channel-live/channel-live.vue +198 -0
  75. package/components/wechat-chat-control/channel-live/quote-icon.svg +1 -0
  76. package/components/wechat-chat-control/channel-video/channel-video.vue +180 -0
  77. package/components/wechat-chat-control/channel-video/quote-icon.svg +1 -0
  78. package/components/wechat-chat-control/channel-video-card/channel-video-card.vue +139 -0
  79. package/components/wechat-chat-control/channel-video-card/quote-icon.svg +1 -0
  80. package/components/wechat-chat-control/company-card/company-card.vue +136 -0
  81. package/components/wechat-chat-control/company-card/quote-icon.svg +1 -0
  82. package/components/wechat-chat-control/custom-expression/custom-expression.vue +45 -0
  83. package/components/wechat-chat-control/empty/empty.vue +27 -0
  84. package/components/wechat-chat-control/file-url/file-url.vue +307 -0
  85. package/components/wechat-chat-control/file-url/icons/file-excel-line.svg +1 -0
  86. package/components/wechat-chat-control/file-url/icons/file-info-line.svg +1 -0
  87. package/components/wechat-chat-control/file-url/icons/file-music-line.svg +1 -0
  88. package/components/wechat-chat-control/file-url/icons/file-pdf-line.svg +1 -0
  89. package/components/wechat-chat-control/file-url/icons/file-ppt-line.svg +1 -0
  90. package/components/wechat-chat-control/file-url/icons/file-settings-line.svg +1 -0
  91. package/components/wechat-chat-control/file-url/icons/file-text-line.svg +1 -0
  92. package/components/wechat-chat-control/file-url/icons/file-unknow-line.svg +1 -0
  93. package/components/wechat-chat-control/file-url/icons/file-word-line.svg +1 -0
  94. package/components/wechat-chat-control/file-url/icons/file-zip-line.svg +1 -0
  95. package/components/wechat-chat-control/file-url/icons/index.js +24 -0
  96. package/components/wechat-chat-control/image/image.vue +344 -0
  97. package/components/wechat-chat-control/image/index.js +1 -0
  98. package/components/wechat-chat-control/image/util.js +29 -0
  99. package/components/wechat-chat-control/index.js +104 -0
  100. package/components/wechat-chat-control/jx-sys-text/jx-sys-text.vue +28 -0
  101. package/components/wechat-chat-control/location/location.vue +179 -0
  102. package/components/wechat-chat-control/location/offline-bg.png +0 -0
  103. package/components/wechat-chat-control/member-change/member-change.vue +37 -0
  104. package/components/wechat-chat-control/music/icons/163.png +0 -0
  105. package/components/wechat-chat-control/music/icons/163.svg +12 -0
  106. package/components/wechat-chat-control/music/icons/default.png +0 -0
  107. package/components/wechat-chat-control/music/icons/default.svg +1 -0
  108. package/components/wechat-chat-control/music/icons/kuwo.png +0 -0
  109. package/components/wechat-chat-control/music/icons/qq.png +0 -0
  110. package/components/wechat-chat-control/music/icons/qq.svg +1 -0
  111. package/components/wechat-chat-control/music/music.vue +156 -0
  112. package/components/wechat-chat-control/music/utils.js +30 -0
  113. package/components/wechat-chat-control/quote-message/quote-message.vue +257 -0
  114. package/components/wechat-chat-control/real-time-position/icon.svg +1 -0
  115. package/components/wechat-chat-control/real-time-position/real-time-position.vue +57 -0
  116. package/components/wechat-chat-control/red-envelopes/quote-icon.svg +1 -0
  117. package/components/wechat-chat-control/red-envelopes/red-envelope.svg +1 -0
  118. package/components/wechat-chat-control/red-envelopes/red-envelopes.vue +168 -0
  119. package/components/wechat-chat-control/revoke-me-message/revoke-me-message.vue +41 -0
  120. package/components/wechat-chat-control/revoke-other-message/revoke-other-message.vue +41 -0
  121. package/components/wechat-chat-control/revoke-you-message/revoke-you-message.vue +41 -0
  122. package/components/wechat-chat-control/room-calling/phone-fill.svg +1 -0
  123. package/components/wechat-chat-control/room-calling/room-calling.vue +52 -0
  124. package/components/wechat-chat-control/room-calling/vidicon-fill.svg +1 -0
  125. package/components/wechat-chat-control/share-card/quote-icon.svg +1 -0
  126. package/components/wechat-chat-control/share-card/share-card.vue +140 -0
  127. package/components/wechat-chat-control/system/system.vue +122 -0
  128. package/components/wechat-chat-control/system-batch-message/system-batch-message.vue +28 -0
  129. package/components/wechat-chat-control/system-money/system-money.vue +39 -0
  130. package/components/wechat-chat-control/text/icons/icon.svg +6 -0
  131. package/components/wechat-chat-control/text/text.vue +164 -0
  132. package/components/wechat-chat-control/text-with-at/text-with-at.vue +88 -0
  133. package/components/wechat-chat-control/transfer/collection.svg +1 -0
  134. package/components/wechat-chat-control/transfer/quote-icon.svg +1 -0
  135. package/components/wechat-chat-control/transfer/red-transfer.svg +1 -0
  136. package/components/wechat-chat-control/transfer/refund.svg +1 -0
  137. package/components/wechat-chat-control/transfer/transfer.svg +1 -0
  138. package/components/wechat-chat-control/transfer/transfer.vue +263 -0
  139. package/components/wechat-chat-control/unknow/unknow.vue +21 -0
  140. package/components/wechat-chat-control/url/icons/link.svg +1 -0
  141. package/components/wechat-chat-control/url/icons/video.svg +6 -0
  142. package/components/wechat-chat-control/url/miniprogram.svg +1 -0
  143. package/components/wechat-chat-control/url/url-file.vue +47 -0
  144. package/components/wechat-chat-control/url/url-link.vue +169 -0
  145. package/components/wechat-chat-control/url/url-merge.vue +164 -0
  146. package/components/wechat-chat-control/url/url-miniprogram.vue +259 -0
  147. package/components/wechat-chat-control/url/url.vue +116 -0
  148. package/components/wechat-chat-control/util.js +234 -0
  149. package/components/wechat-chat-control/video/icons/video.svg +1 -0
  150. package/components/wechat-chat-control/video/video.vue +304 -0
  151. package/components/wechat-chat-control/voice/icons/voice.svg +1 -0
  152. package/components/wechat-chat-control/voice/voice.vue +464 -0
  153. package/components/wechat-chat-control/wechat-chat-control-config-item.vue +24 -0
  154. package/components/wechat-chat-control/wechat-chat-control-config-msg.vue +21 -0
  155. package/components/wechat-chat-control/wechat-chat-control-config.vue +57 -0
  156. package/components/wechat-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +69 -0
  157. package/components/wechat-chat-panel/chat-panel-item.vue +695 -0
  158. package/components/wechat-chat-panel/chat-panel.vue +257 -0
  159. package/components/wechat-chat-panel/index.js +3 -0
  160. package/components/wework-chat-control/calling/calling.vue +223 -0
  161. package/components/wework-chat-control/calling/phone-fill.svg +1 -0
  162. package/components/wework-chat-control/calling/vidicon-fill.svg +1 -0
  163. package/components/wework-chat-control/channel-live/channel-live.vue +198 -0
  164. package/components/wework-chat-control/channel-live/quote-icon.svg +1 -0
  165. package/components/wework-chat-control/channel-video/channel-video.vue +180 -0
  166. package/components/wework-chat-control/channel-video/quote-icon.svg +1 -0
  167. package/components/wework-chat-control/company-card/company-card.vue +136 -0
  168. package/components/wework-chat-control/company-card/quote-icon.svg +1 -0
  169. package/components/wework-chat-control/custom-expression/custom-expression.vue +34 -0
  170. package/components/wework-chat-control/empty/empty.vue +27 -0
  171. package/components/wework-chat-control/expression/expression.vue +53 -0
  172. package/components/wework-chat-control/file-url/file-url.vue +247 -0
  173. package/components/wework-chat-control/file-url/icons/file-excel-line.svg +1 -0
  174. package/components/wework-chat-control/file-url/icons/file-info-line.svg +1 -0
  175. package/components/wework-chat-control/file-url/icons/file-music-line.svg +1 -0
  176. package/components/wework-chat-control/file-url/icons/file-pdf-line.svg +1 -0
  177. package/components/wework-chat-control/file-url/icons/file-ppt-line.svg +1 -0
  178. package/components/wework-chat-control/file-url/icons/file-settings-line.svg +1 -0
  179. package/components/wework-chat-control/file-url/icons/file-text-line.svg +1 -0
  180. package/components/wework-chat-control/file-url/icons/file-unknow-line.svg +1 -0
  181. package/components/wework-chat-control/file-url/icons/file-word-line.svg +1 -0
  182. package/components/wework-chat-control/file-url/icons/file-zip-line.svg +1 -0
  183. package/components/wework-chat-control/file-url/icons/index.js +24 -0
  184. package/components/wework-chat-control/image/image.vue +296 -0
  185. package/components/wework-chat-control/image/index.js +1 -0
  186. package/components/wework-chat-control/image/util.js +21 -0
  187. package/components/wework-chat-control/index.js +105 -0
  188. package/components/wework-chat-control/jx-sys-text/jx-sys-text.vue +28 -0
  189. package/components/wework-chat-control/link/link.vue +100 -0
  190. package/components/wework-chat-control/location/location.vue +181 -0
  191. package/components/wework-chat-control/location/offline-bg.png +0 -0
  192. package/components/wework-chat-control/red-envelopes/quote-icon.svg +1 -0
  193. package/components/wework-chat-control/red-envelopes/red-envelope.svg +1 -0
  194. package/components/wework-chat-control/red-envelopes/red-envelopes.vue +168 -0
  195. package/components/wework-chat-control/share-card/quote-icon.svg +1 -0
  196. package/components/wework-chat-control/share-card/share-card.vue +140 -0
  197. package/components/wework-chat-control/text/icons/icon.svg +6 -0
  198. package/components/wework-chat-control/text/text.vue +157 -0
  199. package/components/wework-chat-control/unknow/unknow.vue +21 -0
  200. package/components/wework-chat-control/url/icons/link.svg +1 -0
  201. package/components/wework-chat-control/url/icons/video.svg +6 -0
  202. package/components/wework-chat-control/url/miniprogram.svg +1 -0
  203. package/components/wework-chat-control/url/url-file.vue +37 -0
  204. package/components/wework-chat-control/url/url-link.vue +169 -0
  205. package/components/wework-chat-control/url/url-merge.vue +164 -0
  206. package/components/wework-chat-control/url/url-miniprogram.vue +248 -0
  207. package/components/wework-chat-control/url/url.vue +103 -0
  208. package/components/wework-chat-control/util.js +223 -0
  209. package/components/wework-chat-control/video/icons/video.svg +1 -0
  210. package/components/wework-chat-control/video/video.vue +304 -0
  211. package/components/wework-chat-control/voice/icons/voice.svg +1 -0
  212. package/components/wework-chat-control/voice/voice.vue +464 -0
  213. package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +35 -0
  214. package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +36 -0
  215. package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +35 -0
  216. package/components/wework-chat-panel/chat-panel-controls/image/image.vue +36 -0
  217. package/components/wework-chat-panel/chat-panel-controls/index.js +35 -0
  218. package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +28 -0
  219. package/components/wework-chat-panel/chat-panel-controls/link/link.vue +35 -0
  220. package/components/wework-chat-panel/chat-panel-controls/location/location.vue +35 -0
  221. package/components/wework-chat-panel/chat-panel-controls/text/text.vue +43 -0
  222. package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +39 -0
  223. package/components/wework-chat-panel/chat-panel-controls/video/video.vue +37 -0
  224. package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +35 -0
  225. package/components/wework-chat-panel/chat-panel-item.vue +650 -0
  226. package/components/wework-chat-panel/chat-panel.vue +163 -0
  227. package/components/wework-chat-panel/index.js +3 -0
  228. package/package.json +23 -0
  229. package/services/client-chat/client-chat-wechat/client-chat-account.js +426 -0
  230. package/services/client-chat/client-chat-wechat/client-chat-concats.js +1029 -0
  231. package/services/client-chat/client-chat-wechat/client-chat-draft.js +92 -0
  232. package/services/client-chat/client-chat-wechat/client-chat-message.js +588 -0
  233. package/services/client-chat/client-chat-wechat/client-chat-session-manage.js +67 -0
  234. package/services/client-chat/client-chat-wechat/client-chat-session.js +1048 -0
  235. package/services/client-chat/client-chat-wechat/client-chat-socket.js +215 -0
  236. package/services/client-chat/client-chat-wechat/client-chat.js +1065 -0
  237. package/services/client-chat/client-chat-wechat/index.js +3 -0
  238. package/services/client-chat/client-chat-wechat/utils.js +82 -0
  239. package/services/client-chat/client-chat-wework/client-chat-account.js +310 -0
  240. package/services/client-chat/client-chat-wework/client-chat-concats.js +772 -0
  241. package/services/client-chat/client-chat-wework/client-chat-message.js +278 -0
  242. package/services/client-chat/client-chat-wework/client-chat-session.js +929 -0
  243. package/services/client-chat/client-chat-wework/client-chat-socket.js +64 -0
  244. package/services/client-chat/client-chat-wework/client-chat.js +330 -0
  245. package/services/client-chat/client-chat-wework/index.js +3 -0
  246. package/services/client-chat/client-chat-wework/utils.js +82 -0
  247. package/services/index.js +10 -0
  248. package/services/socket/index.js +5 -0
  249. package/services/socket/socket.js +797 -0
  250. package/services/socket/utils.js +7 -0
  251. package/uni-common/account-portray/account-portray.vue +51 -0
  252. package/uni-common/account-select/account-select-item.vue +172 -0
  253. package/uni-common/account-select/account-select.vue +252 -0
  254. package/uni-common/all-friend-avatar/all-friend-avatar.vue +49 -0
  255. package/uni-common/friend-avatar/default.svg +1 -0
  256. package/uni-common/friend-avatar/friend-avatar.vue +27 -0
  257. package/uni-common/friend-avatar/index.js +3 -0
  258. package/uni-common/friend-loader/friend-loader.vue +53 -0
  259. package/uni-common/friend-portray/friend-portray.vue +56 -0
  260. package/uni-common/group-avatar/default.svg +1 -0
  261. package/uni-common/group-avatar/group-avatar.vue +18 -0
  262. package/uni-common/group-avatar/index.js +3 -0
  263. package/uni-common/room-avatar/default.svg +6 -0
  264. package/uni-common/room-avatar/index.js +3 -0
  265. package/uni-common/room-avatar/room-avatar.vue +27 -0
  266. package/uni-common/room-loader/room-loader.vue +53 -0
  267. package/uni-common/room-portray/room-portray.vue +56 -0
  268. package/uni-components/chat-control/calling/calling.vue +91 -0
  269. package/uni-components/chat-control/calling/phone-fill.svg +1 -0
  270. package/uni-components/chat-control/calling/vidicon-fill.svg +1 -0
  271. package/uni-components/chat-control/channel-video/channel-video.vue +89 -0
  272. package/uni-components/chat-control/channel-video-card/channel-video-card.vue +105 -0
  273. package/uni-components/chat-control/channel-video-live/channel-video-live.vue +92 -0
  274. package/uni-components/chat-control/chat-control-config-item/chat-control-config-item.vue +20 -0
  275. package/uni-components/chat-control/chat-control-config-item/index.js +3 -0
  276. package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-app.vue +25 -0
  277. package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-h5.vue +21 -0
  278. package/uni-components/chat-control/chat-control-config.vue +59 -0
  279. package/uni-components/chat-control/chat-control.vue +218 -0
  280. package/uni-components/chat-control/company-card/company-card.vue +123 -0
  281. package/uni-components/chat-control/const.js +28 -0
  282. package/uni-components/chat-control/expression/expression.vue +41 -0
  283. package/uni-components/chat-control/image/image.vue +68 -0
  284. package/uni-components/chat-control/index.js +89 -0
  285. package/uni-components/chat-control/location/location.vue +110 -0
  286. package/uni-components/chat-control/member-change/member-change.vue +32 -0
  287. package/uni-components/chat-control/quote-message/quote-message.vue +216 -0
  288. package/uni-components/chat-control/real-time-position/real-time-position.vue +62 -0
  289. package/uni-components/chat-control/redpacket/red-envelope.svg +1 -0
  290. package/uni-components/chat-control/redpacket/redpacket.vue +75 -0
  291. package/uni-components/chat-control/share-card/share-card.vue +101 -0
  292. package/uni-components/chat-control/system/system.vue +69 -0
  293. package/uni-components/chat-control/system-batch-message/system-batch-message.vue +30 -0
  294. package/uni-components/chat-control/system-text/system-text.vue +32 -0
  295. package/uni-components/chat-control/text/text.vue +67 -0
  296. package/uni-components/chat-control/text-with-at/text-with-at.vue +51 -0
  297. package/uni-components/chat-control/transfer/red-transfer.svg +1 -0
  298. package/uni-components/chat-control/transfer/transfer.vue +80 -0
  299. package/uni-components/chat-control/unkonw/unkonw.vue +37 -0
  300. package/uni-components/chat-control/url/icons/file-excel-line.svg +1 -0
  301. package/uni-components/chat-control/url/icons/file-info-line.svg +1 -0
  302. package/uni-components/chat-control/url/icons/file-music-line.svg +1 -0
  303. package/uni-components/chat-control/url/icons/file-pdf-line.svg +1 -0
  304. package/uni-components/chat-control/url/icons/file-ppt-line.svg +1 -0
  305. package/uni-components/chat-control/url/icons/file-settings-line.svg +1 -0
  306. package/uni-components/chat-control/url/icons/file-text-line.svg +1 -0
  307. package/uni-components/chat-control/url/icons/file-unknow-line.svg +1 -0
  308. package/uni-components/chat-control/url/icons/file-word-line.svg +1 -0
  309. package/uni-components/chat-control/url/icons/file-zip-line.svg +1 -0
  310. package/uni-components/chat-control/url/icons/index.js +24 -0
  311. package/uni-components/chat-control/url/miniprogram.svg +1 -0
  312. package/uni-components/chat-control/url/url-miniprogram.vue +116 -0
  313. package/uni-components/chat-control/url/url.vue +306 -0
  314. package/uni-components/chat-control/url-new/icons/file-excel-line.svg +1 -0
  315. package/uni-components/chat-control/url-new/icons/file-info-line.svg +1 -0
  316. package/uni-components/chat-control/url-new/icons/file-music-line.svg +1 -0
  317. package/uni-components/chat-control/url-new/icons/file-pdf-line.svg +1 -0
  318. package/uni-components/chat-control/url-new/icons/file-ppt-line.svg +1 -0
  319. package/uni-components/chat-control/url-new/icons/file-settings-line.svg +1 -0
  320. package/uni-components/chat-control/url-new/icons/file-text-line.svg +1 -0
  321. package/uni-components/chat-control/url-new/icons/file-unknow-line.svg +1 -0
  322. package/uni-components/chat-control/url-new/icons/file-word-line.svg +1 -0
  323. package/uni-components/chat-control/url-new/icons/file-zip-line.svg +1 -0
  324. package/uni-components/chat-control/url-new/icons/index.js +24 -0
  325. package/uni-components/chat-control/url-new/url-new.vue +110 -0
  326. package/uni-components/chat-control/utils.js +12 -0
  327. package/uni-components/chat-control/video/video.vue +156 -0
  328. package/uni-components/chat-control/voice/voice.vue +166 -0
  329. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-collect.vue +84 -0
  330. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-system.vue +28 -0
  331. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet.vue +85 -0
  332. package/uni-components/chat-editor/chat-editor-func/chat-editor-func.vue +157 -0
  333. package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at-panel.vue +158 -0
  334. package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at.vue +61 -0
  335. package/uni-components/chat-editor/chat-editor-func-button/chat-editor-func-button.vue +58 -0
  336. package/uni-components/chat-editor/chat-editor-func-file/chat-editor-func-file.vue +54 -0
  337. package/uni-components/chat-editor/chat-editor-func-image/chat-editor-func-image.vue +42 -0
  338. package/uni-components/chat-editor/chat-editor-func-video/chat-editor-func-video.vue +42 -0
  339. package/uni-components/chat-editor/chat-editor-func-voice/chat-editor-func-voice.vue +25 -0
  340. package/uni-components/chat-editor/chat-editor-message-send/chat-editor-message-send.vue +158 -0
  341. package/uni-components/chat-editor/chat-editor-quote/chat-editor-quote.vue +75 -0
  342. package/uni-components/chat-editor/chat-editor.vue +257 -0
  343. package/uni-components/chat-editor/index.js +10 -0
  344. package/uni-components/chat-editor/util.js +65 -0
  345. package/uni-components/chat-panel/chat-panel-chats-box.vue +238 -0
  346. package/uni-components/chat-panel/chat-panel-chats-forward/chat-panel-chats-forward.vue +273 -0
  347. package/uni-components/chat-panel/chat-panel-chats-item.vue +578 -0
  348. package/uni-components/chat-panel/chat-panel-chats-status/chat-panel-chats-status.vue +71 -0
  349. package/uni-components/chat-panel/chat-panel-chats.vue +368 -0
  350. package/uni-components/chat-panel/chat-panel.vue +227 -0
  351. package/uni-components/contacts-group-select/contacts-group-select-item.vue +85 -0
  352. package/uni-components/contacts-group-select/contacts-group-select-panel.vue +119 -0
  353. package/uni-components/contacts-group-select/contacts-group-select.vue +150 -0
  354. package/utils/color.js +178 -0
  355. package/utils/data.js +11 -0
  356. package/utils/date.js +107 -0
  357. package/utils/event.js +3 -0
  358. package/utils/file.js +26 -0
  359. package/utils/index.js +5 -0
  360. package/utils/json.js +40 -0
  361. package/utils/log.js +243 -0
  362. package/utils/queue.js +97 -0
  363. package/utils/regexp.js +9 -0
  364. package/utils/string.js +66 -0
  365. package/utils/url.js +48 -0
  366. package/utils/util.js +130 -0
@@ -0,0 +1,259 @@
1
+ <template>
2
+ <div class="sdk-chat-panel-control-url-miniprogram" :class="['sdk-chat-panel-control-url-miniprogram--' + type, {'is-border': border}]">
3
+ <template v-if="type === 'default'">
4
+ <div class="sdk-chat-panel-control-url-miniprogram__main">
5
+ <div class="sdk-chat-panel-control-url-miniprogram__head" v-if="icon">
6
+ <img class="sdk-chat-panel-control-url-miniprogram__icon" width="22px" height="22px;" v-if="icon" :src="icon" />
7
+ <div class="sdk-chat-panel-control-url-miniprogram__desc" v-if="desc">
8
+ {{desc}}
9
+ </div>
10
+ </div>
11
+ <div class="sdk-chat-panel-control-url-miniprogram__body">
12
+ <div class="sdk-chat-panel-control-url-miniprogram__title" v-if="title">
13
+ {{title}}
14
+ </div>
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>
17
+ </div>
18
+ </div>
19
+ <div class="sdk-chat-panel-control-url-miniprogram__foot">小程序</div>
20
+ </div>
21
+ </template>
22
+ <template v-else-if="type === 'thumb'">
23
+ <div class="sdk-chat-panel-control-url-miniprogram__main">
24
+ <div class="sdk-chat-panel-control-url-miniprogram__head" v-if="icon">
25
+ <img class="sdk-chat-panel-control-url-miniprogram__icon" width="22px" height="22px;" v-if="icon" :src="icon" />
26
+ <div class="sdk-chat-panel-control-url-miniprogram__desc" v-if="desc">
27
+ {{desc}}
28
+ </div>
29
+ </div>
30
+ <div class="sdk-chat-panel-control-url-miniprogram__body">
31
+ <div class="sdk-chat-panel-control-url-miniprogram__title" v-if="title">
32
+ {{title}}
33
+ </div>
34
+ </div>
35
+ <div class="sdk-chat-panel-control-url-miniprogram__bgimage">
36
+ <div v-if="cover" :style="{width: '100%', height: '100%', background: 'url('+ cover +')', 'background-size': 'cover'}"></div>
37
+ </div>
38
+ <div class="sdk-chat-panel-control-url-miniprogram__foot">小程序</div>
39
+ </div>
40
+ </template>
41
+ <template v-else-if="type === 'quote'">
42
+ <div class="sdk-chat-panel-control-url-miniprogram__icon"></div>
43
+ <div class="sdk-chat-panel-control-url-miniprogram__title" v-if="title">
44
+ {{title}}
45
+ </div>
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>
48
+ </div>
49
+ </template>
50
+ </div>
51
+ </template>
52
+ <script>
53
+ import { parse, parseXml } from '../../../utils/json'
54
+ import { formatOssPath } from '@aochuang/common/utils/oss'
55
+
56
+ export default {
57
+ name: 'SdkChatPanelControlUrlMiniprogram',
58
+ props: {
59
+ id: {
60
+ type: String
61
+ },
62
+ type: {
63
+ type: String
64
+ },
65
+ content: {
66
+ type: [Object, String]
67
+ }
68
+ },
69
+ inject: {
70
+ SdkChatPanelBox: {
71
+ default: null
72
+ }
73
+ },
74
+ computed: {
75
+ nextContent () {
76
+ return parse(this.content)
77
+ },
78
+ miniprogramData () {
79
+ let data = null
80
+ if (!this.nextContent) {
81
+ return data
82
+ }
83
+ if (this.nextContent.contentXml) {
84
+ data = parseXml(this.nextContent.contentXml)
85
+ }
86
+ return data
87
+ },
88
+ icon () {
89
+ return this.miniprogramData.msg && this.miniprogramData.msg.appmsg && this.miniprogramData.msg.appmsg.weappinfo ? this.miniprogramData.msg.appmsg.weappinfo.weappiconurl : ''
90
+ },
91
+ title () {
92
+ return this.miniprogramData.msg && this.miniprogramData.msg.appmsg ? this.miniprogramData.msg.appmsg.title : ''
93
+ },
94
+ url () {
95
+ return this.miniprogramData.msg && this.miniprogramData.msg.appmsg ? this.miniprogramData.msg.appmsg.url : ''
96
+ },
97
+ desc () {
98
+ let desc = this.miniprogramData.msg && this.miniprogramData.msg.appmsg ? this.miniprogramData.msg.appmsg.des : ''
99
+ if (!desc) {
100
+ desc = this.miniprogramData.msg && this.miniprogramData.msg.appmsg && this.miniprogramData.msg.appmsg.sourcedisplayname ? this.miniprogramData.msg.appmsg.sourcedisplayname : ''
101
+ }
102
+ return desc
103
+ },
104
+ cover () {
105
+ let cover = this.miniprogramData.msg && this.miniprogramData.msg.appmsg ? (this.miniprogramData.msg.appmsg.thumburl || this.content.previewImage) : ''
106
+ if (cover) {
107
+ cover = formatOssPath(cover)
108
+ }
109
+ return cover
110
+ },
111
+ border () {
112
+ return !this.SdkChatPanelBox
113
+ }
114
+ }
115
+ }
116
+ </script>
117
+ <style lang="less">
118
+ .sdk-chat-panel-control-url-miniprogram {
119
+ max-width: 280px;
120
+ &.is-border {
121
+ border-radius: 4px;
122
+ border: 1px solid #eee;
123
+ }
124
+ }
125
+ .sdk-chat-panel-control-url-miniprogram--default{
126
+ .sdk-chat-panel-control-url-miniprogram__main{
127
+ width: 280px;
128
+ color: #404040;
129
+ &:hover{
130
+ color: #404040;
131
+ }
132
+ }
133
+ .sdk-chat-panel-control-url-miniprogram__head{
134
+ padding: 6px 12px 0;
135
+ display: flex;
136
+ flex-direction: row;
137
+ align-items: center;
138
+ img {
139
+ margin-right: 6px;
140
+ }
141
+ }
142
+ .sdk-chat-panel-control-url-miniprogram__body{
143
+ padding: 6px 12px 12px;
144
+ }
145
+ .sdk-chat-panel-control-url-miniprogram__title{
146
+ margin-bottom: 12px;
147
+ font-size: 16px;
148
+ }
149
+ .sdk-chat-panel-control-url-miniprogram__content{
150
+ height: 150px;
151
+ background-color: #f1f0f5;
152
+ }
153
+ .sdk-chat-panel-control-url-miniprogram__desc{
154
+ color: #888;
155
+ }
156
+ .sdk-chat-panel-control-url-miniprogram__foot{
157
+ padding: 3px 12px 3px 26px;
158
+ border-top: 1px solid rgba(0,0,0,.1);
159
+ background: url('./miniprogram.svg') no-repeat 12px 50%;
160
+ background-size: 12px;
161
+ font-size: 12px;
162
+ color: #888;
163
+ }
164
+ }
165
+ .sdk-chat-panel-control-url-miniprogram--thumb{
166
+ background-color: #fff;
167
+ position: relative;
168
+ .sdk-chat-panel-control-url-miniprogram__main{
169
+ width: auto;
170
+ color: #404040;
171
+ &:hover{
172
+ color: #404040;
173
+ }
174
+ }
175
+ .sdk-chat-panel-control-url-miniprogram__head{
176
+ padding: 6px 12px 0;
177
+ display: flex;
178
+ flex-direction: row;
179
+ align-items: center;
180
+ position: relative;
181
+ z-index: 5;
182
+ img {
183
+ margin-right: 6px;
184
+ }
185
+ }
186
+ .sdk-chat-panel-control-url-miniprogram__body{
187
+ padding: 6px 12px 12px;
188
+ position: relative;
189
+ z-index: 5;
190
+ }
191
+ .sdk-chat-panel-control-url-miniprogram__title{
192
+ font-size: 16px;
193
+ display: -webkit-box;
194
+ -webkit-box-orient: vertical;
195
+ -webkit-line-clamp: 2; /* 限制显示3行 */
196
+ overflow: hidden;
197
+ }
198
+ .sdk-chat-panel-control-url-miniprogram__desc{
199
+ color: #888;
200
+ }
201
+ .sdk-chat-panel-control-url-miniprogram__foot{
202
+ padding: 3px 12px 3px 26px;
203
+ border-top: 1px solid rgba(0,0,0,.1);
204
+ background: url('./miniprogram.svg') no-repeat 12px 50%;
205
+ background-size: 12px;
206
+ font-size: 12px;
207
+ color: #888;
208
+ position: relative;
209
+ z-index: 5;
210
+ background-color: #fff;
211
+ }
212
+ .sdk-chat-panel-control-url-miniprogram__bgimage{
213
+ position: absolute;
214
+ left: 0;
215
+ right: 0;
216
+ top: 0;
217
+ bottom: 0;
218
+ &:before {
219
+ content: '';
220
+ position: absolute;
221
+ left: 0;
222
+ top: 0;
223
+ right: 0;
224
+ bottom: 0;
225
+ z-index: 3;
226
+ background: linear-gradient(180deg,#fff 0,hsla(0,0%,100%,.8) 48%,hsla(0,0%,100%,.4) 79%,hsla(0,0%,100%,0));
227
+ }
228
+ }
229
+ }
230
+ .sdk-chat-panel-control-url-miniprogram--quote {
231
+ display: flex;
232
+ flex-direction: row;
233
+ max-width: 320px;
234
+ .sdk-chat-panel-control-url-miniprogram__icon {
235
+ display: inline-block;
236
+ width: 14px;
237
+ height: 14px;
238
+ margin-right: 4px;
239
+ min-width: 14px;
240
+ vertical-align: top;
241
+ margin-top: 4px;
242
+ color: #999;
243
+ background: url('./miniprogram.svg') no-repeat 50% 50%;
244
+ background-size: cover;
245
+ }
246
+ .sdk-chat-panel-control-url-miniprogram__content {
247
+ width: 52px;
248
+ height: 52px;
249
+ min-width: 52px;
250
+ background-position: 50% 50%;
251
+ background-repeat: no-repeat;
252
+ background-size: cover;
253
+ background-color: rgba(0,0,0,.1);
254
+ }
255
+ .sdk-chat-panel-control-url-miniprogram__title{
256
+ margin-right: 6px;
257
+ }
258
+ }
259
+ </style>
@@ -0,0 +1,116 @@
1
+ <script>
2
+ import { parse, parseXml } from '../../../utils/json'
3
+ import UrlMerge from './url-merge'
4
+ import UrlMiniprogram from './url-miniprogram'
5
+ import UrlFile from './url-file'
6
+ import UrlLink from './url-link'
7
+
8
+ export default {
9
+ name: 'SdkChatPanelControlsUrl',
10
+ functional: true,
11
+ props: {
12
+ id: {
13
+ type: String
14
+ },
15
+ content: {
16
+ type: [Object, String]
17
+ },
18
+ updateChatBoxProp: {
19
+ type: Function
20
+ },
21
+ allowDownload: {
22
+ type: [Boolean, Function],
23
+ default: false
24
+ },
25
+ downloadMethod: {
26
+ type: Function
27
+ },
28
+ cancelDownloadMethod: {
29
+ type: Function
30
+ },
31
+ getDownloadTipsMethod: {
32
+ type: Function
33
+ },
34
+ previewMethod: {
35
+ type: Function
36
+ },
37
+ allowPreview: {
38
+ type: [Boolean, Function],
39
+ default: false
40
+ },
41
+ beforeLoadMergeMethod: {
42
+ type: Function
43
+ },
44
+ type: {
45
+ type: String,
46
+ default: 'default',
47
+ validator (value) {
48
+ return ['quote', 'default', 'thumb'].includes(value)
49
+ }
50
+ }
51
+ },
52
+ render (h, c) {
53
+ const { props } = c
54
+ let content = props.content
55
+ if (!content) {
56
+ return null
57
+ }
58
+ content = parse(content)
59
+ if (content.type === 'merged') {
60
+ return h(UrlMerge, {
61
+ props: {
62
+ id: props.id,
63
+ type: props.type,
64
+ content: content.content,
65
+ beforeLoad: props.beforeLoadMergeMethod
66
+ }
67
+ })
68
+ } else if (content.type === 'miniprogram') {
69
+ return h(UrlMiniprogram, {
70
+ props: {
71
+ id: props.id,
72
+ type: props.type,
73
+ content
74
+ },
75
+ key: c.data.key
76
+ })
77
+ } else if (content.type === 'file') {
78
+ return h(UrlFile, {
79
+ props: {
80
+ id: props.id,
81
+ type: props.type,
82
+ content,
83
+ allowDownload: props.allowDownload,
84
+ downloadMethod: props.downloadMethod,
85
+ getDownloadTipsMethod: props.getDownloadTipsMethod,
86
+ cancelDownloadMethod: props.cancelDownloadMethod,
87
+ allowPreview: props.allowPreview,
88
+ previewMethod: props.previewMethod,
89
+ updateChatBoxProp: c.props.updateChatBoxProp
90
+ },
91
+ key: c.data.key
92
+ })
93
+ } else {
94
+ if (typeof content === 'string') {
95
+ const xmlData = parseXml(content)
96
+ if (xmlData) {
97
+ content = {
98
+ title: xmlData.msg && xmlData.msg.appmsg && xmlData.msg.appmsg.title,
99
+ desc: xmlData.msg && xmlData.msg.appmsg && xmlData.msg.appmsg.des,
100
+ url: xmlData.msg && xmlData.msg.appmsg && xmlData.msg.appmsg.url
101
+ }
102
+ }
103
+ }
104
+ return h(UrlLink, {
105
+ props: {
106
+ id: props.id,
107
+ content,
108
+ type: props.type,
109
+ updateChatBoxProp: props.updateChatBoxProp
110
+ },
111
+ key: c.data.key
112
+ })
113
+ }
114
+ }
115
+ }
116
+ </script>
@@ -0,0 +1,234 @@
1
+ export const MESSAGE_TYPE = {
2
+ TEXT: 1,
3
+ IMAGE: 3,
4
+ VOICE: 34,
5
+ MUSIC: 1040187441,
6
+ ROOM_CALLING: 64,
7
+ SHARE_CARD: 42,
8
+ COMPANY_CARD: 66,
9
+ VIDEO: 43,
10
+ CUSTOM_EXPRESSION: 47,
11
+ LOCATION: 48,
12
+ URL: 49,
13
+ URLNew: 1090519089,
14
+ CALLING: 50,
15
+ REAL_TIME_POSITION: -1879048186,
16
+ RED_ENVELOPES: 436207665,
17
+ ACCOUNT_TRANSFER: 419430449,
18
+ SYSTEM: 10000,
19
+ SYSTEM_BATCH_MESSAGE: 10002,
20
+ REVOKE_ME_MESSAGE: 268445458,
21
+ REVOKE_YOU_MESSAGE: 285222674,
22
+ REVOKE_OTHER_MESSAGE: 268445456,
23
+ JX_SYS_TEXT: 90000,
24
+ MEMBER_CHANGE: 570425393,
25
+ SYSTEM_MONEY: -10001,
26
+ TIME_DIVIDER: -12346789,
27
+ TEXT_WITH_AT: 90001,
28
+ QUOTE_MESSAGE: 822083633,
29
+ CHANNEL_VIDEO: 754974769,
30
+ CHANNEL_VIDEO_CARD: 771751985, // 视频号名片
31
+ CHANNEL_VIDEO_LIVE: 973078577 // 视频号直播
32
+ }
33
+
34
+ function html2Escape (sHtml) {
35
+ return (sHtml || '').replace(/[<>]/g, (c) => {
36
+ return {
37
+ '<': '&lt;',
38
+ '>': '&gt;'
39
+ }[c]
40
+ })
41
+ }
42
+
43
+ function formatSystemMessage (content) {
44
+ if (!content) {
45
+ return
46
+ }
47
+ // 微被异常关闭 <a href=\"weixin://voip/callagain/?username=wxid_ofo60wv6hxeg22&isvideocall=false\">重新拨打</a>
48
+ content = content.replace(/<a .*?>(.*)?<\/a>/, '$1')
49
+ // 你有一笔待接收的<_wc_custom_link_ href=\"weixin://wxpay/transfer/remindrcvmsg?fromusername=wxid_czvz4ar05mzj12&transferid=1000050001202403131427288081709&transfer_msg_type=1\">转账</_wc_custom_link_>
50
+ content = content.replace(/<_wc_custom_link_ .*?>(.*)?<\/_wc_custom_link_>/, '$1')
51
+ // <img src=\"SystemMessages_HongbaoIcon.png\"/> 你领取了黄哒哒的<_wc_custom_link_ color=\"#FD9931\" href=\"weixin://weixinhongbao/opendetail?sendid=1000039901202403067108164737017&sign=aeb7599b2ba534837903a501e7c0f3aaa3449225842552e5d19221a43b1be006d012bcbf25660c6700d3ff1488703edf16e033ec6fb8a35a484ff79b3d4d71bf90c7dd7561af1335314c9ef451b8d36c&ver=6\">红包</_wc_custom_link_>
52
+ content = content.replace(/<img .*?\/>/, '')
53
+ return content
54
+ }
55
+
56
+ function toJson (data) {
57
+ try {
58
+ return JSON.parse(data)
59
+ } catch (e) {
60
+ console.log(e)
61
+ }
62
+ return data
63
+ }
64
+
65
+ /**
66
+ * 格式化为短消息
67
+ */
68
+ export function formatShortMessage (msgType, msgContent) {
69
+ let shortMessage = msgContent
70
+ switch (msgType) {
71
+ case MESSAGE_TYPE.TEXT:
72
+ shortMessage = msgContent
73
+ break
74
+ case MESSAGE_TYPE.TEXT_WITH_AT:
75
+ let {atId, content, text} = toJson(msgContent) || {}
76
+ shortMessage = text
77
+ break
78
+ case MESSAGE_TYPE.IMAGE:
79
+ shortMessage = '[图片消息]'
80
+ break
81
+ case MESSAGE_TYPE.VIDEO:
82
+ shortMessage = '[视频消息]'
83
+ break
84
+ case MESSAGE_TYPE.CUSTOM_EXPRESSION:
85
+ shortMessage = '[自定义表情消息]'
86
+ break
87
+ case MESSAGE_TYPE.VOICE:
88
+ shortMessage = '[语音消息]'
89
+ break
90
+ case MESSAGE_TYPE.MUSIC:
91
+ shortMessage = '[音乐消息]'
92
+ break
93
+ case MESSAGE_TYPE.JX_SYS_TEXT:
94
+ case MESSAGE_TYPE.MEMBER_CHANGE:
95
+ case MESSAGE_TYPE.SYSTEM_MONEY:
96
+ shortMessage = '[系统消息]'
97
+ break
98
+ case MESSAGE_TYPE.SYSTEM:
99
+ shortMessage = formatSystemMessage(msgContent)
100
+ break
101
+ case MESSAGE_TYPE.URL:
102
+ case MESSAGE_TYPE.URLNew:
103
+ const jsonObj = toJson(msgContent)
104
+ if (typeof jsonObj === 'object') {
105
+ if(jsonObj.type === 'file') {
106
+ shortMessage = '[文件消息]'
107
+ } else if(jsonObj.type === 'link') {
108
+ shortMessage = '[链接消息]'
109
+ } else if(jsonObj.type === 'miniprogram') {
110
+ shortMessage = '[小程序消息]'
111
+ } else if (jsonObj.type === 'music') {
112
+ shortMessage = '[音乐消息]'
113
+ } else if (jsonObj.type === 'merged') {
114
+ shortMessage = '[合并消息]'
115
+ } else {
116
+ shortMessage = '[链接消息]'
117
+ }
118
+ } else {
119
+ shortMessage = '[链接消息]'
120
+ }
121
+ break
122
+ case MESSAGE_TYPE.RED_ENVELOPES:
123
+ shortMessage = '[红包消息]'
124
+ break
125
+ case MESSAGE_TYPE.ACCOUNT_TRANSFER:
126
+ shortMessage = '[转账消息]'
127
+ break
128
+ case MESSAGE_TYPE.COMPANY_CARD:
129
+ case MESSAGE_TYPE.SHARE_CARD:
130
+ shortMessage = '[名片消息]'
131
+ break
132
+ case MESSAGE_TYPE.LOCATION:
133
+ shortMessage = '[位置消息]'
134
+ break
135
+ case MESSAGE_TYPE.QUOTE_MESSAGE:
136
+ let nextContent = null
137
+ if (typeof msgContent === 'string') {
138
+ nextContent = msgContent.replace(/^[\w-_@]+:{/, '{')
139
+ nextContent = toJson(nextContent)
140
+ }
141
+ if (!nextContent) {
142
+ shortMessage = '[引用消息]'
143
+ } else {
144
+ shortMessage = nextContent.content
145
+ }
146
+ break
147
+ case MESSAGE_TYPE.CHANNEL_VIDEO:
148
+ shortMessage = '[视频号消息]'
149
+ break
150
+ case MESSAGE_TYPE.CHANNEL_VIDEO_CARD:
151
+ shortMessage = '[视频号名片]'
152
+ break
153
+ case MESSAGE_TYPE.CHANNEL_VIDEO_LIVE:
154
+ shortMessage = '[视频号直播]'
155
+ break
156
+ case MESSAGE_TYPE.ROOM_CALLING:
157
+ case MESSAGE_TYPE.CALLING:
158
+ shortMessage = '[语音通话消息]'
159
+ break
160
+ case MESSAGE_TYPE.REVOKE_ME_MESSAGE:
161
+ case MESSAGE_TYPE.REVOKE_OTHER_MESSAGE:
162
+ shortMessage = '[撤回消息]'
163
+ break
164
+ default:
165
+ if (msgContent) {
166
+ shortMessage = '[未知消息]'
167
+ }
168
+ break
169
+ }
170
+ return html2Escape(shortMessage)
171
+ }
172
+
173
+ /**
174
+ * {
175
+ "conversationId": "c46acbc06c7d2c98fc1c2cc7a8a166d51b86b978",
176
+ "lastMsgContent": "&lt;div&gt;afwefwefwe&lt;/div&gt;",
177
+ "lastMsgId": "6b8fb723bd3c2587e4cbe1c7dbf432273ae17937",
178
+ "lastMsgTime": 1752805509000,
179
+ "lastMsgType": 1,
180
+ "lastUpdateTime": 1752808689038,
181
+ "mute": false,
182
+ "stickyOnTop": false,
183
+ "targetId": "fa11efc7f771f73bd483d41e54084494e11b5d8b",
184
+ "type": 0,
185
+ "unreadMsgCount": 0,
186
+ "wechatAccountId": "e8aade993e66748cbb845d127ea8e2e067465de7"
187
+ }
188
+ */
189
+ export function formatShortSessionMessage (session, contextFn) {
190
+ if (!session.lastMsgType) {
191
+ return
192
+ }
193
+ if (session.lastMsgType === MESSAGE_TYPE.TEXT_WITH_AT) {
194
+ const content = toJson(session.lastMsgContent)
195
+ if (!contextFn) {
196
+ throw new Error('缺少上下文函数')
197
+ }
198
+ if (content && content.text && content.text.indexOf('@所有人') >= 0) {
199
+ const contextRs = contextFn()
200
+ if (contextRs && contextRs.then) {
201
+ return contextRs.then(rs => {
202
+ // 有未读消息才需要高亮红色提示
203
+ if (rs.session && rs.session.unreadMsgCount > 0) {
204
+ return `<span style="color: #e2544b;">[@所有人]</span>${html2Escape(content.text)}`
205
+ } else {
206
+ return formatShortMessage(session.lastMsgType, session.lastMsgContent)
207
+ }
208
+ })
209
+ } else {
210
+ return formatShortMessage(session.lastMsgType, session.lastMsgContent)
211
+ }
212
+ } else if (content && content.atWechatIdsHash && content.atWechatIdsHash.length) {
213
+ const contextRs = contextFn()
214
+ if (contextRs && contextRs.then) {
215
+ return contextRs.then(rs => {
216
+ if (!rs.wechatAccount) {
217
+ return formatShortMessage(session.lastMsgType, session.lastMsgContent)
218
+ }
219
+ // 有未读消息才需要高亮红色提示
220
+ if (content.atWechatIdsHash.includes(rs.wechatAccount.wechatIdHash) && rs.session && rs.session.unreadMsgCount > 0) {
221
+ return `<span style="color: #e2544b;">[有人@我]</span>${html2Escape(content.text)}`
222
+ } else {
223
+ return formatShortMessage(session.lastMsgType, session.lastMsgContent)
224
+ }
225
+ })
226
+ } else {
227
+ return formatShortMessage(session.lastMsgType, session.lastMsgContent)
228
+ }
229
+ } else {
230
+ return formatShortMessage(session.lastMsgType, session.lastMsgContent)
231
+ }
232
+ }
233
+ return formatShortMessage(session.lastMsgType, session.lastMsgContent)
234
+ }
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731930511288" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1740" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M0 0h1024v1024H0z" fill="#6690FF" p-id="1741"></path><path d="M802.9696 692.736c15.9744 0 28.928-12.5184 28.928-27.904 0-0.5632 0.1024-0.7936 0.1024-1.1008V395.5968c0-0.3072-0.0768-0.5376-0.0768-1.1008 0-15.4112-12.9792-27.904-28.928-27.904-4.9152 0-9.472 1.1776-13.4656 3.2256h-0.1792l-88.2944 45.9776v-68.352c0-38.7584-32.512-70.1184-72.704-70.1184H264.704c-40.192 0-72.7296 31.36-72.7296 70.0928v350.464C192 736.6656 224.512 768 264.704 768h363.648c40.192 0 72.704-31.36 72.704-70.0928v-54.4512l88.8064 46.208c3.9936 1.792 8.3968 3.072 13.1072 3.072z" fill="#FFFFFF" p-id="1742"></path></svg>