askbot-dragon 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +27 -27
  2. package/babel.config.js +6 -6
  3. package/dragon.iml +7 -7
  4. package/package.json +56 -56
  5. package/public/index.html +43 -43
  6. package/src/App.vue +31 -31
  7. package/src/api/index.js +1 -1
  8. package/src/api/mock.http +2 -2
  9. package/src/api/requestUrl.js +185 -185
  10. package/src/assets/js/AliyunlssUtil.js +92 -92
  11. package/src/assets/js/Base64Util.js +22 -22
  12. package/src/assets/js/script.js +36 -36
  13. package/src/assets/less/common.css +6773 -6773
  14. package/src/assets/less/converSationContainer/common.less +191 -191
  15. package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
  16. package/src/assets/less/iconfont.css +37 -37
  17. package/src/assets/less/ticketMessage.less +211 -211
  18. package/src/components/ActionAlertIframe.vue +112 -112
  19. package/src/components/AiGuide.vue +467 -467
  20. package/src/components/AnswerDocknowledge.vue +131 -131
  21. package/src/components/AskIFrame.vue +15 -15
  22. package/src/components/ConversationContainer.vue +4658 -4658
  23. package/src/components/FileType.vue +86 -86
  24. package/src/components/Message.vue +27 -27
  25. package/src/components/actionSatisfaction.vue +107 -107
  26. package/src/components/actionSendToBot.vue +62 -62
  27. package/src/components/answerDissatisfaction.vue +62 -62
  28. package/src/components/answerRadio.vue +76 -76
  29. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  30. package/src/components/ask-components/Msgloading.vue +37 -37
  31. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  32. package/src/components/askVideo.vue +138 -138
  33. package/src/components/assetDetails.vue +370 -370
  34. package/src/components/assetMessage.vue +228 -228
  35. package/src/components/associationIntention.vue +269 -269
  36. package/src/components/botActionSatisfactor.vue +68 -68
  37. package/src/components/chatContent.vue +513 -513
  38. package/src/components/feedBack.vue +136 -136
  39. package/src/components/fielListView.vue +346 -346
  40. package/src/components/file/AliyunOssComponents.vue +108 -108
  41. package/src/components/formTemplate.vue +3344 -3344
  42. package/src/components/loadingProcess.vue +164 -164
  43. package/src/components/message/ActionAlertIframe.vue +112 -112
  44. package/src/components/message/ShopMessage.vue +164 -164
  45. package/src/components/message/TextMessage.vue +924 -924
  46. package/src/components/message/TicketMessage.vue +177 -177
  47. package/src/components/message/swiper/index.js +4 -4
  48. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  49. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  50. package/src/components/msgLoading.vue +231 -231
  51. package/src/components/myPopup.vue +70 -70
  52. package/src/components/popup.vue +227 -227
  53. package/src/components/receiverMessagePlatform.vue +65 -65
  54. package/src/components/recommend.vue +89 -89
  55. package/src/components/selector/hOption.vue +20 -20
  56. package/src/components/selector/hSelector.vue +199 -199
  57. package/src/components/selector/hWrapper.vue +216 -216
  58. package/src/components/senderMessagePlatform.vue +50 -50
  59. package/src/components/source/BotMessage.vue +24 -24
  60. package/src/components/source/CustomMessage.vue +24 -24
  61. package/src/components/test.vue +260 -260
  62. package/src/components/tree.vue +294 -275
  63. package/src/components/utils/AliyunIssUtil.js +72 -72
  64. package/src/components/utils/ckeditor.js +155 -155
  65. package/src/components/utils/ckeditorImageUpload/command.js +109 -109
  66. package/src/components/utils/ckeditorImageUpload/editing.js +11 -11
  67. package/src/components/utils/ckeditorImageUpload/plugin-image.js +11 -11
  68. package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +40 -40
  69. package/src/components/utils/ckeditorfileUpload/common.js +111 -111
  70. package/src/components/utils/ckeditorfileUpload/editing.js +11 -11
  71. package/src/components/utils/ckeditorfileUpload/plugin_file.js +11 -11
  72. package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +34 -34
  73. package/src/components/utils/format_date.js +25 -25
  74. package/src/components/utils/index.js +6 -6
  75. package/src/components/utils/math_utils.js +29 -29
  76. package/src/components/voiceComponent.vue +119 -119
  77. package/src/main.js +60 -60
  78. package/vue.config.js +47 -47
@@ -1,514 +1,514 @@
1
- <template>
2
- <view class="chat-message-content" id="messageContent" @touchstart="touchEvent">
3
- <view class="message-notice" v-show="connectSucess"><view class="notice-content">已为您对接专属智能助理</view></view>
4
- <view v-for="(msg, index) in messageList" :key="index">
5
- <!-- <view class="message-notice">
6
- <view class="notice-content" v-if="showTime(msg, index, messageList) && msg.time != null">{{new Date(msg.time).toISOString().slice(0, 10),}}</view>
7
- </view> -->
8
- <view class="message" v-bind:class="msg.speaker == 'user' ? 'message-kf' : 'message'">
9
- <view class="user-detail">
10
- <Msgloading v-if="msg.speaker != 'user' && msg.type == 'msg_loading'"></Msgloading>
11
- <!-- 小程序富文本组件 -->
12
- <view v-if="msg.type == 'answer_rich_text'" class="media-body">
13
- <!--<mp-html
14
- lazy-load
15
- scroll-table
16
- selectable
17
- use-anchor
18
- show-with-animation
19
- loading-img
20
- :tag-style="tagStyle"
21
- :content="msg.content.html" />-->
22
- <rich-text :nodes="msg.content.html"></rich-text>
23
- </view>
24
- <!-- <view v-if="msg.type == 'answer_rich_text'" class="media-body">
25
- <view id="msg_text"><rich-text :nodes="strings"></rich-text></view>
26
- </view> -->
27
- <!-- 欢迎语、文本组件 -->
28
- <view v-if="msg.type == 'answer_welcofmetext' || msg.type == 'answer_text'" class="media-body">
29
- <view v-if="msg.speaker == 'user'" v-html="msg.content" @click="tapName" :selectable="true" ref="msg_text" id="msg_text"></view>
30
- <view v-if="msg.speaker != 'user'">
31
- <view
32
- v-for="(span, index) in msg.mini_text"
33
- :key="index"
34
- @click="tapName"
35
- :data-content="span"
36
- :style="span.type == 'url' ? 'color: #007AFF;' : ''"
37
- >
38
- <rich-text :nodes="span.content"></rich-text>
39
- </view>
40
- </view>
41
- </view>
42
-
43
- <!-- web-view组件 -->
44
- <view v-if="msg.type == 'web_view'" class="media-body">
45
- <view class="" v-for="(webCell, webcInd) in msg.arr" :key="webcInd">
46
- <view v-show="webCell.type == 'text'"><rich-text :nodes="webCell.text"></rich-text></view>
47
- <text v-show="webCell.type == 'url'" style="color: #007AFF" class="url" @click="gotoWebview(webCell.url)">点击了解详情</text>
48
- </view>
49
- </view>
50
- <!-- 点选组件 -->
51
- <view v-if="msg.type == 'answer_radio'" class="media-body-ps">
52
- <view v-if="msg.content.description != ''" class="other" v-html="msg.content.description"></view>
53
- <view
54
- v-for="(option, ind) in msg.content.options"
55
- v-bind:class="[ind == msg.content.options.length - 1 && ind != 1 ? 'end' : '', 'ps']"
56
- :key="ind"
57
- @click="sendRadioMessage(msg.id + '_' + ind + '_' + option.value + '_' + option.name, option.name)"
58
- >
59
- {{ option.name }}
60
- <i class="arsenal_icon arsenalangle-right-solid"></i>
61
- </view>
62
- </view>
63
- <!-- 图片组件 -->
64
- <view
65
- :style="msg.type == 'answer_image' ? 'background-color: #ffffff !important;' : ''"
66
- v-if="msg.type == 'answer_image' ||msg.type == 'IMAGE'"
67
- class="media-body-image"
68
- >
69
- <img v-if="msg.content.urls!=null" :src="msg.content.urls[0]" mode="widthFix" @click="onImageClick(msg.content.urls[0])" />
70
- <img v-else :src="msg.content.url" mode="widthFix" @click="onImageClick(msg.content.url)" />
71
- </view>
72
- <!-- 等待语音组件 -->
73
- <view v-if="msg.type == 'answer_loading'" class="media-body">
74
- <view class="loading">
75
- <span></span>
76
- <span></span>
77
- <span></span>
78
- <span></span>
79
- </view>
80
- </view>
81
- <!-- 视频组件 -->
82
- <view v-if="msg.type == 'answer_video'" class="media-body-image"><video id="myVideo" :src="msg.content.url"></video></view>
83
- <view v-if="msg.type == 'VIDEO'" class="media-body-image"><video id="myVideo" :src="msg.content.url"></video></view>
84
- <!-- 反问组件 -->
85
- <view v-if="msg.type == 'action_question'" class="media-body"><view v-html="msg.content"></view></view>
86
- <!-- 满意度组件 -->
87
- <view v-if="msg.type == 'action_satisfaction'" class="media-body-ps">
88
- <view class="other" v-html="msg.content.satisfactionDes"></view>
89
- <view class="ps" @click="sendSatisfaction('user_action_to_satisfaction', '满意', msg.content.satisfactoryAnswer)">满意</view>
90
- <view class="ps end" @click="sendSatisfaction('user_action_to_satisfaction', '不满意', msg.content.unsatisfiedAnswer, msg.content.answerRadio)">
91
- 不满意
92
- </view>
93
- </view>
94
- <view v-if="msg.type == 'USER_ACTION_TO_SATISFACTION_V2' ||msg.type == 'USER_ACTION_TO_DISSATISFACTION_V2'" class="media-body">
95
- <SatisfactionV2 :message='msg'></SatisfactionV2>
96
- </view>
97
- <!-- 不满意选项 -->
98
- <view v-if="msg.type == 'answer_dissatisfaction'"
99
- class="message" v-bind:class="msg.speaker == 'user' ? 'message-kf' : 'message'">
100
- <DissatisfactionOptions :message='msg' @onOption="sendDissatisfaction"></DissatisfactionOptions>
101
-
102
- </view>
103
- <view v-if="msg.type == 'user_action_to_satisfaction' || msg.type == 'user_action_to_unsatisfactory'">
104
- <view class="media-body" v-if="msg.speaker == 'user'"><view v-html="msg.content.input"></view></view>
105
- </view>
106
- </view>
107
- </view>
108
- <view
109
- v-if="(msg.type == 'user_action_to_satisfaction' || msg.type == 'user_action_to_unsatisfactory') && msg.speaker != 'user' && msg.content != null"
110
- class="message"
111
- v-bind:class="msg.speaker == 'user' ? 'message-kf' : 'message'"
112
- >
113
- <view class="user-detail">
114
- <view class="media-body-ps">
115
- <view class="other" v-html="msg.content.reply_text"></view>
116
- <view v-if="msg.content.reply_options != null && msg.content.reply_options.length > 0">
117
- <view
118
- v-for="(reply_option, index) in msg.content.reply_options"
119
- v-bind:class="[index == msg.content.reply_options.length - 1 ? 'end' : '', 'ps']"
120
- :key="index"
121
- >
122
- <view @click="sendSatisfaction4Uni" :data-name="reply_option.name" :data-answer="reply_option.answer">{{ reply_option.name }}</view>
123
- </view>
124
- </view>
125
- </view>
126
- </view>
127
- </view>
128
- </view>
129
- </view>
130
- </template>
131
-
132
- <script>
133
- import Msgloading from "./ask-components/Msgloading";
134
- import SatisfactionV2 from "./ask-components/SatisfactionV2";
135
- import DissatisfactionOptions from "./ask-components/DissatisfactionOptions";
136
- export default {
137
- name: "chatContent",
138
- data(){
139
- return{
140
- connectSucess: false,
141
- }
142
- },
143
- components:{Msgloading,SatisfactionV2,DissatisfactionOptions},
144
- props:['messageList'],
145
- methods:{
146
- touchEvent(){
147
- this.$emit('touchEvent')
148
- },
149
- tapName(){
150
- this.$emit('tapName')
151
- },
152
- gotoWebview(url){
153
- this.$emit('gotoWebview',url)
154
- },
155
- sendRadioMessage(value, showValue){
156
- this.$emit('sendRadioMessage',value,showValue)
157
- },
158
- onImageClick(url){
159
- this.$emit('onImageClick',url)
160
- },
161
- sendDissatisfaction(options){
162
- this.$emit('sendDissatisfaction',options)
163
- },
164
- sendSatisfaction4Uni(e){
165
- this.$emit('sendSatisfaction4Uni',e)
166
- },
167
- sendSatisfaction(type, choose, answer, answerRadio){
168
- this.$emit('sendSatisfaction',type,choose,answer,answerRadio)
169
- }
170
- }
171
- }
172
- </script>
173
-
174
- <style scoped lang="less">
175
- .chat-message-content {
176
- display: flex;
177
- flex-direction: column;
178
- .message-notice {
179
- display: inline-block;
180
- text-align: center;
181
- margin-top: 10px;
182
- margin-bottom: 10px;
183
- width: 100%;
184
- background-color: transparent !important;
185
- }
186
- .notice-content {
187
- display: inline-block;
188
- padding: 5px 10px;
189
- border-radius: 5px;
190
- background-color: #F4F8FC;
191
- color: #666666;
192
- font-size: 12px;
193
- max-width: 80%;
194
- word-wrap: break-word;
195
- word-break: break-all;
196
- overflow: hidden;
197
- }
198
- .notice-content-day {
199
- display: inline-block;
200
- padding: 5px 10px;
201
- .line-left {
202
- display: inline-block;
203
- width: 100px;
204
- height: 1px;
205
- margin-bottom: 5px;
206
- margin-right: 5px;
207
- //background:#dcdcdc;
208
- background: -webkit-linear-gradient(left, #fff -4%, #666666 50%);
209
- }
210
- .line-text {
211
- color: #666666;
212
- font-size: 24px;
213
- }
214
- .line-right {
215
- display: inline-block;
216
- width: 100px;
217
- height: 1px;
218
- margin-bottom: 5px;
219
- margin-left: 5px;
220
- //background:#dcdcdc;
221
- background: -webkit-linear-gradient(left, #666666 50%, #fff 100%);
222
- }
223
- }
224
- .voiceinputting {
225
- position: absolute;
226
- top: 50%;
227
- left: 50%;
228
- }
229
- .message {
230
- display: flex;
231
- margin-bottom: 20px;
232
- justify-content: flex-start;
233
- .user-detail {
234
- display: flex;
235
- -ms-flex-align: start;
236
- align-items: flex-start;
237
- /*max-width: 80%;*/
238
- max-width: calc(100vw - 50px);
239
- .media-body-image{
240
- background-color: #F4F8FC;
241
- border: 1px solid #F4F8FC;
242
- word-break: break-word;
243
- box-shadow: 0px 0px 5px 0px rgba(76,97,255,0.38);
244
- flex: 1;
245
- border-radius: 32px;
246
- border-top-left-radius: 0px;
247
- padding: 5px 5px;
248
- image{
249
- border-radius: 32px !important;
250
- border-top-left-radius: 0px !important;
251
- }
252
- video{
253
- border-radius: 32px !important;
254
- border-top-left-radius: 0px !important;
255
- }
256
- }
257
- .media-body {
258
- //max-width: calc(100vw - 800px);
259
- //background-color: #ecebeb;
260
- background-color: #F4F8FC;
261
- border: 1px solid #F4F8FC;
262
- word-break: break-word;
263
- box-shadow: 0px 0px 5px 0px rgba(76,97,255,0.38);
264
- flex: 1;
265
- min-height: 30px;
266
- line-height: 30px;
267
- border-radius: 32px;
268
- border-top-left-radius: 0px;
269
- padding: 8px 15px;
270
- text-align: left;
271
- margin-left: 5px;
272
- h2 {
273
- font-size: 18px;
274
- }
275
- p {
276
- font-size: 14px;
277
- word-wrap: break-word;
278
- word-break: break-all;
279
- overflow: hidden;
280
- height: auto;
281
- }
282
- img{
283
- max-width: 74vw;
284
- }
285
- .voicemessage {
286
- width: 400px;
287
- height: 70px;
288
- line-height: 70px;
289
- background-color: #e8eaec;
290
- border-radius: 10px;
291
- .icon-vioce {
292
- font-size: 24px;
293
- float: left;
294
- margin-left: 40px;
295
- margin-right: 40px;
296
- }
297
- .time {
298
- font-size: 24px;
299
- margin-left: 40px;
300
- }
301
- }
302
- span {
303
- margin-bottom: 10px;
304
- font-size: 12px;
305
- color: #a3a4a5;
306
- float: left;
307
- }
308
- .botname {
309
- margin-left: 20px;
310
- float: right;
311
- }
312
- .mb-0 {
313
- margin-bottom: 0 !important;
314
- text-align: left;
315
- line-height: 1.3;
316
- margin-top: 0;
317
- font-size: 24px;
318
- }
319
- }
320
- .media-body-ps {
321
- //max-width: calc(100vw - 800px);
322
- background-color: #F4F8FC;
323
- border: 1px solid #F4F8FC;
324
- word-break: break-word;
325
- box-shadow: 0px 0px 5px 0px rgba(76,97,255,0.38);
326
- flex: 1;
327
- min-height: 30px;
328
- line-height: 30px;
329
- border-radius: 32px;
330
- border-top-left-radius: 0px;
331
- overflow: hidden;
332
- text-align: left;
333
- margin-left: 5px;
334
- h2 {
335
- font-size: 18px;
336
- }
337
- .other {
338
- font-size: 14px;
339
- word-wrap: break-word;
340
- word-break: break-all;
341
- overflow: hidden;
342
- padding: 8px 20px 8px 15px;
343
- height: auto;
344
- }
345
- .ps {
346
- padding: 8px 20px 8px 15px;
347
- height: auto;
348
- border-top: 1px solid #F4F8FC;
349
- background-color: #ffffff;
350
- color: #4C61E1;
351
- cursor: pointer;
352
- font-size: 14px;
353
- display: flex;
354
- flex-direction: row;
355
- justify-content: space-between;
356
- i{
357
- margin-left: 20px;
358
- }
359
- }
360
- .end {
361
- border: 1px solid #F4F8FC;
362
- border-bottom-left-radius: 32px !important;
363
- border-bottom-right-radius: 32px !important;
364
- }
365
- .voicemessage {
366
- width: 200px;
367
- height: 35px;
368
- line-height: 35px;
369
- background-color: #e8eaec;
370
- border-radius: 10px;
371
- .icon-vioce {
372
- font-size: 24px;
373
- float: left;
374
- margin-left: 20px;
375
- margin-right: 20px;
376
- }
377
- .time {
378
- font-size: 28px;
379
- margin-left: 20px;
380
- }
381
- }
382
- span {
383
- margin-bottom: 10px;
384
- font-size: 24px;
385
- color: #a3a4a5;
386
- float: left;
387
- }
388
- .botname {
389
- margin-left: 20px;
390
- float: right;
391
- }
392
- .mb-0 {
393
- margin-bottom: 0 !important;
394
- text-align: left;
395
- line-height: 1.3;
396
- margin-top: 0;
397
- font-size: 24px;
398
- }
399
- }
400
- }
401
- .video-player .video-js .vjs-icon-placeholder {
402
- width: 300px;
403
- height: 172px;
404
- display: block;
405
- }
406
- .el-image {
407
- float: right;
408
- width: 300px !important;
409
- height: auto !important;
410
- }
411
- }
412
- .message-kf {
413
- display: flex;
414
- margin-bottom: 20px;
415
- justify-content: flex-end;
416
- margin-right: 20px;
417
- .user-detail {
418
- display: flex;
419
- -ms-flex-align: start;
420
- align-items: flex-start;
421
- max-width: 80%;
422
- .media-body-image{
423
- border: 1px solid #4C61E1 !important;
424
- border: 1px solid #4C61E1 !important;
425
- word-break: break-word;
426
- box-shadow: 0px 0px 5px 0px rgba(76,97,255,0.38);
427
- border-radius: 32px !important;
428
- border-top-right-radius: 0px !important;
429
- padding: 5px 5px;
430
- display: flex;
431
- text-align: center;
432
- overflow: hidden;
433
- image{
434
- border-radius: 32px !important;
435
- border-top-right-radius: 0px !important;
436
- }
437
- video{
438
- border-radius: 32px !important;
439
- border-top-right-radius: 0px !important;
440
- }
441
- }
442
- .media-body {
443
- //max-width: calc(100vw - 800px);
444
- border: 1px solid #4C61E1 !important;
445
- background-color: #4C61E1 !important;
446
- color: #ffffff !important;
447
- word-break: break-word;
448
- border-radius: 32px;
449
- border-top-right-radius: 0px;
450
- padding: 8px 15px;
451
- text-align: left;
452
- h2 {
453
- font-size: 36px;
454
- }
455
- p {
456
- font-size: 28px;
457
- word-wrap: break-word;
458
- word-break: break-all;
459
- overflow: hidden;
460
- font-size: 28px;
461
- height: auto;
462
- }
463
- img{
464
- max-width: 66vw;
465
- }
466
- .voicemessage {
467
- width: 200px;
468
- height: 35px;
469
- line-height: 35px;
470
- background-color: #e8eaec;
471
- border-radius: 10px;
472
- .icon-vioce {
473
- font-size: 24px;
474
- float: left;
475
- margin-left: 20px;
476
- margin-right: 20px;
477
- }
478
- .time {
479
- font-size: 28px;
480
- margin-left: 20px;
481
- }
482
- }
483
- span {
484
- margin-bottom: 10px;
485
- font-size: 24px;
486
- color: #a3a4a5;
487
- float: left;
488
- }
489
- .botname {
490
- margin-left: 20px;
491
- float: right;
492
- }
493
- .mb-0 {
494
- margin-bottom: 0 !important;
495
- text-align: left;
496
- line-height: 1.3;
497
- margin-top: 0;
498
- font-size: 24px;
499
- }
500
- }
501
- }
502
- .video-player .video-js .vjs-icon-placeholder {
503
- width: 300px;
504
- height: 172px;
505
- display: block;
506
- }
507
- .el-image {
508
- float: right;
509
- width: 300px !important;
510
- height: auto !important;
511
- }
512
- }
513
- }
1
+ <template>
2
+ <view class="chat-message-content" id="messageContent" @touchstart="touchEvent">
3
+ <view class="message-notice" v-show="connectSucess"><view class="notice-content">已为您对接专属智能助理</view></view>
4
+ <view v-for="(msg, index) in messageList" :key="index">
5
+ <!-- <view class="message-notice">
6
+ <view class="notice-content" v-if="showTime(msg, index, messageList) && msg.time != null">{{new Date(msg.time).toISOString().slice(0, 10),}}</view>
7
+ </view> -->
8
+ <view class="message" v-bind:class="msg.speaker == 'user' ? 'message-kf' : 'message'">
9
+ <view class="user-detail">
10
+ <Msgloading v-if="msg.speaker != 'user' && msg.type == 'msg_loading'"></Msgloading>
11
+ <!-- 小程序富文本组件 -->
12
+ <view v-if="msg.type == 'answer_rich_text'" class="media-body">
13
+ <!--<mp-html
14
+ lazy-load
15
+ scroll-table
16
+ selectable
17
+ use-anchor
18
+ show-with-animation
19
+ loading-img
20
+ :tag-style="tagStyle"
21
+ :content="msg.content.html" />-->
22
+ <rich-text :nodes="msg.content.html"></rich-text>
23
+ </view>
24
+ <!-- <view v-if="msg.type == 'answer_rich_text'" class="media-body">
25
+ <view id="msg_text"><rich-text :nodes="strings"></rich-text></view>
26
+ </view> -->
27
+ <!-- 欢迎语、文本组件 -->
28
+ <view v-if="msg.type == 'answer_welcofmetext' || msg.type == 'answer_text'" class="media-body">
29
+ <view v-if="msg.speaker == 'user'" v-html="msg.content" @click="tapName" :selectable="true" ref="msg_text" id="msg_text"></view>
30
+ <view v-if="msg.speaker != 'user'">
31
+ <view
32
+ v-for="(span, index) in msg.mini_text"
33
+ :key="index"
34
+ @click="tapName"
35
+ :data-content="span"
36
+ :style="span.type == 'url' ? 'color: #007AFF;' : ''"
37
+ >
38
+ <rich-text :nodes="span.content"></rich-text>
39
+ </view>
40
+ </view>
41
+ </view>
42
+
43
+ <!-- web-view组件 -->
44
+ <view v-if="msg.type == 'web_view'" class="media-body">
45
+ <view class="" v-for="(webCell, webcInd) in msg.arr" :key="webcInd">
46
+ <view v-show="webCell.type == 'text'"><rich-text :nodes="webCell.text"></rich-text></view>
47
+ <text v-show="webCell.type == 'url'" style="color: #007AFF" class="url" @click="gotoWebview(webCell.url)">点击了解详情</text>
48
+ </view>
49
+ </view>
50
+ <!-- 点选组件 -->
51
+ <view v-if="msg.type == 'answer_radio'" class="media-body-ps">
52
+ <view v-if="msg.content.description != ''" class="other" v-html="msg.content.description"></view>
53
+ <view
54
+ v-for="(option, ind) in msg.content.options"
55
+ v-bind:class="[ind == msg.content.options.length - 1 && ind != 1 ? 'end' : '', 'ps']"
56
+ :key="ind"
57
+ @click="sendRadioMessage(msg.id + '_' + ind + '_' + option.value + '_' + option.name, option.name)"
58
+ >
59
+ {{ option.name }}
60
+ <i class="arsenal_icon arsenalangle-right-solid"></i>
61
+ </view>
62
+ </view>
63
+ <!-- 图片组件 -->
64
+ <view
65
+ :style="msg.type == 'answer_image' ? 'background-color: #ffffff !important;' : ''"
66
+ v-if="msg.type == 'answer_image' ||msg.type == 'IMAGE'"
67
+ class="media-body-image"
68
+ >
69
+ <img v-if="msg.content.urls!=null" :src="msg.content.urls[0]" mode="widthFix" @click="onImageClick(msg.content.urls[0])" />
70
+ <img v-else :src="msg.content.url" mode="widthFix" @click="onImageClick(msg.content.url)" />
71
+ </view>
72
+ <!-- 等待语音组件 -->
73
+ <view v-if="msg.type == 'answer_loading'" class="media-body">
74
+ <view class="loading">
75
+ <span></span>
76
+ <span></span>
77
+ <span></span>
78
+ <span></span>
79
+ </view>
80
+ </view>
81
+ <!-- 视频组件 -->
82
+ <view v-if="msg.type == 'answer_video'" class="media-body-image"><video id="myVideo" :src="msg.content.url"></video></view>
83
+ <view v-if="msg.type == 'VIDEO'" class="media-body-image"><video id="myVideo" :src="msg.content.url"></video></view>
84
+ <!-- 反问组件 -->
85
+ <view v-if="msg.type == 'action_question'" class="media-body"><view v-html="msg.content"></view></view>
86
+ <!-- 满意度组件 -->
87
+ <view v-if="msg.type == 'action_satisfaction'" class="media-body-ps">
88
+ <view class="other" v-html="msg.content.satisfactionDes"></view>
89
+ <view class="ps" @click="sendSatisfaction('user_action_to_satisfaction', '满意', msg.content.satisfactoryAnswer)">满意</view>
90
+ <view class="ps end" @click="sendSatisfaction('user_action_to_satisfaction', '不满意', msg.content.unsatisfiedAnswer, msg.content.answerRadio)">
91
+ 不满意
92
+ </view>
93
+ </view>
94
+ <view v-if="msg.type == 'USER_ACTION_TO_SATISFACTION_V2' ||msg.type == 'USER_ACTION_TO_DISSATISFACTION_V2'" class="media-body">
95
+ <SatisfactionV2 :message='msg'></SatisfactionV2>
96
+ </view>
97
+ <!-- 不满意选项 -->
98
+ <view v-if="msg.type == 'answer_dissatisfaction'"
99
+ class="message" v-bind:class="msg.speaker == 'user' ? 'message-kf' : 'message'">
100
+ <DissatisfactionOptions :message='msg' @onOption="sendDissatisfaction"></DissatisfactionOptions>
101
+
102
+ </view>
103
+ <view v-if="msg.type == 'user_action_to_satisfaction' || msg.type == 'user_action_to_unsatisfactory'">
104
+ <view class="media-body" v-if="msg.speaker == 'user'"><view v-html="msg.content.input"></view></view>
105
+ </view>
106
+ </view>
107
+ </view>
108
+ <view
109
+ v-if="(msg.type == 'user_action_to_satisfaction' || msg.type == 'user_action_to_unsatisfactory') && msg.speaker != 'user' && msg.content != null"
110
+ class="message"
111
+ v-bind:class="msg.speaker == 'user' ? 'message-kf' : 'message'"
112
+ >
113
+ <view class="user-detail">
114
+ <view class="media-body-ps">
115
+ <view class="other" v-html="msg.content.reply_text"></view>
116
+ <view v-if="msg.content.reply_options != null && msg.content.reply_options.length > 0">
117
+ <view
118
+ v-for="(reply_option, index) in msg.content.reply_options"
119
+ v-bind:class="[index == msg.content.reply_options.length - 1 ? 'end' : '', 'ps']"
120
+ :key="index"
121
+ >
122
+ <view @click="sendSatisfaction4Uni" :data-name="reply_option.name" :data-answer="reply_option.answer">{{ reply_option.name }}</view>
123
+ </view>
124
+ </view>
125
+ </view>
126
+ </view>
127
+ </view>
128
+ </view>
129
+ </view>
130
+ </template>
131
+
132
+ <script>
133
+ import Msgloading from "./ask-components/Msgloading";
134
+ import SatisfactionV2 from "./ask-components/SatisfactionV2";
135
+ import DissatisfactionOptions from "./ask-components/DissatisfactionOptions";
136
+ export default {
137
+ name: "chatContent",
138
+ data(){
139
+ return{
140
+ connectSucess: false,
141
+ }
142
+ },
143
+ components:{Msgloading,SatisfactionV2,DissatisfactionOptions},
144
+ props:['messageList'],
145
+ methods:{
146
+ touchEvent(){
147
+ this.$emit('touchEvent')
148
+ },
149
+ tapName(){
150
+ this.$emit('tapName')
151
+ },
152
+ gotoWebview(url){
153
+ this.$emit('gotoWebview',url)
154
+ },
155
+ sendRadioMessage(value, showValue){
156
+ this.$emit('sendRadioMessage',value,showValue)
157
+ },
158
+ onImageClick(url){
159
+ this.$emit('onImageClick',url)
160
+ },
161
+ sendDissatisfaction(options){
162
+ this.$emit('sendDissatisfaction',options)
163
+ },
164
+ sendSatisfaction4Uni(e){
165
+ this.$emit('sendSatisfaction4Uni',e)
166
+ },
167
+ sendSatisfaction(type, choose, answer, answerRadio){
168
+ this.$emit('sendSatisfaction',type,choose,answer,answerRadio)
169
+ }
170
+ }
171
+ }
172
+ </script>
173
+
174
+ <style scoped lang="less">
175
+ .chat-message-content {
176
+ display: flex;
177
+ flex-direction: column;
178
+ .message-notice {
179
+ display: inline-block;
180
+ text-align: center;
181
+ margin-top: 10px;
182
+ margin-bottom: 10px;
183
+ width: 100%;
184
+ background-color: transparent !important;
185
+ }
186
+ .notice-content {
187
+ display: inline-block;
188
+ padding: 5px 10px;
189
+ border-radius: 5px;
190
+ background-color: #F4F8FC;
191
+ color: #666666;
192
+ font-size: 12px;
193
+ max-width: 80%;
194
+ word-wrap: break-word;
195
+ word-break: break-all;
196
+ overflow: hidden;
197
+ }
198
+ .notice-content-day {
199
+ display: inline-block;
200
+ padding: 5px 10px;
201
+ .line-left {
202
+ display: inline-block;
203
+ width: 100px;
204
+ height: 1px;
205
+ margin-bottom: 5px;
206
+ margin-right: 5px;
207
+ //background:#dcdcdc;
208
+ background: -webkit-linear-gradient(left, #fff -4%, #666666 50%);
209
+ }
210
+ .line-text {
211
+ color: #666666;
212
+ font-size: 24px;
213
+ }
214
+ .line-right {
215
+ display: inline-block;
216
+ width: 100px;
217
+ height: 1px;
218
+ margin-bottom: 5px;
219
+ margin-left: 5px;
220
+ //background:#dcdcdc;
221
+ background: -webkit-linear-gradient(left, #666666 50%, #fff 100%);
222
+ }
223
+ }
224
+ .voiceinputting {
225
+ position: absolute;
226
+ top: 50%;
227
+ left: 50%;
228
+ }
229
+ .message {
230
+ display: flex;
231
+ margin-bottom: 20px;
232
+ justify-content: flex-start;
233
+ .user-detail {
234
+ display: flex;
235
+ -ms-flex-align: start;
236
+ align-items: flex-start;
237
+ /*max-width: 80%;*/
238
+ max-width: calc(100vw - 50px);
239
+ .media-body-image{
240
+ background-color: #F4F8FC;
241
+ border: 1px solid #F4F8FC;
242
+ word-break: break-word;
243
+ box-shadow: 0px 0px 5px 0px rgba(76,97,255,0.38);
244
+ flex: 1;
245
+ border-radius: 32px;
246
+ border-top-left-radius: 0px;
247
+ padding: 5px 5px;
248
+ image{
249
+ border-radius: 32px !important;
250
+ border-top-left-radius: 0px !important;
251
+ }
252
+ video{
253
+ border-radius: 32px !important;
254
+ border-top-left-radius: 0px !important;
255
+ }
256
+ }
257
+ .media-body {
258
+ //max-width: calc(100vw - 800px);
259
+ //background-color: #ecebeb;
260
+ background-color: #F4F8FC;
261
+ border: 1px solid #F4F8FC;
262
+ word-break: break-word;
263
+ box-shadow: 0px 0px 5px 0px rgba(76,97,255,0.38);
264
+ flex: 1;
265
+ min-height: 30px;
266
+ line-height: 30px;
267
+ border-radius: 32px;
268
+ border-top-left-radius: 0px;
269
+ padding: 8px 15px;
270
+ text-align: left;
271
+ margin-left: 5px;
272
+ h2 {
273
+ font-size: 18px;
274
+ }
275
+ p {
276
+ font-size: 14px;
277
+ word-wrap: break-word;
278
+ word-break: break-all;
279
+ overflow: hidden;
280
+ height: auto;
281
+ }
282
+ img{
283
+ max-width: 74vw;
284
+ }
285
+ .voicemessage {
286
+ width: 400px;
287
+ height: 70px;
288
+ line-height: 70px;
289
+ background-color: #e8eaec;
290
+ border-radius: 10px;
291
+ .icon-vioce {
292
+ font-size: 24px;
293
+ float: left;
294
+ margin-left: 40px;
295
+ margin-right: 40px;
296
+ }
297
+ .time {
298
+ font-size: 24px;
299
+ margin-left: 40px;
300
+ }
301
+ }
302
+ span {
303
+ margin-bottom: 10px;
304
+ font-size: 12px;
305
+ color: #a3a4a5;
306
+ float: left;
307
+ }
308
+ .botname {
309
+ margin-left: 20px;
310
+ float: right;
311
+ }
312
+ .mb-0 {
313
+ margin-bottom: 0 !important;
314
+ text-align: left;
315
+ line-height: 1.3;
316
+ margin-top: 0;
317
+ font-size: 24px;
318
+ }
319
+ }
320
+ .media-body-ps {
321
+ //max-width: calc(100vw - 800px);
322
+ background-color: #F4F8FC;
323
+ border: 1px solid #F4F8FC;
324
+ word-break: break-word;
325
+ box-shadow: 0px 0px 5px 0px rgba(76,97,255,0.38);
326
+ flex: 1;
327
+ min-height: 30px;
328
+ line-height: 30px;
329
+ border-radius: 32px;
330
+ border-top-left-radius: 0px;
331
+ overflow: hidden;
332
+ text-align: left;
333
+ margin-left: 5px;
334
+ h2 {
335
+ font-size: 18px;
336
+ }
337
+ .other {
338
+ font-size: 14px;
339
+ word-wrap: break-word;
340
+ word-break: break-all;
341
+ overflow: hidden;
342
+ padding: 8px 20px 8px 15px;
343
+ height: auto;
344
+ }
345
+ .ps {
346
+ padding: 8px 20px 8px 15px;
347
+ height: auto;
348
+ border-top: 1px solid #F4F8FC;
349
+ background-color: #ffffff;
350
+ color: #4C61E1;
351
+ cursor: pointer;
352
+ font-size: 14px;
353
+ display: flex;
354
+ flex-direction: row;
355
+ justify-content: space-between;
356
+ i{
357
+ margin-left: 20px;
358
+ }
359
+ }
360
+ .end {
361
+ border: 1px solid #F4F8FC;
362
+ border-bottom-left-radius: 32px !important;
363
+ border-bottom-right-radius: 32px !important;
364
+ }
365
+ .voicemessage {
366
+ width: 200px;
367
+ height: 35px;
368
+ line-height: 35px;
369
+ background-color: #e8eaec;
370
+ border-radius: 10px;
371
+ .icon-vioce {
372
+ font-size: 24px;
373
+ float: left;
374
+ margin-left: 20px;
375
+ margin-right: 20px;
376
+ }
377
+ .time {
378
+ font-size: 28px;
379
+ margin-left: 20px;
380
+ }
381
+ }
382
+ span {
383
+ margin-bottom: 10px;
384
+ font-size: 24px;
385
+ color: #a3a4a5;
386
+ float: left;
387
+ }
388
+ .botname {
389
+ margin-left: 20px;
390
+ float: right;
391
+ }
392
+ .mb-0 {
393
+ margin-bottom: 0 !important;
394
+ text-align: left;
395
+ line-height: 1.3;
396
+ margin-top: 0;
397
+ font-size: 24px;
398
+ }
399
+ }
400
+ }
401
+ .video-player .video-js .vjs-icon-placeholder {
402
+ width: 300px;
403
+ height: 172px;
404
+ display: block;
405
+ }
406
+ .el-image {
407
+ float: right;
408
+ width: 300px !important;
409
+ height: auto !important;
410
+ }
411
+ }
412
+ .message-kf {
413
+ display: flex;
414
+ margin-bottom: 20px;
415
+ justify-content: flex-end;
416
+ margin-right: 20px;
417
+ .user-detail {
418
+ display: flex;
419
+ -ms-flex-align: start;
420
+ align-items: flex-start;
421
+ max-width: 80%;
422
+ .media-body-image{
423
+ border: 1px solid #4C61E1 !important;
424
+ border: 1px solid #4C61E1 !important;
425
+ word-break: break-word;
426
+ box-shadow: 0px 0px 5px 0px rgba(76,97,255,0.38);
427
+ border-radius: 32px !important;
428
+ border-top-right-radius: 0px !important;
429
+ padding: 5px 5px;
430
+ display: flex;
431
+ text-align: center;
432
+ overflow: hidden;
433
+ image{
434
+ border-radius: 32px !important;
435
+ border-top-right-radius: 0px !important;
436
+ }
437
+ video{
438
+ border-radius: 32px !important;
439
+ border-top-right-radius: 0px !important;
440
+ }
441
+ }
442
+ .media-body {
443
+ //max-width: calc(100vw - 800px);
444
+ border: 1px solid #4C61E1 !important;
445
+ background-color: #4C61E1 !important;
446
+ color: #ffffff !important;
447
+ word-break: break-word;
448
+ border-radius: 32px;
449
+ border-top-right-radius: 0px;
450
+ padding: 8px 15px;
451
+ text-align: left;
452
+ h2 {
453
+ font-size: 36px;
454
+ }
455
+ p {
456
+ font-size: 28px;
457
+ word-wrap: break-word;
458
+ word-break: break-all;
459
+ overflow: hidden;
460
+ font-size: 28px;
461
+ height: auto;
462
+ }
463
+ img{
464
+ max-width: 66vw;
465
+ }
466
+ .voicemessage {
467
+ width: 200px;
468
+ height: 35px;
469
+ line-height: 35px;
470
+ background-color: #e8eaec;
471
+ border-radius: 10px;
472
+ .icon-vioce {
473
+ font-size: 24px;
474
+ float: left;
475
+ margin-left: 20px;
476
+ margin-right: 20px;
477
+ }
478
+ .time {
479
+ font-size: 28px;
480
+ margin-left: 20px;
481
+ }
482
+ }
483
+ span {
484
+ margin-bottom: 10px;
485
+ font-size: 24px;
486
+ color: #a3a4a5;
487
+ float: left;
488
+ }
489
+ .botname {
490
+ margin-left: 20px;
491
+ float: right;
492
+ }
493
+ .mb-0 {
494
+ margin-bottom: 0 !important;
495
+ text-align: left;
496
+ line-height: 1.3;
497
+ margin-top: 0;
498
+ font-size: 24px;
499
+ }
500
+ }
501
+ }
502
+ .video-player .video-js .vjs-icon-placeholder {
503
+ width: 300px;
504
+ height: 172px;
505
+ display: block;
506
+ }
507
+ .el-image {
508
+ float: right;
509
+ width: 300px !important;
510
+ height: auto !important;
511
+ }
512
+ }
513
+ }
514
514
  </style>