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.
@@ -333,45 +333,46 @@ const CustomerService = (props)=>{
333
333
  ],
334
334
  "maximum": 3
335
335
  }).then((res)=>{
336
- let data = res.data.questions;
337
- let questionsList = null;
338
- if (data.length > 0) {
339
- questionsList = data.map((item, index)=>{
340
- if (index < 3) {
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
- } else {
348
- return null;
349
- }
350
- });
351
- }
352
- let obj = {
353
- roomId: roomId,
354
- sender: "AI",
355
- recevier: mid,
356
- message: `Hi,我是智能学习助手,你遇到了什么问题?`,
357
- extraInfos: questionsList.length > 0 ? questionsList : null
358
- };
359
- if (pageNumHistory <= 1) {
360
- setHistoryMessageList((historyMessageList)=>{
361
- let newHistoryMessageList = historyMessageList.filter((e)=>e.id != '123456_date');
362
- newHistoryMessageList.push(_object_spread_props(_object_spread({}, obj), {
363
- id: '123456_date',
364
- upvoted: false,
365
- downvoted: false,
366
- quotedMessage: "",
367
- createdAt: getDataTime(-1),
368
- extraInfo: JSON.stringify(obj.extraInfos)
369
- }));
370
- return newHistoryMessageList;
371
- });
372
- scrollToBottom();
373
- }
374
- return;
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
- var data = res.data.questions;
341
- var questionsList = null;
342
- if (data.length > 0) {
343
- questionsList = data.map(function(item, index) {
344
- if (index < 3) {
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
- newHistoryMessageList.push(_object_spread_props(_object_spread({}, obj), {
369
- id: "123456_date",
370
- upvoted: false,
371
- downvoted: false,
372
- quotedMessage: "",
373
- createdAt: getDataTime(-1),
374
- extraInfo: JSON.stringify(obj.extraInfos)
375
- }));
376
- return newHistoryMessageList;
377
- });
378
- scrollToBottom();
379
- }
380
- return;
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){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.7.15",
3
+ "version": "0.7.16",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",