@tencentcloud/ai-desk-customer-vue 1.3.0 → 1.5.0
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.
- package/CHANGELOG.md +23 -4
- package/assets/customer_avatar.png +0 -0
- package/assets/face.svg +10 -0
- package/assets/feedback_dialog_close.svg +3 -0
- package/assets/feedback_dislike_after.svg +3 -0
- package/assets/feedback_dislike_before.svg +10 -0
- package/assets/feedback_dislike_hover.svg +10 -0
- package/assets/feedback_like_after.svg +14 -0
- package/assets/feedback_like_before.svg +10 -0
- package/assets/feedback_like_hover.svg +10 -0
- package/assets/files.svg +5 -0
- package/assets/green_check.svg +4 -0
- package/assets/image.svg +8 -0
- package/assets/rating_tool_icon.svg +5 -0
- package/assets/rating_tool_icon_h5.svg +1 -0
- package/assets/video.svg +8 -0
- package/assets/video_h5.svg +1 -0
- package/components/CustomerServiceChat/chat-header/index-web.vue +16 -14
- package/components/CustomerServiceChat/index-web.vue +87 -13
- package/components/CustomerServiceChat/message-input/index-web.vue +31 -5
- package/components/CustomerServiceChat/message-input/message-input-editor-web.vue +25 -0
- package/components/CustomerServiceChat/message-input/message-input-quote/index.vue +29 -20
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/emoji-picker-dialog.vue +36 -36
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/index.vue +1 -1
- package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.vue +6 -8
- package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.vue +11 -16
- package/components/CustomerServiceChat/message-input-toolbar/index-web.vue +61 -18
- package/components/CustomerServiceChat/message-input-toolbar/rating-tool/index.vue +72 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/h5.scss +10 -1
- package/components/CustomerServiceChat/message-input-toolbar/user-define-input-tool.vue +80 -0
- package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.vue +9 -14
- package/components/CustomerServiceChat/message-list/index-web.vue +38 -6
- package/components/CustomerServiceChat/message-list/message-elements/feedback-button.vue +369 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-bubble-web.vue +81 -15
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/marked.ts +17 -10
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-branch.vue +18 -10
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-concurrency-limit.vue +1 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-desk.vue +13 -6
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-ivr-form/form-branch.vue +117 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/{message-single-form → message-ivr-form}/form-input.vue +65 -111
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/{message-single-form → message-ivr-form}/index.vue +7 -2
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/branch-pc.vue +25 -9
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/index.vue +5 -3
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-mobile/input-mobile.vue +1 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-mobile/label-mobile.vue +4 -2
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-pc/label-pc.vue +5 -3
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/form-mobile.vue +17 -5
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/form-pc.vue +21 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-order.vue +3 -3
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-product-card.vue +2 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating/message-rating-number.vue +9 -13
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating/message-rating-star.vue +11 -18
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-robot-welcome.vue +1 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-stream.vue +14 -10
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-timeout-warning.vue +29 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/styles/common.scss +1 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-plugin-web.vue +22 -2
- package/components/CustomerServiceChat/message-list/message-elements/message-file.vue +1 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-quote/index-web.vue +6 -24
- package/components/CustomerServiceChat/message-list/message-elements/message-text.vue +0 -9
- package/components/CustomerServiceChat/message-list/message-elements/read-status/index.vue +31 -20
- package/components/CustomerServiceChat/message-list/message-elements/simple-message-list/index.vue +2 -1
- package/components/CustomerServiceChat/message-list/scroll-button/index.vue +3 -3
- package/components/CustomerServiceChat/message-list/style/web.scss +2 -1
- package/components/CustomerServiceChat/message-toolbar-button/index.vue +111 -42
- package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-end-human-service.vue +59 -0
- package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-human-service.vue +55 -0
- package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-service-rating.vue +59 -0
- package/components/common/Toast/index-web.vue +4 -2
- package/constant.ts +25 -0
- package/interface.ts +35 -5
- package/locales/en/aidesk.ts +28 -15
- package/locales/fil/aidesk.ts +28 -15
- package/locales/id/aidesk.ts +28 -15
- package/locales/ja/aidesk.ts +28 -15
- package/locales/ms/aidesk.ts +28 -15
- package/locales/ru/aidesk.ts +28 -15
- package/locales/th/aidesk.ts +28 -15
- package/locales/vi/aidesk.ts +28 -15
- package/locales/zh_cn/aidesk.ts +28 -15
- package/locales/zh_tw/aidesk.ts +28 -15
- package/package.json +1 -1
- package/server.ts +5 -1
- package/utils/state.js +30 -0
- package/utils/utils.ts +48 -1
- package/assets/face.png +0 -0
- package/assets/files.png +0 -0
- package/assets/image.png +0 -0
- package/assets/video.png +0 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-single-form/form-branch.vue +0 -68
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
##
|
|
1
|
+
## 1.5.0 @2025.6.19
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
- 支持转人工后会话超时提醒。
|
|
5
|
+
- 优化消息气泡、欢迎卡片、评价消息等样式。
|
|
6
|
+
- 优化引用消息的交互体验。
|
|
7
|
+
- 优化流式消息 url 的识别提取。
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- vue2 接入报错问题。
|
|
11
|
+
- 转人工成功后,消息从已读变为未读的问题。
|
|
12
|
+
|
|
13
|
+
## 1.4.0 @2025.5.27
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
- 支持自定义配置。
|
|
17
|
+
- 支持任务流分支选择后不隐藏。
|
|
18
|
+
- 优化消息列表的样式的滚动体验。
|
|
19
|
+
|
|
20
|
+
## 1.3.0 @2025.5.21
|
|
2
21
|
|
|
3
22
|
### Features
|
|
4
23
|
- 支持订单消息。
|
|
5
24
|
- 优化表单消息、任务流消息、流式消息、Markdown 图文混排等的交互体验。
|
|
6
25
|
|
|
7
|
-
##
|
|
26
|
+
## 1.1.0 @2025.4.23
|
|
8
27
|
|
|
9
28
|
### Features
|
|
10
29
|
- 新增 `initWithProfile` 接口,支持用户端带昵称(nickName)和头像(avatar)登录,提升人工客服与用户交互体验。
|
|
@@ -12,13 +31,13 @@
|
|
|
12
31
|
- 优化发消息体验。
|
|
13
32
|
- 优化组件样式。
|
|
14
33
|
|
|
15
|
-
##
|
|
34
|
+
## 1.0.1 @2025.4.16
|
|
16
35
|
|
|
17
36
|
### Features
|
|
18
37
|
- 简化接入。
|
|
19
38
|
- TUICustomerServer 新增 sendTextMessage/sendCustomMessage/changeLanguage 等接口。
|
|
20
39
|
|
|
21
|
-
##
|
|
40
|
+
## 1.0.0 @2025.4.10
|
|
22
41
|
|
|
23
42
|
### Features
|
|
24
43
|
- 国际化语言,支持简体中文、繁体中文、英语、日语、马来西亚语、印尼语、越南语、泰语、俄语、菲律宾语。
|
|
Binary file
|
package/assets/face.svg
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="表情">
|
|
3
|
+
<g id="Union">
|
|
4
|
+
<path d="M5.83268 7.83332C6.29292 7.83332 6.66602 7.46023 6.66602 6.99999C6.66602 6.53975 6.29292 6.16666 5.83268 6.16666C5.37245 6.16666 4.99935 6.53975 4.99935 6.99999C4.99935 7.46023 5.37245 7.83332 5.83268 7.83332Z" fill="black" fill-opacity="0.4"/>
|
|
5
|
+
<path d="M10.9993 6.99999C10.9993 7.46023 10.6263 7.83332 10.166 7.83332C9.70578 7.83332 9.33268 7.46023 9.33268 6.99999C9.33268 6.53975 9.70578 6.16666 10.166 6.16666C10.6263 6.16666 10.9993 6.53975 10.9993 6.99999Z" fill="black" fill-opacity="0.4"/>
|
|
6
|
+
<path d="M7.99945 10.5001C8.74027 10.5001 9.41053 10.198 9.89378 9.71027L10.7634 10.7248C10.0452 11.4116 9.0716 11.8334 7.99945 11.8334C6.92723 11.8334 5.95353 11.4115 5.23532 10.7247L6.10497 9.71011C6.58822 10.1979 7.25855 10.5001 7.99945 10.5001Z" fill="black" fill-opacity="0.4"/>
|
|
7
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.3327 8.49999C15.3327 12.5501 12.0494 15.8333 7.99935 15.8333C3.94926 15.8333 0.666016 12.5501 0.666016 8.49999C0.666016 4.4499 3.94926 1.16666 7.99935 1.16666C12.0494 1.16666 15.3327 4.4499 15.3327 8.49999ZM13.9993 8.49999C13.9993 11.8137 11.3131 14.5 7.99935 14.5C4.68564 14.5 1.99935 11.8137 1.99935 8.49999C1.99935 5.18628 4.68564 2.49999 7.99935 2.49999C11.3131 2.49999 13.9993 5.18628 13.9993 8.49999Z" fill="black" fill-opacity="0.4"/>
|
|
8
|
+
</g>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="26" viewBox="0 0 24 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 21.6878C16.5236 21.6878 20.3 17.8597 20.3 13.0001C20.3 8.14041 16.5236 4.3123 12 4.3123C7.47641 4.3123 3.7 8.14041 3.7 13.0001C3.7 17.8597 7.47641 21.6878 12 21.6878ZM12 23.3878C17.5228 23.3878 22 18.7371 22 13.0001C22 7.26306 17.5228 2.6123 12 2.6123C6.47715 2.6123 2 7.26306 2 13.0001C2 18.7371 6.47715 23.3878 12 23.3878ZM12 14.2248L9.05435 17.2847L7.87534 16.06L10.821 13.0001L7.87459 9.93943L9.05359 8.71471L12 11.7754L14.9464 8.71471L16.1254 9.93943L13.179 13.0001L16.1247 16.06L14.9457 17.2847L12 14.2248Z" fill="#8F9AB2"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.93575 12.8076C5.98695 14.02 6.63253 14.5243 7.164 14.734C7.5547 14.8882 7.92273 14.5824 7.99512 14.1686L8.18994 13.0553C8.42499 11.7119 9.42462 10.6306 10.7454 10.2909L10.8549 10.2627L10.8549 3.07497L3.82176 3.07497C3.25596 3.07497 2.77309 3.48403 2.68007 4.04214L1.71554 8.96129C1.59796 9.66679 2.142 10.309 2.85723 10.309L5.93575 10.3091C5.93575 10.3091 5.84768 10.7223 5.93575 12.8076ZM12.9133 2.49994L12.9132 10.4999L14.2466 10.4999L14.2466 2.49994L12.9133 2.49994Z" fill="#727A8A"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_8053_26348)">
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.95155 14.2724C6.34804 14.4288 6.74452 14.3465 7.03909 14.1325C7.32135 13.9274 7.50548 13.6096 7.56518 13.2684L7.76 12.155C7.95587 11.0356 8.7889 10.1344 9.88953 9.85137L9.99901 9.82321L10.4336 9.71144L10.4336 9.26273L10.4336 2.07497L10.4336 1.49626L9.85486 1.49625L2.82176 1.49625C1.97608 1.49625 1.2539 2.10548 1.11074 2.93808L0.147638 7.84993L0.146053 7.85802L0.144699 7.86615C-0.0316758 8.92438 0.784381 9.88773 1.85722 9.88774L1.85723 9.88774L4.32106 9.88777C4.31328 10.2799 4.3178 10.891 4.35754 11.832C4.38755 12.5424 4.59551 13.0903 4.91143 13.5001C5.22412 13.9058 5.61379 14.1391 5.95155 14.2724ZM6.42506 13.0689C6.41914 13.1027 6.4075 13.132 6.39372 13.155C6.38304 13.1727 6.37254 13.1843 6.3649 13.1911C6.17486 13.1143 5.98079 12.9915 5.82812 12.7935C5.67558 12.5956 5.53515 12.2851 5.51395 11.7831C5.47028 10.7491 5.47073 10.1393 5.48118 9.79384C5.48639 9.62136 5.49402 9.51761 5.49941 9.46178C5.50165 9.4385 5.50345 9.42423 5.50438 9.41735L5.65078 8.73035L4.93576 8.73034L1.85724 8.7303L1.85723 8.7303C1.50191 8.7303 1.23107 8.41328 1.2853 8.06319L2.24798 3.15349L2.24956 3.1454L2.25092 3.13728C2.29743 2.85822 2.53887 2.65369 2.82176 2.65369L9.27614 2.65369L9.27614 8.82866C7.89788 9.30898 6.87447 10.5005 6.61988 11.9555L6.42506 13.0689ZM11.9133 1.49994L11.9132 9.49994L13.2466 9.49994L13.2466 1.49994L11.9133 1.49994Z" fill="#727A8A"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<clipPath id="clip0_8053_26348">
|
|
7
|
+
<rect width="14" height="14" fill="white"/>
|
|
8
|
+
</clipPath>
|
|
9
|
+
</defs>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_8984_1331)">
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.95155 14.2724C6.34804 14.4288 6.74452 14.3465 7.03909 14.1325C7.32135 13.9274 7.50548 13.6096 7.56518 13.2684L7.76 12.155C7.95587 11.0356 8.7889 10.1344 9.88953 9.85137L9.99901 9.82321L10.4336 9.71144L10.4336 9.26273L10.4336 2.07497L10.4336 1.49626L9.85486 1.49625L2.82176 1.49625C1.97608 1.49625 1.2539 2.10548 1.11074 2.93808L0.147638 7.84993L0.146053 7.85802L0.144699 7.86615C-0.0316758 8.92438 0.784381 9.88773 1.85722 9.88774L1.85723 9.88774L4.32106 9.88777C4.31328 10.2799 4.3178 10.891 4.35754 11.832C4.38755 12.5424 4.59551 13.0903 4.91143 13.5001C5.22412 13.9058 5.61379 14.1391 5.95155 14.2724ZM6.42506 13.0689C6.41914 13.1027 6.4075 13.132 6.39372 13.155C6.38304 13.1727 6.37254 13.1843 6.3649 13.1911C6.17486 13.1143 5.98079 12.9915 5.82812 12.7935C5.67558 12.5956 5.53515 12.2851 5.51395 11.7831C5.47028 10.7491 5.47073 10.1393 5.48118 9.79384C5.48639 9.62136 5.49402 9.51761 5.49941 9.46178C5.50165 9.4385 5.50345 9.42423 5.50438 9.41735L5.65078 8.73035L4.93576 8.73034L1.85724 8.7303L1.85723 8.7303C1.50191 8.7303 1.23107 8.41328 1.2853 8.06319L2.24798 3.15349L2.24956 3.1454L2.25092 3.13728C2.29743 2.85822 2.53887 2.65369 2.82176 2.65369L9.27614 2.65369L9.27614 8.82866C7.89788 9.30898 6.87447 10.5005 6.61988 11.9555L6.42506 13.0689ZM11.9133 1.49994L11.9132 9.49994L13.2466 9.49994L13.2466 1.49994L11.9133 1.49994Z" fill="#22262E"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<clipPath id="clip0_8984_1331">
|
|
7
|
+
<rect width="14" height="14" fill="white"/>
|
|
8
|
+
</clipPath>
|
|
9
|
+
</defs>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_8053_26576)">
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.06425 3.19243C9.01305 1.98001 8.36747 1.47571 7.836 1.26596C7.4453 1.11177 7.07727 1.41761 7.00488 1.83136L6.81006 2.94473C6.57501 4.28806 5.57538 5.36942 4.25462 5.70911L4.14514 5.73727L4.14514 12.925L11.1782 12.925C11.744 12.925 12.2269 12.516 12.3199 11.9579L13.2845 7.03871C13.402 6.33321 12.858 5.69098 12.1428 5.69098L9.06425 5.69094C9.06425 5.69094 9.15232 5.27767 9.06425 3.19243ZM2.08675 13.5001L2.08675 5.50006L0.753417 5.50006L0.753416 13.5001L2.08675 13.5001Z" fill="url(#paint0_linear_8053_26576)"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="paint0_linear_8053_26576" x1="7.31638" y1="16.2105" x2="18.4078" y2="-7.26721" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="#1C66E5"/>
|
|
8
|
+
<stop offset="1" stop-color="#03C8FD"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<clipPath id="clip0_8053_26576">
|
|
11
|
+
<rect width="14" height="14" fill="white" transform="translate(14 14) rotate(-180)"/>
|
|
12
|
+
</clipPath>
|
|
13
|
+
</defs>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_8053_26340)">
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.04845 0.727649C7.65196 0.57117 7.25548 0.653472 6.96091 0.867493C6.67865 1.07257 6.49452 1.39045 6.43482 1.73161L6.24001 2.84498C6.04413 3.96442 5.2111 4.86556 4.11047 5.14863L4.00099 5.17679L3.56643 5.28856L3.56643 5.73727L3.56642 12.925L3.56642 13.5037L4.14514 13.5037L11.1782 13.5037C12.0239 13.5037 12.7461 12.8945 12.8893 12.0619L13.8524 7.15007L13.8539 7.14198L13.8553 7.13385C14.0317 6.07561 13.2156 5.11227 12.1428 5.11226L12.1428 5.11226L9.67894 5.11223C9.68672 4.72009 9.6822 4.109 9.64246 3.16801C9.61245 2.45757 9.40449 1.90968 9.08857 1.49987C8.77588 1.09424 8.38621 0.860948 8.04845 0.727649ZM7.57494 1.93111C7.58086 1.89728 7.5925 1.86796 7.60628 1.84505C7.61696 1.82729 7.62746 1.81573 7.6351 1.80888C7.82514 1.88567 8.01921 2.00846 8.17188 2.20652C8.32442 2.40439 8.46485 2.71487 8.48605 3.21685C8.52972 4.25092 8.52927 4.86069 8.51882 5.20616C8.51361 5.37864 8.50598 5.48239 8.50059 5.53822C8.49835 5.5615 8.49656 5.57577 8.49562 5.58265L8.34922 6.26965L9.06424 6.26966L12.1428 6.2697L12.1428 6.2697C12.4981 6.2697 12.7689 6.58672 12.7147 6.93681L11.752 11.8465L11.7504 11.8546L11.7491 11.8627C11.7026 12.1418 11.4611 12.3463 11.1782 12.3463L4.72386 12.3463L4.72386 6.17134C6.10212 5.69102 7.12553 4.49946 7.38012 3.04447L7.57494 1.93111ZM2.08675 13.5001L2.08675 5.50006L0.753417 5.50006L0.753416 13.5001L2.08675 13.5001Z" fill="#727A8A"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<clipPath id="clip0_8053_26340">
|
|
7
|
+
<rect width="14" height="14" fill="white" transform="translate(14 14) rotate(-180)"/>
|
|
8
|
+
</clipPath>
|
|
9
|
+
</defs>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_8984_1289)">
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.04845 0.727649C7.65196 0.57117 7.25548 0.653472 6.96091 0.867493C6.67865 1.07257 6.49452 1.39045 6.43482 1.73161L6.24001 2.84498C6.04413 3.96442 5.2111 4.86556 4.11047 5.14863L4.00099 5.17679L3.56643 5.28856L3.56643 5.73727L3.56642 12.925L3.56642 13.5037L4.14514 13.5037L11.1782 13.5037C12.0239 13.5037 12.7461 12.8945 12.8893 12.0619L13.8524 7.15007L13.8539 7.14198L13.8553 7.13385C14.0317 6.07561 13.2156 5.11227 12.1428 5.11226L12.1428 5.11226L9.67894 5.11223C9.68672 4.72009 9.6822 4.109 9.64246 3.16801C9.61245 2.45757 9.40449 1.90968 9.08857 1.49987C8.77588 1.09424 8.38621 0.860948 8.04845 0.727649ZM7.57494 1.93111C7.58086 1.89728 7.5925 1.86796 7.60628 1.84505C7.61696 1.82729 7.62746 1.81573 7.6351 1.80888C7.82514 1.88567 8.01921 2.00846 8.17188 2.20652C8.32442 2.40439 8.46485 2.71487 8.48605 3.21685C8.52972 4.25092 8.52927 4.86069 8.51882 5.20616C8.51361 5.37864 8.50598 5.48239 8.50059 5.53822C8.49835 5.5615 8.49656 5.57577 8.49562 5.58265L8.34922 6.26965L9.06424 6.26966L12.1428 6.2697L12.1428 6.2697C12.4981 6.2697 12.7689 6.58672 12.7147 6.93681L11.752 11.8465L11.7504 11.8546L11.7491 11.8627C11.7026 12.1418 11.4611 12.3463 11.1782 12.3463L4.72386 12.3463L4.72386 6.17134C6.10212 5.69102 7.12553 4.49946 7.38012 3.04447L7.57494 1.93111ZM2.08675 13.5001L2.08675 5.50006L0.753417 5.50006L0.753416 13.5001L2.08675 13.5001Z" fill="#22262E"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<clipPath id="clip0_8984_1289">
|
|
7
|
+
<rect width="14" height="14" fill="white" transform="translate(14 14) rotate(-180)"/>
|
|
8
|
+
</clipPath>
|
|
9
|
+
</defs>
|
|
10
|
+
</svg>
|
package/assets/files.svg
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="文件">
|
|
3
|
+
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M7.00065 3.49999L6.33398 2.16666H1.33398V14.5H14.6673V3.49999H7.00065ZM6.17661 4.83332H13.334V6.49999H2.66732V3.49999H5.50994L6.17661 4.83332ZM2.66732 7.83332V13.1667H13.334V7.83332H2.66732Z" fill="black" fill-opacity="0.4"/>
|
|
4
|
+
</g>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="12" cy="12" r="12" fill="#11A885"/>
|
|
3
|
+
<path d="M10.6037 14.1523L16.665 7.7085L17.5347 8.49115L10.6371 16.4473L6.47656 11.8036L7.32312 10.996L10.6037 14.1523Z" fill="white"/>
|
|
4
|
+
</svg>
|
package/assets/image.svg
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="图片">
|
|
3
|
+
<g id="Union">
|
|
4
|
+
<path d="M5.66602 7.16667C6.2183 7.16667 6.66602 6.71895 6.66602 6.16667C6.66602 5.61438 6.2183 5.16667 5.66602 5.16667C5.11373 5.16667 4.66602 5.61438 4.66602 6.16667C4.66602 6.71895 5.11373 7.16667 5.66602 7.16667Z" fill="black" fill-opacity="0.4"/>
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.666016 2.5V14.5H15.3327V2.5H0.666016ZM13.9993 3.83333H1.99935V10.4027L4.24217 8.51871L6.43497 9.9221L10.914 5.62228L13.9993 7.99186V3.83333ZM1.99935 13.1667V12.144L4.34912 10.1702L6.60076 11.6112L11.0107 7.37772L13.9993 9.67303V13.1667H1.99935Z" fill="black" fill-opacity="0.4"/>
|
|
6
|
+
</g>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="赞">
|
|
3
|
+
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M7.25305 1.42188L8.10572 1.56398C9.39152 1.77829 10.334 2.8908 10.334 4.19437V5.83345H13.8803C14.7043 5.83345 15.331 6.57327 15.1955 7.38595L14.0845 14.0526C14.0377 14.3329 13.8803 15.1667 13.8803 15.1667H1.33398V6.5H5.16207L7.25305 1.42188ZM2.66732 13.8333H4.66732V7.83333H2.66732V13.8333ZM8.07605 2.92511L6.00065 7.96535V13.8334H12.7693L13.8803 7.16675H9.00065V4.19437C9.00065 3.60851 8.61992 3.09984 8.07605 2.92511Z" fill="black" fill-opacity="0.4"/>
|
|
4
|
+
</g>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5C6168"><path d="M720-120H320v-520l280-280 50 50q7 7 11.5 19t4.5 23v14l-44 174h218q32 0 56 24t24 56v80q0 7-1.5 15t-4.5 15L794-168q-9 20-30 34t-44 14ZM240-640v520H80v-520h160Z"/></svg>
|
package/assets/video.svg
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="视频-打开">
|
|
3
|
+
<g id="Union">
|
|
4
|
+
<path d="M2.66667 6.5H5.33333V5.16667H2.66667V6.5Z" fill="black" fill-opacity="0.4"/>
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.6667 5.37037L16 4.16667V12.8333L12.6667 11.6296V14.5H0V2.5H12.6667V5.37037ZM14.6667 6.06575V10.9342L11.3333 9.73054V13.1667H1.33333V3.83333H11.3333V7.26946L14.6667 6.06575Z" fill="black" fill-opacity="0.4"/>
|
|
6
|
+
</g>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5C6168"><path d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h480q33 0 56.5 23.5T720-720v180l160-160v440L720-420v180q0 33-23.5 56.5T640-160H160Z"/></svg>
|
|
@@ -6,12 +6,11 @@
|
|
|
6
6
|
@click="closeChat(currentConversation.conversationID)"
|
|
7
7
|
>
|
|
8
8
|
<Icon :file="backSVG" />
|
|
9
|
-
|
|
10
9
|
</div>
|
|
11
10
|
<div class="chat-header-container">
|
|
12
11
|
<Icon v-if="!isPC" style="width:32px;" :file="customerAvatarMobile" />
|
|
13
12
|
<div :class="['chat-header-content', !isPC && 'chat-header-h5-content']">
|
|
14
|
-
{{
|
|
13
|
+
{{ currentConversationName }}
|
|
15
14
|
</div>
|
|
16
15
|
</div>
|
|
17
16
|
</div>
|
|
@@ -28,6 +27,7 @@ import Icon from '../../common/Icon.vue';
|
|
|
28
27
|
import backSVG from '../../../assets/back.svg';
|
|
29
28
|
import customerAvatarMobile from '../../../assets/customer_avatar_mobile.png';
|
|
30
29
|
import { isPC } from '../../../utils/env';
|
|
30
|
+
import state from '../../../utils/state';
|
|
31
31
|
const { ref, onMounted, onUnmounted } = vue;
|
|
32
32
|
|
|
33
33
|
interface IProps {
|
|
@@ -37,7 +37,7 @@ interface IProps {
|
|
|
37
37
|
const emits = defineEmits(['closeChat']);
|
|
38
38
|
const currentConversation = ref<IConversationModel>();
|
|
39
39
|
const currentConversationName = ref('');
|
|
40
|
-
const
|
|
40
|
+
const isTyping = ref(false);
|
|
41
41
|
|
|
42
42
|
const props = withDefaults(defineProps<IProps>(), {
|
|
43
43
|
canCloseChat: true,
|
|
@@ -48,8 +48,8 @@ onMounted(() => {
|
|
|
48
48
|
currentConversation: onCurrentConversationUpdated,
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
TUIStore.watch(StoreName.
|
|
52
|
-
|
|
51
|
+
TUIStore.watch(StoreName.CUSTOM, {
|
|
52
|
+
isTyping: onTypingStatusUpdated,
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
|
|
@@ -58,8 +58,8 @@ onUnmounted(() => {
|
|
|
58
58
|
currentConversation: onCurrentConversationUpdated,
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
TUIStore.unwatch(StoreName.
|
|
62
|
-
|
|
61
|
+
TUIStore.unwatch(StoreName.CUSTOM, {
|
|
62
|
+
isTyping: onTypingStatusUpdated,
|
|
63
63
|
});
|
|
64
64
|
});
|
|
65
65
|
|
|
@@ -69,17 +69,19 @@ const closeChat = (conversationID: string | undefined) => {
|
|
|
69
69
|
|
|
70
70
|
function onCurrentConversationUpdated(conversation: IConversationModel) {
|
|
71
71
|
currentConversation.value = conversation;
|
|
72
|
-
currentConversationName.value = currentConversation
|
|
72
|
+
currentConversationName.value = currentConversation.value?.getShowName();
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
function onTypingStatusUpdated(status: boolean) {
|
|
76
|
-
|
|
77
|
-
if (
|
|
78
|
-
currentConversationName.value
|
|
79
|
-
= TUITranslateService.t('TUIChat.对方正在输入');
|
|
76
|
+
isTyping.value = status;
|
|
77
|
+
if (isTyping.value && state.get('showTyping') === 1) {
|
|
78
|
+
currentConversationName.value = TUITranslateService.t('TUIChat.对方正在输入');
|
|
80
79
|
} else {
|
|
81
|
-
|
|
82
|
-
= currentConversation.value?.getShowName()
|
|
80
|
+
if (isPC) {
|
|
81
|
+
currentConversationName.value = currentConversation.value?.getShowName();
|
|
82
|
+
} else {
|
|
83
|
+
currentConversationName.value = TUITranslateService.t('AIDesk.Hi,我是') + currentConversation.value?.getShowName();
|
|
84
|
+
}
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
</script>
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
@closeInputToolBar="() => changeToolbarDisplayType('none')"
|
|
20
20
|
/>
|
|
21
21
|
<MessageToolbarButton
|
|
22
|
+
v-if="!(isH5 && Boolean(quoteMessage))"
|
|
22
23
|
:toolbarButtonList="props.toolbarButtonList"
|
|
23
24
|
/>
|
|
24
25
|
<MessageInputToolbar
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
!isPC && 'tui-chat-h5-message-input-toolbar'
|
|
29
30
|
]"
|
|
30
31
|
:displayType="inputToolbarDisplayType"
|
|
32
|
+
:inputToolbarList="props.inputToolbarList"
|
|
31
33
|
@insertEmoji="insertEmoji"
|
|
32
34
|
@changeToolbarDisplayType="changeToolbarDisplayType"
|
|
33
35
|
@scrollToLatestMessage="scrollToLatestMessage"
|
|
@@ -42,10 +44,12 @@
|
|
|
42
44
|
:muteText="muteText"
|
|
43
45
|
:placeholder="TUITranslateService.t('TUIChat.请输入消息')"
|
|
44
46
|
:inputToolbarDisplayType="inputToolbarDisplayType"
|
|
47
|
+
:inputToolbarList="props.inputToolbarList"
|
|
45
48
|
@changeToolbarDisplayType="changeToolbarDisplayType"
|
|
46
49
|
@emojiShow="emojiShow"
|
|
47
50
|
@toolShow="toolShow"
|
|
48
51
|
@blurToolAndEmojiH5="blurToolAndEmojiH5"
|
|
52
|
+
@messageSent="onMessageSent"
|
|
49
53
|
/>
|
|
50
54
|
<div class="input-toolbar-h5">
|
|
51
55
|
<div :class="['emoji-dialog-h5',(toolShowH5 && !emojiOpen)?'tool-dialog-h5':'']">
|
|
@@ -63,6 +67,7 @@
|
|
|
63
67
|
]"
|
|
64
68
|
:isH5ToolShow="toolShowH5"
|
|
65
69
|
:displayType="inputToolbarDisplayType"
|
|
70
|
+
:inputToolbarList="props.inputToolbarList"
|
|
66
71
|
@insertEmoji="insertEmoji"
|
|
67
72
|
@changeToolbarDisplayType="changeToolbarDisplayType"
|
|
68
73
|
@scrollToLatestMessage="scrollToLatestMessage"
|
|
@@ -81,7 +86,7 @@ import {
|
|
|
81
86
|
TUIChatEngine,
|
|
82
87
|
TUIConversationService,
|
|
83
88
|
TUIStore,
|
|
84
|
-
TUITranslateService
|
|
89
|
+
TUITranslateService,
|
|
85
90
|
} from '@tencentcloud/chat-uikit-engine';
|
|
86
91
|
import TUICore, {TUIConstants, TUILogin} from '@tencentcloud/tui-core';
|
|
87
92
|
import ChatHeader from './chat-header/index-web.vue';
|
|
@@ -89,24 +94,37 @@ import MessageList from './message-list/index-web.vue';
|
|
|
89
94
|
import MessageInput from './message-input/index-web.vue';
|
|
90
95
|
import MessageInputToolbar from './message-input-toolbar/index-web.vue';
|
|
91
96
|
import EmojiDialog from './message-input-toolbar/emoji-dialog-mobile/emoji-dialog-mobile.vue';
|
|
92
|
-
import {isH5, isPC} from '../../utils/env';
|
|
93
|
-
import {ToolbarButtonModel, ToolbarDisplayType} from '../../interface';
|
|
94
|
-
import {isSupportedLang} from '../../utils/';
|
|
97
|
+
import { isH5, isPC } from '../../utils/env';
|
|
98
|
+
import { ToolbarButtonModel, ToolbarDisplayType, InputToolbarModel } from '../../interface';
|
|
99
|
+
import { isSupportedLang } from '../../utils/';
|
|
95
100
|
import Log from '../../utils/logger';
|
|
96
101
|
import MessageToolbarButton from './message-toolbar-button/index.vue';
|
|
97
102
|
import TUILocales from '../../locales';
|
|
98
103
|
import { Toast, TOAST_TYPE } from '../common/Toast/index-web';
|
|
104
|
+
import state from '../../utils/state.js';
|
|
105
|
+
import { switchReadStatus } from '../../utils/utils';
|
|
99
106
|
|
|
100
107
|
const { ref, onMounted, onUnmounted, computed, nextTick } = vue;
|
|
101
108
|
|
|
102
109
|
interface IProps {
|
|
103
110
|
canCloseChat?: boolean;
|
|
104
|
-
SDKAppID?:number;
|
|
105
|
-
userID?:string;
|
|
106
|
-
userSig?:string;
|
|
107
|
-
robotLang?:string;
|
|
108
|
-
userLang?:string;
|
|
109
|
-
toolbarButtonList?:ToolbarButtonModel[];
|
|
111
|
+
SDKAppID?: number;
|
|
112
|
+
userID?: string;
|
|
113
|
+
userSig?: string;
|
|
114
|
+
robotLang?: string;
|
|
115
|
+
userLang?: string;
|
|
116
|
+
toolbarButtonList?: ToolbarButtonModel[];
|
|
117
|
+
showAvatar?: number;
|
|
118
|
+
robotAvatar?: string;
|
|
119
|
+
staffAvatar?: string;
|
|
120
|
+
userAvatar?: string;
|
|
121
|
+
showNickName?: number;
|
|
122
|
+
robotNickName?: string;
|
|
123
|
+
staffNickName?: string;
|
|
124
|
+
userNickName?: string;
|
|
125
|
+
inputToolbarList?: InputToolbarModel[];
|
|
126
|
+
showReadStatus?: number;
|
|
127
|
+
showTyping?: number;
|
|
110
128
|
}
|
|
111
129
|
|
|
112
130
|
const emits = defineEmits(['closeChat']);
|
|
@@ -120,14 +138,24 @@ const messageListRef = ref<InstanceType<typeof MessageList>>();
|
|
|
120
138
|
const emojiOpen = ref(false);
|
|
121
139
|
const toolShowH5 = ref(false);
|
|
122
140
|
const languages = Object.keys(TUILocales);
|
|
141
|
+
const quoteMessage = ref<IMessageModel>();
|
|
123
142
|
const props = withDefaults(defineProps<IProps>(), {
|
|
124
143
|
canCloseChat: true,
|
|
125
144
|
SDKAppID: 0,
|
|
126
145
|
userID: '',
|
|
127
146
|
userSig: '',
|
|
128
147
|
robotLang: '',
|
|
129
|
-
userLang:'',
|
|
130
|
-
|
|
148
|
+
userLang: '',
|
|
149
|
+
showReadStatus: 1,
|
|
150
|
+
showAvatar: 1,
|
|
151
|
+
robotAvatar: '',
|
|
152
|
+
staffAvatar: '',
|
|
153
|
+
userAvatar: '',
|
|
154
|
+
showNickName: 0,
|
|
155
|
+
robotNickName: '',
|
|
156
|
+
staffNickName: '',
|
|
157
|
+
userNickName: '',
|
|
158
|
+
showTyping: 0,
|
|
131
159
|
});
|
|
132
160
|
|
|
133
161
|
const loginCustomerUIKit = () => {
|
|
@@ -140,6 +168,7 @@ const loginCustomerUIKit = () => {
|
|
|
140
168
|
Log.i(`login success, robotLang:${props.robotLang}`);
|
|
141
169
|
let conversationID = 'C2C@customer_service_account';
|
|
142
170
|
TUIConversationService.switchConversation(conversationID);
|
|
171
|
+
switchReadStatus(props.showReadStatus);
|
|
143
172
|
TUIChatEngine.chat.callExperimentalAPI('isFeatureEnabledForStat', Math.pow(2, 42));
|
|
144
173
|
}).catch((error) => {
|
|
145
174
|
Toast({
|
|
@@ -185,15 +214,39 @@ const initLanguage = () => {
|
|
|
185
214
|
TUITranslateService.changeLanguage(language);
|
|
186
215
|
}
|
|
187
216
|
|
|
217
|
+
const setAvatarNickName = () => {
|
|
218
|
+
state.set('avatarNickName', {
|
|
219
|
+
showAvatar: props.showAvatar,
|
|
220
|
+
showNickName: props.showNickName,
|
|
221
|
+
userAvatar: props.userAvatar,
|
|
222
|
+
staffAvatar: props.staffAvatar,
|
|
223
|
+
robotAvatar: props.robotAvatar,
|
|
224
|
+
userNickName: props.userNickName,
|
|
225
|
+
staffNickName: props.staffNickName,
|
|
226
|
+
robotNickName: props.robotNickName,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const setShowReadStatus = () => {
|
|
231
|
+
state.set('showReadStatus', props.showReadStatus);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const setShowTyping = () => {
|
|
235
|
+
state.set('showTyping', props.showTyping);
|
|
236
|
+
}
|
|
237
|
+
|
|
188
238
|
try {
|
|
189
239
|
const userContext = TUILogin.getContext();
|
|
190
|
-
if(userContext.userID == '' && props.SDKAppID!==0 && props.userID!=='' && props.userSig!==''){
|
|
240
|
+
if (userContext.userID == '' && props.SDKAppID !==0 && props.userID !=='' && props.userSig !==''){
|
|
191
241
|
loginCustomerUIKit();
|
|
192
242
|
if (props.robotLang && !isSupportedLang(props.robotLang)) {
|
|
193
243
|
Log.w(`robotLang:${props.robotLang} is not supported`);
|
|
194
244
|
}
|
|
195
245
|
}
|
|
196
246
|
initLanguage();
|
|
247
|
+
setAvatarNickName();
|
|
248
|
+
setShowReadStatus();
|
|
249
|
+
setShowTyping();
|
|
197
250
|
} catch (e) {
|
|
198
251
|
console.log(e)
|
|
199
252
|
}
|
|
@@ -205,6 +258,9 @@ onMounted(() => {
|
|
|
205
258
|
TUIStore.watch(StoreName.USER, {
|
|
206
259
|
kickedOut: onKickedOut
|
|
207
260
|
});
|
|
261
|
+
TUIStore.watch(StoreName.CHAT, {
|
|
262
|
+
quoteMessage: onQuoteMessageUpdated,
|
|
263
|
+
});
|
|
208
264
|
});
|
|
209
265
|
|
|
210
266
|
onUnmounted(() => {
|
|
@@ -214,6 +270,9 @@ onUnmounted(() => {
|
|
|
214
270
|
TUIStore.unwatch(StoreName.USER, {
|
|
215
271
|
kickedOut: onKickedOut
|
|
216
272
|
});
|
|
273
|
+
TUIStore.unwatch(StoreName.CHAT, {
|
|
274
|
+
quoteMessage: onQuoteMessageUpdated,
|
|
275
|
+
});
|
|
217
276
|
});
|
|
218
277
|
|
|
219
278
|
const isInputToolbarShow = computed<boolean>(() => {
|
|
@@ -236,6 +295,11 @@ const sendMessage = () => {
|
|
|
236
295
|
messageInputRef.value?.sendMessage();
|
|
237
296
|
}
|
|
238
297
|
|
|
298
|
+
const onMessageSent = () => {
|
|
299
|
+
// 发送消息后列表滚动到底部
|
|
300
|
+
messageListRef.value?.scrollToLatestMessage();
|
|
301
|
+
}
|
|
302
|
+
|
|
239
303
|
const handleEditor = (message: IMessageModel, type: string) => {
|
|
240
304
|
if (!message || !type) return;
|
|
241
305
|
switch (type) {
|
|
@@ -313,7 +377,17 @@ function blurToolAndEmojiH5(){
|
|
|
313
377
|
emojiOpen.value = false;
|
|
314
378
|
}
|
|
315
379
|
toolShowH5.value = false;
|
|
380
|
+
}
|
|
316
381
|
|
|
382
|
+
function onQuoteMessageUpdated(options?: {
|
|
383
|
+
message: IMessageModel;
|
|
384
|
+
type: string;
|
|
385
|
+
}) {
|
|
386
|
+
if (options?.message && options?.type === 'quote') {
|
|
387
|
+
quoteMessage.value = options.message;
|
|
388
|
+
} else {
|
|
389
|
+
quoteMessage.value = undefined;
|
|
390
|
+
}
|
|
317
391
|
}
|
|
318
392
|
</script>
|
|
319
393
|
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
:enableInput="props.enableInput"
|
|
16
16
|
:enableTyping="props.enableTyping"
|
|
17
17
|
:enableDragUpload="props.enableDragUpload"
|
|
18
|
+
:hasInputTool="shouldShowToolbar"
|
|
19
|
+
:hasEmojiTool="shouldShowEmoji"
|
|
18
20
|
@sendMessage="sendMessage"
|
|
19
21
|
@onTyping="onTyping"
|
|
20
22
|
@blurToolAndEmojiH5="blurToolAndEmojiH5"
|
|
@@ -24,10 +26,10 @@
|
|
|
24
26
|
v-if="!props.isMuted && isPC"
|
|
25
27
|
@sendMessage="sendMessage"
|
|
26
28
|
/>
|
|
27
|
-
<div v-if="isH5" class="emoji-icon" id="emoji-icon-h5" @click="emojiShow">
|
|
29
|
+
<div v-if="isH5 && shouldShowEmoji" :class="['emoji-icon',!shouldShowToolbar && isH5 ? 'emoji-h5-no-toolbar' : '']" id="emoji-icon-h5" @click="emojiShow">
|
|
28
30
|
<Icon :file="emojiIcon" width="24px" height="24px"/>
|
|
29
31
|
</div>
|
|
30
|
-
<div v-show="isH5 && !showSendButton" class="tool-icon" @click="toolShow">
|
|
32
|
+
<div v-show="isH5 && shouldShowToolbar && !showSendButton" class="tool-icon" @click="toolShow">
|
|
31
33
|
<Icon :file="toolIcon" width="24px" height="24px"/>
|
|
32
34
|
</div>
|
|
33
35
|
<div v-show="isH5 && showSendButton" class="send-button-h5" @click="sendMessage">
|
|
@@ -55,7 +57,8 @@ import Icon from '../../common/Icon.vue';
|
|
|
55
57
|
import emojiIcon from '../../../assets/emoji.png';
|
|
56
58
|
import toolIcon from '../../../assets/more_tools.png';
|
|
57
59
|
import sendButtonIcon from '../../../assets/send_button_h5.svg';
|
|
58
|
-
|
|
60
|
+
import { INPUT_TOOLBAR_TYPE } from '../../../constant';
|
|
61
|
+
const { ref, onMounted, onBeforeUnmount, computed } = vue;
|
|
59
62
|
|
|
60
63
|
const props = defineProps({
|
|
61
64
|
placeholder: {
|
|
@@ -82,9 +85,13 @@ const props = defineProps({
|
|
|
82
85
|
type: Boolean,
|
|
83
86
|
default: true,
|
|
84
87
|
},
|
|
88
|
+
inputToolbarList: {
|
|
89
|
+
type: Array,
|
|
90
|
+
default: undefined,
|
|
91
|
+
},
|
|
85
92
|
});
|
|
86
93
|
|
|
87
|
-
const emit = defineEmits(['
|
|
94
|
+
const emit = defineEmits(['messageSent', 'resetReplyOrReference', 'onTyping','scrollToLatestMessage','changeToolbarDisplayType','insertEmoji','emojiShow','toolShow','blurToolAndEmojiH5']);
|
|
88
95
|
const editor = ref<InstanceType<typeof MessageInputEditor>>();
|
|
89
96
|
const currentConversation = ref<IConversationModel>();
|
|
90
97
|
const h5Dialog = ref<HTMLElement>();
|
|
@@ -130,7 +137,8 @@ const sendMessage = async () => {
|
|
|
130
137
|
return editor;
|
|
131
138
|
});
|
|
132
139
|
await sendMessages(editorContentList, currentConversation.value);
|
|
133
|
-
emit
|
|
140
|
+
// 注意这里不要 emit 'sendMessage',避免写出死循环
|
|
141
|
+
emit('messageSent');
|
|
134
142
|
editor.value?.resetEditor();
|
|
135
143
|
showSendButton.value = false;
|
|
136
144
|
};
|
|
@@ -162,6 +170,20 @@ const blurToolAndEmojiH5 = () =>{
|
|
|
162
170
|
emit('blurToolAndEmojiH5');
|
|
163
171
|
}
|
|
164
172
|
|
|
173
|
+
const shouldShowToolbar = computed(() => {
|
|
174
|
+
if (props.inputToolbarList !== undefined && props.inputToolbarList.length === 0) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
if (props.inputToolbarList !== undefined && props.inputToolbarList.length === 1 && props.inputToolbarList[0]?.presetId === INPUT_TOOLBAR_TYPE.EMOJI) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
return true;
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const shouldShowEmoji = computed(() => {
|
|
184
|
+
return props.inputToolbarList === undefined || props.inputToolbarList.some(item => item.presetId === INPUT_TOOLBAR_TYPE.EMOJI && item.isEnabled === 1);
|
|
185
|
+
});
|
|
186
|
+
|
|
165
187
|
defineExpose({
|
|
166
188
|
insertEmoji,
|
|
167
189
|
reEdit,
|
|
@@ -202,6 +224,10 @@ defineExpose({
|
|
|
202
224
|
border: none;
|
|
203
225
|
}
|
|
204
226
|
|
|
227
|
+
.emoji-h5-no-toolbar {
|
|
228
|
+
margin-right: 10px;
|
|
229
|
+
}
|
|
230
|
+
|
|
205
231
|
.tool-icon {
|
|
206
232
|
background: #fff;
|
|
207
233
|
margin-left: 5px;
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<div
|
|
3
3
|
:class="[
|
|
4
4
|
'message-input-editor-container',
|
|
5
|
+
isPC && !props.hasInputTool && 'message-input-editor-container-no-inputTool',
|
|
5
6
|
isH5 && 'message-input-editor-container-h5',
|
|
7
|
+
isH5 && !props.hasEmojiTool && props.hasInputTool && 'message-input-editor-container-h5-no-emoji-no-tool',
|
|
8
|
+
isH5 && !props.hasEmojiTool && !props.hasInputTool && 'message-input-editor-container-h5-no-emoji',
|
|
6
9
|
]"
|
|
7
10
|
>
|
|
8
11
|
<div
|
|
@@ -74,6 +77,14 @@ const props = defineProps({
|
|
|
74
77
|
type: Boolean,
|
|
75
78
|
default: true,
|
|
76
79
|
},
|
|
80
|
+
hasEmojiTool: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: true,
|
|
83
|
+
},
|
|
84
|
+
hasInputTool: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: true,
|
|
87
|
+
}
|
|
77
88
|
});
|
|
78
89
|
|
|
79
90
|
const emits = defineEmits(['sendMessage', 'onTyping', 'blurToolAndEmojiH5', 'isInputNotEmpty']);
|
|
@@ -715,6 +726,10 @@ defineExpose({
|
|
|
715
726
|
padding: 3px 10px 10px;
|
|
716
727
|
}
|
|
717
728
|
|
|
729
|
+
&-container-no-inputTool {
|
|
730
|
+
padding: 10px 10px 10px;
|
|
731
|
+
}
|
|
732
|
+
|
|
718
733
|
&-area {
|
|
719
734
|
box-sizing: border-box;
|
|
720
735
|
font-family: PingFangSC-Regular;
|
|
@@ -766,6 +781,7 @@ defineExpose({
|
|
|
766
781
|
hyphens: auto;
|
|
767
782
|
word-break: keep-all;
|
|
768
783
|
overflow-wrap: break-word;
|
|
784
|
+
word-break: normal;
|
|
769
785
|
flex-wrap: wrap;
|
|
770
786
|
.custom-image,
|
|
771
787
|
.custom-image-emoji {
|
|
@@ -787,6 +803,15 @@ defineExpose({
|
|
|
787
803
|
}
|
|
788
804
|
}
|
|
789
805
|
}
|
|
806
|
+
|
|
807
|
+
.message-input-editor-container-h5-no-emoji {
|
|
808
|
+
border-radius: 10px;
|
|
809
|
+
margin: 10px 10px 0 10px;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
.message-input-editor-container-h5-no-emoji-no-tool {
|
|
813
|
+
border-radius: 10px;
|
|
814
|
+
}
|
|
790
815
|
</style>
|
|
791
816
|
<style lang="scss">
|
|
792
817
|
/* stylelint-disable-next-line selector-class-pattern */
|