bhd-components 0.7.8 → 0.7.10
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/README.md +1 -1
- package/dist/a23d0ed7.esm.es5.production.js +468 -0
- package/dist/{bd8fe330.esm.es5.development.js → e7af2e4a.esm.es5.development.js} +177 -7973
- package/dist/index.esm.es5.development.css +2050 -1914
- package/dist/index.esm.es5.development.js +216 -109
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/html2canvas.test.js +8580 -0
- package/es2017/customerService/index.d.ts +2 -0
- package/es2017/customerService/index.js +211 -104
- package/es2017/customerService/index.module.less +32 -1
- package/es2017/customerService/index2.module.less +48 -4
- package/esm/customerService/html2canvas.test.js +8581 -0
- package/esm/customerService/index.d.ts +2 -0
- package/esm/customerService/index.js +215 -107
- package/esm/customerService/index.module.less +32 -1
- package/esm/customerService/index2.module.less +48 -4
- package/package.json +1 -1
- package/dist/989240e2.esm.es5.production.js +0 -485
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "highlight.js/styles/default.css";
|
|
3
|
+
import './html2canvas.test.js';
|
|
3
4
|
interface Service {
|
|
4
5
|
type: string;
|
|
5
6
|
params: any;
|
|
@@ -14,6 +15,7 @@ interface Service {
|
|
|
14
15
|
stepId?: string | number;
|
|
15
16
|
onEvent: (a: string, b: string, c: string) => {};
|
|
16
17
|
config: any;
|
|
18
|
+
screenshotAreaId: string;
|
|
17
19
|
}
|
|
18
20
|
declare const CustomerService: (props: Service) => JSX.Element;
|
|
19
21
|
export default CustomerService;
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runt
|
|
|
4
4
|
import React, { useEffect, useState, useRef } from "react";
|
|
5
5
|
import { Modal, Drawer, Input, Tooltip } from "antd";
|
|
6
6
|
import { ViewImage } from "bhd-components";
|
|
7
|
-
import html2canvas from "html2canvas";
|
|
7
|
+
// import html2canvas from "html2canvas";
|
|
8
8
|
import cssStyle from "./index.module.less";
|
|
9
9
|
import cssStyleOnline from "./index2.module.less";
|
|
10
10
|
let styles = cssStyle;
|
|
@@ -23,11 +23,12 @@ import "highlight.js/styles/default.css";
|
|
|
23
23
|
import { render } from "react-dom";
|
|
24
24
|
import Provider from "../provider";
|
|
25
25
|
const { TextArea } = Input;
|
|
26
|
+
import "./html2canvas.test.js";
|
|
26
27
|
import knowledge_icon from "./images/knowledge_icon.png";
|
|
27
28
|
// import { useMediaRecorder } from "./useMediaRecorder"; //录音使用文件
|
|
28
29
|
import { readMessage, getByteLen, serverUrl, copyText, getDataTime, getQuery, resetStyles, findParent, delegate } from "./function"; //一些方法
|
|
29
30
|
const CustomerService = (props)=>{
|
|
30
|
-
let { userData , http , urllocation , onCancel , serverName , fetchEventSource , initShowType , onEvent , stepIds , stepId , config } = props;
|
|
31
|
+
let { userData , http , urllocation , onCancel , serverName , fetchEventSource , initShowType , onEvent , stepIds , stepId , screenshotAreaId , config } = props;
|
|
31
32
|
// const { bese64String, startRecord, stopRecord } = useMediaRecorder(); //语音转文字
|
|
32
33
|
// const [voiceRecordingStatus, setVoiceRecordingStatus] = useState(3); //语音录制状态 3,语音识别完成 2,录制中, 1,录制结束
|
|
33
34
|
const [copyTextOBJ, setCopyTextObj] = useState([]); //复制的消息id
|
|
@@ -37,6 +38,7 @@ const CustomerService = (props)=>{
|
|
|
37
38
|
const [keyWord, setKeyWord] = useState(""); //搜索内容
|
|
38
39
|
const [questionsList, setQuestionsList] = useState([]); //问题列表
|
|
39
40
|
const [hotQuestionsList, setHotQuestionsList] = useState([]); //热门问题
|
|
41
|
+
// const [videoHotQuestionsList, setVideoHotQuestionsList] = useState([]); //热门问题
|
|
40
42
|
const [greetingMessage, setGreetingMessage] = useState(false); //聊天记录列表是否请求完成
|
|
41
43
|
const [pageNum, setPageNum] = useState(1); //页码
|
|
42
44
|
const [pageNumHistory, setPageNumHistory] = useState(0); //用于搜索历史记录后的页码
|
|
@@ -74,6 +76,7 @@ const CustomerService = (props)=>{
|
|
|
74
76
|
let scrollTopHei = useRef(0);
|
|
75
77
|
let isPosition = useRef(true);
|
|
76
78
|
let recommendeQuestionID = useRef([]); //推荐问题id
|
|
79
|
+
let videoHotQuestionsList = useRef([]); //视频热门问题
|
|
77
80
|
const mid = props.userData.mid;
|
|
78
81
|
const remarkable = new Remarkable({
|
|
79
82
|
highlight: function(str, lang) {
|
|
@@ -88,30 +91,51 @@ const CustomerService = (props)=>{
|
|
|
88
91
|
return ""; // use external default escaping
|
|
89
92
|
}
|
|
90
93
|
});
|
|
94
|
+
useEffect(()=>{
|
|
95
|
+
// console.log(props,'lsdkcmsdlcksd')
|
|
96
|
+
// getQuestiionsList("", 1);
|
|
97
|
+
if (props.config && props.config.type == 'video') {
|
|
98
|
+
//获取热门推荐
|
|
99
|
+
videoPageQuestiionsList(1);
|
|
100
|
+
// getQuestiionsList("", 3)
|
|
101
|
+
}
|
|
102
|
+
setShowType(initShowType);
|
|
103
|
+
//获取视频页面推荐问题
|
|
104
|
+
// videoPageQuestiionsList();
|
|
105
|
+
// scrollToBottom();
|
|
106
|
+
}, [
|
|
107
|
+
initShowType
|
|
108
|
+
]);
|
|
91
109
|
useEffect(()=>{
|
|
92
110
|
if (showType == 5) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
try {
|
|
112
|
+
setImgBese64('');
|
|
113
|
+
// html2canvas(document.getElementsByTagName('html')[0],{
|
|
114
|
+
// // ignoreElements:(element)=>{
|
|
115
|
+
// // if(element.compareDocumentPosition(dom)===2)return true
|
|
116
|
+
// // return false
|
|
117
|
+
// // }
|
|
118
|
+
// }).then((canvas)=>{
|
|
119
|
+
// console.log(canvas,22222);
|
|
120
|
+
// setTimeout(()=>{
|
|
121
|
+
let dom = document.getElementById(screenshotAreaId);
|
|
122
|
+
html2canvas(dom, {
|
|
123
|
+
useCORS: true,
|
|
124
|
+
// allowTaint: true, // 污染处理
|
|
125
|
+
scale: 1
|
|
126
|
+
}).then(function(canvas) {
|
|
127
|
+
// document.body.appendChild(canvas);
|
|
128
|
+
// document.body.appendChild(canvas);
|
|
129
|
+
console.log(canvas, 99999);
|
|
130
|
+
// var base64URL = canvas.toDataURL('image/jpeg')
|
|
131
|
+
let base64URL = canvas.toDataURL("image/jpg", 1.0);
|
|
132
|
+
setImgBese64(base64URL);
|
|
133
|
+
});
|
|
134
|
+
// },100)
|
|
135
|
+
// })
|
|
136
|
+
} catch (error) {
|
|
137
|
+
console.log(error);
|
|
138
|
+
}
|
|
115
139
|
}
|
|
116
140
|
if (showType != 1 && !firstLoad && pageCount > 0) {
|
|
117
141
|
setFirstLoad(true);
|
|
@@ -195,16 +219,21 @@ const CustomerService = (props)=>{
|
|
|
195
219
|
buttomHei,
|
|
196
220
|
showType
|
|
197
221
|
]);
|
|
222
|
+
//创建聊天室并获取聊天室列表
|
|
198
223
|
useEffect(()=>{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
224
|
+
createRooms("AI").then((res)=>{
|
|
225
|
+
setRoomId(res.data.id);
|
|
226
|
+
});
|
|
227
|
+
roomsListTimer();
|
|
228
|
+
return ()=>{
|
|
229
|
+
clearTimeout(receiveMessageTimer.current);
|
|
230
|
+
// clearTimeout(voiceCountdownTimer.current);
|
|
231
|
+
clearTimeout(listTimer.current);
|
|
232
|
+
clearTimeout(timer.current);
|
|
233
|
+
clearTimeout(roomMessage.current);
|
|
234
|
+
clearTimeout(chatRoomList.current);
|
|
235
|
+
};
|
|
236
|
+
}, []);
|
|
208
237
|
useEffect(()=>{
|
|
209
238
|
if (roomId != "") {
|
|
210
239
|
if (lastId == "") {
|
|
@@ -225,21 +254,6 @@ const CustomerService = (props)=>{
|
|
|
225
254
|
}, [
|
|
226
255
|
roomId
|
|
227
256
|
]);
|
|
228
|
-
//创建聊天室并获取聊天室列表
|
|
229
|
-
useEffect(()=>{
|
|
230
|
-
createRooms("AI").then((res)=>{
|
|
231
|
-
setRoomId(res.data.id);
|
|
232
|
-
});
|
|
233
|
-
roomsListTimer();
|
|
234
|
-
return ()=>{
|
|
235
|
-
clearTimeout(receiveMessageTimer.current);
|
|
236
|
-
// clearTimeout(voiceCountdownTimer.current);
|
|
237
|
-
clearTimeout(listTimer.current);
|
|
238
|
-
clearTimeout(timer.current);
|
|
239
|
-
clearTimeout(roomMessage.current);
|
|
240
|
-
clearTimeout(chatRoomList.current);
|
|
241
|
-
};
|
|
242
|
-
}, []);
|
|
243
257
|
//进入页面,发送打招呼信息
|
|
244
258
|
useEffect(()=>{
|
|
245
259
|
//老师的聊天窗口不发送打招呼信息
|
|
@@ -258,9 +272,8 @@ const CustomerService = (props)=>{
|
|
|
258
272
|
scrollToBottom();
|
|
259
273
|
}
|
|
260
274
|
}, [
|
|
261
|
-
greetingMessage
|
|
262
|
-
|
|
263
|
-
]);
|
|
275
|
+
greetingMessage
|
|
276
|
+
]); //hotQuestionsList
|
|
264
277
|
//查找需要复制的代码
|
|
265
278
|
const findCopyContent = (e)=>{
|
|
266
279
|
let source = findParent(e.target, styles.copyCode);
|
|
@@ -301,10 +314,9 @@ const CustomerService = (props)=>{
|
|
|
301
314
|
let questionsList = [];
|
|
302
315
|
let obj = {};
|
|
303
316
|
if (type == 1) {
|
|
304
|
-
|
|
317
|
+
console.log(hotQuestionsList, '33322221111');
|
|
305
318
|
questionsList = hotQuestionsList.map((item, index)=>{
|
|
306
319
|
if (index < 3) {
|
|
307
|
-
questionsId.push(item.id);
|
|
308
320
|
return {
|
|
309
321
|
key: "messageSource",
|
|
310
322
|
value: item.id,
|
|
@@ -315,7 +327,6 @@ const CustomerService = (props)=>{
|
|
|
315
327
|
return null;
|
|
316
328
|
}
|
|
317
329
|
});
|
|
318
|
-
recommendeQuestionID.current = questionsId; //保存推荐问题id
|
|
319
330
|
questionsList = questionsList.filter((i)=>i != null);
|
|
320
331
|
obj = {
|
|
321
332
|
roomId: roomId,
|
|
@@ -326,8 +337,9 @@ const CustomerService = (props)=>{
|
|
|
326
337
|
};
|
|
327
338
|
if (pageNumHistory <= 1) {
|
|
328
339
|
setHistoryMessageList((historyMessageList)=>{
|
|
329
|
-
let newHistoryMessageList = historyMessageList.
|
|
330
|
-
|
|
340
|
+
let newHistoryMessageList = historyMessageList.filter((e)=>e.id != '123456_date');
|
|
341
|
+
newHistoryMessageList.push(_object_spread_props(_object_spread({}, obj), {
|
|
342
|
+
id: '123456_date',
|
|
331
343
|
upvoted: false,
|
|
332
344
|
downvoted: false,
|
|
333
345
|
quotedMessage: "",
|
|
@@ -528,6 +540,38 @@ const CustomerService = (props)=>{
|
|
|
528
540
|
//点击知识库的问题,或者是点击问候消息
|
|
529
541
|
if (questions.length > 0) {
|
|
530
542
|
questions = questions[0];
|
|
543
|
+
//知识库联想的问题没有答案
|
|
544
|
+
if (!questions.answer && userData.modules.some((item)=>item.short == "AIservice")) {
|
|
545
|
+
let sendData = {
|
|
546
|
+
//相关数据
|
|
547
|
+
roomId: roomId,
|
|
548
|
+
message: questions.question,
|
|
549
|
+
quotedMessage: '',
|
|
550
|
+
regenerate: true,
|
|
551
|
+
generateUpvoteOrDownvoteMessage: false
|
|
552
|
+
};
|
|
553
|
+
if (pageNumHistory <= 1) {
|
|
554
|
+
setHistoryMessageList((historyMessageList)=>{
|
|
555
|
+
let newHistoryMessageList = historyMessageList.concat({
|
|
556
|
+
roomId: roomId,
|
|
557
|
+
sender: mid,
|
|
558
|
+
recevier: "AI",
|
|
559
|
+
message: questions.question,
|
|
560
|
+
quotedMessage: '',
|
|
561
|
+
id: "654321",
|
|
562
|
+
upvoted: false,
|
|
563
|
+
downvoted: false,
|
|
564
|
+
createdAt: getDataTime(-1),
|
|
565
|
+
extraInfo: JSON.stringify([])
|
|
566
|
+
});
|
|
567
|
+
return newHistoryMessageList;
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
setFinished(false);
|
|
571
|
+
aiSendQuestions(3, sendData, 1);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
console.log(questions, '知识库内容11111');
|
|
531
575
|
//向知识库发送问题 type 1,发送问题 2 发送答案 obj 需要的参数
|
|
532
576
|
let obj = {
|
|
533
577
|
roomId: roomId,
|
|
@@ -560,14 +604,6 @@ const CustomerService = (props)=>{
|
|
|
560
604
|
generateUpvoteOrDownvoteMessage: false
|
|
561
605
|
};
|
|
562
606
|
let imageUrl = '';
|
|
563
|
-
// if(citationContent.imageUrl){
|
|
564
|
-
// sendData.image = citationContent.imageUrl;
|
|
565
|
-
// imageUrl = citationContent.imageUrl;
|
|
566
|
-
// getBase64Image(citationContent.imageUrl).then((res)=>{
|
|
567
|
-
// console.log(res,33333);
|
|
568
|
-
// });
|
|
569
|
-
// console.log(imageUrl,'转换的bese64');
|
|
570
|
-
// }
|
|
571
607
|
if (screenshotBese64) {
|
|
572
608
|
sendData.image = screenshotBese64;
|
|
573
609
|
imageUrl = screenshotBese64;
|
|
@@ -620,9 +656,9 @@ const CustomerService = (props)=>{
|
|
|
620
656
|
}
|
|
621
657
|
console.log(type, '接受答案77777');
|
|
622
658
|
//获取下面的推荐问题
|
|
623
|
-
if
|
|
624
|
-
|
|
625
|
-
}
|
|
659
|
+
// if(type == 2){
|
|
660
|
+
// videoPageQuestiionsList(2);
|
|
661
|
+
// }
|
|
626
662
|
http.post(`${urllocation}/chat-service/public/v1.0/history-messages`, obj).then((res)=>{
|
|
627
663
|
if (res.data.id) {
|
|
628
664
|
if (pageNumHistory <= 1) {
|
|
@@ -684,6 +720,23 @@ const CustomerService = (props)=>{
|
|
|
684
720
|
});
|
|
685
721
|
});
|
|
686
722
|
}, 60 * 1000);
|
|
723
|
+
if (props.config && props.config.type == 'video' && props.config.params) {
|
|
724
|
+
let params = props.config.params;
|
|
725
|
+
let videoId = params.videoId;
|
|
726
|
+
let watchTime = params.videoProgress;
|
|
727
|
+
let courseId = getQuery('yc_id');
|
|
728
|
+
let sectionId = params.VideoBriefSummaryId;
|
|
729
|
+
obj.contexts = [
|
|
730
|
+
{
|
|
731
|
+
"type": "VIDEO",
|
|
732
|
+
"courseId": courseId,
|
|
733
|
+
"sectionId": sectionId,
|
|
734
|
+
"videoId": videoId,
|
|
735
|
+
"watchTime": watchTime
|
|
736
|
+
}
|
|
737
|
+
];
|
|
738
|
+
obj.regenerate = false;
|
|
739
|
+
}
|
|
687
740
|
let data = JSON.stringify(obj);
|
|
688
741
|
setKeyWord("");
|
|
689
742
|
setQuestionsList([]);
|
|
@@ -723,6 +776,10 @@ const CustomerService = (props)=>{
|
|
|
723
776
|
});
|
|
724
777
|
scrollToBottom();
|
|
725
778
|
}
|
|
779
|
+
if (props.config && props.config.type == 'video') {
|
|
780
|
+
//先请求问题列表
|
|
781
|
+
videoPageQuestiionsList(3);
|
|
782
|
+
}
|
|
726
783
|
//使用fetchEventSource接收数据
|
|
727
784
|
const eventSource = fetchEventSource(`${urllocation}/chat-service/public/v1.0/chat-with-ai/messages`, {
|
|
728
785
|
method: "POST",
|
|
@@ -887,9 +944,23 @@ const CustomerService = (props)=>{
|
|
|
887
944
|
} else {
|
|
888
945
|
let newHistoryMessageList2 = list1.map((item)=>{
|
|
889
946
|
message = item.message + obj.message;
|
|
947
|
+
let extraInfo = [];
|
|
948
|
+
// message = '抱歉,我暂时无法回答这样的问题。'
|
|
949
|
+
if (message == '抱歉,我暂时无法回答这样的问题。') {
|
|
950
|
+
extraInfo = videoHotQuestionsList.current.map((str, index)=>{
|
|
951
|
+
return {
|
|
952
|
+
key: "messageSource",
|
|
953
|
+
value: str.id,
|
|
954
|
+
question: str.question,
|
|
955
|
+
answer: str.answer,
|
|
956
|
+
welcomeMessage: true
|
|
957
|
+
};
|
|
958
|
+
});
|
|
959
|
+
}
|
|
890
960
|
if (item.id == id) {
|
|
891
961
|
return _object_spread_props(_object_spread({}, item), {
|
|
892
|
-
message: message
|
|
962
|
+
message: message,
|
|
963
|
+
extraInfo: extraInfo == null ? item.extraInfo : JSON.stringify(extraInfo)
|
|
893
964
|
});
|
|
894
965
|
} else {
|
|
895
966
|
return item;
|
|
@@ -1205,15 +1276,14 @@ const CustomerService = (props)=>{
|
|
|
1205
1276
|
} else if (flag == 3) {
|
|
1206
1277
|
data = {
|
|
1207
1278
|
page: 1,
|
|
1208
|
-
maxPageSize:
|
|
1279
|
+
maxPageSize: 5,
|
|
1209
1280
|
question: value,
|
|
1210
1281
|
sectionId: getQuery('s_id')
|
|
1211
1282
|
};
|
|
1212
1283
|
} else if (flag == 4) {
|
|
1213
1284
|
data = {
|
|
1214
1285
|
page: 1,
|
|
1215
|
-
maxPageSize: 4
|
|
1216
|
-
question: value
|
|
1286
|
+
maxPageSize: 4
|
|
1217
1287
|
};
|
|
1218
1288
|
} else {
|
|
1219
1289
|
data = {
|
|
@@ -1230,7 +1300,7 @@ const CustomerService = (props)=>{
|
|
|
1230
1300
|
if (flag == 1) {
|
|
1231
1301
|
setHotQuestionsList(questionList);
|
|
1232
1302
|
} else if (flag == 4) {
|
|
1233
|
-
|
|
1303
|
+
setHotQuestionsList((questionList)=>{
|
|
1234
1304
|
return [
|
|
1235
1305
|
...questionList,
|
|
1236
1306
|
...res.data.questions
|
|
@@ -1239,30 +1309,41 @@ const CustomerService = (props)=>{
|
|
|
1239
1309
|
} else {
|
|
1240
1310
|
setQuestionsList(questionList);
|
|
1241
1311
|
}
|
|
1242
|
-
if (questionList.length <
|
|
1312
|
+
if (questionList.length < 5 && flag == 3) {
|
|
1243
1313
|
console.log('视频页面,联想问题小于4个');
|
|
1244
1314
|
//视频页面,联想问题小于4个
|
|
1245
|
-
|
|
1315
|
+
http.get(`${urllocation}/chat-service/public/v1.0/knowledge-base/questions`, {
|
|
1316
|
+
params: {
|
|
1317
|
+
page: 1,
|
|
1318
|
+
maxPageSize: 5 - questionList.length
|
|
1319
|
+
}
|
|
1320
|
+
}).then((res)=>{
|
|
1321
|
+
if (res.data.questions) {
|
|
1322
|
+
setHotQuestionsList((questionList)=>{
|
|
1323
|
+
return [
|
|
1324
|
+
...questionList,
|
|
1325
|
+
...res.data.questions
|
|
1326
|
+
];
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
});
|
|
1246
1330
|
}
|
|
1247
1331
|
}
|
|
1248
1332
|
});
|
|
1249
1333
|
};
|
|
1250
|
-
//获取视频页面热门问题 flag == 1,默认推荐问题 == 2
|
|
1334
|
+
//获取视频页面热门问题 flag == 1,默认推荐问题 == 2,底部渲染问题,flag == 3,ai回答后请求相关问题
|
|
1251
1335
|
const videoPageQuestiionsList = (flag = 1)=>{
|
|
1252
|
-
console.log(props, 3333333);
|
|
1336
|
+
console.log(flag, props, 3333333);
|
|
1253
1337
|
let config = props.config;
|
|
1254
1338
|
if (config && config.type == 'video' && config.params) {
|
|
1255
1339
|
let params = config.params;
|
|
1256
1340
|
let videoId = params.videoId;
|
|
1257
1341
|
let watchTime = params.videoProgress;
|
|
1258
1342
|
let courseId = getQuery('yc_id');
|
|
1259
|
-
let sectionId =
|
|
1260
|
-
if (videoId &&
|
|
1261
|
-
console.log('请求接口2222', config);
|
|
1343
|
+
let sectionId = params.VideoBriefSummaryId;
|
|
1344
|
+
if (videoId && courseId && sectionId) {
|
|
1262
1345
|
http.post(`${urllocation}/chat-service/public/v1.0/knowledge-base/questions:recommend`, {
|
|
1263
|
-
"recommendedQuestions":
|
|
1264
|
-
''
|
|
1265
|
-
],
|
|
1346
|
+
"recommendedQuestions": [],
|
|
1266
1347
|
"contexts": [
|
|
1267
1348
|
{
|
|
1268
1349
|
"type": "VIDEO",
|
|
@@ -1272,19 +1353,32 @@ const CustomerService = (props)=>{
|
|
|
1272
1353
|
"watchTime": watchTime
|
|
1273
1354
|
}
|
|
1274
1355
|
],
|
|
1275
|
-
"maximum": 5
|
|
1356
|
+
"maximum": flag == 1 || flag == 2 ? 3 : 5
|
|
1276
1357
|
}).then((res)=>{
|
|
1277
|
-
console.log(res, 333333);
|
|
1278
1358
|
if (res.data.total > 0) {
|
|
1279
1359
|
let data = res.data.questions;
|
|
1360
|
+
if (flag == 3) {
|
|
1361
|
+
// setQuestionsList(data);
|
|
1362
|
+
// setVideoHotQuestionsList(data);
|
|
1363
|
+
videoHotQuestionsList.current = data;
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1280
1366
|
if (flag == 2) {
|
|
1281
1367
|
setBottomRecommendationQuestions(data);
|
|
1282
1368
|
} else {
|
|
1283
1369
|
setHotQuestionsList(data);
|
|
1284
1370
|
}
|
|
1371
|
+
let ids = [];
|
|
1372
|
+
data.map((str)=>{
|
|
1373
|
+
ids.push(str.id);
|
|
1374
|
+
});
|
|
1375
|
+
recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
|
|
1285
1376
|
resettingBottomHei();
|
|
1286
1377
|
scrollToBottom();
|
|
1287
|
-
|
|
1378
|
+
// console.log(data,99999);
|
|
1379
|
+
// if(data.length < 4){
|
|
1380
|
+
// getQuestiionsList('',4)
|
|
1381
|
+
// }
|
|
1288
1382
|
}
|
|
1289
1383
|
}).catch(()=>{});
|
|
1290
1384
|
}
|
|
@@ -1937,23 +2031,37 @@ const CustomerService = (props)=>{
|
|
|
1937
2031
|
})
|
|
1938
2032
|
]
|
|
1939
2033
|
}),
|
|
1940
|
-
item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/
|
|
1941
|
-
className: styles.association_problem
|
|
1942
|
-
children:
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
2034
|
+
item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/ _jsxs("ul", {
|
|
2035
|
+
className: `${styles.association_problem} ${item.message == '抱歉,我暂时无法回答这样的问题。' ? 'association_problem_flag' : ''}`,
|
|
2036
|
+
children: [
|
|
2037
|
+
item.message == '抱歉,我暂时无法回答这样的问题。' && /*#__PURE__*/ _jsx("li", {
|
|
2038
|
+
className: styles.related_issues_flag,
|
|
2039
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
2040
|
+
children: "相关问题"
|
|
2041
|
+
})
|
|
2042
|
+
}),
|
|
2043
|
+
JSON.parse(item.extraInfo).map((list, index)=>{
|
|
2044
|
+
return /*#__PURE__*/ _jsx("li", {
|
|
2045
|
+
onClick: ()=>{
|
|
2046
|
+
sendMessage(list, 1);
|
|
2047
|
+
if (props.config && props.config.type == 'video') {
|
|
2048
|
+
//先请求问题列表
|
|
2049
|
+
videoPageQuestiionsList(2);
|
|
2050
|
+
}
|
|
2051
|
+
},
|
|
2052
|
+
children: item.message == '抱歉,我暂时无法回答这样的问题。' ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
2053
|
+
children: [
|
|
2054
|
+
index + 1,
|
|
2055
|
+
".",
|
|
2056
|
+
list.question
|
|
2057
|
+
]
|
|
2058
|
+
})
|
|
2059
|
+
}, i + "_" + index + "_" + list.value);
|
|
2060
|
+
})
|
|
2061
|
+
]
|
|
1954
2062
|
}),
|
|
1955
2063
|
//findTeacher//是否在召唤老师过程中,是否是最后一条消息
|
|
1956
|
-
!item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
|
|
2064
|
+
!item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != '123456_date' && renderLastOperateBtn(item, isAiChatWindow, i),
|
|
1957
2065
|
//召唤老师回答按钮
|
|
1958
2066
|
isAiChatWindow && item.findTeacher && userData.modules.some((item)=>item.short == "TeacherAnswer") && /*#__PURE__*/ _jsx("div", {
|
|
1959
2067
|
className: `${styles.operate_modal_bottom} `,
|
|
@@ -2167,11 +2275,9 @@ const CustomerService = (props)=>{
|
|
|
2167
2275
|
if (!showStopBtn && isAiChatWindow && (extraInfo != undefined && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "questionId" || extraInfo == null) && historyMessageList[i - 1] && historyMessageList[i - 1].extraInfo && JSON.parse(historyMessageList[i - 1].extraInfo).length > 0 && JSON.parse(historyMessageList[i - 1].extraInfo)[0].key != "imageUrl") {
|
|
2168
2276
|
findTeacherBtn = true;
|
|
2169
2277
|
}
|
|
2278
|
+
/// style={{position:showStopBtn && isPosition.current ? 'sticky' : 'relative'}}
|
|
2170
2279
|
return /*#__PURE__*/ _jsxs("div", {
|
|
2171
2280
|
className: `${styles.operate_modal_bottom}`,
|
|
2172
|
-
style: {
|
|
2173
|
-
position: showStopBtn && isPosition.current ? 'sticky' : 'relative'
|
|
2174
|
-
},
|
|
2175
2281
|
children: [
|
|
2176
2282
|
/*#__PURE__*/ _jsxs("p", {
|
|
2177
2283
|
className: styles.stop_generate,
|
|
@@ -2427,6 +2533,7 @@ const CustomerService = (props)=>{
|
|
|
2427
2533
|
className: styles.icon_close,
|
|
2428
2534
|
onClick: ()=>{
|
|
2429
2535
|
setScreenshotBese64('');
|
|
2536
|
+
resettingBottomHei();
|
|
2430
2537
|
},
|
|
2431
2538
|
children: /*#__PURE__*/ _jsx(CustomRoundClose, {})
|
|
2432
2539
|
}),
|
|
@@ -2791,7 +2898,7 @@ const CustomerService = (props)=>{
|
|
|
2791
2898
|
return /*#__PURE__*/ _jsx("div", {
|
|
2792
2899
|
className: styles.issues_list_flag,
|
|
2793
2900
|
style: {
|
|
2794
|
-
bottom: `${buttomHei}px`
|
|
2901
|
+
bottom: `${buttomHei - 60}px`
|
|
2795
2902
|
},
|
|
2796
2903
|
id: "BottomAssociationProblem",
|
|
2797
2904
|
children: bottomRecommendationQuestions.map((item)=>{
|
|
@@ -626,7 +626,9 @@
|
|
|
626
626
|
cursor: pointer;
|
|
627
627
|
list-style-type: none;
|
|
628
628
|
}
|
|
629
|
+
|
|
629
630
|
}
|
|
631
|
+
|
|
630
632
|
|
|
631
633
|
.img_con{
|
|
632
634
|
width: 100%;
|
|
@@ -743,6 +745,34 @@
|
|
|
743
745
|
|
|
744
746
|
}
|
|
745
747
|
}
|
|
748
|
+
|
|
749
|
+
.association_problem_flag{
|
|
750
|
+
padding-left: 30px;
|
|
751
|
+
|
|
752
|
+
li{
|
|
753
|
+
position: relative;
|
|
754
|
+
&::after{
|
|
755
|
+
content: '';
|
|
756
|
+
width: 6px;
|
|
757
|
+
height: 6px;
|
|
758
|
+
border-radius: 50%;
|
|
759
|
+
background-color: rgba(217, 217, 217, 1);
|
|
760
|
+
display: block;
|
|
761
|
+
position: absolute;
|
|
762
|
+
top: 12px;
|
|
763
|
+
left: 12px;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
.related_issues_flag{
|
|
767
|
+
span{
|
|
768
|
+
color: #000;
|
|
769
|
+
font-weight: 600;
|
|
770
|
+
border-bottom: 4px solid @color-background-primary-weak-hover;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
746
776
|
.time {
|
|
747
777
|
display: block;
|
|
748
778
|
margin: 40px 0;
|
|
@@ -910,11 +940,12 @@
|
|
|
910
940
|
margin: 0 16px;
|
|
911
941
|
// padding-bottom: 4px;
|
|
912
942
|
line-height: 1;
|
|
913
|
-
|
|
943
|
+
padding-top: 24px;
|
|
914
944
|
p{
|
|
915
945
|
padding: 8px 16px;
|
|
916
946
|
background-color: #fff;
|
|
917
947
|
border-radius: 38px;
|
|
948
|
+
margin-bottom: 16px;
|
|
918
949
|
cursor: pointer;
|
|
919
950
|
&:hover{
|
|
920
951
|
background-color: @color-background-primary-weak;
|