@pisell/materials 6.2.32 → 6.2.34
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 +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +20 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +76 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.less +75 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.js +82 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.less +31 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.js +56 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +6 -6
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +1 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +1 -2
- package/es/components/productCard/cartSkuCard/components/resources/index.js +6 -8
- package/es/components/productCard/cartSkuCard/components/specs/index.less +1 -1
- package/es/components/productCard/cartSkuCard/components/timeRange/index.less +1 -1
- package/es/components/productCard/cartSkuCard/index.js +7 -7
- package/es/components/productCard/cartSkuCard/index.less +4 -0
- package/es/components/productCard/components/Header/index.js +1 -14
- package/es/components/productCard/components/Header/index.less +0 -20
- package/es/components/productCard/locales.js +3 -3
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +80 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.less +75 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.js +71 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.less +31 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.js +77 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +2 -2
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +1 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +1 -2
- package/lib/components/productCard/cartSkuCard/components/resources/index.js +4 -6
- package/lib/components/productCard/cartSkuCard/components/specs/index.less +1 -1
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.less +1 -1
- package/lib/components/productCard/cartSkuCard/index.js +5 -6
- package/lib/components/productCard/cartSkuCard/index.less +4 -0
- package/lib/components/productCard/components/Header/index.js +0 -4
- package/lib/components/productCard/components/Header/index.less +0 -20
- package/lib/components/productCard/locales.js +3 -3
- package/package.json +3 -3
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { Divider } from 'antd';
|
|
4
|
+
import { Tag, Tooltip } from 'antd';
|
|
5
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
6
|
+
import { _formatAmount } from "../packages/utils";
|
|
7
|
+
import "./index.less";
|
|
8
|
+
import { locales } from '@pisell/utils';
|
|
9
|
+
import { PREFIX } from "../../index";
|
|
10
|
+
var Footer = function Footer(_ref) {
|
|
11
|
+
var item = _ref.item,
|
|
12
|
+
hideDivider = _ref.hideDivider,
|
|
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;
|
|
21
|
+
/**
|
|
22
|
+
* @title: 折扣
|
|
23
|
+
* @description:
|
|
24
|
+
* @param {*} useMemo
|
|
25
|
+
* @return {*}
|
|
26
|
+
* @Author: WangHan
|
|
27
|
+
* @Date: 2024-11-22 13:50
|
|
28
|
+
*/
|
|
29
|
+
var isDiscount = useMemo(function () {
|
|
30
|
+
// item中没有该属性则不展示
|
|
31
|
+
if (!origin_total) return false;
|
|
32
|
+
return Number(total) != Number(origin_total);
|
|
33
|
+
}, [total, origin_total]);
|
|
34
|
+
var renderDiscountReason = function renderDiscountReason() {
|
|
35
|
+
if (isDiscount && discount_reason && type === 'total') {
|
|
36
|
+
if (Array.isArray(discount_reason)) {
|
|
37
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: "".concat(PREFIX, "_discount-reason")
|
|
39
|
+
}, discount_reason.map(function (reason, index) {
|
|
40
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
41
|
+
key: index,
|
|
42
|
+
color: "red"
|
|
43
|
+
}, reason);
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: "".concat(PREFIX, "_discount-reason")
|
|
48
|
+
}, /*#__PURE__*/React.createElement("span", null, "".concat(locales.getText('pisell2.product.card.discount.reason'), ": ").concat(discount_reason))));
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
};
|
|
52
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !hideDivider ? /*#__PURE__*/React.createElement(Divider, {
|
|
53
|
+
style: {
|
|
54
|
+
margin: 0
|
|
55
|
+
}
|
|
56
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: classNames("".concat(PREFIX, "__product-footer"), hideDivider && "".concat(PREFIX, "__hide-divider-footer"), isOnlyTotal && "".concat(PREFIX, "__only-total-footer"))
|
|
58
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: classNames("".concat(PREFIX, "__footer-price-wrap"))
|
|
60
|
+
}, !isOnlyTotal ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: classNames("".concat(PREFIX, "__footer-price"))
|
|
62
|
+
}, /*#__PURE__*/React.createElement("span", null, _formatAmount(total, symbol)), tip ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
63
|
+
title: locales.getText(tip),
|
|
64
|
+
destroyTooltipOnHide: true
|
|
65
|
+
}, /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
|
|
66
|
+
style: {
|
|
67
|
+
fontSize: '16px',
|
|
68
|
+
color: '#1570ef'
|
|
69
|
+
}
|
|
70
|
+
})) : null), /*#__PURE__*/React.createElement("span", null, "\xD7".concat(num))) : null, /*#__PURE__*/React.createElement("span", {
|
|
71
|
+
className: "".concat(PREFIX, "__footer-total")
|
|
72
|
+
}, isDiscount ? /*#__PURE__*/React.createElement("span", {
|
|
73
|
+
className: "".concat(PREFIX, "__footer-origin-total")
|
|
74
|
+
}, _formatAmount(origin_total * num, symbol, 2)) : null, /*#__PURE__*/React.createElement("span", null, _formatAmount(total * num, symbol))))), renderDiscountReason());
|
|
75
|
+
};
|
|
76
|
+
export default Footer;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
.pisell-cart-sku-card {
|
|
2
|
+
&__product-footer {
|
|
3
|
+
color: var(--Gray-500, #667085);
|
|
4
|
+
font-size: 14px;
|
|
5
|
+
font-style: normal;
|
|
6
|
+
font-weight: 600;
|
|
7
|
+
line-height: 20px;
|
|
8
|
+
> div {
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
&__only-total-footer {
|
|
14
|
+
> div {
|
|
15
|
+
justify-content: end !important;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__footer-price {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: 4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__footer-discount {
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
line-height: 18px;
|
|
29
|
+
text-decoration-line: line-through;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__footer-total {
|
|
33
|
+
color: var(--Gray-900, #101828);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&__footer-origin-total {
|
|
37
|
+
color: var(--Gray-500, #667085);
|
|
38
|
+
text-align: center;
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
line-height: 18px; /* 150% */
|
|
43
|
+
text-decoration-line: line-through;
|
|
44
|
+
margin-right: 8px;
|
|
45
|
+
display: inline-block;
|
|
46
|
+
transform: translateY(-1px);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__hide-divider-footer {
|
|
50
|
+
margin-top: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&-product-item-discount-reason {
|
|
54
|
+
color: var(--gray-500, #667085);
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
font-style: normal;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
line-height: 20px;
|
|
59
|
+
margin-top: 4px;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
gap: 4px;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
|
|
65
|
+
> span {
|
|
66
|
+
display: inline-block;
|
|
67
|
+
max-width: 100%;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
border-radius: 4px;
|
|
72
|
+
margin: 0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
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 : String(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
|
+
import React, { useMemo } from 'react';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
import { Divider } from 'antd';
|
|
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
|
+
import { PREFIX } from "../../index";
|
|
16
|
+
var MultiDay = function MultiDay(_ref) {
|
|
17
|
+
var _context$appHelper;
|
|
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
|
+
var utils = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils;
|
|
28
|
+
translationOriginal = (utils === null || utils === void 0 ? void 0 : utils.translationOriginal) || (utils === null || utils === void 0 ? void 0 : utils.translation);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @title: 商品单价 + 套餐价格
|
|
32
|
+
* @description:
|
|
33
|
+
* @param {*} useMemo
|
|
34
|
+
* @return {*}
|
|
35
|
+
* @Author: WangHan
|
|
36
|
+
* @Date: 2024-12-28 23:00
|
|
37
|
+
*/
|
|
38
|
+
var lists = useMemo(function () {
|
|
39
|
+
// if (!items?.length) return [];
|
|
40
|
+
|
|
41
|
+
// // 套餐明细
|
|
42
|
+
// const bundleDetails = bundle
|
|
43
|
+
// ?.map(
|
|
44
|
+
// (b: any) =>
|
|
45
|
+
// `${translationOriginal(b?.title)} (${symbol}${
|
|
46
|
+
// Number(b.price) * Number(b.num)
|
|
47
|
+
// })`
|
|
48
|
+
// )
|
|
49
|
+
// ?.join('+');
|
|
50
|
+
|
|
51
|
+
return formatDateRanges([dataSource]);
|
|
52
|
+
}, [items, dataSource]);
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: classNames("".concat(PREFIX, "__multi-day-wrap"))
|
|
55
|
+
}, lists === null || lists === void 0 ? void 0 : lists.map(function (m, index) {
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
key: index
|
|
58
|
+
}, /*#__PURE__*/React.createElement(Divider, {
|
|
59
|
+
style: {
|
|
60
|
+
margin: '4px 0'
|
|
61
|
+
}
|
|
62
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: classNames("".concat(PREFIX, "__multi-day"))
|
|
64
|
+
}, /*#__PURE__*/React.createElement("div", null, formatMultiDayDate(_objectSpread(_objectSpread({}, m), {}, {
|
|
65
|
+
locale: locale
|
|
66
|
+
}))), /*#__PURE__*/React.createElement(AmountFooter, {
|
|
67
|
+
item: _objectSpread(_objectSpread({}, m), {}, {
|
|
68
|
+
symbol: symbol
|
|
69
|
+
}),
|
|
70
|
+
hideDivider: true
|
|
71
|
+
})));
|
|
72
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: classNames("".concat(PREFIX, "__multi-day-total-wrap"))
|
|
74
|
+
}, /*#__PURE__*/React.createElement(AmountFooter, {
|
|
75
|
+
item: _objectSpread(_objectSpread({}, dataSource), {}, {
|
|
76
|
+
num: 1
|
|
77
|
+
}),
|
|
78
|
+
type: "total",
|
|
79
|
+
isOnlyTotal: true
|
|
80
|
+
})));
|
|
81
|
+
};
|
|
82
|
+
export default MultiDay;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.pisell-cart-sku-card {
|
|
2
|
+
&__multi-day-wrap {
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
&__multi-day {
|
|
6
|
+
color: var(--Gray-500, #667085);
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
line-height: 20px;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&__multi-day-total {
|
|
15
|
+
color: var(--Gray-900, #101828);
|
|
16
|
+
text-align: right;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
line-height: 20px;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&__multi-day-total-discount {
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
line-height: 18px;
|
|
28
|
+
text-decoration-line: line-through;
|
|
29
|
+
color: var(--Gray-500, #667085);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -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,56 @@
|
|
|
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 : String(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
|
+
import dayjs from 'dayjs';
|
|
8
|
+
|
|
9
|
+
// 定义输入数据的接口
|
|
10
|
+
|
|
11
|
+
// 定义输出数据的接口
|
|
12
|
+
|
|
13
|
+
export function formatDateRanges(list) {
|
|
14
|
+
var result = [];
|
|
15
|
+
var currentGroup = null;
|
|
16
|
+
list.forEach(function (item, index) {
|
|
17
|
+
// Convert string dates using dayjs
|
|
18
|
+
var currentStartDate = dayjs(item.start_date);
|
|
19
|
+
var currentEndDate = dayjs(item.end_date);
|
|
20
|
+
var currentTotal = item.total;
|
|
21
|
+
var currentNum = item.num;
|
|
22
|
+
if (!currentGroup) {
|
|
23
|
+
// Start a new group
|
|
24
|
+
currentGroup = _objectSpread(_objectSpread({}, item), {}, {
|
|
25
|
+
start_date: currentStartDate.format('YYYY-MM-DD'),
|
|
26
|
+
end_date: currentEndDate.format('YYYY-MM-DD'),
|
|
27
|
+
total: currentTotal,
|
|
28
|
+
num: currentNum
|
|
29
|
+
});
|
|
30
|
+
} else {
|
|
31
|
+
var prevEndDate = dayjs(currentGroup.end_date);
|
|
32
|
+
|
|
33
|
+
// Check if current item can be merged with current group
|
|
34
|
+
if (currentTotal === currentGroup.total && prevEndDate.isSame(currentStartDate, 'day')) {
|
|
35
|
+
// Update end date and add up num
|
|
36
|
+
currentGroup.end_date = currentEndDate.format('YYYY-MM-DD');
|
|
37
|
+
currentGroup.num += currentNum;
|
|
38
|
+
} else {
|
|
39
|
+
// Push current group and start a new one
|
|
40
|
+
result.push(currentGroup);
|
|
41
|
+
currentGroup = _objectSpread(_objectSpread({}, item), {}, {
|
|
42
|
+
start_date: currentStartDate.format('YYYY-MM-DD'),
|
|
43
|
+
end_date: currentEndDate.format('YYYY-MM-DD'),
|
|
44
|
+
total: currentTotal,
|
|
45
|
+
num: currentNum
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Push the last group
|
|
51
|
+
if (index === list.length - 1 && currentGroup) {
|
|
52
|
+
result.push(currentGroup);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
@@ -55,24 +55,24 @@ var BasicInfo = function BasicInfo(props) {
|
|
|
55
55
|
style: style || {}
|
|
56
56
|
}, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /*#__PURE__*/React.createElement("div", {
|
|
57
57
|
style: {
|
|
58
|
-
width:
|
|
58
|
+
width: 20
|
|
59
59
|
}
|
|
60
60
|
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
61
61
|
className: "product-info"
|
|
62
62
|
}, /*#__PURE__*/React.createElement("div", {
|
|
63
63
|
className: "product-name"
|
|
64
|
-
}, name),
|
|
65
|
-
dataSource: dataSource
|
|
66
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
}, name), !holder_id || !(holder_id !== null && holder_id !== void 0 && holder_id.length) ? /*#__PURE__*/React.createElement("div", {
|
|
67
65
|
className: "product-price"
|
|
68
|
-
}, formatAmount(price, 2, symbol))
|
|
66
|
+
}, formatAmount(price, 2, symbol)) : /*#__PURE__*/React.createElement(Holders, {
|
|
67
|
+
dataSource: dataSource
|
|
68
|
+
})));
|
|
69
69
|
}
|
|
70
70
|
return /*#__PURE__*/React.createElement("div", {
|
|
71
71
|
className: "".concat(PREFIX, "__basic-info"),
|
|
72
72
|
style: style || {}
|
|
73
73
|
}, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /*#__PURE__*/React.createElement("div", {
|
|
74
74
|
style: {
|
|
75
|
-
width:
|
|
75
|
+
width: 20
|
|
76
76
|
}
|
|
77
77
|
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
78
78
|
className: "product-info"
|
|
@@ -29,13 +29,11 @@ var Resources = function Resources(props) {
|
|
|
29
29
|
return null;
|
|
30
30
|
}) : null;
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return
|
|
38
|
-
className: "".concat(PREFIX, "__resources")
|
|
39
|
-
}, renderContent());
|
|
32
|
+
if (isMultipleResource && (multiResources === null || multiResources === void 0 ? void 0 : multiResources.length) > 0) {
|
|
33
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: "".concat(PREFIX, "__resources")
|
|
35
|
+
}, multiResources.map(renderResourceItem));
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
40
38
|
};
|
|
41
39
|
export default Resources;
|
|
@@ -20,11 +20,11 @@ import Packages from "./components/packages";
|
|
|
20
20
|
import Sales from "./components/sales";
|
|
21
21
|
import { SwipeAction } from "./components/swipeAction";
|
|
22
22
|
import Note from "./components/Note";
|
|
23
|
+
import AmountFooter from "./components/AmountFooter";
|
|
24
|
+
import Items from "./components/MultiDay";
|
|
23
25
|
import "./index.less";
|
|
24
26
|
import Iconfont from "../../iconfont";
|
|
25
27
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
26
|
-
import Items from "../components/MultiDay";
|
|
27
|
-
import AmountFooter from "../components/AmountFooter";
|
|
28
28
|
import Action from "../components/Action";
|
|
29
29
|
import { defaultValue } from "../status";
|
|
30
30
|
export var PREFIX = 'pisell-cart-sku-card';
|
|
@@ -101,9 +101,9 @@ var CartSkuCard = function CartSkuCard(props) {
|
|
|
101
101
|
return actions;
|
|
102
102
|
}, [dataSource, onDelete, isShowDelete, rightActions]);
|
|
103
103
|
var hideDivider = useMemo(function () {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return
|
|
104
|
+
return false;
|
|
105
|
+
// const { bundle, relation_products } = dataSource;
|
|
106
|
+
// return bundle?.length || relation_products?.length;
|
|
107
107
|
}, [dataSource]);
|
|
108
108
|
var renderA2 = function renderA2() {
|
|
109
109
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BasicInfo, {
|
|
@@ -133,7 +133,7 @@ var CartSkuCard = function CartSkuCard(props) {
|
|
|
133
133
|
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
134
134
|
type: "pisell2-trash-01"
|
|
135
135
|
})) : null, /*#__PURE__*/React.createElement(BasicInfo, {
|
|
136
|
-
isShowImage:
|
|
136
|
+
isShowImage: isShowImage,
|
|
137
137
|
dataSource: dataSource,
|
|
138
138
|
isMainProduct: true,
|
|
139
139
|
type: type
|
|
@@ -192,7 +192,7 @@ var CartSkuCard = function CartSkuCard(props) {
|
|
|
192
192
|
}, renderContent())) : /*#__PURE__*/React.createElement("div", {
|
|
193
193
|
className: classNames("".concat(PREFIX, "-wrapper"))
|
|
194
194
|
}, /*#__PURE__*/React.createElement("div", {
|
|
195
|
-
className: classNames(PREFIX, "".concat(PREFIX, "
|
|
195
|
+
className: classNames(PREFIX, "".concat(PREFIX, "-").concat(type)),
|
|
196
196
|
onClick: function onClick(e) {
|
|
197
197
|
e.preventDefault();
|
|
198
198
|
e.stopPropagation();
|
|
@@ -68,19 +68,6 @@ var Header = function Header(props) {
|
|
|
68
68
|
var showDelete = useMemo(function () {
|
|
69
69
|
return isShowDelete && !disabledEdit && !disabled;
|
|
70
70
|
}, [isShowDelete, disabledEdit, disabled]);
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @title: 商品数量角标
|
|
74
|
-
* @returns {*}
|
|
75
|
-
* @Author: Arthur
|
|
76
|
-
* @Date: 2025-08-08 10:26
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
var renderNumTag = function renderNumTag() {
|
|
80
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
81
|
-
className: classNames("num-tag")
|
|
82
|
-
}, num < 100 ? num : '99+');
|
|
83
|
-
};
|
|
84
71
|
var renderImage = function renderImage() {
|
|
85
72
|
if (!isShowImage) return null;
|
|
86
73
|
if (image) {
|
|
@@ -100,7 +87,7 @@ var Header = function Header(props) {
|
|
|
100
87
|
className: classNames("".concat(prefix, "product-header"), headerCenterStyle && "".concat(prefix, "product-options-header"))
|
|
101
88
|
}, showDelete ? /*#__PURE__*/React.createElement(DeleteButton, {
|
|
102
89
|
onDelete: onDelete
|
|
103
|
-
}) : null,
|
|
90
|
+
}) : null, renderImage(), id ? /*#__PURE__*/React.createElement("div", {
|
|
104
91
|
className: classNames("".concat(prefix, "product-right-wrap"), _defineProperty({}, "".concat(prefix, "product-right-wrap-stretch"), isShowEditProduct))
|
|
105
92
|
}, /*#__PURE__*/React.createElement("div", {
|
|
106
93
|
className: "".concat(prefix, "product-title")
|
|
@@ -6,26 +6,6 @@
|
|
|
6
6
|
align-items: center;
|
|
7
7
|
gap: 8px;
|
|
8
8
|
padding-right: 0 !important;
|
|
9
|
-
|
|
10
|
-
.num-tag {
|
|
11
|
-
background-color: #7f56da;
|
|
12
|
-
position: absolute;
|
|
13
|
-
left: 0;
|
|
14
|
-
top: 0;
|
|
15
|
-
border-radius: 12px;
|
|
16
|
-
min-width: 24px;
|
|
17
|
-
height: 24px;
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
z-index: 1;
|
|
22
|
-
|
|
23
|
-
color: var(--Base-White, #fff);
|
|
24
|
-
font-size: 16px;
|
|
25
|
-
font-style: normal;
|
|
26
|
-
font-weight: 600;
|
|
27
|
-
line-height: 16px;
|
|
28
|
-
}
|
|
29
9
|
}
|
|
30
10
|
|
|
31
11
|
&-product-options-header {
|
|
@@ -31,7 +31,7 @@ export default {
|
|
|
31
31
|
},
|
|
32
32
|
'pisell2.product.card.add.holder.modal.title.1': "Please Select",
|
|
33
33
|
'pisell2.product.card.hour.minute': function pisell2ProductCardHourMinute(hour, minute) {
|
|
34
|
-
if (hour
|
|
34
|
+
if (hour <= 0 && minute <= 0) return "".concat(0, "min");
|
|
35
35
|
return "".concat(hour > 0 ? "".concat(hour, "h") : '').concat(hour > 0 && minute > 0 ? ' ' : '').concat(minute > 0 ? "".concat(minute, "min") : '');
|
|
36
36
|
},
|
|
37
37
|
'pisell2.product.card.sales': 'Sales',
|
|
@@ -73,7 +73,7 @@ export default {
|
|
|
73
73
|
},
|
|
74
74
|
'pisell2.product.card.add.holder.modal.title.1': "\u8BF7\u9009\u62E9",
|
|
75
75
|
'pisell2.product.card.hour.minute': function pisell2ProductCardHourMinute(hour, minute) {
|
|
76
|
-
if (hour
|
|
76
|
+
if (hour <= 0 && minute <= 0) return "".concat(0, "\u5206\u949F");
|
|
77
77
|
return "".concat(hour > 0 ? "".concat(hour, "\u5C0F\u65F6") : '').concat(minute > 0 ? "".concat(minute, "\u5206\u949F") : '');
|
|
78
78
|
},
|
|
79
79
|
'pisell2.product.card.sales': '销售',
|
|
@@ -115,7 +115,7 @@ export default {
|
|
|
115
115
|
},
|
|
116
116
|
'pisell2.product.card.add.holder.modal.title.1': "\u8ACB\u9078\u64C7",
|
|
117
117
|
'pisell2.product.card.hour.minute': function pisell2ProductCardHourMinute(hour, minute) {
|
|
118
|
-
if (hour
|
|
118
|
+
if (hour <= 0 && minute <= 0) return "".concat(0, "\u5206\u9418");
|
|
119
119
|
return "".concat(hour > 0 ? "".concat(hour, "\u5C0F\u6642") : '').concat(minute > 0 ? "".concat(minute, "\u5206\u9418") : '');
|
|
120
120
|
},
|
|
121
121
|
'pisell2.product.card.sales': '銷售',
|