bhd-components 0.7.15 → 0.7.16
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/{954539dd.esm.es5.development.js → cb6a18bd.esm.es5.development.js} +1 -1
- package/dist/{f6061320.esm.es5.production.js → ee67a556.esm.es5.production.js} +1 -1
- package/dist/index.esm.es5.development.js +38 -36
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/index.js +35 -33
- package/esm/customerService/index.js +36 -34
- package/package.json +1 -1
|
@@ -333,45 +333,46 @@ const CustomerService = (props)=>{
|
|
|
333
333
|
],
|
|
334
334
|
"maximum": 3
|
|
335
335
|
}).then((res)=>{
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
336
|
+
try {
|
|
337
|
+
let data = res.data.questions;
|
|
338
|
+
let questionsList = null;
|
|
339
|
+
if (data.length > 0) {
|
|
340
|
+
questionsList = data.map((item, index)=>{
|
|
341
341
|
return {
|
|
342
342
|
key: "messageSource",
|
|
343
343
|
value: item.id,
|
|
344
344
|
question: item.question,
|
|
345
345
|
answer: item.answer
|
|
346
346
|
};
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
console.log('dflkvmdfklvdf欢迎语', data);
|
|
350
|
+
let obj = {
|
|
351
|
+
roomId: roomId,
|
|
352
|
+
sender: "AI",
|
|
353
|
+
recevier: mid,
|
|
354
|
+
message: `Hi,我是智能学习助手,你遇到了什么问题?`,
|
|
355
|
+
extraInfos: questionsList == null ? null : questionsList
|
|
356
|
+
};
|
|
357
|
+
if (pageNumHistory <= 1) {
|
|
358
|
+
console.log('欢迎语');
|
|
359
|
+
setHistoryMessageList((historyMessageList)=>{
|
|
360
|
+
let newHistoryMessageList = historyMessageList.filter((e)=>e.id != '123456_date');
|
|
361
|
+
newHistoryMessageList.push(_object_spread_props(_object_spread({}, obj), {
|
|
362
|
+
id: '123456_date',
|
|
363
|
+
upvoted: false,
|
|
364
|
+
downvoted: false,
|
|
365
|
+
quotedMessage: "",
|
|
366
|
+
createdAt: getDataTime(-1),
|
|
367
|
+
extraInfo: obj.extraInfos != null ? JSON.stringify(obj.extraInfos) : null
|
|
368
|
+
}));
|
|
369
|
+
console.log(newHistoryMessageList, 3333333333339999);
|
|
370
|
+
return newHistoryMessageList;
|
|
371
|
+
});
|
|
372
|
+
scrollToBottom();
|
|
373
|
+
}
|
|
374
|
+
return;
|
|
375
|
+
} catch (error) {}
|
|
375
376
|
}).catch(()=>{});
|
|
376
377
|
}
|
|
377
378
|
} else {
|
|
@@ -409,6 +410,7 @@ const CustomerService = (props)=>{
|
|
|
409
410
|
let questionsList = [];
|
|
410
411
|
let obj = {};
|
|
411
412
|
if (type == 1) {
|
|
413
|
+
console.log('dflkvmdfklvdf欢迎语');
|
|
412
414
|
sendWelcomMessage();
|
|
413
415
|
// console.log(hotQuestionsList,newHotQuestionsList.current,'33322221111');
|
|
414
416
|
// if(newHotQuestionsList.current.length > 0){
|
|
@@ -337,47 +337,48 @@ var CustomerService = function(props) {
|
|
|
337
337
|
],
|
|
338
338
|
"maximum": 3
|
|
339
339
|
}).then(function(res) {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
340
|
+
try {
|
|
341
|
+
var data = res.data.questions;
|
|
342
|
+
var questionsList = null;
|
|
343
|
+
if (data.length > 0) {
|
|
344
|
+
questionsList = data.map(function(item, index) {
|
|
345
345
|
return {
|
|
346
346
|
key: "messageSource",
|
|
347
347
|
value: item.id,
|
|
348
348
|
question: item.question,
|
|
349
349
|
answer: item.answer
|
|
350
350
|
};
|
|
351
|
-
} else {
|
|
352
|
-
return null;
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
var obj = {
|
|
357
|
-
roomId: roomId,
|
|
358
|
-
sender: "AI",
|
|
359
|
-
recevier: mid,
|
|
360
|
-
message: "Hi,我是智能学习助手,你遇到了什么问题?",
|
|
361
|
-
extraInfos: questionsList.length > 0 ? questionsList : null
|
|
362
|
-
};
|
|
363
|
-
if (pageNumHistory <= 1) {
|
|
364
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
365
|
-
var newHistoryMessageList = historyMessageList.filter(function(e) {
|
|
366
|
-
return e.id != "123456_date";
|
|
367
351
|
});
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
352
|
+
}
|
|
353
|
+
console.log("dflkvmdfklvdf欢迎语", data);
|
|
354
|
+
var obj = {
|
|
355
|
+
roomId: roomId,
|
|
356
|
+
sender: "AI",
|
|
357
|
+
recevier: mid,
|
|
358
|
+
message: "Hi,我是智能学习助手,你遇到了什么问题?",
|
|
359
|
+
extraInfos: questionsList == null ? null : questionsList
|
|
360
|
+
};
|
|
361
|
+
if (pageNumHistory <= 1) {
|
|
362
|
+
console.log("欢迎语");
|
|
363
|
+
setHistoryMessageList(function(historyMessageList) {
|
|
364
|
+
var newHistoryMessageList = historyMessageList.filter(function(e) {
|
|
365
|
+
return e.id != "123456_date";
|
|
366
|
+
});
|
|
367
|
+
newHistoryMessageList.push(_object_spread_props(_object_spread({}, obj), {
|
|
368
|
+
id: "123456_date",
|
|
369
|
+
upvoted: false,
|
|
370
|
+
downvoted: false,
|
|
371
|
+
quotedMessage: "",
|
|
372
|
+
createdAt: getDataTime(-1),
|
|
373
|
+
extraInfo: obj.extraInfos != null ? JSON.stringify(obj.extraInfos) : null
|
|
374
|
+
}));
|
|
375
|
+
console.log(newHistoryMessageList, 3333333333339999);
|
|
376
|
+
return newHistoryMessageList;
|
|
377
|
+
});
|
|
378
|
+
scrollToBottom();
|
|
379
|
+
}
|
|
380
|
+
return;
|
|
381
|
+
} catch (error) {}
|
|
381
382
|
}).catch(function() {});
|
|
382
383
|
}
|
|
383
384
|
} else {
|
|
@@ -417,6 +418,7 @@ var CustomerService = function(props) {
|
|
|
417
418
|
var questionsList = [];
|
|
418
419
|
var obj = {};
|
|
419
420
|
if (type == 1) {
|
|
421
|
+
console.log("dflkvmdfklvdf欢迎语");
|
|
420
422
|
sendWelcomMessage();
|
|
421
423
|
// console.log(hotQuestionsList,newHotQuestionsList.current,'33322221111');
|
|
422
424
|
// if(newHotQuestionsList.current.length > 0){
|