@pisell/materials 3.0.61 → 3.0.63
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +28 -60
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +22 -54
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/TimeResourceSelector/index.d.ts +21 -0
- package/es/components/TimeResourceSelector/index.js +115 -0
- package/es/components/TimeResourceSelector/index.less +59 -0
- package/es/components/cardPro/index.js +1 -4
- package/es/components/collapse/index.js +27 -4
- package/es/components/iconfont/index.js +1 -1
- package/es/components/pisellAnchor/index.d.ts +15 -0
- package/es/components/pisellAnchor/index.js +126 -0
- package/es/components/pisellAnchor/index.less +177 -0
- package/es/components/pisellAvatar/index.d.ts +19 -0
- package/es/components/pisellAvatar/index.js +90 -0
- package/es/components/pisellAvatar/index.less +26 -0
- package/es/components/pisellCard/index.d.ts +8 -0
- package/es/components/pisellCard/index.js +34 -5
- package/es/components/pisellCard/index.less +31 -4
- package/es/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
- package/es/components/pisellCustomCheckboxGroup/index.js +72 -0
- package/es/components/pisellCustomCheckboxGroup/index.less +0 -0
- package/es/components/pisellDropdown/index.d.ts +20 -0
- package/es/components/pisellDropdown/index.js +51 -0
- package/es/components/pisellDropdown/index.less +44 -0
- package/es/components/pisellEmpty/index.d.ts +2 -1
- package/es/components/pisellHeaderProgressBar/index.d.ts +29 -0
- package/es/components/pisellHeaderProgressBar/index.js +76 -0
- package/es/components/pisellHeaderProgressBar/index.less +18 -0
- package/es/components/pisellImageCarousels/index.d.ts +18 -0
- package/es/components/pisellImageCarousels/index.js +108 -0
- package/es/components/pisellImageCarousels/index.less +92 -0
- package/es/components/pisellList01/index.d.ts +17 -0
- package/es/components/pisellList01/index.js +105 -0
- package/es/components/pisellList01/index.less +53 -0
- package/es/components/pisellModal/components/PcModal/index.js +1 -1
- package/es/components/pisellSectionHeaders/index.d.ts +21 -0
- package/es/components/pisellSectionHeaders/index.js +35 -0
- package/es/components/pisellSectionHeaders/index.less +46 -0
- package/es/components/pisellText/components/Amount/index.js +1 -1
- package/es/components/pisellViewGrid/index.d.ts +16 -0
- package/es/components/pisellViewGrid/index.js +66 -0
- package/es/components/pisellViewGrid/index.less +31 -0
- package/es/components/productCard/components/Action/index.js +1 -1
- package/es/components/productCard/components/AmountFooter/index.d.ts +1 -1
- package/es/components/productCard/components/AmountFooter/index.js +30 -10
- package/es/components/productCard/components/AmountFooter/index.less +11 -0
- package/es/components/productCard/components/Header/index.js +24 -15
- package/es/components/productCard/components/MultiDay/index.d.ts +4 -0
- package/es/components/productCard/components/MultiDay/index.js +79 -0
- package/es/components/productCard/components/MultiDay/index.less +34 -0
- package/es/components/productCard/components/MultiDay/utils.d.ts +14 -0
- package/es/components/productCard/components/MultiDay/utils.js +54 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.js +11 -5
- package/es/components/productCard/components/Packages/components/options/index.js +2 -2
- package/es/components/productCard/components/Packages/index.js +1 -2
- package/es/components/productCard/components/Sales/index.js +2 -2
- package/es/components/productCard/components/Time/index.js +15 -13
- package/es/components/productCard/hooks/useOpenNote.js +3 -2
- package/es/components/productCard/index.d.ts +1 -1
- package/es/components/productCard/index.js +39 -21
- package/es/components/productCard/index.less +6 -1
- package/es/components/productCard/status.d.ts +24 -1
- package/es/components/productCard/status.js +54 -2
- package/es/components/productCard/types.d.ts +62 -1
- package/es/components/productCard/utils.d.ts +10 -144
- package/es/components/productCard/utils.js +49 -670
- package/es/components/section-footers/index.d.ts +9 -0
- package/es/components/section-footers/index.js +17 -0
- package/es/components/section-footers/index.less +5 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/index.d.ts +10 -0
- package/es/index.js +10 -0
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/TimeResourceSelector/index.d.ts +21 -0
- package/lib/components/TimeResourceSelector/index.js +109 -0
- package/lib/components/TimeResourceSelector/index.less +59 -0
- package/lib/components/cardPro/index.js +0 -3
- package/lib/components/collapse/index.js +30 -4
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/pisellAnchor/index.d.ts +15 -0
- package/lib/components/pisellAnchor/index.js +120 -0
- package/lib/components/pisellAnchor/index.less +177 -0
- package/lib/components/pisellAvatar/index.d.ts +19 -0
- package/lib/components/pisellAvatar/index.js +108 -0
- package/lib/components/pisellAvatar/index.less +26 -0
- package/lib/components/pisellCard/index.d.ts +8 -0
- package/lib/components/pisellCard/index.js +30 -7
- package/lib/components/pisellCard/index.less +31 -4
- package/lib/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
- package/lib/components/pisellCustomCheckboxGroup/index.js +71 -0
- package/lib/components/pisellCustomCheckboxGroup/index.less +0 -0
- package/lib/components/pisellDropdown/index.d.ts +20 -0
- package/lib/components/pisellDropdown/index.js +72 -0
- package/lib/components/pisellDropdown/index.less +44 -0
- package/lib/components/pisellEmpty/index.d.ts +2 -1
- package/lib/components/pisellHeaderProgressBar/index.d.ts +29 -0
- package/lib/components/pisellHeaderProgressBar/index.js +88 -0
- package/lib/components/pisellHeaderProgressBar/index.less +18 -0
- package/lib/components/pisellImageCarousels/index.d.ts +18 -0
- package/lib/components/pisellImageCarousels/index.js +108 -0
- package/lib/components/pisellImageCarousels/index.less +92 -0
- package/lib/components/pisellList01/index.d.ts +17 -0
- package/lib/components/pisellList01/index.js +113 -0
- package/lib/components/pisellList01/index.less +53 -0
- package/lib/components/pisellModal/components/PcModal/index.js +1 -1
- package/lib/components/pisellSectionHeaders/index.d.ts +21 -0
- package/lib/components/pisellSectionHeaders/index.js +52 -0
- package/lib/components/pisellSectionHeaders/index.less +46 -0
- package/lib/components/pisellText/components/Amount/index.js +2 -2
- package/lib/components/pisellViewGrid/index.d.ts +16 -0
- package/lib/components/pisellViewGrid/index.js +98 -0
- package/lib/components/pisellViewGrid/index.less +31 -0
- package/lib/components/productCard/components/Action/index.js +1 -1
- package/lib/components/productCard/components/AmountFooter/index.d.ts +1 -1
- package/lib/components/productCard/components/AmountFooter/index.js +33 -9
- package/lib/components/productCard/components/AmountFooter/index.less +11 -0
- package/lib/components/productCard/components/Header/index.js +18 -9
- package/lib/components/productCard/components/MultiDay/index.d.ts +4 -0
- package/lib/components/productCard/components/MultiDay/index.js +72 -0
- package/lib/components/productCard/components/MultiDay/index.less +34 -0
- package/lib/components/productCard/components/MultiDay/utils.d.ts +14 -0
- package/lib/components/productCard/components/MultiDay/utils.js +77 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.js +2 -1
- package/lib/components/productCard/components/Packages/components/options/index.js +2 -2
- package/lib/components/productCard/components/Packages/index.js +1 -1
- package/lib/components/productCard/components/Sales/index.js +1 -2
- package/lib/components/productCard/components/Time/index.js +14 -11
- package/lib/components/productCard/hooks/useOpenNote.js +2 -1
- package/lib/components/productCard/index.d.ts +1 -1
- package/lib/components/productCard/index.js +37 -20
- package/lib/components/productCard/index.less +6 -1
- package/lib/components/productCard/status.d.ts +24 -1
- package/lib/components/productCard/status.js +37 -2
- package/lib/components/productCard/types.d.ts +62 -1
- package/lib/components/productCard/utils.d.ts +10 -144
- package/lib/components/productCard/utils.js +40 -566
- package/lib/components/section-footers/index.d.ts +9 -0
- package/lib/components/section-footers/index.js +44 -0
- package/lib/components/section-footers/index.less +5 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/index.d.ts +10 -0
- package/lib/index.js +30 -0
- package/lowcode/pisell-anchor/meta.ts +118 -0
- package/lowcode/pisell-anchor/snippets.ts +26 -0
- package/lowcode/pisell-avatar/__screenshots__/avatar-1.jpg +0 -0
- package/lowcode/pisell-avatar/meta.ts +111 -0
- package/lowcode/pisell-avatar/snippets.ts +14 -0
- package/lowcode/pisell-card/meta.ts +62 -27
- package/lowcode/pisell-card/snippets.ts +6 -0
- package/lowcode/pisell-custom-checkbox-group/__screenshots__/card-1.png +0 -0
- package/lowcode/pisell-custom-checkbox-group/meta.ts +204 -0
- package/lowcode/pisell-custom-checkbox-group/snippets.ts +56 -0
- package/lowcode/pisell-dropdown/__screenshots__/dropdown-1.png +0 -0
- package/lowcode/pisell-dropdown/meta.ts +180 -0
- package/lowcode/pisell-dropdown/snippets.ts +69 -0
- package/lowcode/pisell-header-progress-bar/meta.ts +116 -0
- package/lowcode/pisell-header-progress-bar/snippets.ts +24 -0
- package/lowcode/pisell-image-carousels/meta.ts +143 -0
- package/lowcode/pisell-image-carousels/snippets.ts +20 -0
- package/lowcode/pisell-list01/meta.ts +74 -0
- package/lowcode/pisell-list01/snippets.ts +35 -0
- package/lowcode/pisell-section-headers/meta.ts +91 -0
- package/lowcode/pisell-section-headers/snippets.ts +22 -0
- package/lowcode/pisell-view-grid/__screenshots__/card-1.png +0 -0
- package/lowcode/pisell-view-grid/meta.ts +167 -0
- package/lowcode/pisell-view-grid/snippets.ts +54 -0
- package/lowcode/section-footers/meta.ts +66 -0
- package/lowcode/section-footers/snippe.ts +21 -0
- package/package.json +4 -3
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
+
import { Tooltip } from 'antd';
|
|
4
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
3
5
|
import { _formatAmount } from "../Packages/utils";
|
|
4
6
|
import Divider from "../Divider";
|
|
5
7
|
import "./index.less";
|
|
6
8
|
import { locales } from '@pisell/utils';
|
|
7
9
|
var prefix = 'pisell-lowcode-';
|
|
8
10
|
var Footer = function Footer(_ref) {
|
|
9
|
-
var _item$_extend, _item$_extend2;
|
|
10
11
|
var item = _ref.item,
|
|
11
12
|
hideDivider = _ref.hideDivider,
|
|
12
|
-
type = _ref.type
|
|
13
|
+
type = _ref.type,
|
|
14
|
+
isOnlyTotal = _ref.isOnlyTotal;
|
|
15
|
+
var total = item.total,
|
|
16
|
+
origin_total = item.origin_total,
|
|
17
|
+
symbol = item.symbol,
|
|
18
|
+
tip = item.tip,
|
|
19
|
+
num = item.num,
|
|
20
|
+
discount_reason = item.discount_reason;
|
|
13
21
|
/**
|
|
14
22
|
* @title: 折扣
|
|
15
23
|
* @description:
|
|
@@ -20,19 +28,31 @@ var Footer = function Footer(_ref) {
|
|
|
20
28
|
*/
|
|
21
29
|
var isDiscount = useMemo(function () {
|
|
22
30
|
// item中没有该属性则不展示
|
|
23
|
-
if (!
|
|
24
|
-
return Number(
|
|
25
|
-
}, [
|
|
31
|
+
if (!origin_total) return false;
|
|
32
|
+
return Number(total) != Number(origin_total);
|
|
33
|
+
}, [total, origin_total]);
|
|
26
34
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !hideDivider ? /*#__PURE__*/React.createElement(Divider, {
|
|
27
35
|
type: type !== 'total' ? 'inside' : ''
|
|
28
36
|
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
29
|
-
className: classNames("".concat(prefix, "packages-product-footer"), hideDivider && "".concat(prefix, "packages-product-hide-divider-footer"))
|
|
30
|
-
}, /*#__PURE__*/React.createElement("div",
|
|
37
|
+
className: classNames("".concat(prefix, "packages-product-footer"), hideDivider && "".concat(prefix, "packages-product-hide-divider-footer"), isOnlyTotal && "".concat(prefix, "packages-product-only-total-footer"))
|
|
38
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: classNames("".concat(prefix, "packages-product-footer-price-wrap"))
|
|
40
|
+
}, !isOnlyTotal ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: classNames("".concat(prefix, "packages-product-footer-price"))
|
|
42
|
+
}, /*#__PURE__*/React.createElement("span", null, _formatAmount(total, symbol)), tip ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
43
|
+
title: locales.getText(tip),
|
|
44
|
+
destroyTooltipOnHide: true
|
|
45
|
+
}, /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
|
|
46
|
+
style: {
|
|
47
|
+
fontSize: '16px',
|
|
48
|
+
color: '#1570ef'
|
|
49
|
+
}
|
|
50
|
+
})) : null), /*#__PURE__*/React.createElement("span", null, "\xD7".concat(num))) : null, /*#__PURE__*/React.createElement("span", {
|
|
31
51
|
className: "".concat(prefix, "packages-product-footer-total")
|
|
32
|
-
}, _formatAmount(
|
|
52
|
+
}, _formatAmount(total * num, symbol))), isDiscount ? /*#__PURE__*/React.createElement("div", {
|
|
33
53
|
className: "".concat(prefix, "packages-product-footer-discount")
|
|
34
|
-
}, /*#__PURE__*/React.createElement("span", null, _formatAmount(
|
|
54
|
+
}, !isOnlyTotal ? /*#__PURE__*/React.createElement("span", null, _formatAmount(origin_total, symbol)) : null, /*#__PURE__*/React.createElement("span", null, _formatAmount(origin_total * num, symbol, 2))) : null), isDiscount && discount_reason && type === 'total' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
|
|
35
55
|
className: "".concat(prefix, "product-item-discount-reason")
|
|
36
|
-
}, /*#__PURE__*/React.createElement("span", null, "".concat(locales.getText('pisell2.product.card.discount.reason'), ": ").concat(
|
|
56
|
+
}, /*#__PURE__*/React.createElement("span", null, "".concat(locales.getText('pisell2.product.card.discount.reason'), ": ").concat(discount_reason)))) : null);
|
|
37
57
|
};
|
|
38
58
|
export default Footer;
|
|
@@ -12,6 +12,17 @@
|
|
|
12
12
|
justify-content: space-between;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
&-packages-product-only-total-footer {
|
|
16
|
+
> div {
|
|
17
|
+
justify-content: end !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-packages-product-footer-price {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 4px;
|
|
25
|
+
}
|
|
15
26
|
|
|
16
27
|
&-packages-product-footer-discount {
|
|
17
28
|
font-size: 12px;
|
|
@@ -2,7 +2,7 @@ import { Button } from 'antd';
|
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import Iconfont from "../../../iconfont";
|
|
5
|
-
import { image, formatAmount } from '@pisell/utils';
|
|
5
|
+
import { image as imageAli, formatAmount } from '@pisell/utils';
|
|
6
6
|
import Options from "../Packages/components/options";
|
|
7
7
|
import "./index.less";
|
|
8
8
|
var prefix = 'pisell-lowcode-';
|
|
@@ -12,6 +12,15 @@ var Header = function Header(props) {
|
|
|
12
12
|
showImage = props.showImage,
|
|
13
13
|
onDelete = props.onDelete,
|
|
14
14
|
disabledEdit = props.disabledEdit;
|
|
15
|
+
var id = item.id,
|
|
16
|
+
options = item.options,
|
|
17
|
+
bundle = item.bundle,
|
|
18
|
+
product_option_string = item.product_option_string,
|
|
19
|
+
image = item.image,
|
|
20
|
+
name = item.name,
|
|
21
|
+
price = item.price,
|
|
22
|
+
symbol = item.symbol,
|
|
23
|
+
show_delete = item.show_delete;
|
|
15
24
|
|
|
16
25
|
/**
|
|
17
26
|
* @title: 是否显示价格
|
|
@@ -22,9 +31,10 @@ var Header = function Header(props) {
|
|
|
22
31
|
* @Date: 2024-11-23 16:13
|
|
23
32
|
*/
|
|
24
33
|
var showPrice = useMemo(function () {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
// 如果有报价单则不需要显示价格
|
|
35
|
+
|
|
36
|
+
return (bundle === null || bundle === void 0 ? void 0 : bundle.length) > 0 || (options === null || options === void 0 ? void 0 : options.length) > 0;
|
|
37
|
+
}, [bundle, options]);
|
|
28
38
|
|
|
29
39
|
/**
|
|
30
40
|
* @title: 样式是否居中
|
|
@@ -35,12 +45,11 @@ var Header = function Header(props) {
|
|
|
35
45
|
* @Date: 2024-11-23 17:37
|
|
36
46
|
*/
|
|
37
47
|
var headerCenterStyle = useMemo(function () {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, [item === null || item === void 0 ? void 0 : item.options, item === null || item === void 0 ? void 0 : item.product_option_string]);
|
|
48
|
+
return (options === null || options === void 0 ? void 0 : options.length) > 0 || product_option_string;
|
|
49
|
+
}, [options, product_option_string]);
|
|
41
50
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
51
|
className: classNames("".concat(prefix, "product-header"), headerCenterStyle && "".concat(prefix, "product-options-header"))
|
|
43
|
-
}, isShowDelete && !disabledEdit ? /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
}, isShowDelete && !disabledEdit || show_delete ? /*#__PURE__*/React.createElement("div", {
|
|
44
53
|
className: "".concat(prefix, "product-delete"),
|
|
45
54
|
onClick: function onClick(e) {
|
|
46
55
|
e.stopPropagation();
|
|
@@ -52,19 +61,19 @@ var Header = function Header(props) {
|
|
|
52
61
|
type: "pisell2-trash-01"
|
|
53
62
|
})
|
|
54
63
|
})) : null, showImage ? /*#__PURE__*/React.createElement("img", {
|
|
55
|
-
src:
|
|
64
|
+
src: imageAli.ali(image, 64),
|
|
56
65
|
className: "".concat(prefix, "product-header-cover")
|
|
57
|
-
}) : null,
|
|
66
|
+
}) : null, id ? /*#__PURE__*/React.createElement("div", {
|
|
58
67
|
className: "".concat(prefix, "product-right-wrap")
|
|
59
68
|
}, /*#__PURE__*/React.createElement("div", {
|
|
60
69
|
className: "".concat(prefix, "product-title")
|
|
61
|
-
}, /*#__PURE__*/React.createElement("span", null,
|
|
70
|
+
}, /*#__PURE__*/React.createElement("span", null, name), showPrice ? /*#__PURE__*/React.createElement("span", {
|
|
62
71
|
className: "".concat(prefix, "product-title-price")
|
|
63
|
-
}, formatAmount(
|
|
72
|
+
}, formatAmount(price, 2, symbol)) : null), product_option_string ? /*#__PURE__*/React.createElement("span", {
|
|
64
73
|
className: "".concat(prefix, "product-title-variant")
|
|
65
|
-
},
|
|
66
|
-
options:
|
|
67
|
-
amountSymbol:
|
|
74
|
+
}, product_option_string) : null, /*#__PURE__*/React.createElement(Options, {
|
|
75
|
+
options: options,
|
|
76
|
+
amountSymbol: symbol
|
|
68
77
|
})) : null);
|
|
69
78
|
};
|
|
70
79
|
export default Header;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import React, { useMemo } from 'react';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
import Divider from "../Divider";
|
|
10
|
+
import AmountFooter from "../AmountFooter";
|
|
11
|
+
import { formatMultiDayDate } from "../../utils";
|
|
12
|
+
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
13
|
+
import "./index.less";
|
|
14
|
+
import { formatDateRanges } from "./utils";
|
|
15
|
+
var prefix = 'pisell-lowcode-';
|
|
16
|
+
var MultiDay = function MultiDay(_ref) {
|
|
17
|
+
var _context$appHelper, _context$appHelper$ut;
|
|
18
|
+
var dataSource = _ref.dataSource,
|
|
19
|
+
hideDivider = _ref.hideDivider;
|
|
20
|
+
var items = dataSource.items,
|
|
21
|
+
symbol = dataSource.symbol,
|
|
22
|
+
locale = dataSource.locale;
|
|
23
|
+
var translationOriginal = function translationOriginal(text) {
|
|
24
|
+
return '';
|
|
25
|
+
};
|
|
26
|
+
var context = useEngineContext();
|
|
27
|
+
translationOriginal = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.translationOriginal;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @title: 商品单价 + 套餐价格
|
|
31
|
+
* @description:
|
|
32
|
+
* @param {*} useMemo
|
|
33
|
+
* @return {*}
|
|
34
|
+
* @Author: WangHan
|
|
35
|
+
* @Date: 2024-12-28 23:00
|
|
36
|
+
*/
|
|
37
|
+
var lists = useMemo(function () {
|
|
38
|
+
if (!(items !== null && items !== void 0 && items.length)) return [];
|
|
39
|
+
|
|
40
|
+
// // 套餐明细
|
|
41
|
+
// const bundleDetails = bundle
|
|
42
|
+
// ?.map(
|
|
43
|
+
// (b: any) =>
|
|
44
|
+
// `${translationOriginal(b?.title)} (${symbol}${
|
|
45
|
+
// Number(b.price) * Number(b.num)
|
|
46
|
+
// })`
|
|
47
|
+
// )
|
|
48
|
+
// ?.join('+');
|
|
49
|
+
|
|
50
|
+
return formatDateRanges(items);
|
|
51
|
+
}, [items]);
|
|
52
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: classNames("".concat(prefix, "multi-day-wrap"))
|
|
54
|
+
}, lists === null || lists === void 0 ? void 0 : lists.map(function (m, index) {
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
key: index
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Divider, {
|
|
58
|
+
type: "inside"
|
|
59
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: classNames("".concat(prefix, "multi-day"))
|
|
61
|
+
}, /*#__PURE__*/React.createElement("div", null, formatMultiDayDate(_objectSpread(_objectSpread({}, m), {}, {
|
|
62
|
+
locale: locale
|
|
63
|
+
}))), /*#__PURE__*/React.createElement(AmountFooter, {
|
|
64
|
+
item: _objectSpread(_objectSpread({}, m), {}, {
|
|
65
|
+
symbol: symbol
|
|
66
|
+
}),
|
|
67
|
+
hideDivider: true
|
|
68
|
+
})));
|
|
69
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: classNames("".concat(prefix, "multi-day-total-wrap"))
|
|
71
|
+
}, /*#__PURE__*/React.createElement(AmountFooter, {
|
|
72
|
+
item: _objectSpread(_objectSpread({}, dataSource), {}, {
|
|
73
|
+
num: 1
|
|
74
|
+
}),
|
|
75
|
+
type: "total",
|
|
76
|
+
isOnlyTotal: true
|
|
77
|
+
})));
|
|
78
|
+
};
|
|
79
|
+
export default MultiDay;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@pisell-prefix: pisell-lowcode;
|
|
2
|
+
|
|
3
|
+
.@{pisell-prefix} {
|
|
4
|
+
&-multi-day-wrap {
|
|
5
|
+
margin-top: 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&-multi-day {
|
|
9
|
+
color: var(--Gray-500, #667085);
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
line-height: 20px;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-multi-day-total {
|
|
18
|
+
color: var(--Gray-900, #101828);
|
|
19
|
+
text-align: right;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
line-height: 20px;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&-multi-day-total-discount {
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
font-weight: 400;
|
|
30
|
+
line-height: 18px;
|
|
31
|
+
text-decoration-line: line-through;
|
|
32
|
+
color: var(--Gray-500, #667085);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface InputItem {
|
|
2
|
+
start_date: string;
|
|
3
|
+
end_date: string;
|
|
4
|
+
total: number;
|
|
5
|
+
num: number;
|
|
6
|
+
}
|
|
7
|
+
interface OutputItem {
|
|
8
|
+
start_date: string;
|
|
9
|
+
end_date: string;
|
|
10
|
+
total: number;
|
|
11
|
+
num: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function formatDateRanges(list: InputItem[]): OutputItem[];
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import dayjs from 'dayjs';
|
|
8
|
+
|
|
9
|
+
// 定义输入数据的接口
|
|
10
|
+
|
|
11
|
+
export function formatDateRanges(list) {
|
|
12
|
+
var result = [];
|
|
13
|
+
var currentGroup = null;
|
|
14
|
+
list.forEach(function (item, index) {
|
|
15
|
+
// Convert string dates using dayjs
|
|
16
|
+
var currentStartDate = dayjs(item.start_date);
|
|
17
|
+
var currentEndDate = dayjs(item.end_date);
|
|
18
|
+
var currentTotal = item.total;
|
|
19
|
+
var currentNum = item.num;
|
|
20
|
+
if (!currentGroup) {
|
|
21
|
+
// Start a new group
|
|
22
|
+
currentGroup = _objectSpread(_objectSpread({}, item), {}, {
|
|
23
|
+
start_date: currentStartDate.format('YYYY-MM-DD'),
|
|
24
|
+
end_date: currentEndDate.format('YYYY-MM-DD'),
|
|
25
|
+
total: currentTotal,
|
|
26
|
+
num: currentNum
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
var prevEndDate = dayjs(currentGroup.end_date);
|
|
30
|
+
|
|
31
|
+
// Check if current item can be merged with current group
|
|
32
|
+
if (currentTotal === currentGroup.total && prevEndDate.isSame(currentStartDate, 'day')) {
|
|
33
|
+
// Update end date and add up num
|
|
34
|
+
currentGroup.end_date = currentEndDate.format('YYYY-MM-DD');
|
|
35
|
+
currentGroup.num += currentNum;
|
|
36
|
+
} else {
|
|
37
|
+
// Push current group and start a new one
|
|
38
|
+
result.push(currentGroup);
|
|
39
|
+
currentGroup = _objectSpread(_objectSpread({}, item), {}, {
|
|
40
|
+
start_date: currentStartDate.format('YYYY-MM-DD'),
|
|
41
|
+
end_date: currentEndDate.format('YYYY-MM-DD'),
|
|
42
|
+
total: currentTotal,
|
|
43
|
+
num: currentNum
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Push the last group
|
|
49
|
+
if (index === list.length - 1 && currentGroup) {
|
|
50
|
+
result.push(currentGroup);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
@@ -12,18 +12,24 @@ export var renderBundles = function renderBundles(item, hidePrice, isShowPackage
|
|
|
12
12
|
};
|
|
13
13
|
var context = useEngineContext();
|
|
14
14
|
translationOriginal = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.translationOriginal;
|
|
15
|
+
var title = item.title,
|
|
16
|
+
name = item.name,
|
|
17
|
+
id = item.id,
|
|
18
|
+
price = item.price,
|
|
19
|
+
symbol = item.symbol,
|
|
20
|
+
option = item.option;
|
|
15
21
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
key:
|
|
22
|
+
key: id,
|
|
17
23
|
className: "".concat(prefix, "packages-product-bundle-item")
|
|
18
24
|
}, /*#__PURE__*/React.createElement("div", {
|
|
19
25
|
className: "".concat(prefix, "packages-product-bundle-info")
|
|
20
26
|
}, /*#__PURE__*/React.createElement("div", {
|
|
21
27
|
className: "".concat(prefix, "packages-product-bundle-info-title")
|
|
22
|
-
}, translationOriginal(
|
|
28
|
+
}, translationOriginal(title || name)), !hidePrice ? /*#__PURE__*/React.createElement("div", {
|
|
23
29
|
className: "".concat(prefix, "packages-product-bundle-info-num")
|
|
24
|
-
}, _formatAmount(
|
|
25
|
-
options:
|
|
26
|
-
amountSymbol:
|
|
30
|
+
}, _formatAmount(price, symbol)) : null), /*#__PURE__*/React.createElement(Options, {
|
|
31
|
+
options: option,
|
|
32
|
+
amountSymbol: symbol
|
|
27
33
|
}), /*#__PURE__*/React.createElement(Footer, {
|
|
28
34
|
item: item
|
|
29
35
|
}), isShowPackageNote ? /*#__PURE__*/React.createElement(Note, {
|
|
@@ -15,9 +15,9 @@ var Options = function Options(_ref) {
|
|
|
15
15
|
className: "".concat(prefix, "packages-product-bundle-option-item-left")
|
|
16
16
|
}, /*#__PURE__*/React.createElement("span", null, option === null || option === void 0 ? void 0 : option.name), /*#__PURE__*/React.createElement("div", {
|
|
17
17
|
className: "".concat(prefix, "packages-product-bundle-option-item-left-amount")
|
|
18
|
-
}, /*#__PURE__*/React.createElement("span", null, _formatAmount(option === null || option === void 0 ? void 0 : option.
|
|
18
|
+
}, /*#__PURE__*/React.createElement("span", null, _formatAmount(option === null || option === void 0 ? void 0 : option.price, amountSymbol)), /*#__PURE__*/React.createElement("span", null, "\xD7"), /*#__PURE__*/React.createElement("span", null, option === null || option === void 0 ? void 0 : option.num))), /*#__PURE__*/React.createElement("span", {
|
|
19
19
|
className: "".concat(prefix, "packages-product-bundle-option-item-amount")
|
|
20
|
-
}, _formatAmount((option === null || option === void 0 ? void 0 : option.
|
|
20
|
+
}, _formatAmount((option === null || option === void 0 ? void 0 : option.price) * (option === null || option === void 0 ? void 0 : option.num), amountSymbol)));
|
|
21
21
|
})) : null;
|
|
22
22
|
};
|
|
23
23
|
export default Options;
|
|
@@ -23,8 +23,7 @@ var Packages = function Packages(_ref) {
|
|
|
23
23
|
list: bundle || [],
|
|
24
24
|
renderItem: function renderItem(items) {
|
|
25
25
|
return renderBundles(_objectSpread(_objectSpread({}, items), {}, {
|
|
26
|
-
symbol: item === null || item === void 0 ? void 0 : item.symbol
|
|
27
|
-
total: items === null || items === void 0 ? void 0 : items.price
|
|
26
|
+
symbol: item === null || item === void 0 ? void 0 : item.symbol
|
|
28
27
|
}), false, isShowPackageNote);
|
|
29
28
|
}
|
|
30
29
|
}))) : null;
|
|
@@ -10,10 +10,10 @@ import { renderBundles } from "../Packages/components/collapsibleList/utils";
|
|
|
10
10
|
import "./index.less";
|
|
11
11
|
var prefix = 'pisell-lowcode-';
|
|
12
12
|
var Sales = function Sales(_ref) {
|
|
13
|
-
var
|
|
13
|
+
var _other_products;
|
|
14
14
|
var item = _ref.item,
|
|
15
15
|
isShowNote = _ref.isShowNote;
|
|
16
|
-
var other_products = (item === null || item === void 0 ? void 0 :
|
|
16
|
+
var other_products = (item === null || item === void 0 ? void 0 : item.relation_products) || [];
|
|
17
17
|
|
|
18
18
|
// 格式化商品数据
|
|
19
19
|
other_products = other_products.map(function (p) {
|
|
@@ -11,34 +11,36 @@ import Like from "./components/Like";
|
|
|
11
11
|
import "./index.less";
|
|
12
12
|
var prefix = 'pisell-lowcode-';
|
|
13
13
|
var Time = function Time(_ref) {
|
|
14
|
-
var _item$_extend5, _item$_extend5$date, _item$_extend6, _item$_extend7, _item$_extend8, _item$_extend9, _item$_extend10, _item$_extend11, _item$_extend12;
|
|
15
14
|
var item = _ref.item,
|
|
16
15
|
isShowHolder = _ref.isShowHolder,
|
|
17
16
|
_onLike = _ref.onLike;
|
|
17
|
+
var start_date = item.start_date,
|
|
18
|
+
end_date = item.end_date,
|
|
19
|
+
holder_title = item.holder_title,
|
|
20
|
+
resource_id = item.resource_id,
|
|
21
|
+
relation_form_name = item.relation_form_name,
|
|
22
|
+
like_status = item.like_status;
|
|
18
23
|
var isShow = useMemo(function () {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, [item === null || item === void 0 ? void 0 : item._extend, isShowHolder]);
|
|
24
|
+
return start_date && end_date || isShowHolder && holder_title || resource_id || relation_form_name;
|
|
25
|
+
}, [start_date, isShowHolder, holder_title, resource_id]);
|
|
22
26
|
return isShow ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
|
|
23
27
|
className: "".concat(prefix, "product-time-wrap")
|
|
24
|
-
},
|
|
28
|
+
}, start_date && end_date ? /*#__PURE__*/React.createElement("div", {
|
|
25
29
|
className: "".concat(prefix, "product-date")
|
|
26
|
-
}, getServiceTime(item,
|
|
30
|
+
}, getServiceTime(item, start_date)) : null, isShowHolder && holder_title ? /*#__PURE__*/React.createElement("div", {
|
|
27
31
|
className: "".concat(prefix, "product-holder-wrap")
|
|
28
|
-
},
|
|
32
|
+
}, holder_title) : null, resource_id || relation_form_name ? /*#__PURE__*/React.createElement("div", {
|
|
29
33
|
className: "".concat(prefix, "product-technician")
|
|
30
|
-
},
|
|
34
|
+
}, resource_id ? /*#__PURE__*/React.createElement(Like, {
|
|
31
35
|
style: {
|
|
32
36
|
marginRight: 4
|
|
33
37
|
},
|
|
34
|
-
status:
|
|
38
|
+
status: like_status,
|
|
35
39
|
onLike: function onLike(e) {
|
|
36
40
|
_onLike(_objectSpread(_objectSpread({}, item), {}, {
|
|
37
|
-
|
|
38
|
-
like_status: e
|
|
39
|
-
})
|
|
41
|
+
like_status: e
|
|
40
42
|
}));
|
|
41
43
|
}
|
|
42
|
-
}) : null,
|
|
44
|
+
}) : null, relation_form_name) : null)) : null;
|
|
43
45
|
};
|
|
44
46
|
export default Time;
|
|
@@ -5,7 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useState, forwardRef, useImperativeHandle } from 'react';
|
|
8
|
-
import { locales } from '@pisell/utils';
|
|
8
|
+
import { locales, isMobile } from '@pisell/utils';
|
|
9
9
|
import { PisellModal, Input } from "../../../index";
|
|
10
10
|
var useOpenNote = function useOpenNote(_ref, ref) {
|
|
11
11
|
var onNoteChange = _ref.onNoteChange;
|
|
@@ -36,7 +36,7 @@ var useOpenNote = function useOpenNote(_ref, ref) {
|
|
|
36
36
|
setOpen(false);
|
|
37
37
|
};
|
|
38
38
|
return /*#__PURE__*/React.createElement(PisellModal, {
|
|
39
|
-
platform: 'pc',
|
|
39
|
+
platform: isMobile() ? 'h5' : 'pc',
|
|
40
40
|
open: open,
|
|
41
41
|
bodyStyle: {
|
|
42
42
|
padding: 0
|
|
@@ -47,6 +47,7 @@ var useOpenNote = function useOpenNote(_ref, ref) {
|
|
|
47
47
|
},
|
|
48
48
|
onOk: handleOk,
|
|
49
49
|
destroyOnClose: true,
|
|
50
|
+
mobileModalHeight: '80vh',
|
|
50
51
|
className: "pisell-lowcode__booking-select-pet-modal-wrap",
|
|
51
52
|
okText: locales.getText('pisell2.product.card.confirm'),
|
|
52
53
|
cancelText: locales.getText('pisell2.product.card.cancel')
|