bhd-components 0.7.14 → 0.7.15

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.
@@ -309,7 +309,7 @@ const CustomerService = (props)=>{
309
309
  };
310
310
  //发送欢迎语,视频页面
311
311
  const sendWelcomMessage = ()=>{
312
- if (config.type == 'video') {
312
+ if (config && config.type == 'video') {
313
313
  let params = config.params;
314
314
  let videoId = params.videoId;
315
315
  let watchTime = params.videoProgress;
@@ -334,18 +334,21 @@ const CustomerService = (props)=>{
334
334
  "maximum": 3
335
335
  }).then((res)=>{
336
336
  let data = res.data.questions;
337
- let questionsList = data.map((item, index)=>{
338
- if (index < 3) {
339
- return {
340
- key: "messageSource",
341
- value: item.id,
342
- question: item.question,
343
- answer: item.answer
344
- };
345
- } else {
346
- return null;
347
- }
348
- });
337
+ let questionsList = null;
338
+ if (data.length > 0) {
339
+ questionsList = data.map((item, index)=>{
340
+ if (index < 3) {
341
+ return {
342
+ key: "messageSource",
343
+ value: item.id,
344
+ question: item.question,
345
+ answer: item.answer
346
+ };
347
+ } else {
348
+ return null;
349
+ }
350
+ });
351
+ }
349
352
  let obj = {
350
353
  roomId: roomId,
351
354
  sender: "AI",
@@ -2096,7 +2099,7 @@ const CustomerService = (props)=>{
2096
2099
  //是否在智能客服窗口
2097
2100
  isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
2098
2101
  let header = 2; //代表是ai头像
2099
- if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
2102
+ if (isAiChatWindow && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
2100
2103
  //使用AI头像
2101
2104
  header = 1;
2102
2105
  }
@@ -2160,7 +2163,7 @@ const CustomerService = (props)=>{
2160
2163
  })
2161
2164
  ]
2162
2165
  }),
2163
- 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", {
2166
+ item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/ _jsxs("ul", {
2164
2167
  className: `${styles.association_problem} ${item.message == '抱歉,我暂时无法回答这样的问题。' ? styles.association_problem_flag : ''}`,
2165
2168
  children: [
2166
2169
  item.message == '抱歉,我暂时无法回答这样的问题。' && /*#__PURE__*/ _jsx("li", {
@@ -627,6 +627,44 @@
627
627
  }
628
628
 
629
629
 
630
+ .association_problem_flag{
631
+
632
+ li{
633
+ padding-left: 30px;
634
+ position: relative;
635
+ &::after{
636
+ content: '';
637
+ width: 6px;
638
+ height: 6px;
639
+ border-radius: 50%;
640
+ background-color: rgba(217, 217, 217, 1);
641
+ display: block;
642
+ position: absolute;
643
+ top: 26px;
644
+ left: 10px;
645
+ }
646
+ }
647
+
648
+ li:first-child{
649
+ padding-left:0;
650
+ &::after{
651
+ display: none;
652
+ }
653
+ }
654
+
655
+ .related_issues_flag{
656
+ span{
657
+ color: #000;
658
+ font-weight: 600;
659
+ border-bottom: 6px solid @color-background-primary-weak-hover;
660
+ display: inline-block;
661
+ height: 22px;
662
+ }
663
+
664
+ }
665
+ }
666
+
667
+
630
668
  .img_con{
631
669
  width: 100%;
632
670
  text-align: center;
@@ -754,33 +792,6 @@
754
792
  }
755
793
  }
756
794
 
757
- .association_problem_flag{
758
- padding-left: 30px;
759
-
760
- li{
761
- position: relative;
762
- &::after{
763
- content: '';
764
- width: 6px;
765
- height: 6px;
766
- border-radius: 50%;
767
- background-color: rgba(217, 217, 217, 1);
768
- display: block;
769
- position: absolute;
770
- top: 12px;
771
- left: 12px;
772
- }
773
- }
774
- .related_issues_flag{
775
- span{
776
- color: #000;
777
- font-weight: 600;
778
- border-bottom: 4px solid @color-background-primary-weak-hover;
779
- }
780
-
781
- }
782
- }
783
-
784
795
  .time {
785
796
  display: block;
786
797
  margin: 40px 0;
@@ -313,7 +313,7 @@ var CustomerService = function(props) {
313
313
  };
314
314
  //发送欢迎语,视频页面
315
315
  var sendWelcomMessage = function() {
316
- if (config.type == "video") {
316
+ if (config && config.type == "video") {
317
317
  var params = config.params;
318
318
  var videoId = params.videoId;
319
319
  var watchTime = params.videoProgress;
@@ -338,18 +338,21 @@ var CustomerService = function(props) {
338
338
  "maximum": 3
339
339
  }).then(function(res) {
340
340
  var data = res.data.questions;
341
- var questionsList = data.map(function(item, index) {
342
- if (index < 3) {
343
- return {
344
- key: "messageSource",
345
- value: item.id,
346
- question: item.question,
347
- answer: item.answer
348
- };
349
- } else {
350
- return null;
351
- }
352
- });
341
+ var questionsList = null;
342
+ if (data.length > 0) {
343
+ questionsList = data.map(function(item, index) {
344
+ if (index < 3) {
345
+ return {
346
+ key: "messageSource",
347
+ value: item.id,
348
+ question: item.question,
349
+ answer: item.answer
350
+ };
351
+ } else {
352
+ return null;
353
+ }
354
+ });
355
+ }
353
356
  var obj = {
354
357
  roomId: roomId,
355
358
  sender: "AI",
@@ -2120,7 +2123,7 @@ var CustomerService = function(props) {
2120
2123
  //是否在智能客服窗口
2121
2124
  isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
2122
2125
  var header = 2; //代表是ai头像
2123
- if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
2126
+ if (isAiChatWindow && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
2124
2127
  //使用AI头像
2125
2128
  header = 1;
2126
2129
  }
@@ -2184,7 +2187,7 @@ var CustomerService = function(props) {
2184
2187
  })
2185
2188
  ]
2186
2189
  }),
2187
- 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", {
2190
+ item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/ _jsxs("ul", {
2188
2191
  className: "".concat(styles.association_problem, " ").concat(item.message == "抱歉,我暂时无法回答这样的问题。" ? styles.association_problem_flag : ""),
2189
2192
  children: [
2190
2193
  item.message == "抱歉,我暂时无法回答这样的问题。" && /*#__PURE__*/ _jsx("li", {
@@ -627,6 +627,44 @@
627
627
  }
628
628
 
629
629
 
630
+ .association_problem_flag{
631
+
632
+ li{
633
+ padding-left: 30px;
634
+ position: relative;
635
+ &::after{
636
+ content: '';
637
+ width: 6px;
638
+ height: 6px;
639
+ border-radius: 50%;
640
+ background-color: rgba(217, 217, 217, 1);
641
+ display: block;
642
+ position: absolute;
643
+ top: 26px;
644
+ left: 10px;
645
+ }
646
+ }
647
+
648
+ li:first-child{
649
+ padding-left:0;
650
+ &::after{
651
+ display: none;
652
+ }
653
+ }
654
+
655
+ .related_issues_flag{
656
+ span{
657
+ color: #000;
658
+ font-weight: 600;
659
+ border-bottom: 6px solid @color-background-primary-weak-hover;
660
+ display: inline-block;
661
+ height: 22px;
662
+ }
663
+
664
+ }
665
+ }
666
+
667
+
630
668
  .img_con{
631
669
  width: 100%;
632
670
  text-align: center;
@@ -754,33 +792,6 @@
754
792
  }
755
793
  }
756
794
 
757
- .association_problem_flag{
758
- padding-left: 30px;
759
-
760
- li{
761
- position: relative;
762
- &::after{
763
- content: '';
764
- width: 6px;
765
- height: 6px;
766
- border-radius: 50%;
767
- background-color: rgba(217, 217, 217, 1);
768
- display: block;
769
- position: absolute;
770
- top: 12px;
771
- left: 12px;
772
- }
773
- }
774
- .related_issues_flag{
775
- span{
776
- color: #000;
777
- font-weight: 600;
778
- border-bottom: 4px solid @color-background-primary-weak-hover;
779
- }
780
-
781
- }
782
- }
783
-
784
795
  .time {
785
796
  display: block;
786
797
  margin: 40px 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.7.14",
3
+ "version": "0.7.15",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",