@tencentcloud/ai-desk-customer-vue 1.1.0 → 1.3.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 +6 -0
- package/components/CustomerServiceChat/index-web.vue +3 -3
- package/components/CustomerServiceChat/message-list/index-web.vue +1 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-bubble-web.vue +14 -15
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/marked.ts +1 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-branch.vue +25 -6
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-concurrency-limit.vue +40 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-desk.vue +21 -4
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/branch-pc.vue +93 -73
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/index.vue +53 -52
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-mobile/input-mobile.vue +73 -80
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-mobile/label-mobile.vue +21 -24
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-mobile/radios-mobile.vue +115 -116
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-pc/input-pc.vue +69 -73
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-pc/label-pc.vue +21 -25
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-pc/radio-pc.vue +87 -77
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/form-mobile.vue +213 -200
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/form-pc.vue +122 -113
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/index.vue +7 -7
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-order.vue +142 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rich-text.vue +5 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-stream.vue +25 -1
- package/components/CustomerServiceChat/message-list/scroll-button/index.vue +15 -3
- package/components/common/BottomPopup/index.vue +1 -1
- package/constant.ts +10 -4
- package/locales/en/aidesk.ts +3 -1
- package/locales/fil/aidesk.ts +3 -1
- package/locales/id/aidesk.ts +4 -2
- package/locales/ja/aidesk.ts +4 -2
- package/locales/ms/aidesk.ts +4 -2
- package/locales/ru/aidesk.ts +5 -3
- package/locales/th/aidesk.ts +3 -1
- package/locales/vi/aidesk.ts +4 -2
- package/locales/zh_cn/aidesk.ts +4 -3
- package/locales/zh_tw/aidesk.ts +3 -1
- package/package.json +1 -1
- package/server.ts +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -119,7 +119,7 @@ const muteText = ref('');
|
|
|
119
119
|
const messageListRef = ref<InstanceType<typeof MessageList>>();
|
|
120
120
|
const emojiOpen = ref(false);
|
|
121
121
|
const toolShowH5 = ref(false);
|
|
122
|
-
const
|
|
122
|
+
const languages = Object.keys(TUILocales);
|
|
123
123
|
const props = withDefaults(defineProps<IProps>(), {
|
|
124
124
|
canCloseChat: true,
|
|
125
125
|
SDKAppID: 0,
|
|
@@ -168,7 +168,7 @@ const initLanguage = () => {
|
|
|
168
168
|
let language;
|
|
169
169
|
if (props.userLang !== '') {
|
|
170
170
|
let userLang = convertLanguageToLowercase(props.userLang);
|
|
171
|
-
if (!
|
|
171
|
+
if (!languages.includes(userLang)) {
|
|
172
172
|
Log.w(`userLang:${props.userLang} is not supported`);
|
|
173
173
|
language = 'en';
|
|
174
174
|
} else {
|
|
@@ -176,7 +176,7 @@ const initLanguage = () => {
|
|
|
176
176
|
}
|
|
177
177
|
} else {
|
|
178
178
|
let navigatorLang = convertLanguageToLowercase(navigator.language);
|
|
179
|
-
if (!
|
|
179
|
+
if (!languages.includes(navigatorLang)) {
|
|
180
180
|
language = 'en';
|
|
181
181
|
} else {
|
|
182
182
|
language = navigatorLang;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
isNoPadding && isBlink ? 'blink-shadow' : '',
|
|
45
45
|
!isNoPadding && isBlink ? 'blink-content' : '',
|
|
46
46
|
isMultiBranchMsg?'multi-branch-message':'',
|
|
47
|
-
(
|
|
47
|
+
(isProductCardOrOrderMessage && isH5) ? 'product-order-message-bubble-h5' : (isProductCardOrOrderMessage ? 'product-order-message-bubble' : ''),
|
|
48
48
|
isPC ? '':'body-mobile',
|
|
49
49
|
]"
|
|
50
50
|
>
|
|
@@ -204,20 +204,19 @@ const hasEmojiReaction = computed(() => {
|
|
|
204
204
|
});
|
|
205
205
|
|
|
206
206
|
const isMultiBranchMsg = computed(()=>{
|
|
207
|
-
if(message.value?.type == "TIMCustomElem"){
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
if (message.value?.type == "TIMCustomElem") {
|
|
208
|
+
const src = JSON.parse(message.value.payload.data).src;
|
|
209
|
+
if (src === CUSTOM_MESSAGE_SRC.MULTI_BRANCH || src === CUSTOM_MESSAGE_SRC.BRANCH || src === CUSTOM_MESSAGE_SRC.BRANCH_NUMBER) {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
212
|
}
|
|
213
|
-
|
|
214
213
|
return false;
|
|
215
214
|
});
|
|
216
215
|
|
|
217
|
-
|
|
218
|
-
const isProductCardMessage = computed(()=>{
|
|
216
|
+
const isProductCardOrOrderMessage = computed(() => {
|
|
219
217
|
if (message.value?.type == "TIMCustomElem") {
|
|
220
|
-
|
|
218
|
+
const src = JSON.parse(message.value.payload.data).src;
|
|
219
|
+
if (src === CUSTOM_MESSAGE_SRC.PRODUCT_CARD || src === CUSTOM_MESSAGE_SRC.ORDER) {
|
|
221
220
|
return true;
|
|
222
221
|
}
|
|
223
222
|
}
|
|
@@ -395,8 +394,8 @@ function scrollTo(scrollHeight: number) {
|
|
|
395
394
|
padding-top: 5px;
|
|
396
395
|
}
|
|
397
396
|
}
|
|
398
|
-
|
|
399
|
-
|
|
397
|
+
|
|
398
|
+
|
|
400
399
|
.content-in {
|
|
401
400
|
background: #f3f4f7;
|
|
402
401
|
border-radius: 0 10px 10px;
|
|
@@ -411,12 +410,12 @@ function scrollTo(scrollHeight: number) {
|
|
|
411
410
|
border-radius: 0 10px 10px;
|
|
412
411
|
padding: 0px;
|
|
413
412
|
}
|
|
414
|
-
|
|
415
|
-
.product-message-bubble {
|
|
413
|
+
|
|
414
|
+
.product-order-message-bubble {
|
|
416
415
|
background: #f3f4f7 !important ;
|
|
417
416
|
}
|
|
418
417
|
|
|
419
|
-
.product-message-bubble-h5 {
|
|
418
|
+
.product-order-message-bubble-h5 {
|
|
420
419
|
background: #fff !important ;
|
|
421
420
|
}
|
|
422
421
|
|
|
@@ -10,7 +10,7 @@ export const marked = new Marked(
|
|
|
10
10
|
class="image-container"
|
|
11
11
|
onclick="onMarkdownImageClicked('${safeHref}')"
|
|
12
12
|
style="cursor:pointer;" >
|
|
13
|
-
<img src="${href}" alt="${text}"/>
|
|
13
|
+
<img src="${href}" alt="${text}" onload="onMarkdownImageLoad()"/>
|
|
14
14
|
</div>
|
|
15
15
|
`;
|
|
16
16
|
},
|
|
@@ -2,31 +2,32 @@
|
|
|
2
2
|
<div class="branch-card">
|
|
3
3
|
<div
|
|
4
4
|
v-if="content.header || content.title"
|
|
5
|
-
class="branch-body branch-bubble"
|
|
5
|
+
:class="['branch-body',isPC ? 'branch-bubble':'branch-bubble-h5']"
|
|
6
6
|
>
|
|
7
7
|
<Icon :src="iconQuestion" class="branch-title-icon"/>
|
|
8
8
|
{{ content.header || content.title }}
|
|
9
|
-
|
|
9
|
+
</div>
|
|
10
10
|
<div
|
|
11
11
|
v-for="(item, index) in content.items"
|
|
12
12
|
:key="index"
|
|
13
|
-
:class="['branch-body','branch-bubble','branch-item',isSelected ? 'branch-item-selected' : '']"
|
|
13
|
+
:class="['branch-body',isPC ? 'branch-bubble':'branch-bubble-h5','branch-item',isSelected ? 'branch-item-selected' : '', item.content ? '' : 'warning-item']"
|
|
14
14
|
:style="{ borderWidth: content.header ? '1px 0 0px 0' : '' }"
|
|
15
15
|
@click="handleContentListItemClick(item)"
|
|
16
16
|
>
|
|
17
|
-
{{ item.content }}
|
|
17
|
+
{{ item.content || TUITranslateService.t('AIDesk.分支选项异常') }}
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script lang="ts">
|
|
23
23
|
import vue from '../../../../../../adapter-vue';
|
|
24
|
+
import { TUITranslateService } from '@tencentcloud/chat-uikit-engine';
|
|
24
25
|
import { customerServicePayloadType } from '../../../../../../interface';
|
|
25
26
|
import iconRight from '../../../../../../assets/iconRight.svg';
|
|
26
27
|
import iconQuestion from '../../../../../../assets/icon_question.png';
|
|
27
28
|
import Icon from './customer-icon.vue';
|
|
29
|
+
import { isPC } from '../../../../../../utils/env';
|
|
28
30
|
const { computed, ref} = vue;
|
|
29
|
-
// const { computed,ref } = vue;
|
|
30
31
|
|
|
31
32
|
interface Props {
|
|
32
33
|
payload: customerServicePayloadType;
|
|
@@ -47,7 +48,7 @@ export default {
|
|
|
47
48
|
default: () => ({}),
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
|
-
emits: ['sendMessage'],
|
|
51
|
+
emits: ['sendMessage', 'heightChanged'],
|
|
51
52
|
setup(props: Props, { emit }) {
|
|
52
53
|
const isSelected = ref<boolean>(false);
|
|
53
54
|
const content = computed(() => {
|
|
@@ -60,6 +61,9 @@ export default {
|
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
const handleContentListItemClick = (branch: branchItem) => {
|
|
64
|
+
if (!branch.content) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
63
67
|
if(!isSelected.value) {
|
|
64
68
|
isSelected.value = true;
|
|
65
69
|
emit('sendMessage', { text: branch.content });
|
|
@@ -72,8 +76,13 @@ export default {
|
|
|
72
76
|
iconRight,
|
|
73
77
|
iconQuestion,
|
|
74
78
|
isSelected,
|
|
79
|
+
isPC,
|
|
80
|
+
TUITranslateService
|
|
75
81
|
};
|
|
76
82
|
},
|
|
83
|
+
mounted() {
|
|
84
|
+
this.$emit('heightChanged');
|
|
85
|
+
},
|
|
77
86
|
};
|
|
78
87
|
</script>
|
|
79
88
|
|
|
@@ -107,10 +116,18 @@ export default {
|
|
|
107
116
|
border-radius: 0 10px 10px;
|
|
108
117
|
margin-bottom: 8px;
|
|
109
118
|
}
|
|
119
|
+
.branch-bubble-h5 {
|
|
120
|
+
background: #fff;
|
|
121
|
+
border-radius: 0 10px 10px;
|
|
122
|
+
margin-bottom: 8px;
|
|
123
|
+
}
|
|
110
124
|
.branch-item {
|
|
111
125
|
color:#1c66e5;
|
|
112
126
|
cursor: pointer;
|
|
113
127
|
}
|
|
128
|
+
.warning-item {
|
|
129
|
+
color: #ff9800;
|
|
130
|
+
}
|
|
114
131
|
.branch-card {
|
|
115
132
|
min-width: 250px;
|
|
116
133
|
max-width: 350px;
|
|
@@ -125,5 +142,7 @@ export default {
|
|
|
125
142
|
}
|
|
126
143
|
.branch-title-icon {
|
|
127
144
|
margin-right: 5px;
|
|
145
|
+
align-items: flex-start !important;
|
|
146
|
+
margin-top: 2px;
|
|
128
147
|
}
|
|
129
148
|
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['message-text-container']">
|
|
3
|
+
<span class="text">{{ TUITranslateService.t('AIDesk.并发限制') }}</span>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import {TUITranslateService} from "@tencentcloud/chat-uikit-engine";
|
|
9
|
+
|
|
10
|
+
</script>
|
|
11
|
+
<style lang="scss" scoped>
|
|
12
|
+
.message-text-container {
|
|
13
|
+
display: inline;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.text-select {
|
|
17
|
+
-webkit-user-select: text;
|
|
18
|
+
-moz-user-select: text;
|
|
19
|
+
-ms-user-select: text;
|
|
20
|
+
user-select: text;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.text {
|
|
24
|
+
white-space: pre-wrap;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
text-size-adjust: none;
|
|
27
|
+
font-family: PingFangSC-Regular;
|
|
28
|
+
overflow-wrap: break-word;
|
|
29
|
+
word-break: break-all;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.text:lang(en) {
|
|
33
|
+
white-space: pre-wrap;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
text-size-adjust: none;
|
|
36
|
+
font-family: PingFangSC-Regular;
|
|
37
|
+
overflow-wrap: break-word;
|
|
38
|
+
word-break: normal;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="message-custom">
|
|
3
|
-
|
|
4
3
|
<div class="custom">
|
|
5
4
|
<div
|
|
6
5
|
v-if="
|
|
@@ -13,6 +12,7 @@
|
|
|
13
12
|
<MessageBranch
|
|
14
13
|
:payload="payload"
|
|
15
14
|
@sendMessage="sendTextMessage"
|
|
15
|
+
@heightChanged="onHeightChanged"
|
|
16
16
|
/>
|
|
17
17
|
</div>
|
|
18
18
|
<div
|
|
@@ -35,7 +35,10 @@
|
|
|
35
35
|
<MessageProductCard :payload="payload" />
|
|
36
36
|
</div>
|
|
37
37
|
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.RICH_TEXT">
|
|
38
|
-
<MessageRichText
|
|
38
|
+
<MessageRichText
|
|
39
|
+
:payload="payload"
|
|
40
|
+
@heightChanged="onHeightChanged"
|
|
41
|
+
/>
|
|
39
42
|
</div>
|
|
40
43
|
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.STREAM_TEXT">
|
|
41
44
|
<MessageStream
|
|
@@ -44,7 +47,11 @@
|
|
|
44
47
|
/>
|
|
45
48
|
</div>
|
|
46
49
|
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.MULTI_BRANCH">
|
|
47
|
-
<MessageMultiBranch
|
|
50
|
+
<MessageMultiBranch
|
|
51
|
+
:payload="payload"
|
|
52
|
+
@sendMessage="sendTextMessage"
|
|
53
|
+
@heightChanged="onHeightChanged"
|
|
54
|
+
/>
|
|
48
55
|
</div>
|
|
49
56
|
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.MULTI_FORM && message.flow == 'in'">
|
|
50
57
|
<MessageMultiForm :payload="payload"
|
|
@@ -58,6 +65,12 @@
|
|
|
58
65
|
@sendMessage="sendCustomMessage"
|
|
59
66
|
/>
|
|
60
67
|
</div>
|
|
68
|
+
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.CONCURRENCY_LIMIT">
|
|
69
|
+
<MessageConcurrencyLimit />
|
|
70
|
+
</div>
|
|
71
|
+
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.ORDER">
|
|
72
|
+
<MessageOrder :payload="payload" />
|
|
73
|
+
</div>
|
|
61
74
|
</div>
|
|
62
75
|
</div>
|
|
63
76
|
</template>
|
|
@@ -75,6 +88,8 @@ import MessageRichText from './message-rich-text.vue';
|
|
|
75
88
|
import MessageStream from './message-stream.vue';
|
|
76
89
|
import MessageMultiBranch from './message-multi-branch/index.vue';
|
|
77
90
|
import MessageMultiForm from './message-multi-form/index.vue';
|
|
91
|
+
import MessageConcurrencyLimit from "./message-concurrency-limit.vue";
|
|
92
|
+
import MessageOrder from './message-order.vue';
|
|
78
93
|
import {
|
|
79
94
|
IMessageModel,
|
|
80
95
|
TUIChatService,
|
|
@@ -93,7 +108,9 @@ export default {
|
|
|
93
108
|
MessageStream,
|
|
94
109
|
MessageMultiBranch,
|
|
95
110
|
MessageMultiForm,
|
|
96
|
-
MessageRating
|
|
111
|
+
MessageRating,
|
|
112
|
+
MessageConcurrencyLimit,
|
|
113
|
+
MessageOrder,
|
|
97
114
|
},
|
|
98
115
|
props: {
|
|
99
116
|
message: {
|
|
@@ -1,79 +1,99 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</div>
|
|
9
|
-
<div
|
|
10
|
-
v-if="props.payload.status == 0 && !isClicked"
|
|
11
|
-
v-for="(item, index) in props.payload.content.items"
|
|
12
|
-
:key="index"
|
|
13
|
-
class="form-branch-item"
|
|
14
|
-
@click="listItemClick(item)"
|
|
15
|
-
>
|
|
16
|
-
{{ item.content }}
|
|
17
|
-
</div>
|
|
2
|
+
<div class="form-branch-container">
|
|
3
|
+
<div
|
|
4
|
+
v-if="props.payload.content.header"
|
|
5
|
+
:class="['card-title-container',isPC ? 'card-title' : 'card-title-h5']"
|
|
6
|
+
>
|
|
7
|
+
{{ props.payload.content.header }}
|
|
18
8
|
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
<div
|
|
10
|
+
v-if="props.payload.status == 0 && !isClicked"
|
|
11
|
+
v-for="(item, index) in props.payload.content.items"
|
|
12
|
+
:key="index"
|
|
13
|
+
:class="['form-branch-item', item.content ? '' : 'warning-item']"
|
|
14
|
+
@click="listItemClick(item)"
|
|
15
|
+
>
|
|
16
|
+
{{ item.content || TUITranslateService.t('AIDesk.分支选项异常') }}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { TUITranslateService } from '@tencentcloud/chat-uikit-engine';
|
|
22
23
|
import { customerServicePayloadType } from '../../../../../../../interface';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
import { isPC } from '../../../../../../../utils/env'
|
|
25
|
+
interface branchItem {
|
|
26
|
+
content: string;
|
|
27
|
+
desc: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Props {
|
|
31
|
+
payload: customerServicePayloadType;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
props: {
|
|
36
|
+
payload: {
|
|
37
|
+
type: Object as () => customerServicePayloadType,
|
|
38
|
+
default: () => ({content: { header: '', items: [] },status:0}),
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
emits: ['input-click'],
|
|
42
|
+
setup(props: Props, { emit }) {
|
|
43
|
+
let isClicked = false;
|
|
44
|
+
const listItemClick = (branch: branchItem): void => {
|
|
45
|
+
if (!branch.content) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
emit('input-click', branch);
|
|
49
|
+
isClicked = true;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
props,
|
|
54
|
+
isClicked,
|
|
55
|
+
listItemClick,
|
|
56
|
+
isPC,
|
|
57
|
+
TUITranslateService
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
</script>
|
|
62
|
+
<style lang="scss">
|
|
63
|
+
.form-branch-container {
|
|
64
|
+
.card-title-container {
|
|
65
|
+
padding: 12px;
|
|
66
|
+
border-radius: 0 10px 10px;
|
|
67
|
+
width:fit-content;
|
|
68
|
+
font-family: PingFangSC-Regular;
|
|
26
69
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
payload: customerServicePayloadType;
|
|
70
|
+
.card-title {
|
|
71
|
+
background-color: #f3f4f7;
|
|
30
72
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<style lang="scss">
|
|
56
|
-
.form-branch-container {
|
|
57
|
-
.card-title {
|
|
58
|
-
background-color: #fbfbfb;
|
|
59
|
-
padding: 12px;
|
|
60
|
-
border-radius: 0 10px 10px;
|
|
61
|
-
width:fit-content;
|
|
62
|
-
font-family: PingFangSC-Regular;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.form-branch-item {
|
|
66
|
-
font-weight: 500;
|
|
67
|
-
color: rgba(54, 141, 255, 1);
|
|
68
|
-
background-color: #fbfbfb;
|
|
69
|
-
border: 1px solid rgba(0, 110, 255, 0.3);
|
|
70
|
-
padding: 12px;
|
|
71
|
-
border-radius: 25px;
|
|
72
|
-
margin-top: 8px;
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
width:fit-content;
|
|
75
|
-
font-family: PingFangSC-Regular;
|
|
76
|
-
}
|
|
73
|
+
.card-title-h5 {
|
|
74
|
+
background-color: #fff;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.form-branch-item {
|
|
78
|
+
font-weight: 500;
|
|
79
|
+
color: #1C66E5;
|
|
80
|
+
background-color: #fff;
|
|
81
|
+
border: 1px solid rgba(0, 110, 255, 0.3);
|
|
82
|
+
padding: 12px;
|
|
83
|
+
border-radius: 20px;
|
|
84
|
+
margin-top: 8px;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
line-height: 16px;
|
|
87
|
+
width:fit-content;
|
|
88
|
+
font-family: PingFangSC-Regular;
|
|
89
|
+
min-width: 50px;
|
|
90
|
+
text-align: center;
|
|
91
|
+
overflow-wrap: break-word;
|
|
92
|
+
word-wrap: break-word;
|
|
93
|
+
word-break: normal;
|
|
94
|
+
}
|
|
95
|
+
.warning-item {
|
|
96
|
+
color: #ff9800;
|
|
77
97
|
}
|
|
78
|
-
|
|
79
|
-
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
@@ -1,59 +1,60 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<div class="message-form">
|
|
3
|
+
<BranchPc
|
|
4
|
+
:payload ="payload"
|
|
5
|
+
@input-click="handleContentListItemClick"
|
|
6
|
+
/>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
payload: {
|
|
32
|
-
type: Object,
|
|
33
|
-
default: () => ({}),
|
|
34
|
-
},
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import vue from '../../../../../../../adapter-vue';
|
|
12
|
+
import BranchPc from './branch-pc.vue';
|
|
13
|
+
import { customerServicePayloadType } from '../../../../../../../interface';
|
|
14
|
+
const { computed} = vue;
|
|
15
|
+
|
|
16
|
+
interface branchItem {
|
|
17
|
+
content: string;
|
|
18
|
+
desc: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
payload: customerServicePayloadType;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
components: {
|
|
27
|
+
BranchPc
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
payload: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => ({}),
|
|
35
33
|
},
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
},
|
|
35
|
+
emits: ['sendMessage', 'heightChanged'],
|
|
36
|
+
setup(props: Props, { emit }) {
|
|
38
37
|
const payload = computed<customerServicePayloadType>(() => {
|
|
39
38
|
return props.payload;
|
|
40
39
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
const handleContentListItemClick = (branch: branchItem) => {
|
|
41
|
+
emit('sendMessage', { text: branch.content });
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const handleFormSaveInputSubmit = (text: string) => {
|
|
45
|
+
emit('sendMessage', { text });
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
payload,
|
|
49
|
+
handleContentListItemClick,
|
|
50
|
+
handleFormSaveInputSubmit,
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
mounted() {
|
|
54
|
+
this.$emit('heightChanged');
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
</script>
|
|
58
|
+
<style lang="scss">
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
</style>
|