@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
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
}"
|
|
8
8
|
>
|
|
9
9
|
<div :class="(!isPC) ? 'input-quote-content-h5' :'input-quote-content'">
|
|
10
|
-
<div>
|
|
10
|
+
<div v-if="isPC" class="max-one-line">
|
|
11
|
+
{{ (quoteMessage.nick || quoteMessage.from)+ ': ' + quoteContentText }}
|
|
12
|
+
</div>
|
|
13
|
+
<div v-else class="input-quote-message-h5 max-one-line">
|
|
14
|
+
<div class="input-quote-sender-h5">
|
|
15
|
+
{{ (quoteMessage.nick || quoteMessage.from) }}
|
|
16
|
+
</div>
|
|
11
17
|
<div class="max-one-line">
|
|
12
|
-
|
|
18
|
+
{{ quoteContentText }}
|
|
13
19
|
</div>
|
|
14
20
|
</div>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
<Icon
|
|
22
|
+
class="input-quote-close-icon"
|
|
23
|
+
:file="closeIcon"
|
|
24
|
+
width="11px"
|
|
25
|
+
height="11px"
|
|
26
|
+
@onClick="cancelQuote"
|
|
27
|
+
/>
|
|
24
28
|
</div>
|
|
25
29
|
</div>
|
|
26
30
|
</template>
|
|
@@ -120,7 +124,7 @@ function onQuoteMessageUpdated(options?: {
|
|
|
120
124
|
|
|
121
125
|
<style lang="scss" scoped>
|
|
122
126
|
%common-container-style {
|
|
123
|
-
margin: 5px
|
|
127
|
+
margin: 5px 30px 5px 8px;
|
|
124
128
|
display: flex;
|
|
125
129
|
flex: 0 1 auto;
|
|
126
130
|
|
|
@@ -148,15 +152,22 @@ function onQuoteMessageUpdated(options?: {
|
|
|
148
152
|
.input-quote-content-h5 {
|
|
149
153
|
display: flex;
|
|
150
154
|
justify-content: space-between;
|
|
151
|
-
background-color: #
|
|
152
|
-
padding:
|
|
155
|
+
background-color: #fff;
|
|
156
|
+
padding: 8px 16px 8px 8px;
|
|
153
157
|
font-size: 12px;
|
|
154
158
|
align-items: center;
|
|
155
|
-
line-height: 16px;
|
|
156
159
|
max-width: 100%;
|
|
160
|
+
height: 60px;
|
|
157
161
|
box-sizing: border-box;
|
|
158
162
|
width:100%;
|
|
159
163
|
|
|
164
|
+
.input-quote-message-h5 {
|
|
165
|
+
height: 100%;
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
gap: 8px;
|
|
169
|
+
}
|
|
170
|
+
|
|
160
171
|
.max-one-line {
|
|
161
172
|
flex: 0 1 auto;
|
|
162
173
|
overflow: hidden;
|
|
@@ -173,21 +184,19 @@ function onQuoteMessageUpdated(options?: {
|
|
|
173
184
|
}
|
|
174
185
|
|
|
175
186
|
.input-quote-close-icon {
|
|
176
|
-
|
|
187
|
+
margin-left: 8px;
|
|
177
188
|
}
|
|
178
189
|
}
|
|
179
190
|
|
|
180
191
|
.input-quote-container {
|
|
181
192
|
@extend %common-container-style;
|
|
182
|
-
|
|
183
|
-
max-width: 500px;
|
|
193
|
+
max-width: 700px;
|
|
184
194
|
}
|
|
185
195
|
|
|
186
196
|
|
|
187
197
|
.input-quote-container-h5 {
|
|
188
198
|
@extend %common-container-style;
|
|
189
199
|
width:100%;
|
|
190
|
-
|
|
191
|
-
margin: 5px 0 5px 0;
|
|
200
|
+
margin: 0px 0 5px 5px;
|
|
192
201
|
}
|
|
193
202
|
</style>
|
package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/emoji-picker-dialog.vue
CHANGED
|
@@ -21,41 +21,41 @@
|
|
|
21
21
|
class="emoji"
|
|
22
22
|
:src="currentTabItem.url + BASIC_EMOJI_URL_MAPPING[childrenItem]"
|
|
23
23
|
>
|
|
24
|
-
<img
|
|
25
|
-
v-else-if="currentTabItem.type === EMOJI_TYPE.BIG"
|
|
26
|
-
class="emoji-big"
|
|
27
|
-
:src="currentTabItem.url + childrenItem + '@2x.png'"
|
|
28
|
-
|
|
29
|
-
<img
|
|
30
|
-
v-else
|
|
31
|
-
class="emoji-custom emoji-big"
|
|
32
|
-
:src="currentTabItem.url + childrenItem"
|
|
33
|
-
|
|
24
|
+
<!-- <img-->
|
|
25
|
+
<!-- v-else-if="currentTabItem.type === EMOJI_TYPE.BIG"-->
|
|
26
|
+
<!-- class="emoji-big"-->
|
|
27
|
+
<!-- :src="currentTabItem.url + childrenItem + '@2x.png'"-->
|
|
28
|
+
<!-- >-->
|
|
29
|
+
<!-- <img-->
|
|
30
|
+
<!-- v-else-->
|
|
31
|
+
<!-- class="emoji-custom emoji-big"-->
|
|
32
|
+
<!-- :src="currentTabItem.url + childrenItem"-->
|
|
33
|
+
<!-- >-->
|
|
34
34
|
</li>
|
|
35
35
|
</ul>
|
|
36
36
|
<ul class="emoji-picker-tab">
|
|
37
|
-
<li
|
|
38
|
-
v-for="(item, index) in list"
|
|
39
|
-
:key="index"
|
|
40
|
-
class="emoji-picker-tab-item"
|
|
41
|
-
@click="toggleEmojiTab(index)"
|
|
42
|
-
|
|
43
|
-
<Icon
|
|
44
|
-
v-if="item.type === EMOJI_TYPE.BASIC"
|
|
45
|
-
class="icon"
|
|
46
|
-
:file="faceIcon"
|
|
47
|
-
|
|
48
|
-
<img
|
|
49
|
-
v-else-if="item.type === EMOJI_TYPE.BIG"
|
|
50
|
-
class="icon-big"
|
|
51
|
-
:src="item.url + item.list[0] + '@2x.png'"
|
|
52
|
-
|
|
53
|
-
<img
|
|
54
|
-
v-else
|
|
55
|
-
class="icon-custom icon-big"
|
|
56
|
-
:src="item.url + item.list[0]"
|
|
57
|
-
|
|
58
|
-
</li
|
|
37
|
+
<!-- <li-->
|
|
38
|
+
<!-- v-for="(item, index) in list"-->
|
|
39
|
+
<!-- :key="index"-->
|
|
40
|
+
<!-- class="emoji-picker-tab-item"-->
|
|
41
|
+
<!-- @click="toggleEmojiTab(index)"-->
|
|
42
|
+
<!-- >-->
|
|
43
|
+
<!-- <Icon-->
|
|
44
|
+
<!-- v-if="item.type === EMOJI_TYPE.BASIC"-->
|
|
45
|
+
<!-- class="icon"-->
|
|
46
|
+
<!-- :file="faceIcon"-->
|
|
47
|
+
<!-- />-->
|
|
48
|
+
<!-- <img-->
|
|
49
|
+
<!-- v-else-if="item.type === EMOJI_TYPE.BIG"-->
|
|
50
|
+
<!-- class="icon-big"-->
|
|
51
|
+
<!-- :src="item.url + item.list[0] + '@2x.png'"-->
|
|
52
|
+
<!-- >-->
|
|
53
|
+
<!-- <img-->
|
|
54
|
+
<!-- v-else-->
|
|
55
|
+
<!-- class="icon-custom icon-big"-->
|
|
56
|
+
<!-- :src="item.url + item.list[0]"-->
|
|
57
|
+
<!-- >-->
|
|
58
|
+
<!-- </li>-->
|
|
59
59
|
<li
|
|
60
60
|
v-if="isH5"
|
|
61
61
|
class="send-btn"
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
TUITranslateService
|
|
78
78
|
} from '@tencentcloud/chat-uikit-engine';
|
|
79
79
|
import Icon from '../../../common/Icon.vue';
|
|
80
|
-
import faceIcon from '../../../../assets/face.
|
|
80
|
+
import faceIcon from '../../../../assets/face.svg';
|
|
81
81
|
import { EMOJI_TYPE } from '.././../../../constant';
|
|
82
82
|
import { isPC, isH5 } from '../../../../utils/env';
|
|
83
83
|
import { IEmojiGroupList, IEmojiGroup } from '../../../../interface';
|
|
@@ -116,7 +116,7 @@ const toggleEmojiTab = (index: number) => {
|
|
|
116
116
|
currentEmojiList.value = list?.value[index]?.list;
|
|
117
117
|
// web & h5 side scroll to top
|
|
118
118
|
emojiPickerListRef?.value && (emojiPickerListRef.value.scrollTop = 0);
|
|
119
|
-
|
|
119
|
+
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
const select = (item: any, index: number) => {
|
|
@@ -128,7 +128,7 @@ const select = (item: any, index: number) => {
|
|
|
128
128
|
case EMOJI_TYPE.BASIC:
|
|
129
129
|
options.url = currentTabItem?.value?.url + BASIC_EMOJI_URL_MAPPING[item];
|
|
130
130
|
emits('insertEmoji', options);
|
|
131
|
-
|
|
131
|
+
|
|
132
132
|
break;
|
|
133
133
|
case EMOJI_TYPE.BIG:
|
|
134
134
|
sendFaceMessage(index, currentTabItem.value);
|
|
@@ -159,7 +159,7 @@ const sendFaceMessage = (index: number, listItem: IEmojiGroup) => {
|
|
|
159
159
|
|
|
160
160
|
function sendMessage() {
|
|
161
161
|
emits('sendMessage');
|
|
162
|
-
|
|
162
|
+
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
function onCurrentConversationUpdate(conversation: IConversationModel) {
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
TUITranslateService
|
|
24
24
|
} from '@tencentcloud/chat-uikit-engine';
|
|
25
25
|
import vue from '../../../../adapter-vue';
|
|
26
|
-
import faceIcon from '../../../../assets/face.
|
|
26
|
+
import faceIcon from '../../../../assets/face.svg';
|
|
27
27
|
import EmojiPickerDialog from './emoji-picker-dialog.vue';
|
|
28
28
|
import ToolbarItemContainer from '../toolbar-item-container/index.vue';
|
|
29
29
|
import { isH5 } from '../../../../utils/env';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<ToolbarItemContainer
|
|
3
3
|
:iconFile="isH5?fileIconH5:fileIcon"
|
|
4
4
|
:title="TUITranslateService.t('文件')"
|
|
5
|
-
iconWidth='
|
|
6
|
-
iconHeight='
|
|
5
|
+
iconWidth='20px'
|
|
6
|
+
iconHeight='20px'
|
|
7
7
|
:needDialog="false"
|
|
8
8
|
@onIconClick="onIconClick"
|
|
9
9
|
>
|
|
@@ -31,10 +31,10 @@ import {
|
|
|
31
31
|
} from '@tencentcloud/chat-uikit-engine';
|
|
32
32
|
import vue from '../../../../adapter-vue';
|
|
33
33
|
import ToolbarItemContainer from '../toolbar-item-container/index.vue';
|
|
34
|
-
import fileIcon from '../../../../assets/files.
|
|
34
|
+
import fileIcon from '../../../../assets/files.svg';
|
|
35
35
|
import fileIconH5 from '../../../../assets/file-h5.png';
|
|
36
36
|
import { isPC, isH5 } from '../../../../utils/env';
|
|
37
|
-
import { isEnabledMessageReadReceiptGlobal } from '../../../../utils/utils';
|
|
37
|
+
import { isEnabledMessageReadReceiptGlobal, getTo } from '../../../../utils/utils';
|
|
38
38
|
const { ref } = vue;
|
|
39
39
|
|
|
40
40
|
const inputRef = ref();
|
|
@@ -47,7 +47,7 @@ TUIStore.watch(StoreName.CONV, {
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
const onIconClick = () => {
|
|
50
|
-
|
|
50
|
+
inputRef?.value?.click && inputRef?.value?.click();
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
const sendFileMessage = (e: any) => {
|
|
@@ -55,9 +55,7 @@ const sendFileMessage = (e: any) => {
|
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
const options = {
|
|
58
|
-
to:
|
|
59
|
-
currentConversation?.value?.groupProfile?.groupID
|
|
60
|
-
|| currentConversation?.value?.userProfile?.userID,
|
|
58
|
+
to: getTo(currentConversation?.value),
|
|
61
59
|
conversationType: currentConversation?.value?.type,
|
|
62
60
|
payload: {
|
|
63
61
|
file: e?.target,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<ToolbarItemContainer
|
|
3
3
|
:iconFile="imageToolbarForShow.icon"
|
|
4
4
|
:title="imageToolbarForShow.title"
|
|
5
|
-
iconWidth='
|
|
6
|
-
iconHeight=
|
|
5
|
+
iconWidth='20px'
|
|
6
|
+
iconHeight='20px'
|
|
7
7
|
:needDialog="false"
|
|
8
8
|
@onIconClick="onIconClick"
|
|
9
9
|
:isH5ToolShow="isH5ToolShow"
|
|
@@ -35,9 +35,9 @@ import { TUIGlobal } from '@tencentcloud/universal-api';
|
|
|
35
35
|
import vue from '../../../../adapter-vue';
|
|
36
36
|
import { isPC, isH5 } from '../../../../utils/env';
|
|
37
37
|
import ToolbarItemContainer from '../toolbar-item-container/index.vue';
|
|
38
|
-
import imageIcon from '../../../../assets/image.
|
|
38
|
+
import imageIcon from '../../../../assets/image.svg';
|
|
39
39
|
import imageUniIcon from '../../../../assets/image-uni.png';
|
|
40
|
-
import { isEnabledMessageReadReceiptGlobal } from '../../../../utils/utils';
|
|
40
|
+
import { getTo, isEnabledMessageReadReceiptGlobal } from '../../../../utils/utils';
|
|
41
41
|
const { ref, computed } = vue;
|
|
42
42
|
|
|
43
43
|
const props = defineProps({
|
|
@@ -74,7 +74,7 @@ TUIStore.watch(StoreName.CONV, {
|
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
const imageToolbarForShow = computed((): { icon: string; title: string } => {
|
|
77
|
-
if(isH5){
|
|
77
|
+
if (isH5) {
|
|
78
78
|
return IMAGE_TOOLBAR_SHOW_MAP['uni_album'];
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
@@ -83,10 +83,9 @@ const imageToolbarForShow = computed((): { icon: string; title: string } => {
|
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
const onIconClick = () => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
if (inputRef.value?.click) {
|
|
87
|
+
inputRef.value.click();
|
|
88
|
+
}
|
|
90
89
|
};
|
|
91
90
|
|
|
92
91
|
const sendImageInWeb = (e: any) => {
|
|
@@ -103,7 +102,7 @@ const sendImageInWeb = (e: any) => {
|
|
|
103
102
|
// 处理视频文件
|
|
104
103
|
sendVideoMessage(e?.target);
|
|
105
104
|
}
|
|
106
|
-
|
|
105
|
+
|
|
107
106
|
e.target.value = '';
|
|
108
107
|
};
|
|
109
108
|
|
|
@@ -112,9 +111,7 @@ const sendImageMessage = (files: any) => {
|
|
|
112
111
|
return;
|
|
113
112
|
}
|
|
114
113
|
const options = {
|
|
115
|
-
to:
|
|
116
|
-
currentConversation?.value?.groupProfile?.groupID
|
|
117
|
-
|| currentConversation?.value?.userProfile?.userID,
|
|
114
|
+
to: getTo(currentConversation?.value),
|
|
118
115
|
conversationType: currentConversation?.value?.type,
|
|
119
116
|
payload: {
|
|
120
117
|
file: files,
|
|
@@ -129,9 +126,7 @@ const sendVideoMessage = (file: any) => {
|
|
|
129
126
|
return;
|
|
130
127
|
}
|
|
131
128
|
const options = {
|
|
132
|
-
to:
|
|
133
|
-
currentConversation?.value?.groupProfile?.groupID
|
|
134
|
-
|| currentConversation?.value?.userProfile?.userID,
|
|
129
|
+
to: getTo(currentConversation?.value),
|
|
135
130
|
conversationType: currentConversation?.value?.type,
|
|
136
131
|
payload: {
|
|
137
132
|
file,
|
|
@@ -11,20 +11,48 @@
|
|
|
11
11
|
!isPC && 'message-input-toolbar-h5-list',
|
|
12
12
|
]"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
<template v-if="props.inputToolbarList === undefined">
|
|
15
|
+
<EmojiPicker
|
|
16
|
+
v-if="isPC"
|
|
17
|
+
ref="emojiPickerRef"
|
|
18
|
+
@insertEmoji="insertEmoji"
|
|
19
|
+
@dialogShowInH5="dialogShowInH5"
|
|
20
|
+
@dialogCloseInH5="dialogCloseInH5"
|
|
21
|
+
@changeToolbarDisplayType="
|
|
22
|
+
(type) => emits('changeToolbarDisplayType', type)
|
|
23
|
+
"
|
|
24
|
+
:isH5EmojiShow="isH5EmojiShow"
|
|
25
|
+
@sendMessage="sendMessage"
|
|
26
|
+
/>
|
|
27
|
+
<ImageUpload imageSourceType="album" :isH5ToolShow="isH5ToolShow"/>
|
|
28
|
+
<FileUpload :isH5ToolShow="isH5ToolShow"/>
|
|
29
|
+
</template>
|
|
30
|
+
<template v-else v-for="(item, index) in props.inputToolbarList">
|
|
31
|
+
<EmojiPicker
|
|
32
|
+
v-if="isPC && item.presetId === INPUT_TOOLBAR_TYPE.EMOJI && item.isEnabled === 1"
|
|
33
|
+
ref="emojiPickerRef"
|
|
34
|
+
@insertEmoji="insertEmoji"
|
|
35
|
+
@dialogShowInH5="dialogShowInH5"
|
|
36
|
+
@dialogCloseInH5="dialogCloseInH5"
|
|
37
|
+
@changeToolbarDisplayType="
|
|
38
|
+
(type) => emits('changeToolbarDisplayType', type)
|
|
39
|
+
"
|
|
40
|
+
:isH5EmojiShow="isH5EmojiShow"
|
|
41
|
+
@sendMessage="sendMessage"
|
|
42
|
+
/>
|
|
43
|
+
<ImageUpload v-else-if="item.presetId === INPUT_TOOLBAR_TYPE.IMAGE && item.isEnabled === 1" imageSourceType="album" :isH5ToolShow="isH5ToolShow"/>
|
|
44
|
+
<FileUpload v-else-if="item.presetId === INPUT_TOOLBAR_TYPE.FILE && item.isEnabled === 1" :isH5ToolShow="isH5ToolShow"/>
|
|
45
|
+
<VideoUpload v-else-if="item.presetId === INPUT_TOOLBAR_TYPE.VIDEO && item.isEnabled === 1" videoSourceType="album" :isH5ToolShow="isH5ToolShow"/>
|
|
46
|
+
<RatingTool v-else-if="item.presetId === INPUT_TOOLBAR_TYPE.RATING && item.isEnabled === 1 && isInHumanService" :isH5ToolShow="isH5ToolShow"/>
|
|
47
|
+
<UserDefineTool
|
|
48
|
+
v-else-if="item.isEnabled === 1 && item.isPreset === 0 && item.presetId !== INPUT_TOOLBAR_TYPE.EMOJI"
|
|
49
|
+
:isH5ToolShow="isH5ToolShow"
|
|
50
|
+
:title="item.title"
|
|
51
|
+
:icon="item.icon"
|
|
52
|
+
:type="item.type"
|
|
53
|
+
:content="item.content"
|
|
54
|
+
/>
|
|
55
|
+
</template>
|
|
28
56
|
</div>
|
|
29
57
|
<div
|
|
30
58
|
v-if="isH5"
|
|
@@ -44,14 +72,18 @@ import EmojiPicker from './emoji-picker/index.vue';
|
|
|
44
72
|
import ImageUpload from './image-upload/index.vue';
|
|
45
73
|
import FileUpload from './file-upload/index.vue';
|
|
46
74
|
import VideoUpload from './video-upload/index.vue';
|
|
75
|
+
import RatingTool from './rating-tool/index.vue';
|
|
47
76
|
import { isPC, isH5 } from '../../../utils/env';
|
|
48
|
-
import { ToolbarDisplayType } from '../../../interface';
|
|
77
|
+
import { ToolbarDisplayType, InputToolbarModel } from '../../../interface';
|
|
78
|
+
import UserDefineTool from './user-define-input-tool.vue'
|
|
79
|
+
import { INPUT_TOOLBAR_TYPE } from '../../../constant';
|
|
49
80
|
const { ref, onMounted, onUnmounted, watch } = vue;
|
|
50
81
|
|
|
51
82
|
interface IProps {
|
|
52
83
|
displayType: ToolbarDisplayType;
|
|
53
|
-
isH5EmojiShow?:boolean;
|
|
54
|
-
isH5ToolShow?:boolean;
|
|
84
|
+
isH5EmojiShow?: boolean;
|
|
85
|
+
isH5ToolShow?: boolean;
|
|
86
|
+
inputToolbarList?: InputToolbarModel[];
|
|
55
87
|
}
|
|
56
88
|
interface IEmits {
|
|
57
89
|
(e: 'scrollToLatestMessage'): void;
|
|
@@ -70,17 +102,24 @@ const h5Dialog = ref<HTMLElement>();
|
|
|
70
102
|
const currentConversation = ref<IConversationModel>();
|
|
71
103
|
const isGroup = ref<boolean>(false);
|
|
72
104
|
const emojiPickerRef = ref<InstanceType<typeof EmojiPicker>>();
|
|
105
|
+
const isInHumanService = ref(false);
|
|
73
106
|
|
|
74
107
|
onMounted(() => {
|
|
75
108
|
TUIStore.watch(StoreName.CONV, {
|
|
76
109
|
currentConversation: onCurrentConversationUpdate,
|
|
77
110
|
});
|
|
111
|
+
TUIStore.watch(StoreName.CUSTOM, {
|
|
112
|
+
isInHumanService: onInHumanServiceUpdate,
|
|
113
|
+
});
|
|
78
114
|
});
|
|
79
115
|
|
|
80
116
|
onUnmounted(() => {
|
|
81
117
|
TUIStore.unwatch(StoreName.CONV, {
|
|
82
118
|
currentConversation: onCurrentConversationUpdate,
|
|
83
119
|
});
|
|
120
|
+
TUIStore.unwatch(StoreName.CUSTOM, {
|
|
121
|
+
isInHumanService: onInHumanServiceUpdate,
|
|
122
|
+
});
|
|
84
123
|
});
|
|
85
124
|
|
|
86
125
|
watch(
|
|
@@ -99,7 +138,7 @@ watch(
|
|
|
99
138
|
(newValue) => {
|
|
100
139
|
if (newValue === false) {
|
|
101
140
|
emojiPickerRef.value?.closeEmojiPicker();
|
|
102
|
-
}
|
|
141
|
+
}
|
|
103
142
|
},
|
|
104
143
|
);
|
|
105
144
|
|
|
@@ -109,6 +148,10 @@ const onCurrentConversationUpdate = (conversation: IConversationModel) => {
|
|
|
109
148
|
= currentConversation?.value?.type === TUIChatEngine.TYPES.CONV_GROUP;
|
|
110
149
|
};
|
|
111
150
|
|
|
151
|
+
const onInHumanServiceUpdate = (value: boolean) => {
|
|
152
|
+
isInHumanService.value = value;
|
|
153
|
+
};
|
|
154
|
+
|
|
112
155
|
const insertEmoji = (emojiObj: object) => {
|
|
113
156
|
emits('insertEmoji', emojiObj);
|
|
114
157
|
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ToolbarItemContainer
|
|
3
|
+
:iconFile="getIcon()"
|
|
4
|
+
:title="props.title"
|
|
5
|
+
:iconWidth="isPC ? '20px' : '25px'"
|
|
6
|
+
:iconHeight="isPC ? '20px' : '25px'"
|
|
7
|
+
:needDialog="false"
|
|
8
|
+
@onIconClick="onIconClick"
|
|
9
|
+
:isH5ToolShow="isH5ToolShow"
|
|
10
|
+
/>
|
|
11
|
+
</template>
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import {
|
|
14
|
+
TUIChatService,
|
|
15
|
+
TUIStore,
|
|
16
|
+
StoreName,
|
|
17
|
+
IConversationModel,
|
|
18
|
+
TUITranslateService,
|
|
19
|
+
} from '@tencentcloud/chat-uikit-engine';
|
|
20
|
+
import vue from '../../../../adapter-vue';
|
|
21
|
+
import { isPC, isH5 } from '../../../../utils/env';
|
|
22
|
+
import ToolbarItemContainer from '../toolbar-item-container/index.vue';
|
|
23
|
+
import ratingToolIcon from '../../../../assets/rating_tool_icon.svg'
|
|
24
|
+
import ratingToolIconH5 from '../../../../assets/rating_tool_icon_h5.svg';
|
|
25
|
+
import { getTo } from '../../../../utils/utils';
|
|
26
|
+
import { CUSTOM_MESSAGE_SRC } from '../../../../constant';
|
|
27
|
+
const { ref, onMounted, onUnmounted } = vue;
|
|
28
|
+
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
isH5ToolShow:{
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
title: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: TUITranslateService.t('AIDesk.提交评价')
|
|
37
|
+
},
|
|
38
|
+
icon: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '',
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const currentConversation = ref<IConversationModel>();
|
|
45
|
+
|
|
46
|
+
TUIStore.watch(StoreName.CONV, {
|
|
47
|
+
currentConversation: (conversation: IConversationModel) => {
|
|
48
|
+
currentConversation.value = conversation;
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const getIcon = (): string => {
|
|
53
|
+
return isH5 ? ratingToolIconH5 : ratingToolIcon;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const onIconClick = () => {
|
|
57
|
+
TUIChatService.sendCustomMessage({
|
|
58
|
+
to: getTo(currentConversation?.value),
|
|
59
|
+
conversationType: currentConversation?.value?.type,
|
|
60
|
+
payload:{
|
|
61
|
+
data:JSON.stringify({
|
|
62
|
+
src: CUSTOM_MESSAGE_SRC.USER_SATISFACTION,
|
|
63
|
+
customerServicePlugin: 0,
|
|
64
|
+
}),
|
|
65
|
+
},
|
|
66
|
+
},{ onlineUserOnly: true })
|
|
67
|
+
};
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style lang="scss" scoped>
|
|
71
|
+
@import "../../style/common";
|
|
72
|
+
</style>
|
package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/h5.scss
CHANGED
|
@@ -6,11 +6,20 @@
|
|
|
6
6
|
margin-right:15px;
|
|
7
7
|
&-title {
|
|
8
8
|
margin-top:5px;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
max-width: 85px;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
text-overflow: ellipsis;
|
|
9
14
|
}
|
|
10
15
|
&-icon{
|
|
11
16
|
background-color: #fff;
|
|
12
|
-
|
|
17
|
+
width: 40px;
|
|
13
18
|
border-radius: 10px;
|
|
19
|
+
height: 40px;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
14
23
|
}
|
|
15
24
|
&-dialog {
|
|
16
25
|
position: static !important;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ToolbarItemContainer
|
|
3
|
+
:iconFile="getIcon()"
|
|
4
|
+
:title="props.title"
|
|
5
|
+
:iconWidth="isPC ? '20px' : '25px'"
|
|
6
|
+
:iconHeight="isPC ? '20px' : '25px'"
|
|
7
|
+
:needDialog="false"
|
|
8
|
+
@onIconClick="onIconClick"
|
|
9
|
+
:isH5ToolShow="isH5ToolShow">
|
|
10
|
+
<div :class="['image-upload', !isPC && 'image-upload-h5', 'image-video']">
|
|
11
|
+
</div>
|
|
12
|
+
</ToolbarItemContainer>
|
|
13
|
+
</template>
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import {
|
|
16
|
+
TUIChatService,
|
|
17
|
+
TUIStore,
|
|
18
|
+
StoreName,
|
|
19
|
+
IConversationModel,
|
|
20
|
+
} from '@tencentcloud/chat-uikit-engine';
|
|
21
|
+
import vue from '../../../adapter-vue';
|
|
22
|
+
import { isPC } from '../../../utils/env';
|
|
23
|
+
import ToolbarItemContainer from './toolbar-item-container/index.vue';
|
|
24
|
+
import { isEnabledMessageReadReceiptGlobal, openSafeUrl, getTo } from '../../../utils/utils';
|
|
25
|
+
const { ref } = vue;
|
|
26
|
+
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
isH5ToolShow: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
title: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: ''
|
|
35
|
+
},
|
|
36
|
+
icon: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: '',
|
|
39
|
+
},
|
|
40
|
+
type: {
|
|
41
|
+
type: Number,
|
|
42
|
+
default: 1
|
|
43
|
+
},
|
|
44
|
+
content: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ''
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const currentConversation = ref<IConversationModel>();
|
|
51
|
+
|
|
52
|
+
TUIStore.watch(StoreName.CONV, {
|
|
53
|
+
currentConversation: (conversation: IConversationModel) => {
|
|
54
|
+
currentConversation.value = conversation;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const getIcon = (): string => {
|
|
59
|
+
return props.icon;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const onIconClick = () => {
|
|
63
|
+
if (props.type === 1 && props.content) {
|
|
64
|
+
TUIChatService.sendTextMessage({
|
|
65
|
+
to: getTo(currentConversation?.value),
|
|
66
|
+
conversationType: currentConversation?.value?.type,
|
|
67
|
+
payload: {
|
|
68
|
+
text: props.content
|
|
69
|
+
},
|
|
70
|
+
needReadReceipt: isEnabledMessageReadReceiptGlobal(),
|
|
71
|
+
});
|
|
72
|
+
} else if (props.type === 2 && props.content) {
|
|
73
|
+
openSafeUrl(props.content);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<style lang="scss" scoped>
|
|
79
|
+
@import "../style/common";
|
|
80
|
+
</style>
|