@pisell/materials 2.2.93 → 2.2.95
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 +5 -5
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +13 -13
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +12 -12
- package/es/components/appVersionControl/index.d.ts +0 -1
- package/es/components/batch-editor/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
- package/es/components/date-picker/index.d.ts +0 -1
- package/es/components/iconfont/index.js +1 -1
- package/es/components/page/index.d.ts +0 -1
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/es/components/pisellGoodPassCard/index.js +8 -7
- package/es/components/pisellInput/index.d.ts +0 -1
- package/es/components/pisellModal/components/IpadModal/index.d.ts +0 -1
- package/es/components/pisellModal/components/MobileModal/index.d.ts +0 -1
- package/es/components/pisellModal/components/index.d.ts +0 -1
- package/es/components/pisellWalletPassCard/index.d.ts +0 -1
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +6 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +25 -5
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +5 -2
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +0 -1
- package/es/components/productCard/cartSkuCard/components/packages/index.js +1 -1
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +0 -1
- package/es/components/productCard/cartSkuCard/components/resources/index.js +2 -5
- package/es/components/productCard/cartSkuCard/components/resources/index.less +6 -7
- package/es/components/productCard/cartSkuCard/components/sales/index.js +1 -1
- package/es/components/productCard/cartSkuCard/components/specs/index.js +3 -2
- package/es/components/productCard/cartSkuCard/components/specs/index.less +6 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +2 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +12 -2
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -1
- package/es/components/productCard/cartSkuCard/components/timeRange/index.js +6 -5
- package/es/components/productCard/cartSkuCard/components/timeRange/index.less +6 -5
- package/es/components/productCard/cartSkuCard/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/index.js +21 -19
- package/es/components/productCard/cartSkuCard/index.less +4 -44
- package/es/components/productCard/components/Header/index.js +17 -2
- package/es/components/productCard/components/Header/index.less +23 -3
- package/es/components/productCard/components/Time/components/SelectHolderModal/index.js +3 -1
- package/es/components/productCard/components/Time/components/SelectHolderModal/index.less +3 -0
- package/es/components/productCard/components/Time/index.d.ts +0 -1
- package/es/components/productCard/locales.js +3 -0
- package/es/components/select-time/index.d.ts +0 -1
- package/es/components/table/Actions/component/ColumnsSetting/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/index.d.ts +0 -1
- package/es/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
- package/es/components/table/Actions/component/Group/index.d.ts +0 -1
- package/es/components/table/Actions/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
- package/es/components/table/Table/fields/date/index.d.ts +0 -1
- package/es/components/table/Table/fields/image/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/image/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +0 -1
- package/es/components/table/Table/fields/link/index.d.ts +0 -1
- package/es/components/table/Table/fields/number/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/number/index.d.ts +0 -1
- package/es/components/table/Table/fields/numberRange/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/numberRange/index.d.ts +0 -1
- package/es/components/table/Table/fields/oldRangePicker/index.d.ts +0 -1
- package/es/components/table/Table/fields/pSwitch/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/pSwitch/index.d.ts +0 -1
- package/es/components/table/Table/fields/rangePicker/index.d.ts +0 -1
- package/es/components/table/Table/fields/search/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/search/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +0 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/versionSelect/index.d.ts +0 -1
- package/lib/components/appVersionControl/index.d.ts +0 -1
- package/lib/components/batch-editor/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
- package/lib/components/date-picker/index.d.ts +0 -1
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/page/index.d.ts +0 -1
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/lib/components/pisellGoodPassCard/index.js +27 -4
- package/lib/components/pisellInput/index.d.ts +0 -1
- package/lib/components/pisellModal/components/IpadModal/index.d.ts +0 -1
- package/lib/components/pisellModal/components/MobileModal/index.d.ts +0 -1
- package/lib/components/pisellModal/components/index.d.ts +0 -1
- package/lib/components/pisellWalletPassCard/index.d.ts +0 -1
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +6 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +17 -14
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +5 -2
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +0 -1
- package/lib/components/productCard/cartSkuCard/components/packages/index.js +1 -1
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +0 -1
- package/lib/components/productCard/cartSkuCard/components/resources/index.js +2 -2
- package/lib/components/productCard/cartSkuCard/components/resources/index.less +6 -7
- package/lib/components/productCard/cartSkuCard/components/sales/index.js +1 -1
- package/lib/components/productCard/cartSkuCard/components/specs/index.js +3 -2
- package/lib/components/productCard/cartSkuCard/components/specs/index.less +6 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +2 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +11 -2
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -1
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +2 -1
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.less +6 -5
- package/lib/components/productCard/cartSkuCard/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/index.js +25 -6
- package/lib/components/productCard/cartSkuCard/index.less +4 -44
- package/lib/components/productCard/components/Header/index.js +6 -1
- package/lib/components/productCard/components/Header/index.less +23 -3
- package/lib/components/productCard/components/Time/components/SelectHolderModal/index.js +1 -1
- package/lib/components/productCard/components/Time/components/SelectHolderModal/index.less +3 -0
- package/lib/components/productCard/components/Time/index.d.ts +0 -1
- package/lib/components/productCard/locales.js +12 -3
- package/lib/components/select-time/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ColumnsSetting/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +0 -1
- package/lib/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
- package/lib/components/table/Actions/component/Group/index.d.ts +0 -1
- package/lib/components/table/Actions/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
- package/lib/components/table/Table/fields/date/index.d.ts +0 -1
- package/lib/components/table/Table/fields/image/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/image/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +0 -1
- package/lib/components/table/Table/fields/link/index.d.ts +0 -1
- package/lib/components/table/Table/fields/number/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/number/index.d.ts +0 -1
- package/lib/components/table/Table/fields/numberRange/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/numberRange/index.d.ts +0 -1
- package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +0 -1
- package/lib/components/table/Table/fields/pSwitch/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/pSwitch/index.d.ts +0 -1
- package/lib/components/table/Table/fields/rangePicker/index.d.ts +0 -1
- package/lib/components/table/Table/fields/search/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/search/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +0 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/versionSelect/index.d.ts +0 -1
- package/package.json +3 -3
|
@@ -70,7 +70,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
70
70
|
useCustomAction: boolean;
|
|
71
71
|
actionType: string;
|
|
72
72
|
openMode: "modal" | "drawer";
|
|
73
|
-
openContentSize: "small" | "
|
|
73
|
+
openContentSize: "small" | "middle" | "large";
|
|
74
74
|
openTitle: string;
|
|
75
75
|
key: string;
|
|
76
76
|
} | undefined;
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
import { createFromIconfontCN } from '@ant-design/icons';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
var MyIcon = createFromIconfontCN({
|
|
5
|
-
scriptUrl: 'https://static.pisellcdn.com/pisell2iconfont1.
|
|
5
|
+
scriptUrl: 'https://static.pisellcdn.com/pisell2iconfont1.8.js' // 在 iconfont.cn 上生成
|
|
6
6
|
});
|
|
7
7
|
var IconFont = function IconFont(props) {
|
|
8
8
|
return /*#__PURE__*/React.createElement(MyIcon, _extends({}, props, {
|
|
@@ -47,7 +47,7 @@ var index = function index(props) {
|
|
|
47
47
|
var renderVoucherContent = function renderVoucherContent(item) {
|
|
48
48
|
return /*#__PURE__*/React.createElement("span", {
|
|
49
49
|
className: "voucher-item-content-save"
|
|
50
|
-
}, getText('pisell2.text.goodpass.save'),
|
|
50
|
+
}, getText('pisell2.text.goodpass.save'), ' ', /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
51
51
|
value: item.savedAmount
|
|
52
52
|
}));
|
|
53
53
|
};
|
|
@@ -86,8 +86,8 @@ var index = function index(props) {
|
|
|
86
86
|
}, /*#__PURE__*/React.createElement("div", {
|
|
87
87
|
style: {
|
|
88
88
|
padding: '10px 0',
|
|
89
|
-
display:
|
|
90
|
-
flexDirection:
|
|
89
|
+
display: 'flex',
|
|
90
|
+
flexDirection: 'column',
|
|
91
91
|
gap: 12
|
|
92
92
|
}
|
|
93
93
|
}, dataSource.map(renderVoucherItem)));
|
|
@@ -112,22 +112,23 @@ var index = function index(props) {
|
|
|
112
112
|
};
|
|
113
113
|
var renderModalMode = function renderModalMode() {
|
|
114
114
|
var sortList = (mixedSort === null || mixedSort === void 0 ? void 0 : mixedSort(dataSource)) || dataSource;
|
|
115
|
+
if (sortList.length === 0) return null;
|
|
115
116
|
return /*#__PURE__*/React.createElement("div", {
|
|
116
117
|
style: {
|
|
117
118
|
padding: '10px 0',
|
|
118
|
-
display:
|
|
119
|
-
flexDirection:
|
|
119
|
+
display: 'flex',
|
|
120
|
+
flexDirection: 'column',
|
|
120
121
|
gap: 12
|
|
121
122
|
}
|
|
122
123
|
}, sortList.map(renderVoucherItem));
|
|
123
124
|
};
|
|
124
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, !props.isInModal ? renderModal() : null, /*#__PURE__*/React.createElement(PisellCard, {
|
|
125
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !props.isInModal ? renderModal() : null, dataSource.length > 0 ? /*#__PURE__*/React.createElement(PisellCard, {
|
|
125
126
|
padding: 8,
|
|
126
127
|
borderRadius: 8,
|
|
127
128
|
style: _objectSpread({
|
|
128
129
|
width: 378
|
|
129
130
|
}, style),
|
|
130
131
|
className: clsPrefix
|
|
131
|
-
}, props.isInModal ? renderModalMode() : renderMixedMode()));
|
|
132
|
+
}, props.isInModal ? renderModalMode() : renderMixedMode()) : null);
|
|
132
133
|
};
|
|
133
134
|
export default index;
|
|
@@ -13,9 +13,15 @@ interface IProps {
|
|
|
13
13
|
total?: number;
|
|
14
14
|
origin_total?: number;
|
|
15
15
|
num?: number;
|
|
16
|
+
holder_id?: any;
|
|
16
17
|
};
|
|
17
18
|
style?: React.CSSProperties;
|
|
19
|
+
/** 作为主商品卡片展示
|
|
20
|
+
* 1. 影响商品数量 tag 的位置
|
|
21
|
+
* 2. isMain 且 type 为 a5,展示holder
|
|
22
|
+
*/
|
|
18
23
|
isMainProduct?: boolean;
|
|
24
|
+
type?: 'a2' | 'a5';
|
|
19
25
|
}
|
|
20
26
|
declare const BasicInfo: (props: IProps) => JSX.Element;
|
|
21
27
|
export default BasicInfo;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { image as imageAli, formatAmount } from '@pisell/utils';
|
|
4
4
|
import Specs from "../specs";
|
|
5
|
+
import Holders from "../holders";
|
|
5
6
|
import { PREFIX } from "../../index";
|
|
6
7
|
import "./index.less";
|
|
7
8
|
var BasicInfo = function BasicInfo(props) {
|
|
@@ -9,7 +10,8 @@ var BasicInfo = function BasicInfo(props) {
|
|
|
9
10
|
_props$dataSource = props.dataSource,
|
|
10
11
|
dataSource = _props$dataSource === void 0 ? {} : _props$dataSource,
|
|
11
12
|
style = props.style,
|
|
12
|
-
isMainProduct = props.isMainProduct
|
|
13
|
+
isMainProduct = props.isMainProduct,
|
|
14
|
+
type = props.type;
|
|
13
15
|
var image = dataSource.image,
|
|
14
16
|
bundle = dataSource.bundle,
|
|
15
17
|
options = dataSource.options,
|
|
@@ -22,14 +24,14 @@ var BasicInfo = function BasicInfo(props) {
|
|
|
22
24
|
_dataSource$origin_to = dataSource.origin_total,
|
|
23
25
|
origin_total = _dataSource$origin_to === void 0 ? 0 : _dataSource$origin_to,
|
|
24
26
|
_dataSource$num = dataSource.num,
|
|
25
|
-
num = _dataSource$num === void 0 ? 1 : _dataSource$num
|
|
27
|
+
num = _dataSource$num === void 0 ? 1 : _dataSource$num,
|
|
28
|
+
holder_id = dataSource.holder_id;
|
|
26
29
|
var renderNumTag = function renderNumTag() {
|
|
27
|
-
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
28
31
|
className: classNames("num-tag", {
|
|
29
32
|
'is-main': isMainProduct
|
|
30
33
|
})
|
|
31
34
|
}, num < 100 ? num : '99+');
|
|
32
|
-
return null;
|
|
33
35
|
};
|
|
34
36
|
var hasSpecs = (bundle === null || bundle === void 0 ? void 0 : bundle.length) || (options === null || options === void 0 ? void 0 : options.length) || product_option_string;
|
|
35
37
|
var renderImage = function renderImage() {
|
|
@@ -47,10 +49,28 @@ var BasicInfo = function BasicInfo(props) {
|
|
|
47
49
|
className: "product-cover-text"
|
|
48
50
|
}, displayText);
|
|
49
51
|
};
|
|
52
|
+
if (type === 'a5') {
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "".concat(PREFIX, "__basic-info"),
|
|
55
|
+
style: style || {}
|
|
56
|
+
}, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
style: {
|
|
58
|
+
width: 26
|
|
59
|
+
}
|
|
60
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "product-info"
|
|
62
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: "product-name"
|
|
64
|
+
}, name), !!holder_id || !(holder_id !== null && holder_id !== void 0 && holder_id.length) ? /*#__PURE__*/React.createElement(Holders, {
|
|
65
|
+
dataSource: dataSource
|
|
66
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: "product-price"
|
|
68
|
+
}, formatAmount(price, 2, symbol))));
|
|
69
|
+
}
|
|
50
70
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
71
|
className: "".concat(PREFIX, "__basic-info"),
|
|
52
72
|
style: style || {}
|
|
53
|
-
}, renderNumTag(), renderImage(),
|
|
73
|
+
}, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /*#__PURE__*/React.createElement("div", {
|
|
54
74
|
style: {
|
|
55
75
|
width: 26
|
|
56
76
|
}
|
|
@@ -46,16 +46,18 @@
|
|
|
46
46
|
display: flex;
|
|
47
47
|
align-items: center;
|
|
48
48
|
justify-content: center;
|
|
49
|
-
font-size:
|
|
49
|
+
font-size: 20px;
|
|
50
50
|
font-weight: 500;
|
|
51
51
|
line-height: 1;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
text-overflow: ellipsis;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
.product-info {
|
|
55
58
|
flex: 1;
|
|
56
59
|
display: flex;
|
|
57
60
|
align-items: center;
|
|
58
|
-
gap: 4px;
|
|
59
61
|
flex: 1 0 0;
|
|
60
62
|
flex-wrap: wrap;
|
|
61
63
|
overflow: hidden;
|
|
@@ -70,6 +72,7 @@
|
|
|
70
72
|
overflow: hidden;
|
|
71
73
|
text-overflow: ellipsis;
|
|
72
74
|
white-space: nowrap;
|
|
75
|
+
padding-right: 20px;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
.product-price {
|
|
@@ -21,7 +21,7 @@ var Packages = function Packages(_ref) {
|
|
|
21
21
|
symbol = _dataSource$symbol === void 0 ? '$' : _dataSource$symbol;
|
|
22
22
|
return (bundle === null || bundle === void 0 ? void 0 : bundle.length) > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
|
|
23
23
|
style: {
|
|
24
|
-
margin:
|
|
24
|
+
margin: 0
|
|
25
25
|
}
|
|
26
26
|
}), /*#__PURE__*/React.createElement("div", {
|
|
27
27
|
className: "".concat(PREFIX, "__packages-wrap")
|
|
@@ -16,10 +16,7 @@ var Resources = function Resources(props) {
|
|
|
16
16
|
var ids = item.id,
|
|
17
17
|
lists = item.lists,
|
|
18
18
|
_id = item._id;
|
|
19
|
-
return
|
|
20
|
-
className: "resource-item",
|
|
21
|
-
key: _id
|
|
22
|
-
}, Array.isArray(ids) ? ids.map(function (id) {
|
|
19
|
+
return Array.isArray(ids) ? ids.map(function (id) {
|
|
23
20
|
var targetRes = lists.find(function (l) {
|
|
24
21
|
return l.id === id;
|
|
25
22
|
});
|
|
@@ -30,7 +27,7 @@ var Resources = function Resources(props) {
|
|
|
30
27
|
}, targetRes.label);
|
|
31
28
|
}
|
|
32
29
|
return null;
|
|
33
|
-
}) : null
|
|
30
|
+
}) : null;
|
|
34
31
|
};
|
|
35
32
|
var renderContent = function renderContent() {
|
|
36
33
|
if (isMultipleResource && (multiResources === null || multiResources === void 0 ? void 0 : multiResources.length) > 0) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
.pisell-cart-sku-card__resources {
|
|
2
|
-
margin-top: 4px;
|
|
3
2
|
display: flex;
|
|
4
3
|
flex-wrap: wrap;
|
|
5
4
|
gap: 4px;
|
|
@@ -9,12 +8,12 @@
|
|
|
9
8
|
display: flex;
|
|
10
9
|
flex-wrap: wrap;
|
|
11
10
|
gap: 4px;
|
|
11
|
+
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
13
|
+
.resource-tag {
|
|
14
|
+
max-width: 120px;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
margin: 0;
|
|
19
18
|
}
|
|
20
19
|
}
|
|
@@ -32,7 +32,7 @@ var Sales = function Sales(_ref) {
|
|
|
32
32
|
});
|
|
33
33
|
return (other_products === null || other_products === void 0 ? void 0 : other_products.length) > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, hideDivider ? null : /*#__PURE__*/React.createElement(Divider, {
|
|
34
34
|
style: {
|
|
35
|
-
margin:
|
|
35
|
+
margin: 0
|
|
36
36
|
}
|
|
37
37
|
}), /*#__PURE__*/React.createElement("div", {
|
|
38
38
|
className: "".concat(PREFIX, "_sales-wrap")
|
|
@@ -12,7 +12,8 @@ var Specs = function Specs(props) {
|
|
|
12
12
|
var more = /*#__PURE__*/React.createElement("div", {
|
|
13
13
|
style: {
|
|
14
14
|
color: '#667085',
|
|
15
|
-
fontSize: 10
|
|
15
|
+
fontSize: 10,
|
|
16
|
+
lineHeight: '10px'
|
|
16
17
|
}
|
|
17
18
|
}, locales.getText('pisell2.cart.sku-card.more'));
|
|
18
19
|
if (Array.isArray(bundle) && (bundle === null || bundle === void 0 ? void 0 : bundle.length) > 0) {
|
|
@@ -36,7 +37,7 @@ var Specs = function Specs(props) {
|
|
|
36
37
|
className: "spec-name"
|
|
37
38
|
}, _first.name), /*#__PURE__*/React.createElement("span", {
|
|
38
39
|
className: "spec-num"
|
|
39
|
-
}, symbol, _first.price, "x", _first.num)), options.length > 1 ? more : null);
|
|
40
|
+
}, /*#__PURE__*/React.createElement("span", null, symbol, _first.price), /*#__PURE__*/React.createElement("span", null), "x", /*#__PURE__*/React.createElement("span", null, _first.num))), options.length > 1 ? more : null);
|
|
40
41
|
}
|
|
41
42
|
return null;
|
|
42
43
|
};
|
|
@@ -28,6 +28,7 @@ export declare type SwipeActionProps = {
|
|
|
28
28
|
stopPropagation?: PropagationEvent[];
|
|
29
29
|
onActionsReveal?: (side: SideType) => void;
|
|
30
30
|
onClose?: () => void;
|
|
31
|
+
escapeDom?: string;
|
|
31
32
|
} & NativeProps<'--background'>;
|
|
32
33
|
export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
33
34
|
rightActions?: Action[] | undefined;
|
|
@@ -39,5 +40,6 @@ export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
|
39
40
|
stopPropagation?: "click"[] | undefined;
|
|
40
41
|
onActionsReveal?: ((side: SideType) => void) | undefined;
|
|
41
42
|
onClose?: (() => void) | undefined;
|
|
43
|
+
escapeDom?: string | undefined;
|
|
42
44
|
} & NativeProps<"--background"> & React.RefAttributes<SwipeActionRef>>;
|
|
43
45
|
export {};
|
|
@@ -201,6 +201,11 @@ export var SwipeAction = /*#__PURE__*/forwardRef(function (p, ref) {
|
|
|
201
201
|
useEffect(function () {
|
|
202
202
|
if (!props.closeOnTouchOutside) return;
|
|
203
203
|
function handle(e) {
|
|
204
|
+
// 检查点击的元素或其祖先元素是否有特定 class
|
|
205
|
+
if (e.target && props.escapeDom) {
|
|
206
|
+
var container = document.querySelector(props.escapeDom);
|
|
207
|
+
if (container !== null && container !== void 0 && container.contains(e.target)) return;
|
|
208
|
+
}
|
|
204
209
|
if (x.get() === 0) {
|
|
205
210
|
return;
|
|
206
211
|
}
|
|
@@ -209,11 +214,16 @@ export var SwipeAction = /*#__PURE__*/forwardRef(function (p, ref) {
|
|
|
209
214
|
close();
|
|
210
215
|
}
|
|
211
216
|
}
|
|
212
|
-
|
|
217
|
+
if ('ontouchstart' in window) {
|
|
218
|
+
document.addEventListener('touchstart', handle);
|
|
219
|
+
} else {
|
|
220
|
+
document.addEventListener('mousedown', handle);
|
|
221
|
+
}
|
|
213
222
|
return function () {
|
|
214
223
|
document.removeEventListener('touchstart', handle);
|
|
224
|
+
document.removeEventListener('mousedown', handle);
|
|
215
225
|
};
|
|
216
|
-
}, [props.closeOnTouchOutside]);
|
|
226
|
+
}, [props.closeOnTouchOutside, props.escapeDom]);
|
|
217
227
|
function renderAction(action) {
|
|
218
228
|
var _action$color, _colorRecord$color;
|
|
219
229
|
var color = (_action$color = action.color) !== null && _action$color !== void 0 ? _action$color : 'light';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Iconfont from "../../../../iconfont";
|
|
2
2
|
import React, { useEffect, useMemo } from 'react';
|
|
3
3
|
import { Divider } from 'antd';
|
|
4
|
+
import { getServiceTime } from "../../../utils";
|
|
4
5
|
import dayjs from 'dayjs';
|
|
5
6
|
import 'dayjs/locale/zh-cn';
|
|
6
7
|
import 'dayjs/locale/en';
|
|
@@ -41,13 +42,13 @@ var TimeRange = function TimeRange(props) {
|
|
|
41
42
|
};
|
|
42
43
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
|
|
43
44
|
style: {
|
|
44
|
-
margin: '
|
|
45
|
+
margin: '0'
|
|
45
46
|
}
|
|
46
47
|
}), /*#__PURE__*/React.createElement("div", {
|
|
47
48
|
className: "".concat(PREFIX, "__time-range")
|
|
48
|
-
},
|
|
49
|
-
className: "
|
|
50
|
-
type: "pisell2-
|
|
51
|
-
}),
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
50
|
+
className: "time-icon",
|
|
51
|
+
type: "pisell2-clock"
|
|
52
|
+
}), getServiceTime(dataSource, start_date)));
|
|
52
53
|
};
|
|
53
54
|
export default TimeRange;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.pisell-cart-sku-card__time-range {
|
|
2
2
|
user-select: none;
|
|
3
|
+
color: #667085;
|
|
3
4
|
|
|
4
5
|
display: flex;
|
|
5
6
|
align-items: center;
|
|
@@ -11,6 +12,11 @@
|
|
|
11
12
|
color: #7f56da;
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
.time-icon {
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
color: #7f56da;
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
.time-range-item {
|
|
15
21
|
white-space: nowrap;
|
|
16
22
|
display: flex;
|
|
@@ -18,11 +24,6 @@
|
|
|
18
24
|
align-items: center;
|
|
19
25
|
overflow: hidden;
|
|
20
26
|
|
|
21
|
-
.time-icon {
|
|
22
|
-
font-size: 16px;
|
|
23
|
-
color: #7f56da;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
27
|
.time-str {
|
|
27
28
|
color: #667085;
|
|
28
29
|
font-size: 14px;
|
|
@@ -3,6 +3,7 @@ import { ProductCardTypes } from '../types';
|
|
|
3
3
|
interface ISKUCardProps extends ProductCardTypes {
|
|
4
4
|
type: 'a2' | 'a5';
|
|
5
5
|
rightActions: any[];
|
|
6
|
+
escapeDom?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare const PREFIX = "pisell-cart-sku-card";
|
|
8
9
|
declare const CartSkuCard: (props: ISKUCardProps) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
-
var _excluded = ["dataSource", "isShowImage", "isShowHolder", "isShowNote", "isShowDelete", "isShowPackageNote", "isShowEditProduct", "onEditProduct", "onAction", "onDelete", "onNote", "onLike", "onCard", "onChangeResource", "onChangeHolder", "type", "rightActions"];
|
|
2
|
+
var _excluded = ["dataSource", "isShowImage", "isShowHolder", "isShowNote", "isShowDelete", "isShowPackageNote", "isShowEditProduct", "onEditProduct", "onAction", "onDelete", "onNote", "onLike", "onCard", "onChangeResource", "onChangeHolder", "type", "rightActions", "escapeDom"];
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
@@ -16,11 +16,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
16
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
17
|
import React, { useMemo, useRef } from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
|
-
import {
|
|
19
|
+
import { locales } from '@pisell/utils';
|
|
20
20
|
import localeTexts from "./locales";
|
|
21
21
|
import BasicInfo from "./components/basicInfo";
|
|
22
22
|
import DiscountReason from "./components/discountReason";
|
|
23
|
-
import Holders from "./components/holders";
|
|
24
23
|
import TimeRange from "./components/timeRange";
|
|
25
24
|
import Resources from "./components/resources";
|
|
26
25
|
import Packages from "./components/packages";
|
|
@@ -63,6 +62,7 @@ var CartSkuCard = function CartSkuCard(props) {
|
|
|
63
62
|
type = props.type,
|
|
64
63
|
_props$rightActions = props.rightActions,
|
|
65
64
|
rightActions = _props$rightActions === void 0 ? [] : _props$rightActions,
|
|
65
|
+
escapeDom = props.escapeDom,
|
|
66
66
|
other = _objectWithoutProperties(props, _excluded);
|
|
67
67
|
var useOpenNoteRef = useRef();
|
|
68
68
|
var context = useEngineContext();
|
|
@@ -130,8 +130,6 @@ var CartSkuCard = function CartSkuCard(props) {
|
|
|
130
130
|
};
|
|
131
131
|
var renderA5 = function renderA5() {
|
|
132
132
|
var _dataSource$bundle, _dataSource$items;
|
|
133
|
-
var image = dataSource.image,
|
|
134
|
-
name = dataSource.name;
|
|
135
133
|
return /*#__PURE__*/React.createElement(React.Fragment, null, isShowDelete ? /*#__PURE__*/React.createElement("div", {
|
|
136
134
|
className: "".concat(PREFIX, "__delete-btn"),
|
|
137
135
|
onClick: function onClick(e) {
|
|
@@ -141,18 +139,12 @@ var CartSkuCard = function CartSkuCard(props) {
|
|
|
141
139
|
}
|
|
142
140
|
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
143
141
|
type: "pisell2-trash-01"
|
|
144
|
-
})) : null, /*#__PURE__*/React.createElement(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}), /*#__PURE__*/React.createElement(
|
|
150
|
-
className: "product-info"
|
|
151
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
152
|
-
className: "product-name"
|
|
153
|
-
}, name), /*#__PURE__*/React.createElement(Holders, {
|
|
154
|
-
dataSource: dataSource
|
|
155
|
-
}))), /*#__PURE__*/React.createElement(TimeRange, {
|
|
142
|
+
})) : null, /*#__PURE__*/React.createElement(BasicInfo, {
|
|
143
|
+
isShowImage: true,
|
|
144
|
+
dataSource: dataSource,
|
|
145
|
+
isMainProduct: true,
|
|
146
|
+
type: type
|
|
147
|
+
}), /*#__PURE__*/React.createElement(TimeRange, {
|
|
156
148
|
dataSource: dataSource
|
|
157
149
|
}), /*#__PURE__*/React.createElement(Resources, {
|
|
158
150
|
dataSource: dataSource
|
|
@@ -191,10 +183,20 @@ var CartSkuCard = function CartSkuCard(props) {
|
|
|
191
183
|
}
|
|
192
184
|
return renderA2();
|
|
193
185
|
};
|
|
194
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SwipeAction, {
|
|
186
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, type === 'a2' ? /*#__PURE__*/React.createElement(SwipeAction, {
|
|
195
187
|
closeOnAction: false,
|
|
196
188
|
className: classNames("".concat(PREFIX, "-wrapper")),
|
|
197
|
-
rightActions: _rightActions
|
|
189
|
+
rightActions: _rightActions,
|
|
190
|
+
escapeDom: escapeDom
|
|
191
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
192
|
+
className: classNames(PREFIX, "".concat(PREFIX, "--").concat(type)),
|
|
193
|
+
onClick: function onClick(e) {
|
|
194
|
+
e.preventDefault();
|
|
195
|
+
e.stopPropagation();
|
|
196
|
+
onCard === null || onCard === void 0 || onCard(dataSource);
|
|
197
|
+
}
|
|
198
|
+
}, renderContent())) : /*#__PURE__*/React.createElement("div", {
|
|
199
|
+
className: classNames("".concat(PREFIX, "-wrapper"))
|
|
198
200
|
}, /*#__PURE__*/React.createElement("div", {
|
|
199
201
|
className: classNames(PREFIX, "".concat(PREFIX, "--").concat(type)),
|
|
200
202
|
onClick: function onClick(e) {
|