@fle-ui/plus-im-record 0.0.8-beta.0 → 0.0.8-beta.3

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.
Files changed (79) hide show
  1. package/es/@types/index.d.ts +620 -0
  2. package/es/CardTag/index.d.ts +3 -0
  3. package/es/CardTag/index.js +18 -0
  4. package/es/ChatMessageItem/index.d.ts +15 -0
  5. package/es/ChatMessageItem/index.js +130 -0
  6. package/es/ChatMessageItem/index.less +108 -0
  7. package/es/ChatMessageList/index.d.ts +29 -0
  8. package/es/ChatMessageList/index.js +66 -0
  9. package/es/ChatMessageList/index.less +34 -0
  10. package/es/GoodsCard/index.d.ts +15 -0
  11. package/es/GoodsCard/index.js +95 -0
  12. package/es/GoodsCard/index.less +49 -0
  13. package/es/GoodsOrderCard/index.d.ts +14 -0
  14. package/es/GoodsOrderCard/index.js +161 -0
  15. package/es/GoodsOrderCard/index.less +81 -0
  16. package/es/Icon/index.d.ts +8 -0
  17. package/es/Icon/index.js +11 -0
  18. package/es/ParseSession/AudioPlayer.d.ts +14 -0
  19. package/es/ParseSession/AudioPlayer.js +89 -0
  20. package/es/ParseSession/audioAndVideoTool.d.ts +3 -0
  21. package/es/ParseSession/audioAndVideoTool.js +21 -0
  22. package/es/ParseSession/index.d.ts +15 -0
  23. package/es/ParseSession/index.js +492 -0
  24. package/es/ParseSession/index.less +226 -0
  25. package/es/api/index.d.ts +30 -0
  26. package/es/api/index.js +48 -0
  27. package/es/audioAndVideoTool.d.ts +3 -0
  28. package/es/audioAndVideoTool.js +21 -0
  29. package/es/common/const/index.d.ts +46 -0
  30. package/es/common/const/index.js +82 -0
  31. package/es/common/utils/index.d.ts +33 -0
  32. package/es/common/utils/index.js +169 -0
  33. package/es/index.d.ts +38 -0
  34. package/es/index.js +111 -0
  35. package/es/styles/extends.less +50 -0
  36. package/es/styles/index.less +35 -0
  37. package/es/styles/vars.less +8 -0
  38. package/es/utils/index.d.ts +14 -0
  39. package/es/utils/index.js +50 -0
  40. package/lib/@types/index.d.ts +620 -0
  41. package/lib/CardTag/index.d.ts +3 -0
  42. package/lib/CardTag/index.js +25 -0
  43. package/lib/ChatMessageItem/index.d.ts +15 -0
  44. package/lib/ChatMessageItem/index.js +136 -0
  45. package/lib/ChatMessageItem/index.less +108 -0
  46. package/lib/ChatMessageList/index.d.ts +29 -0
  47. package/lib/ChatMessageList/index.js +76 -0
  48. package/lib/ChatMessageList/index.less +34 -0
  49. package/lib/GoodsCard/index.d.ts +15 -0
  50. package/lib/GoodsCard/index.js +105 -0
  51. package/lib/GoodsCard/index.less +49 -0
  52. package/lib/GoodsOrderCard/index.d.ts +14 -0
  53. package/lib/GoodsOrderCard/index.js +169 -0
  54. package/lib/GoodsOrderCard/index.less +81 -0
  55. package/lib/Icon/index.d.ts +8 -0
  56. package/lib/Icon/index.js +18 -0
  57. package/lib/ParseSession/AudioPlayer.d.ts +14 -0
  58. package/lib/ParseSession/AudioPlayer.js +98 -0
  59. package/lib/ParseSession/audioAndVideoTool.d.ts +3 -0
  60. package/lib/ParseSession/audioAndVideoTool.js +27 -0
  61. package/lib/ParseSession/index.d.ts +15 -0
  62. package/lib/ParseSession/index.js +494 -0
  63. package/lib/ParseSession/index.less +226 -0
  64. package/lib/api/index.d.ts +30 -0
  65. package/lib/api/index.js +55 -0
  66. package/lib/audioAndVideoTool.d.ts +3 -0
  67. package/lib/audioAndVideoTool.js +27 -0
  68. package/lib/common/const/index.d.ts +46 -0
  69. package/lib/common/const/index.js +88 -0
  70. package/lib/common/utils/index.d.ts +33 -0
  71. package/lib/common/utils/index.js +183 -0
  72. package/lib/index.d.ts +38 -0
  73. package/lib/index.js +119 -0
  74. package/lib/styles/extends.less +50 -0
  75. package/lib/styles/index.less +35 -0
  76. package/lib/styles/vars.less +8 -0
  77. package/lib/utils/index.d.ts +14 -0
  78. package/lib/utils/index.js +56 -0
  79. package/package.json +2 -2
@@ -0,0 +1,161 @@
1
+ import "antd/es/tooltip/style";
2
+ import _Tooltip from "antd/es/tooltip";
3
+ import "antd/es/message/style";
4
+ import _message from "antd/es/message";
5
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+ import React, { useContext, useEffect, useState } from 'react';
13
+ import { ExclamationCircleOutlined } from '@ant-design/icons';
14
+ import classNames from 'classnames';
15
+ import Icon from '../Icon';
16
+ import CardTag from '../CardTag';
17
+ import { cardTagMap, fallbackImg } from '../common/const';
18
+ import { copyText } from '../common/utils';
19
+ import { ImContext } from '..';
20
+ import './index.less';
21
+ var ORDER_STATUS_MAP = {
22
+ 1: {
23
+ text: '待付款'
24
+ },
25
+ 2: {
26
+ text: '待发货'
27
+ },
28
+ 3: {
29
+ text: '已发货'
30
+ },
31
+ 4: {
32
+ text: '已完成'
33
+ },
34
+ 5: {
35
+ text: '已关闭'
36
+ },
37
+ 6: {
38
+ text: '售后'
39
+ }
40
+ };
41
+ export function fitUrl(url) {
42
+ if (!url) return '';
43
+ return url.startsWith('http') ? url : "http://".concat(url);
44
+ }
45
+ var GoodsOrderCard = function GoodsOrderCard(props) {
46
+ var _ref2, _ORDER_STATUS_MAP$dat;
47
+ var _useContext = useContext(ImContext),
48
+ api = _useContext.api;
49
+ var _props$prefix = props.prefix,
50
+ prefix = _props$prefix === void 0 ? 'chart-messages-item' : _props$prefix,
51
+ _props$suspend = props.suspend,
52
+ suspend = _props$suspend === void 0 ? false : _props$suspend,
53
+ _props$orderSn = props.orderSn,
54
+ orderSn = _props$orderSn === void 0 ? '' : _props$orderSn,
55
+ orderId = props.orderId,
56
+ recordSession = props.recordSession;
57
+ var relationId = recordSession === null || recordSession === void 0 ? void 0 : recordSession.relationId;
58
+ var relationType = recordSession === null || recordSession === void 0 ? void 0 : recordSession.relationType;
59
+ var accid = recordSession === null || recordSession === void 0 ? void 0 : recordSession.accid;
60
+ var _useState = useState({}),
61
+ _useState2 = _slicedToArray(_useState, 2),
62
+ data = _useState2[0],
63
+ setData = _useState2[1];
64
+ useEffect(function () {
65
+ if (orderId || orderSn) {
66
+ api.getCSOrder({
67
+ orderSn: orderSn,
68
+ orderId: Number(orderId) || orderId,
69
+ accid: accid,
70
+ relationId: relationId,
71
+ relationType: relationType
72
+ }).then(function (_ref) {
73
+ var data = _ref.data;
74
+ setData(data || {});
75
+ });
76
+ }
77
+ }, [orderSn, orderId, relationId, accid]);
78
+ function onCardClick() {
79
+ // 现金
80
+ // https://cash.koudaiqifu.cn/1002855/order/order_detail?order_id=12128707
81
+ // 积分
82
+ // https://jifen.koudaiqifu.cn/1003408/order/order_detail?order_id=12128708
83
+ // 卡券
84
+ // http://cardjs.ufuly.cn/index.html#/8JmeYWGzdyI=/exchangeHistory
85
+ if (data.applicationId === 7) {
86
+ if (data.siteUrl) {
87
+ window.open(fitUrl(data.siteUrl), '_blank');
88
+ }
89
+ } else if (data.siteUrl) {
90
+ window.open("".concat(fitUrl(data.siteUrl), "/order/order_detail?order_id=").concat(data.orderId), '_blank');
91
+ }
92
+ }
93
+ function formatOrderPrice() {
94
+ var price = '';
95
+ if (data.applicationId === 6) {
96
+ price = "".concat(data.totalPrice || 0, "\u5143");
97
+ }
98
+ if (Number(data.totalScore) > 0 && Number(data.totalPrice) > 0) {
99
+ price = "".concat(data.totalPrice, "\u5143+").concat(data.totalScore).concat(data.currencyStr || '积分');
100
+ } else if (Number(data.totalScore) > 0) {
101
+ price = "".concat(data.totalScore).concat(data.currencyStr);
102
+ } else if (Number(data.totalPrice) > 0) {
103
+ price = "".concat(data.totalPrice, "\u5143");
104
+ }
105
+ if (price) {
106
+ price = "\uFF0C\u5408\u8BA1".concat(price);
107
+ }
108
+ return price;
109
+ }
110
+ return /*#__PURE__*/React.createElement("div", {
111
+ className: classNames("".concat(prefix, "-order"), {
112
+ suspend: suspend
113
+ }),
114
+ onClick: function onClick() {
115
+ return onCardClick();
116
+ }
117
+ }, /*#__PURE__*/React.createElement("div", {
118
+ className: "".concat(prefix, "-order-info")
119
+ }, /*#__PURE__*/React.createElement("div", {
120
+ className: "".concat(prefix, "-order-info-img"),
121
+ style: {
122
+ background: "url(".concat(data.pic || fallbackImg, ") 0 0 / cover no-repeat")
123
+ }
124
+ }), /*#__PURE__*/React.createElement("div", {
125
+ className: "".concat(prefix, "-order-info-right")
126
+ }, /*#__PURE__*/React.createElement("div", {
127
+ className: "".concat(prefix, "-order-info-title")
128
+ }, /*#__PURE__*/React.createElement("div", {
129
+ className: "one-line-text"
130
+ }, "\u8BA2\u5355\u7F16\u53F7: ", data.orderSn), /*#__PURE__*/React.createElement(_Tooltip, {
131
+ title: "\u590D\u5236"
132
+ }, /*#__PURE__*/React.createElement(Icon, {
133
+ type: "icon-fuzhi",
134
+ onClick: function onClick(e) {
135
+ e.stopPropagation();
136
+ e.preventDefault();
137
+ copyText(data.orderSn).then(function () {
138
+ _message.success('复制成功');
139
+ });
140
+ }
141
+ }))), data.applicationId === 7 ? null : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
142
+ className: "".concat(prefix, "-order-info-price")
143
+ }, "\u5171\u8BA1", data.itemCount || 0, "\u4EF6\u5546\u54C1", formatOrderPrice())), /*#__PURE__*/React.createElement("div", {
144
+ className: "".concat(prefix, "-order-info-bottom")
145
+ }, /*#__PURE__*/React.createElement("div", {
146
+ className: "".concat(prefix, "-order-info-tags")
147
+ }, Array.isArray(data.tagList) ? data.tagList.map(function (item, idx) {
148
+ if (item.supplierType && cardTagMap[item.supplierType]) {
149
+ return /*#__PURE__*/React.createElement(CardTag, _extends({}, cardTagMap[item.supplierType], {
150
+ key: idx
151
+ }));
152
+ } else {
153
+ return null;
154
+ }
155
+ }) : null), /*#__PURE__*/React.createElement("div", {
156
+ className: "".concat(prefix, "-order-info-state")
157
+ }, (_ref2 = data.state && ((_ORDER_STATUS_MAP$dat = ORDER_STATUS_MAP[data.state]) === null || _ORDER_STATUS_MAP$dat === void 0 ? void 0 : _ORDER_STATUS_MAP$dat.text)) !== null && _ref2 !== void 0 ? _ref2 : '')))), !suspend && !data.isCurrentSite && /*#__PURE__*/React.createElement("div", {
158
+ className: "".concat(prefix, "-order-tip")
159
+ }, /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null), "\xA0 \u5F53\u524D\u8BA2\u5355\u5E76\u4E0D\u662F\u672C\u7AD9\u70B9\u5185\u8BA2\u5355\uFF0C\u8BF7\u6838\u5BF9\uFF01"));
160
+ };
161
+ export default GoodsOrderCard;
@@ -0,0 +1,81 @@
1
+ @prefix: chart-messages-item;
2
+
3
+ .@{prefix}-order {
4
+ max-width: 272px;
5
+ padding-bottom: 2px;
6
+
7
+ &-info {
8
+ display: flex;
9
+ flex-flow: row;
10
+ padding: 12px;
11
+ cursor: pointer;
12
+ border-radius: 4px;
13
+ background-color: #fff;
14
+ &-img {
15
+ flex-shrink: 0;
16
+ border-radius: 3px;
17
+ width: 72px;
18
+ height: 72px;
19
+ margin-right: 6px;
20
+ overflow: hidden;
21
+ object-fit: fill;
22
+ background: url() no-repeat;
23
+ }
24
+ img {
25
+ width: 100%;
26
+ object-fit: contain;
27
+ }
28
+
29
+ &-right {
30
+ flex: 1;
31
+ overflow: hidden;
32
+ }
33
+ &-title {
34
+ display: flex;
35
+ justify-content: space-between;
36
+ align-items: center;
37
+ margin-bottom: 5px;
38
+
39
+ .one-line-text {
40
+ flex: 1;
41
+ padding-right: 3px;
42
+ }
43
+ .anticon {
44
+ color: #aaa;
45
+ }
46
+ .anticon:hover {
47
+ color: #2c6bffff;
48
+ }
49
+ }
50
+
51
+ &-price {
52
+ font-size: 12px;
53
+ color: #aaa;
54
+ }
55
+
56
+ &-bottom {
57
+ display: flex;
58
+ }
59
+ &-tags {
60
+ flex: 1;
61
+ }
62
+ &-state {
63
+ margin-bottom: 2px;
64
+ align-self: flex-end;
65
+ font-size: 12px;
66
+ color: #8c8c8c;
67
+ line-height: 16px;
68
+ }
69
+ }
70
+
71
+ &-tip {
72
+ margin-top: 5px;
73
+ height: 24px;
74
+ padding-left: 5px;
75
+ line-height: 24px;
76
+ background: rgba(225, 11, 25, 0.06);
77
+ border-radius: 4px;
78
+ color: #e10b19;
79
+ font-size: 12px;
80
+ }
81
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { AntdIconProps } from '@ant-design/icons/lib/components/AntdIcon';
3
+ interface MainProps {
4
+ [key: string]: any;
5
+ type: string;
6
+ }
7
+ declare const Icon: React.FC<MainProps & AntdIconProps>;
8
+ export default Icon;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { createFromIconfontCN } from '@ant-design/icons';
3
+ // antd 字体图标
4
+ var IconFont = createFromIconfontCN({
5
+ scriptUrl: ['//at.alicdn.com/t/c/font_4411856_i5o5y30jwrr.js' // 小鲤客服
6
+ ]
7
+ });
8
+ var Icon = function Icon(props) {
9
+ return /*#__PURE__*/React.createElement(IconFont, props);
10
+ };
11
+ export default Icon;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface AudioPlayerProps {
3
+ prefix: string;
4
+ msg: {
5
+ idClient: string;
6
+ flow: string;
7
+ };
8
+ url: string;
9
+ dur: number;
10
+ text?: string;
11
+ style?: React.CSSProperties;
12
+ }
13
+ declare const AudioPlayer: React.FC<AudioPlayerProps>;
14
+ export default AudioPlayer;
@@ -0,0 +1,89 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React, { useState, useRef } from 'react';
14
+ import Icon from '../Icon';
15
+ var AudioPlayer = function AudioPlayer(_ref) {
16
+ var prefix = _ref.prefix,
17
+ msg = _ref.msg,
18
+ url = _ref.url,
19
+ dur = _ref.dur,
20
+ text = _ref.text,
21
+ _ref$style = _ref.style,
22
+ style = _ref$style === void 0 ? {} : _ref$style;
23
+ var audioRef = useRef(null);
24
+ var _useState = useState(false),
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ animationFlag = _useState2[0],
27
+ setAnimationFlag = _useState2[1];
28
+ var pauseAllAudio = function pauseAllAudio() {
29
+ var audio = document.getElementById('fxMessageAudio');
30
+ audio === null || audio === void 0 ? void 0 : audio.pause();
31
+ return audio;
32
+ };
33
+ var pauseAllVideo = function pauseAllVideo() {
34
+ var videoElements = document.getElementsByTagName('video');
35
+ for (var i = 0; i < videoElements.length; i++) {
36
+ if (videoElements[i].id.startsWith('fxMessageVideo-')) {
37
+ videoElements[i].pause();
38
+ }
39
+ }
40
+ };
41
+ var handleAudioClick = function handleAudioClick() {
42
+ var _audioRef$current;
43
+ pauseAllVideo();
44
+ var oldAudio = pauseAllAudio();
45
+ var msgId = oldAudio === null || oldAudio === void 0 ? void 0 : oldAudio.getAttribute('msgId');
46
+ if (msgId === msg.idClient) {
47
+ setAnimationFlag(false);
48
+ return;
49
+ }
50
+ var audio = new Audio(url);
51
+ audio.id = 'fxMessageAudio';
52
+ audio.setAttribute('msgId', msg.idClient);
53
+ audio.play();
54
+ (_audioRef$current = audioRef.current) === null || _audioRef$current === void 0 ? void 0 : _audioRef$current.appendChild(audio);
55
+ audio.addEventListener('ended', function () {
56
+ var _audio$parentNode;
57
+ setAnimationFlag(false);
58
+ (_audio$parentNode = audio.parentNode) === null || _audio$parentNode === void 0 ? void 0 : _audio$parentNode.removeChild(audio);
59
+ });
60
+ audio.addEventListener('pause', function () {
61
+ var _audio$parentNode2;
62
+ setAnimationFlag(false);
63
+ (_audio$parentNode2 = audio.parentNode) === null || _audio$parentNode2 === void 0 ? void 0 : _audio$parentNode2.removeChild(audio);
64
+ });
65
+ setAnimationFlag(true);
66
+ };
67
+ var duration = Math.floor(dur) || 0;
68
+ var durations = {
69
+ mm: Math.floor(duration / 60),
70
+ ss: duration % 60
71
+ };
72
+ return /*#__PURE__*/React.createElement("div", {
73
+ className: "".concat(prefix, "-audio"),
74
+ ref: audioRef,
75
+ style: _objectSpread({}, style)
76
+ }, /*#__PURE__*/React.createElement("div", {
77
+ className: msg.flow === 'in' ? "".concat(prefix, "-audio-in") : "".concat(prefix, "-audio-out"),
78
+ onClick: handleAudioClick
79
+ }, /*#__PURE__*/React.createElement("span", null, ' ', "".concat(durations.mm > 0 ? "".concat(durations.mm, "'") : '', " ").concat(durations.ss, "\"")), /*#__PURE__*/React.createElement("span", {
80
+ className: "".concat(prefix, "-audio-icon")
81
+ }, animationFlag ? /*#__PURE__*/React.createElement("img", {
82
+ src: "https://qa-oss.elebuys.com/tmpdir/202401152050070000640984.gif"
83
+ }) : /*#__PURE__*/React.createElement(Icon, {
84
+ type: "icon-a-yuyin2"
85
+ }))), text && /*#__PURE__*/React.createElement("div", {
86
+ className: "".concat(prefix, "-audio-audio2text")
87
+ }, text));
88
+ };
89
+ export default AudioPlayer;
@@ -0,0 +1,3 @@
1
+ export declare const pauseAllAudio: () => HTMLAudioElement;
2
+ export declare const pauseOtherVideo: (idClient: string) => void;
3
+ export declare const pauseAllVideo: () => void;
@@ -0,0 +1,21 @@
1
+ export var pauseAllAudio = function pauseAllAudio() {
2
+ var audio = document.getElementById('fxMessageAudio');
3
+ audio === null || audio === void 0 ? void 0 : audio.pause();
4
+ return audio;
5
+ };
6
+ export var pauseOtherVideo = function pauseOtherVideo(idClient) {
7
+ var videoElements = document.getElementsByTagName('video');
8
+ for (var i = 0; i < videoElements.length; i++) {
9
+ if (videoElements[i].id !== "fxMessageVideo-".concat(idClient)) {
10
+ videoElements[i].pause();
11
+ }
12
+ }
13
+ };
14
+ export var pauseAllVideo = function pauseAllVideo() {
15
+ var videoElements = document.getElementsByTagName('video');
16
+ for (var i = 0; i < videoElements.length; i++) {
17
+ if (videoElements[i].id.startsWith('fxMessageVideo-')) {
18
+ videoElements[i].pause();
19
+ }
20
+ }
21
+ };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { IMMessage } from '../@types';
3
+ import { RecordSession } from '../ChatMessageList';
4
+ import './index.less';
5
+ export interface IParseSessionProps {
6
+ prefix?: string;
7
+ keyword?: string;
8
+ h5?: boolean;
9
+ msg: IMMessage;
10
+ isSessionEnd?: boolean;
11
+ onChartHistoryClick?: Function;
12
+ recordSession?: RecordSession;
13
+ }
14
+ declare const ParseSession: React.FC<IParseSessionProps>;
15
+ export default ParseSession;