bhd-components 0.7.27 → 0.7.29

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.
@@ -136,9 +136,11 @@ const getBase64Image = (src)=>{
136
136
  const formatDate = (dateStr)=>{
137
137
  const today = new Date();
138
138
  const date = new Date(dateStr);
139
+ let isSameDay = today.getFullYear() === date.getFullYear() && today.getMonth() === date.getMonth() && today.getDate() === date.getDate();
139
140
  const dayDiff = Math.ceil((today - date) / (1000 * 60 * 60 * 24)); // 计算天数差
141
+ // 判断当前的日期 是否于传入的日期为同一天 同一天则显示时间 不是同一天则判断是否超过一周
140
142
  // console.log(dayDiff,'dayDiffdayDiff',today,'___',date);
141
- if (dayDiff === 0 || dayDiff === 1) {
143
+ if (isSameDay) {
142
144
  // 今天
143
145
  return date.toLocaleTimeString('zh-CN', {
144
146
  hour12: false
@@ -1427,10 +1427,13 @@ const CustomerService = (props)=>{
1427
1427
  }).then((res)=>{
1428
1428
  if (res.data.questions) {
1429
1429
  setQuestionsList((questionList)=>{
1430
- return [
1430
+ let newList = [
1431
1431
  ...questionList,
1432
1432
  ...res.data.questions
1433
1433
  ];
1434
+ // 数组去重
1435
+ newList = newList.filter((item, index, self)=>index === self.findIndex((t)=>t.id === item.id));
1436
+ return newList;
1434
1437
  });
1435
1438
  }
1436
1439
  });
@@ -2656,11 +2659,11 @@ const CustomerService = (props)=>{
2656
2659
  children: [
2657
2660
  /*#__PURE__*/ _jsxs("p", {
2658
2661
  onClick: ()=>{
2659
- sendScreenshotData('讲解图片里的知识点;');
2662
+ sendScreenshotData('讲解图片里的知识点');
2660
2663
  },
2661
2664
  children: [
2662
2665
  /*#__PURE__*/ _jsx(CustomKnowledgeContent, {}),
2663
- "讲解图片里的知识点;"
2666
+ "讲解图片里的知识点"
2664
2667
  ]
2665
2668
  }),
2666
2669
  /*#__PURE__*/ _jsx("br", {}),
@@ -769,6 +769,13 @@
769
769
  }
770
770
  }
771
771
  }
772
+ code{
773
+ border: none;
774
+ background-color: @color-background-fillsecondary-Tr;
775
+ border-radius: 2px;
776
+ color: #000;
777
+ padding: 0 2px;
778
+ }
772
779
  }
773
780
  p>code{
774
781
  border: none;
@@ -766,6 +766,13 @@
766
766
  }
767
767
  }
768
768
  }
769
+ code{
770
+ border: none;
771
+ background-color: @color-background-fillsecondary-Tr;
772
+ border-radius: 2px;
773
+ color: #000;
774
+ padding: 0 2px;
775
+ }
769
776
  }
770
777
  p>code{
771
778
  border: none;
@@ -140,9 +140,11 @@ var getBase64Image = function(src) {
140
140
  var formatDate = function(dateStr) {
141
141
  var today = new Date();
142
142
  var date = new Date(dateStr);
143
+ var isSameDay = today.getFullYear() === date.getFullYear() && today.getMonth() === date.getMonth() && today.getDate() === date.getDate();
143
144
  var dayDiff = Math.ceil((today - date) / (1000 * 60 * 60 * 24)); // 计算天数差
145
+ // 判断当前的日期 是否于传入的日期为同一天 同一天则显示时间 不是同一天则判断是否超过一周
144
146
  // console.log(dayDiff,'dayDiffdayDiff',today,'___',date);
145
- if (dayDiff === 0 || dayDiff === 1) {
147
+ if (isSameDay) {
146
148
  // 今天
147
149
  return date.toLocaleTimeString("zh-CN", {
148
150
  hour12: false
@@ -1467,7 +1467,14 @@ var CustomerService = function(props) {
1467
1467
  }).then(function(res) {
1468
1468
  if (res.data.questions) {
1469
1469
  setQuestionsList(function(questionList) {
1470
- return _to_consumable_array(questionList).concat(_to_consumable_array(res.data.questions));
1470
+ var newList = _to_consumable_array(questionList).concat(_to_consumable_array(res.data.questions));
1471
+ // 数组去重
1472
+ newList = newList.filter(function(item, index, self) {
1473
+ return index === self.findIndex(function(t) {
1474
+ return t.id === item.id;
1475
+ });
1476
+ });
1477
+ return newList;
1471
1478
  });
1472
1479
  }
1473
1480
  });
@@ -2707,11 +2714,11 @@ var CustomerService = function(props) {
2707
2714
  children: [
2708
2715
  /*#__PURE__*/ _jsxs("p", {
2709
2716
  onClick: function() {
2710
- sendScreenshotData("讲解图片里的知识点;");
2717
+ sendScreenshotData("讲解图片里的知识点");
2711
2718
  },
2712
2719
  children: [
2713
2720
  /*#__PURE__*/ _jsx(CustomKnowledgeContent, {}),
2714
- "讲解图片里的知识点;"
2721
+ "讲解图片里的知识点"
2715
2722
  ]
2716
2723
  }),
2717
2724
  /*#__PURE__*/ _jsx("br", {}),
@@ -769,6 +769,13 @@
769
769
  }
770
770
  }
771
771
  }
772
+ code{
773
+ border: none;
774
+ background-color: @color-background-fillsecondary-Tr;
775
+ border-radius: 2px;
776
+ color: #000;
777
+ padding: 0 2px;
778
+ }
772
779
  }
773
780
  p>code{
774
781
  border: none;
@@ -766,6 +766,13 @@
766
766
  }
767
767
  }
768
768
  }
769
+ code{
770
+ border: none;
771
+ background-color: @color-background-fillsecondary-Tr;
772
+ border-radius: 2px;
773
+ color: #000;
774
+ padding: 0 2px;
775
+ }
769
776
  }
770
777
  p>code{
771
778
  border: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.7.27",
3
+ "version": "0.7.29",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",