bhd-components 0.7.10 → 0.7.11
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 +2 -3
- package/dist/{a23d0ed7.esm.es5.production.js → 901ed6b6.esm.es5.production.js} +1 -1
- package/dist/{e7af2e4a.esm.es5.development.js → facd5ad8.esm.es5.development.js} +72 -96
- package/dist/index.esm.es5.development.css +976 -978
- package/dist/index.esm.es5.development.js +62 -42
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/contactsList.js +1 -1
- package/es2017/customerService/index.js +56 -36
- package/es2017/customerService/index.module.less +3 -2
- package/esm/customerService/contactsList.js +1 -1
- package/esm/customerService/index.js +57 -37
- package/esm/customerService/index.module.less +3 -2
- package/package.json +1 -1
|
@@ -114,7 +114,7 @@ const ContactsList = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
114
114
|
}) : /*#__PURE__*/ _jsxs("div", {
|
|
115
115
|
className: `${styles.teacher_layout} ${type == 3 ? styles.teacher_layout_newlabo : ""}`,
|
|
116
116
|
style: {
|
|
117
|
-
left: type == 3 ? document.getElementById("box").offsetWidth + 10 + "px" : "auto"
|
|
117
|
+
left: type == 3 ? document.getElementById("box") && document.getElementById("box").offsetWidth + 10 + "px" : "auto"
|
|
118
118
|
},
|
|
119
119
|
children: [
|
|
120
120
|
/*#__PURE__*/ _jsxs("div", {
|
|
@@ -64,6 +64,7 @@ const CustomerService = (props)=>{
|
|
|
64
64
|
const [viewBase64, setViewBase64] = useState(""); //图片预览
|
|
65
65
|
const [visible, setVisible] = useState(false); //是否显示图片预览
|
|
66
66
|
const [bottomRecommendationQuestions, setBottomRecommendationQuestions] = useState([]); //底部推荐问题
|
|
67
|
+
const [showScreenshot, setShowScreenshot] = useState(false); //是否显示截图 主要用于newlabo页面
|
|
67
68
|
const [saveShowType, setSaveShowType] = useState(-1); //保存截图时的状态
|
|
68
69
|
const timer = useRef(null); //文本框输入时
|
|
69
70
|
let receiveMessageTimer = useRef(null); //接收ai发回的消息
|
|
@@ -92,22 +93,17 @@ const CustomerService = (props)=>{
|
|
|
92
93
|
}
|
|
93
94
|
});
|
|
94
95
|
useEffect(()=>{
|
|
95
|
-
|
|
96
|
-
// getQuestiionsList("", 1);
|
|
97
|
-
if (props.config && props.config.type == 'video') {
|
|
96
|
+
if (config && config.type == 'video') {
|
|
98
97
|
//获取热门推荐
|
|
99
98
|
videoPageQuestiionsList(1);
|
|
100
|
-
// getQuestiionsList("", 3)
|
|
101
99
|
}
|
|
102
100
|
setShowType(initShowType);
|
|
103
|
-
//获取视频页面推荐问题
|
|
104
|
-
// videoPageQuestiionsList();
|
|
105
|
-
// scrollToBottom();
|
|
106
101
|
}, [
|
|
107
102
|
initShowType
|
|
108
103
|
]);
|
|
109
104
|
useEffect(()=>{
|
|
110
|
-
|
|
105
|
+
//|| showScreenshot
|
|
106
|
+
if (showType == 5 || showScreenshot) {
|
|
111
107
|
try {
|
|
112
108
|
setImgBese64('');
|
|
113
109
|
// html2canvas(document.getElementsByTagName('html')[0],{
|
|
@@ -200,7 +196,8 @@ const CustomerService = (props)=>{
|
|
|
200
196
|
}, [
|
|
201
197
|
historyMessageList,
|
|
202
198
|
showType,
|
|
203
|
-
pageCount
|
|
199
|
+
pageCount,
|
|
200
|
+
showScreenshot
|
|
204
201
|
]);
|
|
205
202
|
useEffect(()=>{
|
|
206
203
|
resettingBottomHei();
|
|
@@ -694,6 +691,10 @@ const CustomerService = (props)=>{
|
|
|
694
691
|
sendingExistingIssues(2, dataObj, "");
|
|
695
692
|
testLabQuestion(obj.message, questions.answer, "");
|
|
696
693
|
}
|
|
694
|
+
if (type == 2 && config && config.type == 'video') {
|
|
695
|
+
//先请求问题列表
|
|
696
|
+
videoPageQuestiionsList(2);
|
|
697
|
+
}
|
|
697
698
|
});
|
|
698
699
|
};
|
|
699
700
|
//向AI发送问题 type == 1 发送点赞或踩消息,type == 2 发送重新生成消息,type == 3 正常发送消息
|
|
@@ -720,8 +721,8 @@ const CustomerService = (props)=>{
|
|
|
720
721
|
});
|
|
721
722
|
});
|
|
722
723
|
}, 60 * 1000);
|
|
723
|
-
if (
|
|
724
|
-
let params =
|
|
724
|
+
if (config && config.type == 'video' && config.params) {
|
|
725
|
+
let params = config.params;
|
|
725
726
|
let videoId = params.videoId;
|
|
726
727
|
let watchTime = params.videoProgress;
|
|
727
728
|
let courseId = getQuery('yc_id');
|
|
@@ -776,7 +777,7 @@ const CustomerService = (props)=>{
|
|
|
776
777
|
});
|
|
777
778
|
scrollToBottom();
|
|
778
779
|
}
|
|
779
|
-
if (
|
|
780
|
+
if (config && config.type == 'video') {
|
|
780
781
|
//先请求问题列表
|
|
781
782
|
videoPageQuestiionsList(3);
|
|
782
783
|
}
|
|
@@ -880,6 +881,7 @@ const CustomerService = (props)=>{
|
|
|
880
881
|
}
|
|
881
882
|
if (msg.finished) {
|
|
882
883
|
setFinished(true); //发送结束
|
|
884
|
+
videoPageQuestiionsList(2);
|
|
883
885
|
// isPosition.current = true;
|
|
884
886
|
setTimeout(()=>{
|
|
885
887
|
isPosition.current = true;
|
|
@@ -1267,6 +1269,7 @@ const CustomerService = (props)=>{
|
|
|
1267
1269
|
};
|
|
1268
1270
|
//获取问题列表flag ==1 是问候消息 2,搜索列表 展示相关问题 ,3.视频页面,4.视频联想问题不够时,增加知识库联想问题
|
|
1269
1271
|
const getQuestiionsList = (value, flag)=>{
|
|
1272
|
+
// console.log(flag,'dlfkvdmflkvmdfklv');
|
|
1270
1273
|
let data = {};
|
|
1271
1274
|
if (flag == 1) {
|
|
1272
1275
|
data = {
|
|
@@ -1319,7 +1322,7 @@ const CustomerService = (props)=>{
|
|
|
1319
1322
|
}
|
|
1320
1323
|
}).then((res)=>{
|
|
1321
1324
|
if (res.data.questions) {
|
|
1322
|
-
|
|
1325
|
+
setQuestionsList((questionList)=>{
|
|
1323
1326
|
return [
|
|
1324
1327
|
...questionList,
|
|
1325
1328
|
...res.data.questions
|
|
@@ -1334,16 +1337,20 @@ const CustomerService = (props)=>{
|
|
|
1334
1337
|
//获取视频页面热门问题 flag == 1,默认推荐问题 == 2,底部渲染问题,flag == 3,ai回答后请求相关问题
|
|
1335
1338
|
const videoPageQuestiionsList = (flag = 1)=>{
|
|
1336
1339
|
console.log(flag, props, 3333333);
|
|
1337
|
-
let config = props.config;
|
|
1338
1340
|
if (config && config.type == 'video' && config.params) {
|
|
1339
1341
|
let params = config.params;
|
|
1340
1342
|
let videoId = params.videoId;
|
|
1341
1343
|
let watchTime = params.videoProgress;
|
|
1342
1344
|
let courseId = getQuery('yc_id');
|
|
1343
1345
|
let sectionId = params.VideoBriefSummaryId;
|
|
1346
|
+
// let courseId="20899",
|
|
1347
|
+
// sectionId= "462347",
|
|
1348
|
+
// videoId= "29707",
|
|
1349
|
+
// watchTime= 262
|
|
1344
1350
|
if (videoId && courseId && sectionId) {
|
|
1351
|
+
console.log(recommendeQuestionID.current, 'recommendeQuestionID.current');
|
|
1345
1352
|
http.post(`${urllocation}/chat-service/public/v1.0/knowledge-base/questions:recommend`, {
|
|
1346
|
-
"recommendedQuestions":
|
|
1353
|
+
"recommendedQuestions": recommendeQuestionID.current,
|
|
1347
1354
|
"contexts": [
|
|
1348
1355
|
{
|
|
1349
1356
|
"type": "VIDEO",
|
|
@@ -1368,11 +1375,11 @@ const CustomerService = (props)=>{
|
|
|
1368
1375
|
} else {
|
|
1369
1376
|
setHotQuestionsList(data);
|
|
1370
1377
|
}
|
|
1371
|
-
let ids = [];
|
|
1372
|
-
data.map((str)=>{
|
|
1373
|
-
|
|
1374
|
-
})
|
|
1375
|
-
recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
|
|
1378
|
+
// let ids:any[] = [];
|
|
1379
|
+
// data.map((str: { id: string; })=>{
|
|
1380
|
+
// ids.push(str.id);
|
|
1381
|
+
// })
|
|
1382
|
+
// recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
|
|
1376
1383
|
resettingBottomHei();
|
|
1377
1384
|
scrollToBottom();
|
|
1378
1385
|
// console.log(data,99999);
|
|
@@ -2044,10 +2051,9 @@ const CustomerService = (props)=>{
|
|
|
2044
2051
|
return /*#__PURE__*/ _jsx("li", {
|
|
2045
2052
|
onClick: ()=>{
|
|
2046
2053
|
sendMessage(list, 1);
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
}
|
|
2054
|
+
recommendeQuestionID.current = recommendeQuestionID.current.concat(list.value);
|
|
2055
|
+
setBottomRecommendationQuestions([]);
|
|
2056
|
+
resettingBottomHei();
|
|
2051
2057
|
},
|
|
2052
2058
|
children: item.message == '抱歉,我暂时无法回答这样的问题。' ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
2053
2059
|
children: [
|
|
@@ -2586,6 +2592,7 @@ const CustomerService = (props)=>{
|
|
|
2586
2592
|
"讲解这张图片涉及到的知识内容"
|
|
2587
2593
|
]
|
|
2588
2594
|
}),
|
|
2595
|
+
/*#__PURE__*/ _jsx("br", {}),
|
|
2589
2596
|
/*#__PURE__*/ _jsxs("p", {
|
|
2590
2597
|
onClick: ()=>{
|
|
2591
2598
|
setHistoryMessageList((historyMessageList)=>{
|
|
@@ -2649,7 +2656,7 @@ const CustomerService = (props)=>{
|
|
|
2649
2656
|
let roomList = contactsList;
|
|
2650
2657
|
if (roomList.length > 0 && roomList[0].roomId != roomId) return;
|
|
2651
2658
|
console.log(props, 333333);
|
|
2652
|
-
if (
|
|
2659
|
+
if (config && config.type == 'video') {
|
|
2653
2660
|
getQuestiionsList(String(e.target.value), 3);
|
|
2654
2661
|
} else {
|
|
2655
2662
|
getQuestiionsList(String(e.target.value), 2);
|
|
@@ -2740,7 +2747,11 @@ const CustomerService = (props)=>{
|
|
|
2740
2747
|
onClick: ()=>{
|
|
2741
2748
|
if (!finished) return;
|
|
2742
2749
|
setSaveShowType(showType);
|
|
2743
|
-
|
|
2750
|
+
if (showType == 3) {
|
|
2751
|
+
setShowScreenshot(true);
|
|
2752
|
+
} else {
|
|
2753
|
+
setShowType(5);
|
|
2754
|
+
}
|
|
2744
2755
|
},
|
|
2745
2756
|
children: /*#__PURE__*/ _jsx(CustomScreenshot, {})
|
|
2746
2757
|
})
|
|
@@ -2894,17 +2905,20 @@ const CustomerService = (props)=>{
|
|
|
2894
2905
|
});
|
|
2895
2906
|
}
|
|
2896
2907
|
};
|
|
2908
|
+
//视频页面底部推荐问题
|
|
2897
2909
|
const renderBottomAssociationProblem = ()=>{
|
|
2898
2910
|
return /*#__PURE__*/ _jsx("div", {
|
|
2899
2911
|
className: styles.issues_list_flag,
|
|
2900
|
-
style: {
|
|
2901
|
-
bottom: `${buttomHei - 60}px`
|
|
2902
|
-
},
|
|
2903
2912
|
id: "BottomAssociationProblem",
|
|
2904
2913
|
children: bottomRecommendationQuestions.map((item)=>{
|
|
2905
2914
|
return /*#__PURE__*/ _jsx("p", {
|
|
2906
2915
|
onClick: ()=>{
|
|
2907
2916
|
sendMessage(item, 1);
|
|
2917
|
+
if (config && config.type == 'video') {
|
|
2918
|
+
recommendeQuestionID.current = recommendeQuestionID.current.concat(item.id);
|
|
2919
|
+
setBottomRecommendationQuestions([]);
|
|
2920
|
+
resettingBottomHei();
|
|
2921
|
+
}
|
|
2908
2922
|
},
|
|
2909
2923
|
children: item.question
|
|
2910
2924
|
}, item.id);
|
|
@@ -3116,7 +3130,7 @@ const CustomerService = (props)=>{
|
|
|
3116
3130
|
})
|
|
3117
3131
|
]
|
|
3118
3132
|
}),
|
|
3119
|
-
showType == 3
|
|
3133
|
+
showType == 3 && /*#__PURE__*/ _jsxs("div", {
|
|
3120
3134
|
className: `${styles.ChatWindow_Drawer}`,
|
|
3121
3135
|
id: "",
|
|
3122
3136
|
onClick: ()=>{
|
|
@@ -3227,12 +3241,12 @@ const CustomerService = (props)=>{
|
|
|
3227
3241
|
})
|
|
3228
3242
|
})
|
|
3229
3243
|
]
|
|
3230
|
-
})
|
|
3231
|
-
showType == 4 && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
3244
|
+
}),
|
|
3245
|
+
(showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
3232
3246
|
children: [
|
|
3233
3247
|
/*#__PURE__*/ _jsxs(Modal, {
|
|
3234
3248
|
title: "AI助手",
|
|
3235
|
-
open: true,
|
|
3249
|
+
open: showType == 4 ? true : false,
|
|
3236
3250
|
onCancel: ()=>{
|
|
3237
3251
|
onCancel();
|
|
3238
3252
|
onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
|
|
@@ -3318,7 +3332,7 @@ const CustomerService = (props)=>{
|
|
|
3318
3332
|
})
|
|
3319
3333
|
]
|
|
3320
3334
|
}),
|
|
3321
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
3335
|
+
(showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs("div", {
|
|
3322
3336
|
className: `${styles.ChatWindow_Drawer}`,
|
|
3323
3337
|
id: "",
|
|
3324
3338
|
children: [
|
|
@@ -3416,7 +3430,7 @@ const CustomerService = (props)=>{
|
|
|
3416
3430
|
})
|
|
3417
3431
|
]
|
|
3418
3432
|
}),
|
|
3419
|
-
showType == 5 && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
|
|
3433
|
+
(showType == 5 || showScreenshot) && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
|
|
3420
3434
|
imgBese64: imgBese64,
|
|
3421
3435
|
saveScreenshotBese64: (base64)=>{
|
|
3422
3436
|
setScreenshotBese64(base64);
|
|
@@ -3425,9 +3439,15 @@ const CustomerService = (props)=>{
|
|
|
3425
3439
|
} else {
|
|
3426
3440
|
setShowType(1);
|
|
3427
3441
|
}
|
|
3442
|
+
setShowScreenshot(false);
|
|
3428
3443
|
},
|
|
3429
3444
|
cancelScreenshot: ()=>{
|
|
3430
|
-
|
|
3445
|
+
if (saveShowType != -1) {
|
|
3446
|
+
setShowType(saveShowType);
|
|
3447
|
+
} else {
|
|
3448
|
+
setShowType(1);
|
|
3449
|
+
}
|
|
3450
|
+
setShowScreenshot(false);
|
|
3431
3451
|
}
|
|
3432
3452
|
}),
|
|
3433
3453
|
viewBase64 && visible && /*#__PURE__*/ _jsx(ViewImage, {
|
|
@@ -935,8 +935,8 @@
|
|
|
935
935
|
}
|
|
936
936
|
}
|
|
937
937
|
.issues_list_flag {
|
|
938
|
-
position: absolute;
|
|
939
|
-
bottom: 60px;
|
|
938
|
+
// position: absolute;
|
|
939
|
+
// bottom: 60px;
|
|
940
940
|
margin: 0 16px;
|
|
941
941
|
// padding-bottom: 4px;
|
|
942
942
|
line-height: 1;
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
background-color: #fff;
|
|
947
947
|
border-radius: 38px;
|
|
948
948
|
margin-bottom: 16px;
|
|
949
|
+
line-height: 1.5;
|
|
949
950
|
cursor: pointer;
|
|
950
951
|
&:hover{
|
|
951
952
|
background-color: @color-background-primary-weak;
|
|
@@ -120,7 +120,7 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
120
120
|
}) : /*#__PURE__*/ _jsxs("div", {
|
|
121
121
|
className: "".concat(styles.teacher_layout, " ").concat(type == 3 ? styles.teacher_layout_newlabo : ""),
|
|
122
122
|
style: {
|
|
123
|
-
left: type == 3 ? document.getElementById("box").offsetWidth + 10 + "px" : "auto"
|
|
123
|
+
left: type == 3 ? document.getElementById("box") && document.getElementById("box").offsetWidth + 10 + "px" : "auto"
|
|
124
124
|
},
|
|
125
125
|
children: [
|
|
126
126
|
/*#__PURE__*/ _jsxs("div", {
|
|
@@ -66,7 +66,8 @@ var CustomerService = function(props) {
|
|
|
66
66
|
var _useState29 = _sliced_to_array(useState(""), 2), viewBase64 = _useState29[0], setViewBase64 = _useState29[1]; //图片预览
|
|
67
67
|
var _useState30 = _sliced_to_array(useState(false), 2), visible = _useState30[0], setVisible = _useState30[1]; //是否显示图片预览
|
|
68
68
|
var _useState31 = _sliced_to_array(useState([]), 2), bottomRecommendationQuestions = _useState31[0], setBottomRecommendationQuestions = _useState31[1]; //底部推荐问题
|
|
69
|
-
var _useState32 = _sliced_to_array(useState(
|
|
69
|
+
var _useState32 = _sliced_to_array(useState(false), 2), showScreenshot = _useState32[0], setShowScreenshot = _useState32[1]; //是否显示截图 主要用于newlabo页面
|
|
70
|
+
var _useState33 = _sliced_to_array(useState(-1), 2), saveShowType = _useState33[0], setSaveShowType = _useState33[1]; //保存截图时的状态
|
|
70
71
|
var timer = useRef(null); //文本框输入时
|
|
71
72
|
var receiveMessageTimer = useRef(null); //接收ai发回的消息
|
|
72
73
|
// let voiceCountdownTimer = useRef(null); //语音录制倒计时
|
|
@@ -94,17 +95,11 @@ var CustomerService = function(props) {
|
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
97
|
useEffect(function() {
|
|
97
|
-
|
|
98
|
-
// getQuestiionsList("", 1);
|
|
99
|
-
if (props.config && props.config.type == "video") {
|
|
98
|
+
if (config && config.type == "video") {
|
|
100
99
|
//获取热门推荐
|
|
101
100
|
videoPageQuestiionsList(1);
|
|
102
|
-
// getQuestiionsList("", 3)
|
|
103
101
|
}
|
|
104
102
|
setShowType(initShowType);
|
|
105
|
-
//获取视频页面推荐问题
|
|
106
|
-
// videoPageQuestiionsList();
|
|
107
|
-
// scrollToBottom();
|
|
108
103
|
}, [
|
|
109
104
|
initShowType
|
|
110
105
|
]);
|
|
@@ -155,7 +150,8 @@ var CustomerService = function(props) {
|
|
|
155
150
|
}
|
|
156
151
|
scrollTopHei.current = scrollTop;
|
|
157
152
|
};
|
|
158
|
-
|
|
153
|
+
//|| showScreenshot
|
|
154
|
+
if (showType == 5 || showScreenshot) {
|
|
159
155
|
try {
|
|
160
156
|
setImgBese64("");
|
|
161
157
|
// html2canvas(document.getElementsByTagName('html')[0],{
|
|
@@ -202,7 +198,8 @@ var CustomerService = function(props) {
|
|
|
202
198
|
}, [
|
|
203
199
|
historyMessageList,
|
|
204
200
|
showType,
|
|
205
|
-
pageCount
|
|
201
|
+
pageCount,
|
|
202
|
+
showScreenshot
|
|
206
203
|
]);
|
|
207
204
|
useEffect(function() {
|
|
208
205
|
resettingBottomHei();
|
|
@@ -710,6 +707,10 @@ var CustomerService = function(props) {
|
|
|
710
707
|
sendingExistingIssues(2, dataObj, "");
|
|
711
708
|
testLabQuestion(obj.message, questions.answer, "");
|
|
712
709
|
}
|
|
710
|
+
if (type == 2 && config && config.type == "video") {
|
|
711
|
+
//先请求问题列表
|
|
712
|
+
videoPageQuestiionsList(2);
|
|
713
|
+
}
|
|
713
714
|
});
|
|
714
715
|
};
|
|
715
716
|
//向AI发送问题 type == 1 发送点赞或踩消息,type == 2 发送重新生成消息,type == 3 正常发送消息
|
|
@@ -738,8 +739,8 @@ var CustomerService = function(props) {
|
|
|
738
739
|
});
|
|
739
740
|
});
|
|
740
741
|
}, 60 * 1000);
|
|
741
|
-
if (
|
|
742
|
-
var params =
|
|
742
|
+
if (config && config.type == "video" && config.params) {
|
|
743
|
+
var params = config.params;
|
|
743
744
|
var videoId = params.videoId;
|
|
744
745
|
var watchTime = params.videoProgress;
|
|
745
746
|
var courseId = getQuery("yc_id");
|
|
@@ -794,7 +795,7 @@ var CustomerService = function(props) {
|
|
|
794
795
|
});
|
|
795
796
|
scrollToBottom();
|
|
796
797
|
}
|
|
797
|
-
if (
|
|
798
|
+
if (config && config.type == "video") {
|
|
798
799
|
//先请求问题列表
|
|
799
800
|
videoPageQuestiionsList(3);
|
|
800
801
|
}
|
|
@@ -904,6 +905,7 @@ var CustomerService = function(props) {
|
|
|
904
905
|
}
|
|
905
906
|
if (msg.finished) {
|
|
906
907
|
setFinished(true); //发送结束
|
|
908
|
+
videoPageQuestiionsList(2);
|
|
907
909
|
// isPosition.current = true;
|
|
908
910
|
setTimeout(function() {
|
|
909
911
|
isPosition.current = true;
|
|
@@ -1304,6 +1306,7 @@ var CustomerService = function(props) {
|
|
|
1304
1306
|
};
|
|
1305
1307
|
//获取问题列表flag ==1 是问候消息 2,搜索列表 展示相关问题 ,3.视频页面,4.视频联想问题不够时,增加知识库联想问题
|
|
1306
1308
|
var getQuestiionsList = function(value, flag) {
|
|
1309
|
+
// console.log(flag,'dlfkvdmflkvmdfklv');
|
|
1307
1310
|
var data = {};
|
|
1308
1311
|
if (flag == 1) {
|
|
1309
1312
|
data = {
|
|
@@ -1353,7 +1356,7 @@ var CustomerService = function(props) {
|
|
|
1353
1356
|
}
|
|
1354
1357
|
}).then(function(res) {
|
|
1355
1358
|
if (res.data.questions) {
|
|
1356
|
-
|
|
1359
|
+
setQuestionsList(function(questionList) {
|
|
1357
1360
|
return _to_consumable_array(questionList).concat(_to_consumable_array(res.data.questions));
|
|
1358
1361
|
});
|
|
1359
1362
|
}
|
|
@@ -1366,16 +1369,20 @@ var CustomerService = function(props) {
|
|
|
1366
1369
|
var videoPageQuestiionsList = function() {
|
|
1367
1370
|
var flag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
|
|
1368
1371
|
console.log(flag, props, 3333333);
|
|
1369
|
-
var config = props.config;
|
|
1370
1372
|
if (config && config.type == "video" && config.params) {
|
|
1371
1373
|
var params = config.params;
|
|
1372
1374
|
var videoId = params.videoId;
|
|
1373
1375
|
var watchTime = params.videoProgress;
|
|
1374
1376
|
var courseId = getQuery("yc_id");
|
|
1375
1377
|
var sectionId = params.VideoBriefSummaryId;
|
|
1378
|
+
// let courseId="20899",
|
|
1379
|
+
// sectionId= "462347",
|
|
1380
|
+
// videoId= "29707",
|
|
1381
|
+
// watchTime= 262
|
|
1376
1382
|
if (videoId && courseId && sectionId) {
|
|
1383
|
+
console.log(recommendeQuestionID.current, "recommendeQuestionID.current");
|
|
1377
1384
|
http.post("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions:recommend"), {
|
|
1378
|
-
"recommendedQuestions":
|
|
1385
|
+
"recommendedQuestions": recommendeQuestionID.current,
|
|
1379
1386
|
"contexts": [
|
|
1380
1387
|
{
|
|
1381
1388
|
"type": "VIDEO",
|
|
@@ -1400,11 +1407,11 @@ var CustomerService = function(props) {
|
|
|
1400
1407
|
} else {
|
|
1401
1408
|
setHotQuestionsList(data);
|
|
1402
1409
|
}
|
|
1403
|
-
|
|
1404
|
-
data.map(
|
|
1405
|
-
|
|
1406
|
-
})
|
|
1407
|
-
recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
|
|
1410
|
+
// let ids:any[] = [];
|
|
1411
|
+
// data.map((str: { id: string; })=>{
|
|
1412
|
+
// ids.push(str.id);
|
|
1413
|
+
// })
|
|
1414
|
+
// recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
|
|
1408
1415
|
resettingBottomHei();
|
|
1409
1416
|
scrollToBottom();
|
|
1410
1417
|
// console.log(data,99999);
|
|
@@ -2067,10 +2074,9 @@ var CustomerService = function(props) {
|
|
|
2067
2074
|
return /*#__PURE__*/ _jsx("li", {
|
|
2068
2075
|
onClick: function() {
|
|
2069
2076
|
sendMessage(list, 1);
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
}
|
|
2077
|
+
recommendeQuestionID.current = recommendeQuestionID.current.concat(list.value);
|
|
2078
|
+
setBottomRecommendationQuestions([]);
|
|
2079
|
+
resettingBottomHei();
|
|
2074
2080
|
},
|
|
2075
2081
|
children: item.message == "抱歉,我暂时无法回答这样的问题。" ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
2076
2082
|
children: [
|
|
@@ -2635,6 +2641,7 @@ var CustomerService = function(props) {
|
|
|
2635
2641
|
"讲解这张图片涉及到的知识内容"
|
|
2636
2642
|
]
|
|
2637
2643
|
}),
|
|
2644
|
+
/*#__PURE__*/ _jsx("br", {}),
|
|
2638
2645
|
/*#__PURE__*/ _jsxs("p", {
|
|
2639
2646
|
onClick: function() {
|
|
2640
2647
|
setHistoryMessageList(function(historyMessageList) {
|
|
@@ -2698,7 +2705,7 @@ var CustomerService = function(props) {
|
|
|
2698
2705
|
var roomList = contactsList;
|
|
2699
2706
|
if (roomList.length > 0 && roomList[0].roomId != roomId) return;
|
|
2700
2707
|
console.log(props, 333333);
|
|
2701
|
-
if (
|
|
2708
|
+
if (config && config.type == "video") {
|
|
2702
2709
|
getQuestiionsList(String(e.target.value), 3);
|
|
2703
2710
|
} else {
|
|
2704
2711
|
getQuestiionsList(String(e.target.value), 2);
|
|
@@ -2795,7 +2802,11 @@ var CustomerService = function(props) {
|
|
|
2795
2802
|
onClick: function() {
|
|
2796
2803
|
if (!finished) return;
|
|
2797
2804
|
setSaveShowType(showType);
|
|
2798
|
-
|
|
2805
|
+
if (showType == 3) {
|
|
2806
|
+
setShowScreenshot(true);
|
|
2807
|
+
} else {
|
|
2808
|
+
setShowType(5);
|
|
2809
|
+
}
|
|
2799
2810
|
},
|
|
2800
2811
|
children: /*#__PURE__*/ _jsx(CustomScreenshot, {})
|
|
2801
2812
|
})
|
|
@@ -2955,17 +2966,20 @@ var CustomerService = function(props) {
|
|
|
2955
2966
|
});
|
|
2956
2967
|
}
|
|
2957
2968
|
};
|
|
2969
|
+
//视频页面底部推荐问题
|
|
2958
2970
|
var renderBottomAssociationProblem = function() {
|
|
2959
2971
|
return /*#__PURE__*/ _jsx("div", {
|
|
2960
2972
|
className: styles.issues_list_flag,
|
|
2961
|
-
style: {
|
|
2962
|
-
bottom: "".concat(buttomHei - 60, "px")
|
|
2963
|
-
},
|
|
2964
2973
|
id: "BottomAssociationProblem",
|
|
2965
2974
|
children: bottomRecommendationQuestions.map(function(item) {
|
|
2966
2975
|
return /*#__PURE__*/ _jsx("p", {
|
|
2967
2976
|
onClick: function() {
|
|
2968
2977
|
sendMessage(item, 1);
|
|
2978
|
+
if (config && config.type == "video") {
|
|
2979
|
+
recommendeQuestionID.current = recommendeQuestionID.current.concat(item.id);
|
|
2980
|
+
setBottomRecommendationQuestions([]);
|
|
2981
|
+
resettingBottomHei();
|
|
2982
|
+
}
|
|
2969
2983
|
},
|
|
2970
2984
|
children: item.question
|
|
2971
2985
|
}, item.id);
|
|
@@ -3177,7 +3191,7 @@ var CustomerService = function(props) {
|
|
|
3177
3191
|
})
|
|
3178
3192
|
]
|
|
3179
3193
|
}),
|
|
3180
|
-
showType == 3
|
|
3194
|
+
showType == 3 && /*#__PURE__*/ _jsxs("div", {
|
|
3181
3195
|
className: "".concat(styles.ChatWindow_Drawer),
|
|
3182
3196
|
id: "",
|
|
3183
3197
|
onClick: function() {
|
|
@@ -3288,12 +3302,12 @@ var CustomerService = function(props) {
|
|
|
3288
3302
|
})
|
|
3289
3303
|
})
|
|
3290
3304
|
]
|
|
3291
|
-
})
|
|
3292
|
-
showType == 4 && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
3305
|
+
}),
|
|
3306
|
+
(showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
3293
3307
|
children: [
|
|
3294
3308
|
/*#__PURE__*/ _jsxs(Modal, {
|
|
3295
3309
|
title: "AI助手",
|
|
3296
|
-
open: true,
|
|
3310
|
+
open: showType == 4 ? true : false,
|
|
3297
3311
|
onCancel: function() {
|
|
3298
3312
|
onCancel();
|
|
3299
3313
|
onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
|
|
@@ -3379,7 +3393,7 @@ var CustomerService = function(props) {
|
|
|
3379
3393
|
})
|
|
3380
3394
|
]
|
|
3381
3395
|
}),
|
|
3382
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
3396
|
+
(showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs("div", {
|
|
3383
3397
|
className: "".concat(styles.ChatWindow_Drawer),
|
|
3384
3398
|
id: "",
|
|
3385
3399
|
children: [
|
|
@@ -3477,7 +3491,7 @@ var CustomerService = function(props) {
|
|
|
3477
3491
|
})
|
|
3478
3492
|
]
|
|
3479
3493
|
}),
|
|
3480
|
-
showType == 5 && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
|
|
3494
|
+
(showType == 5 || showScreenshot) && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
|
|
3481
3495
|
imgBese64: imgBese64,
|
|
3482
3496
|
saveScreenshotBese64: function(base64) {
|
|
3483
3497
|
setScreenshotBese64(base64);
|
|
@@ -3486,9 +3500,15 @@ var CustomerService = function(props) {
|
|
|
3486
3500
|
} else {
|
|
3487
3501
|
setShowType(1);
|
|
3488
3502
|
}
|
|
3503
|
+
setShowScreenshot(false);
|
|
3489
3504
|
},
|
|
3490
3505
|
cancelScreenshot: function() {
|
|
3491
|
-
|
|
3506
|
+
if (saveShowType != -1) {
|
|
3507
|
+
setShowType(saveShowType);
|
|
3508
|
+
} else {
|
|
3509
|
+
setShowType(1);
|
|
3510
|
+
}
|
|
3511
|
+
setShowScreenshot(false);
|
|
3492
3512
|
}
|
|
3493
3513
|
}),
|
|
3494
3514
|
viewBase64 && visible && /*#__PURE__*/ _jsx(ViewImage, {
|
|
@@ -935,8 +935,8 @@
|
|
|
935
935
|
}
|
|
936
936
|
}
|
|
937
937
|
.issues_list_flag {
|
|
938
|
-
position: absolute;
|
|
939
|
-
bottom: 60px;
|
|
938
|
+
// position: absolute;
|
|
939
|
+
// bottom: 60px;
|
|
940
940
|
margin: 0 16px;
|
|
941
941
|
// padding-bottom: 4px;
|
|
942
942
|
line-height: 1;
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
background-color: #fff;
|
|
947
947
|
border-radius: 38px;
|
|
948
948
|
margin-bottom: 16px;
|
|
949
|
+
line-height: 1.5;
|
|
949
950
|
cursor: pointer;
|
|
950
951
|
&:hover{
|
|
951
952
|
background-color: @color-background-primary-weak;
|