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

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 (67) hide show
  1. package/package.json +2 -2
  2. package/es/@types/index.d.ts +0 -620
  3. package/es/CardTag/index.d.ts +0 -3
  4. package/es/CardTag/index.js +0 -18
  5. package/es/ChatMessageItem/index.d.ts +0 -17
  6. package/es/ChatMessageItem/index.js +0 -130
  7. package/es/ChatMessageItem/index.less +0 -108
  8. package/es/ChatMessageList/index.d.ts +0 -26
  9. package/es/ChatMessageList/index.js +0 -56
  10. package/es/ChatMessageList/index.less +0 -33
  11. package/es/GoodsCard/index.d.ts +0 -14
  12. package/es/GoodsCard/index.js +0 -93
  13. package/es/GoodsCard/index.less +0 -49
  14. package/es/GoodsOrderCard/index.d.ts +0 -17
  15. package/es/GoodsOrderCard/index.js +0 -161
  16. package/es/GoodsOrderCard/index.less +0 -81
  17. package/es/Icon/index.d.ts +0 -8
  18. package/es/Icon/index.js +0 -11
  19. package/es/ParseSession/index.d.ts +0 -21
  20. package/es/ParseSession/index.js +0 -454
  21. package/es/ParseSession/index.less +0 -181
  22. package/es/api/index.d.ts +0 -29
  23. package/es/api/index.js +0 -48
  24. package/es/common/const/index.d.ts +0 -46
  25. package/es/common/const/index.js +0 -82
  26. package/es/common/utils/index.d.ts +0 -33
  27. package/es/common/utils/index.js +0 -169
  28. package/es/index.d.ts +0 -25
  29. package/es/index.js +0 -76
  30. package/es/styles/extends.less +0 -50
  31. package/es/styles/index.less +0 -35
  32. package/es/styles/vars.less +0 -8
  33. package/es/utils/index.d.ts +0 -14
  34. package/es/utils/index.js +0 -50
  35. package/lib/@types/index.d.ts +0 -620
  36. package/lib/CardTag/index.d.ts +0 -3
  37. package/lib/CardTag/index.js +0 -25
  38. package/lib/ChatMessageItem/index.d.ts +0 -17
  39. package/lib/ChatMessageItem/index.js +0 -136
  40. package/lib/ChatMessageItem/index.less +0 -108
  41. package/lib/ChatMessageList/index.d.ts +0 -26
  42. package/lib/ChatMessageList/index.js +0 -63
  43. package/lib/ChatMessageList/index.less +0 -33
  44. package/lib/GoodsCard/index.d.ts +0 -14
  45. package/lib/GoodsCard/index.js +0 -103
  46. package/lib/GoodsCard/index.less +0 -49
  47. package/lib/GoodsOrderCard/index.d.ts +0 -17
  48. package/lib/GoodsOrderCard/index.js +0 -169
  49. package/lib/GoodsOrderCard/index.less +0 -81
  50. package/lib/Icon/index.d.ts +0 -8
  51. package/lib/Icon/index.js +0 -18
  52. package/lib/ParseSession/index.d.ts +0 -21
  53. package/lib/ParseSession/index.js +0 -456
  54. package/lib/ParseSession/index.less +0 -181
  55. package/lib/api/index.d.ts +0 -29
  56. package/lib/api/index.js +0 -55
  57. package/lib/common/const/index.d.ts +0 -46
  58. package/lib/common/const/index.js +0 -88
  59. package/lib/common/utils/index.d.ts +0 -33
  60. package/lib/common/utils/index.js +0 -183
  61. package/lib/index.d.ts +0 -25
  62. package/lib/index.js +0 -85
  63. package/lib/styles/extends.less +0 -50
  64. package/lib/styles/index.less +0 -35
  65. package/lib/styles/vars.less +0 -8
  66. package/lib/utils/index.d.ts +0 -14
  67. package/lib/utils/index.js +0 -56
@@ -1,161 +0,0 @@
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) && relationId && accid) {
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;
@@ -1,81 +0,0 @@
1
- @prefix: chart-messages-item;
2
-
3
- .@{prefix}-order {
4
- 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
- }
@@ -1,8 +0,0 @@
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;
package/es/Icon/index.js DELETED
@@ -1,11 +0,0 @@
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;
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { IMMessage } from '../@types';
3
- import './index.less';
4
- export interface IParseSessionProps {
5
- prefix?: string;
6
- keyword?: string;
7
- h5?: boolean;
8
- msg: IMMessage;
9
- isSessionEnd?: boolean;
10
- onChartHistoryClick?: Function;
11
- recordSession?: {
12
- relationId: string | number;
13
- accid: string;
14
- relationType?: number;
15
- };
16
- }
17
- export declare const pauseAllAudio: () => HTMLAudioElement;
18
- export declare const pauseOtherVideo: (idClient: string) => void;
19
- export declare const pauseAllVideo: () => void;
20
- declare const ParseSession: React.FC<IParseSessionProps>;
21
- export default ParseSession;