@pisell/materials 6.1.1 → 6.1.2
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 +7 -7
- package/build/lowcode/preview.js +146 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +36 -27
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +41 -32
- package/es/components/TimeResourceSelector/index.d.ts +21 -0
- package/es/components/appVersionControl/index.d.ts +4 -0
- package/es/components/badge/index.d.ts +7 -0
- package/es/components/buttonGroupEdit/index.d.ts +8 -0
- package/es/components/buttonGroupPreview/index.d.ts +19 -0
- package/es/components/cardPro/index.d.ts +3 -0
- package/es/components/collapse/index.d.ts +15 -0
- package/es/components/cropPhoto/index.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +38 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +32 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +78 -0
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +24 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +24 -0
- package/es/components/dataSourceComponents/fields/Upload/serve.d.ts +20 -0
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +37 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +6 -6
- package/es/components/dataSourceComponents/hooks/usePlatform.d.ts +3 -0
- package/es/components/drag-sort-tree/TreeItem/index.js +2 -1
- package/es/components/drag-sort-tree/index.d.ts +4 -0
- package/es/components/iconfont/index.d.ts +8 -0
- package/es/components/iconfont/index.js +1 -1
- package/es/components/login-and-register/index.d.ts +82 -0
- package/es/components/login-and-register/index.js +22 -18
- package/es/components/page/index.d.ts +5 -0
- package/es/components/pisell-config-provider/index.d.ts +12 -0
- package/es/components/pisellAdjustPrice/index.d.ts +1 -6
- package/es/components/pisellAdjustPrice/index.js +64 -8
- package/es/components/pisellAdjustPrice/index.less +35 -6
- package/es/components/pisellAdjustPrice/status.d.ts +32 -0
- package/es/components/pisellAdjustPrice/status.js +32 -0
- package/es/components/pisellAdjustPrice/type.d.ts +20 -0
- package/es/components/pisellAdjustPrice/type.js +1 -0
- package/es/components/pisellAnchor/index.d.ts +23 -0
- package/es/components/pisellAvatar/index.d.ts +19 -0
- package/es/components/pisellCard/index.d.ts +19 -0
- package/es/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
- package/es/components/pisellDropdown/index.d.ts +20 -0
- package/es/components/pisellEmpty/index.d.ts +19 -0
- package/es/components/pisellHeaderProgressBar/index.d.ts +29 -0
- package/es/components/pisellImageCarousels/index.d.ts +18 -0
- package/es/components/pisellInformationEntry/hooks/useNativeScanner.d.ts +4 -0
- package/es/components/pisellInformationEntry/index.d.ts +33 -0
- package/es/components/pisellList01/index.d.ts +17 -0
- package/es/components/pisellQrcode/index.d.ts +10 -0
- package/es/components/pisellSectionHeaders/index.d.ts +21 -0
- package/es/components/pisellStatisticList/index.d.ts +21 -0
- package/es/components/pisellToast/index.js +3 -0
- package/es/components/pisellWalletPassCard/index.d.ts +0 -1
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +21 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +61 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +98 -0
- package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
- package/es/components/productCard/cartSkuCard/components/discountReason/index.js +51 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.js +32 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.less +32 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.js +52 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.less +22 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.js +40 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.js +44 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.less +20 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +11 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.js +55 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.less +22 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.js +43 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.less +28 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.js +53 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.less +37 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +8 -0
- package/es/components/productCard/cartSkuCard/index.js +195 -0
- package/es/components/productCard/cartSkuCard/index.less +69 -0
- package/es/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/es/components/productCard/cartSkuCard/locales.js +30 -0
- package/es/components/productCard/components/Action/index.d.ts +3 -0
- package/es/components/productCard/components/AmountFooter/index.js +22 -6
- package/es/components/productCard/components/AmountFooter/index.less +28 -1
- package/es/components/productCard/components/Divider/index.d.ts +3 -0
- package/es/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
- package/es/components/productCard/components/Header/index.js +4 -3
- package/es/components/productCard/components/MultiDay/index.d.ts +3 -0
- package/es/components/productCard/components/MultiDay/utils.d.ts +14 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.js +2 -1
- package/es/components/productCard/components/Packages/components/options/index.d.ts +3 -0
- package/es/components/productCard/components/Packages/components/options/index.less +3 -2
- package/es/components/productCard/components/Sales/index.js +2 -2
- package/es/components/productCard/components/Time/components/Like/index.d.ts +9 -0
- package/es/components/productCard/components/Time/index.d.ts +3 -0
- package/es/components/productCard/components/Warning/index.d.ts +7 -0
- package/es/components/productCard/components/Warning/index.js +48 -0
- package/es/components/productCard/index.d.ts +3 -1
- package/es/components/productCard/index.js +10 -8
- package/es/components/productCard/locales.d.ts +84 -0
- package/es/components/productCard/locales.js +6 -3
- package/es/components/productCard/status.d.ts +32 -0
- package/es/components/productCard/status.js +3 -1
- package/es/components/productCard/types.d.ts +84 -0
- package/es/components/productCard/utils.js +8 -6
- package/es/components/section-footers/index.d.ts +9 -0
- package/es/components/table/Actions/component/ExportImport/index.d.ts +7 -0
- package/es/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
- package/es/components/table/Table/fields/index.d.ts +2 -2
- package/es/components/table/Table/index.d.ts +4 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/hooks/useTableSetting.d.ts +22 -0
- package/es/components/table/types.d.ts +251 -0
- package/es/components/tabs/index.d.ts +16 -0
- package/es/components/translation/index.d.ts +4 -3
- package/es/components/translation/index.js +34 -32
- package/es/components/versionModal/index.d.ts +23 -0
- package/es/components/virtual-keyboard/Amount/index.d.ts +3 -20
- package/es/components/virtual-keyboard/Amount/index.js +79 -7
- package/es/components/virtual-keyboard/Amount/index.less +39 -0
- package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Amount/themeConfig.js +32 -0
- package/es/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/es/components/virtual-keyboard/Amount/types.js +1 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +3 -1
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +38 -10
- package/es/components/virtual-keyboard/Keyboard/index.js +2 -2
- package/es/components/virtual-keyboard/Number/index.d.ts +3 -11
- package/es/components/virtual-keyboard/Number/index.js +77 -7
- package/es/components/virtual-keyboard/Number/index.less +39 -0
- package/es/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Number/themeConfig.js +32 -0
- package/es/components/virtual-keyboard/Number/types.d.ts +25 -0
- package/es/components/virtual-keyboard/Number/types.js +1 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +2 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.js +10 -3
- package/es/components/virtual-keyboard/index.d.ts +11 -0
- package/es/components/virtual-keyboard/index.js +88 -3
- package/es/components/virtual-keyboard/index.less +33 -1
- package/es/components/walletCard/Guest/index.d.ts +3 -0
- package/es/components/walletCard/Guide/index.d.ts +3 -0
- package/es/components/walletCard/index.d.ts +67 -0
- package/lib/components/TimeResourceSelector/index.d.ts +21 -0
- package/lib/components/appVersionControl/index.d.ts +4 -0
- package/lib/components/badge/index.d.ts +7 -0
- package/lib/components/buttonGroupEdit/index.d.ts +8 -0
- package/lib/components/buttonGroupPreview/index.d.ts +19 -0
- package/lib/components/cardPro/index.d.ts +3 -0
- package/lib/components/collapse/index.d.ts +15 -0
- package/lib/components/cropPhoto/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +38 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +32 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +78 -0
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +24 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +24 -0
- package/lib/components/dataSourceComponents/fields/Upload/serve.d.ts +20 -0
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +37 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +6 -6
- package/lib/components/dataSourceComponents/hooks/usePlatform.d.ts +3 -0
- package/lib/components/drag-sort-tree/TreeItem/index.js +2 -1
- package/lib/components/drag-sort-tree/index.d.ts +4 -0
- package/lib/components/iconfont/index.d.ts +8 -0
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/login-and-register/index.d.ts +82 -0
- package/lib/components/login-and-register/index.js +2 -2
- package/lib/components/page/index.d.ts +5 -0
- package/lib/components/pisell-config-provider/index.d.ts +12 -0
- package/lib/components/pisellAdjustPrice/index.d.ts +1 -6
- package/lib/components/pisellAdjustPrice/index.js +119 -57
- package/lib/components/pisellAdjustPrice/index.less +35 -6
- package/lib/components/pisellAdjustPrice/status.d.ts +32 -0
- package/lib/components/pisellAdjustPrice/status.js +60 -0
- package/lib/components/pisellAdjustPrice/type.d.ts +20 -0
- package/lib/components/pisellAdjustPrice/type.js +17 -0
- package/lib/components/pisellAnchor/index.d.ts +23 -0
- package/lib/components/pisellAvatar/index.d.ts +19 -0
- package/lib/components/pisellCard/index.d.ts +19 -0
- package/lib/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
- package/lib/components/pisellDropdown/index.d.ts +20 -0
- package/lib/components/pisellEmpty/index.d.ts +19 -0
- package/lib/components/pisellHeaderProgressBar/index.d.ts +29 -0
- package/lib/components/pisellImageCarousels/index.d.ts +18 -0
- package/lib/components/pisellInformationEntry/hooks/useNativeScanner.d.ts +4 -0
- package/lib/components/pisellInformationEntry/index.d.ts +33 -0
- package/lib/components/pisellList01/index.d.ts +17 -0
- package/lib/components/pisellQrcode/index.d.ts +10 -0
- package/lib/components/pisellSectionHeaders/index.d.ts +21 -0
- package/lib/components/pisellStatisticList/index.d.ts +21 -0
- package/lib/components/pisellToast/index.js +3 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +0 -1
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +21 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +71 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +98 -0
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.js +70 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.js +52 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.less +32 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.js +73 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.less +22 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.js +44 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.js +73 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.less +20 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +11 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.js +76 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.less +22 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.js +65 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.less +28 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +67 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.less +37 -0
- package/lib/components/productCard/cartSkuCard/index.d.ts +8 -0
- package/lib/components/productCard/cartSkuCard/index.js +216 -0
- package/lib/components/productCard/cartSkuCard/index.less +69 -0
- package/lib/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/lib/components/productCard/cartSkuCard/locales.js +61 -0
- package/lib/components/productCard/components/Action/index.d.ts +3 -0
- package/lib/components/productCard/components/AmountFooter/index.js +16 -6
- package/lib/components/productCard/components/AmountFooter/index.less +28 -1
- package/lib/components/productCard/components/Divider/index.d.ts +3 -0
- package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
- package/lib/components/productCard/components/Header/index.js +4 -3
- package/lib/components/productCard/components/MultiDay/index.d.ts +3 -0
- package/lib/components/productCard/components/MultiDay/utils.d.ts +14 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.js +2 -2
- package/lib/components/productCard/components/Packages/components/options/index.d.ts +3 -0
- package/lib/components/productCard/components/Packages/components/options/index.less +3 -2
- package/lib/components/productCard/components/Sales/index.js +2 -2
- package/lib/components/productCard/components/Time/components/Like/index.d.ts +9 -0
- package/lib/components/productCard/components/Time/index.d.ts +3 -0
- package/lib/components/productCard/components/Warning/index.d.ts +7 -0
- package/lib/components/productCard/components/Warning/index.js +68 -0
- package/lib/components/productCard/index.d.ts +3 -1
- package/lib/components/productCard/index.js +6 -11
- package/lib/components/productCard/locales.d.ts +84 -0
- package/lib/components/productCard/locales.js +6 -3
- package/lib/components/productCard/status.d.ts +32 -0
- package/lib/components/productCard/status.js +3 -1
- package/lib/components/productCard/types.d.ts +84 -0
- package/lib/components/productCard/utils.js +7 -6
- package/lib/components/section-footers/index.d.ts +9 -0
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +7 -0
- package/lib/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
- package/lib/components/table/Table/fields/index.d.ts +2 -2
- package/lib/components/table/Table/index.d.ts +4 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +22 -0
- package/lib/components/table/types.d.ts +251 -0
- package/lib/components/tabs/index.d.ts +16 -0
- package/lib/components/translation/index.d.ts +4 -3
- package/lib/components/translation/index.js +1 -0
- package/lib/components/versionModal/index.d.ts +23 -0
- package/lib/components/virtual-keyboard/Amount/index.d.ts +3 -20
- package/lib/components/virtual-keyboard/Amount/index.js +72 -16
- package/lib/components/virtual-keyboard/Amount/index.less +39 -0
- package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Amount/themeConfig.js +60 -0
- package/lib/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/lib/components/virtual-keyboard/Amount/types.js +17 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +3 -1
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +31 -8
- package/lib/components/virtual-keyboard/Keyboard/index.js +2 -1
- package/lib/components/virtual-keyboard/Number/index.d.ts +3 -11
- package/lib/components/virtual-keyboard/Number/index.js +65 -11
- package/lib/components/virtual-keyboard/Number/index.less +39 -0
- package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Number/themeConfig.js +60 -0
- package/lib/components/virtual-keyboard/Number/types.d.ts +25 -0
- package/lib/components/virtual-keyboard/Number/types.js +17 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +2 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +34 -20
- package/lib/components/virtual-keyboard/index.d.ts +11 -0
- package/lib/components/virtual-keyboard/index.js +60 -2
- package/lib/components/virtual-keyboard/index.less +33 -1
- package/lib/components/walletCard/Guest/index.d.ts +3 -0
- package/lib/components/walletCard/Guide/index.d.ts +3 -0
- package/lib/components/walletCard/index.d.ts +67 -0
- package/lowcode/_setters/antd-icon-setter/index.tsx +3 -2
- package/lowcode/pisell-adjust-price/meta.ts +168 -0
- package/lowcode/pisell-adjust-price/snippets.ts +1 -0
- package/lowcode/pisell-number-keyboard/meta.ts +167 -0
- package/lowcode/pisell-price-keyboard/meta.ts +167 -0
- package/lowcode/virtual-keyboard/meta.ts +131 -0
- package/package.json +2 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { image as imageAli, formatAmount } from '@pisell/utils';
|
|
4
|
+
import Specs from "../specs";
|
|
5
|
+
import { PREFIX } from "../../index";
|
|
6
|
+
import "./index.less";
|
|
7
|
+
var BasicInfo = function BasicInfo(props) {
|
|
8
|
+
var isShowImage = props.isShowImage,
|
|
9
|
+
_props$dataSource = props.dataSource,
|
|
10
|
+
dataSource = _props$dataSource === void 0 ? {} : _props$dataSource,
|
|
11
|
+
style = props.style,
|
|
12
|
+
isMainProduct = props.isMainProduct;
|
|
13
|
+
var image = dataSource.image,
|
|
14
|
+
bundle = dataSource.bundle,
|
|
15
|
+
options = dataSource.options,
|
|
16
|
+
product_option_string = dataSource.product_option_string,
|
|
17
|
+
name = dataSource.name,
|
|
18
|
+
price = dataSource.price,
|
|
19
|
+
symbol = dataSource.symbol,
|
|
20
|
+
_dataSource$total = dataSource.total,
|
|
21
|
+
total = _dataSource$total === void 0 ? 0 : _dataSource$total,
|
|
22
|
+
_dataSource$origin_to = dataSource.origin_total,
|
|
23
|
+
origin_total = _dataSource$origin_to === void 0 ? 0 : _dataSource$origin_to,
|
|
24
|
+
_dataSource$num = dataSource.num,
|
|
25
|
+
num = _dataSource$num === void 0 ? 1 : _dataSource$num;
|
|
26
|
+
var renderNumTag = function renderNumTag() {
|
|
27
|
+
if (num > 1) return /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: classNames("num-tag", {
|
|
29
|
+
'is-main': isMainProduct
|
|
30
|
+
})
|
|
31
|
+
}, num < 99 ? num : '99+');
|
|
32
|
+
return null;
|
|
33
|
+
};
|
|
34
|
+
var hasSpecs = (bundle === null || bundle === void 0 ? void 0 : bundle.length) || (options === null || options === void 0 ? void 0 : options.length) || product_option_string;
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "".concat(PREFIX, "__basic-info"),
|
|
37
|
+
style: style || {}
|
|
38
|
+
}, renderNumTag(), isShowImage && image && /*#__PURE__*/React.createElement("img", {
|
|
39
|
+
src: imageAli.ali(image, 64),
|
|
40
|
+
className: "product-cover"
|
|
41
|
+
}), (!isShowImage || !image) && num > 1 ? /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
style: {
|
|
43
|
+
width: 26
|
|
44
|
+
}
|
|
45
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: "product-info"
|
|
47
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: "product-name"
|
|
49
|
+
}, name), hasSpecs ? /*#__PURE__*/React.createElement(Specs, {
|
|
50
|
+
dataSource: dataSource
|
|
51
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: "product-price"
|
|
53
|
+
}, formatAmount(price, 2, symbol))), /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "product-amount"
|
|
55
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "total-amont"
|
|
57
|
+
}, formatAmount(total * num, 2, symbol)), origin_total && Number(total) !== Number(origin_total) ? /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: "origin-amount"
|
|
59
|
+
}, formatAmount(origin_total * num, 2, symbol)) : null));
|
|
60
|
+
};
|
|
61
|
+
export default BasicInfo;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
.pisell-cart-sku-card {
|
|
2
|
+
&__basic-info {
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: 4px;
|
|
5
|
+
position: relative;
|
|
6
|
+
|
|
7
|
+
.num-tag {
|
|
8
|
+
background-color: #7f56da;
|
|
9
|
+
position: absolute;
|
|
10
|
+
left: 0;
|
|
11
|
+
top: 0;
|
|
12
|
+
border-radius: 12px;
|
|
13
|
+
min-width: 24px;
|
|
14
|
+
height: 24px;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
z-index: 1;
|
|
19
|
+
|
|
20
|
+
color: var(--Base-White, #fff);
|
|
21
|
+
font-size: 16px;
|
|
22
|
+
font-style: normal;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
line-height: 16px;
|
|
25
|
+
|
|
26
|
+
&.is-main {
|
|
27
|
+
left: -4px;
|
|
28
|
+
top: -4px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
img {
|
|
33
|
+
width: 48px;
|
|
34
|
+
height: 48px;
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
border-radius: 6px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.product-info {
|
|
40
|
+
flex: 1;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 4px;
|
|
44
|
+
flex: 1 0 0;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
|
|
48
|
+
.product-name {
|
|
49
|
+
color: var(--Gray-900, #101828);
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
font-style: normal;
|
|
52
|
+
font-weight: 600;
|
|
53
|
+
line-height: 20px;
|
|
54
|
+
width: 100%;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.product-price {
|
|
61
|
+
color: var(--Gray-900, #101828);
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
font-style: normal;
|
|
64
|
+
font-weight: 500;
|
|
65
|
+
line-height: 20px;
|
|
66
|
+
width: 100%;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.product-amount {
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: 4px;
|
|
74
|
+
flex-wrap: wrap;
|
|
75
|
+
flex-shrink: 0;
|
|
76
|
+
.total-amont {
|
|
77
|
+
color: var(--Base-Black, #000);
|
|
78
|
+
text-align: center;
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
font-style: normal;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
line-height: 20px;
|
|
83
|
+
width: 100%;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.origin-amount {
|
|
87
|
+
color: var(--Gray-500, #667085);
|
|
88
|
+
text-align: center;
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
font-style: normal;
|
|
91
|
+
font-weight: 400;
|
|
92
|
+
line-height: 18px;
|
|
93
|
+
text-decoration-line: line-through;
|
|
94
|
+
width: 100%;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Divider, Tag } from 'antd';
|
|
3
|
+
import { locales } from '@pisell/utils';
|
|
4
|
+
import { PREFIX } from "../../index";
|
|
5
|
+
var DiscountReason = function DiscountReason(props) {
|
|
6
|
+
var _props$dataSource = props.dataSource,
|
|
7
|
+
dataSource = _props$dataSource === void 0 ? {} : _props$dataSource,
|
|
8
|
+
hideDivider = props.hideDivider;
|
|
9
|
+
var total = dataSource.total,
|
|
10
|
+
origin_total = dataSource.origin_total,
|
|
11
|
+
symbol = dataSource.symbol,
|
|
12
|
+
tip = dataSource.tip,
|
|
13
|
+
num = dataSource.num,
|
|
14
|
+
discount_reason = dataSource.discount_reason;
|
|
15
|
+
var isDiscount = useMemo(function () {
|
|
16
|
+
// item中没有该属性则不展示
|
|
17
|
+
if (!origin_total) return false;
|
|
18
|
+
return Number(total) != Number(origin_total);
|
|
19
|
+
}, [total, origin_total]);
|
|
20
|
+
var renderDivider = function renderDivider() {
|
|
21
|
+
return isDiscount && discount_reason && !hideDivider ? /*#__PURE__*/React.createElement(Divider, {
|
|
22
|
+
style: {
|
|
23
|
+
margin: '4px 0'
|
|
24
|
+
}
|
|
25
|
+
}) : null;
|
|
26
|
+
};
|
|
27
|
+
var renderDiscountReason = function renderDiscountReason() {
|
|
28
|
+
if (isDiscount && discount_reason) {
|
|
29
|
+
if (Array.isArray(discount_reason)) {
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "".concat(PREFIX, "_discount-reason"),
|
|
32
|
+
style: {
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexWrap: 'wrap',
|
|
35
|
+
gap: '4px'
|
|
36
|
+
}
|
|
37
|
+
}, discount_reason.map(function (reason, index) {
|
|
38
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
39
|
+
key: index,
|
|
40
|
+
color: "red"
|
|
41
|
+
}, reason);
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: "".concat(PREFIX, "_discount-reason")
|
|
46
|
+
}, /*#__PURE__*/React.createElement("span", null, "".concat(locales.getText('pisell2.product.card.discount.reason'), ": ").concat(discount_reason)));
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderDivider(), renderDiscountReason());
|
|
50
|
+
};
|
|
51
|
+
export default DiscountReason;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Iconfont from "../../../../iconfont";
|
|
3
|
+
import { PREFIX } from "../../index";
|
|
4
|
+
import "./index.less";
|
|
5
|
+
var Holders = function Holders(props) {
|
|
6
|
+
var _props$dataSource = props.dataSource,
|
|
7
|
+
dataSource = _props$dataSource === void 0 ? {} : _props$dataSource;
|
|
8
|
+
var holders = dataSource.holders,
|
|
9
|
+
holder_id = dataSource.holder_id;
|
|
10
|
+
if (!holder_id) return null;
|
|
11
|
+
var renderHolder = function renderHolder(id) {
|
|
12
|
+
if (!id) return null;
|
|
13
|
+
var holder = holders.find(function (item) {
|
|
14
|
+
return item.id === id;
|
|
15
|
+
});
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: "holder-item",
|
|
18
|
+
key: id
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
20
|
+
className: "holder-icon",
|
|
21
|
+
type: "pisell2-user-check-01"
|
|
22
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
23
|
+
className: "holder-label"
|
|
24
|
+
}, (holder === null || holder === void 0 ? void 0 : holder.label) || id));
|
|
25
|
+
};
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: "".concat(PREFIX, "__holders")
|
|
28
|
+
}, Array.isArray(holder_id) ? holder_id === null || holder_id === void 0 ? void 0 : holder_id.map(function (id) {
|
|
29
|
+
return renderHolder(id);
|
|
30
|
+
}) : renderHolder(holder_id));
|
|
31
|
+
};
|
|
32
|
+
export default Holders;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.pisell-cart-sku-card__holders {
|
|
2
|
+
user-select: none;
|
|
3
|
+
|
|
4
|
+
display: flex;
|
|
5
|
+
gap: 16px;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
|
|
8
|
+
.holder-item {
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
min-width: 30px;
|
|
14
|
+
|
|
15
|
+
.holder-icon {
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
color: #7f56da;
|
|
18
|
+
margin-right: 2;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.holder-label {
|
|
22
|
+
color: #667085;
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
line-height: 20px;
|
|
26
|
+
display: inline-block;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 from 'react';
|
|
8
|
+
import { Divider } from 'antd';
|
|
9
|
+
import { locales } from '@pisell/utils';
|
|
10
|
+
import CollapsibleList from "../../../components/Packages/components/collapsibleList";
|
|
11
|
+
import BasicInfo from "../basicInfo";
|
|
12
|
+
import { PREFIX } from "../../index";
|
|
13
|
+
import "./index.less";
|
|
14
|
+
var Packages = function Packages(_ref) {
|
|
15
|
+
var isShowImage = _ref.isShowImage,
|
|
16
|
+
_ref$dataSource = _ref.dataSource,
|
|
17
|
+
dataSource = _ref$dataSource === void 0 ? {} : _ref$dataSource;
|
|
18
|
+
var _dataSource$bundle = dataSource.bundle,
|
|
19
|
+
bundle = _dataSource$bundle === void 0 ? [] : _dataSource$bundle,
|
|
20
|
+
_dataSource$symbol = dataSource.symbol,
|
|
21
|
+
symbol = _dataSource$symbol === void 0 ? '$' : _dataSource$symbol;
|
|
22
|
+
return (bundle === null || bundle === void 0 ? void 0 : bundle.length) > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
|
|
23
|
+
style: {
|
|
24
|
+
margin: '4px 0'
|
|
25
|
+
}
|
|
26
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: "".concat(PREFIX, "__packages-wrap")
|
|
28
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: "packages-title"
|
|
30
|
+
}, locales.getText('pisell2.cart.sku-card.packages.title')), /*#__PURE__*/React.createElement(CollapsibleList, {
|
|
31
|
+
style: {
|
|
32
|
+
marginTop: 4
|
|
33
|
+
},
|
|
34
|
+
list: bundle || [],
|
|
35
|
+
renderItem: function renderItem(item) {
|
|
36
|
+
return /*#__PURE__*/React.createElement(BasicInfo, {
|
|
37
|
+
isShowImage: isShowImage,
|
|
38
|
+
dataSource: _objectSpread(_objectSpread({}, item), {}, {
|
|
39
|
+
name: item.title,
|
|
40
|
+
image: item.cover,
|
|
41
|
+
symbol: symbol
|
|
42
|
+
}),
|
|
43
|
+
style: {
|
|
44
|
+
border: '1px solid #D0D5DD',
|
|
45
|
+
borderRadius: 4,
|
|
46
|
+
padding: 4
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}))) : null;
|
|
51
|
+
};
|
|
52
|
+
export default Packages;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.pisell-cart-sku-card__packages-wrap {
|
|
2
|
+
padding: 0 4px;
|
|
3
|
+
|
|
4
|
+
.packages-title {
|
|
5
|
+
color: #101828;
|
|
6
|
+
font-size: 12px;
|
|
7
|
+
font-weight: 600;
|
|
8
|
+
line-height: 18px;
|
|
9
|
+
word-wrap: break-word;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pisell2-collapsible-list {
|
|
13
|
+
gap: 4px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.product-info {
|
|
17
|
+
.product-name,
|
|
18
|
+
.product-price {
|
|
19
|
+
color: #667085;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title: 金额是否是负
|
|
3
|
+
* @description:
|
|
4
|
+
* @param {string} type
|
|
5
|
+
* @return {*}
|
|
6
|
+
* @Author: WangHan
|
|
7
|
+
* @Date: 2024-11-22 10:01
|
|
8
|
+
*/
|
|
9
|
+
export declare const minusSign: (item: any, type?: string) => "" | "-";
|
|
10
|
+
/**
|
|
11
|
+
* @title: 金额格式化
|
|
12
|
+
* @description:
|
|
13
|
+
* @param {number} price
|
|
14
|
+
* @param {string} amountSymbol
|
|
15
|
+
* @param {number} digit
|
|
16
|
+
* @return {*}
|
|
17
|
+
* @Author: WangHan
|
|
18
|
+
* @Date: 2024-11-22 10:58
|
|
19
|
+
*/
|
|
20
|
+
export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { formatAmount } from '@pisell/utils';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @title: 金额是否是负
|
|
5
|
+
* @description:
|
|
6
|
+
* @param {string} type
|
|
7
|
+
* @return {*}
|
|
8
|
+
* @Author: WangHan
|
|
9
|
+
* @Date: 2024-11-22 10:01
|
|
10
|
+
*/
|
|
11
|
+
export var minusSign = function minusSign(item, type) {
|
|
12
|
+
// 单个商品 + 单规格价格之后的价格
|
|
13
|
+
if (type === 'total') {
|
|
14
|
+
var _price2 = (item === null || item === void 0 ? void 0 : item.bundle_sum_price) || 0;
|
|
15
|
+
var _isMarkdown = (item === null || item === void 0 ? void 0 : item.bundle_sum_type) === 'markdown';
|
|
16
|
+
return _price2 > 0 && _isMarkdown ? '-' : '';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 单个商品的价格
|
|
20
|
+
var _price = (item === null || item === void 0 ? void 0 : item.price) || 0;
|
|
21
|
+
var isMarkdown = (item === null || item === void 0 ? void 0 : item.price_type) === 'markdown';
|
|
22
|
+
return _price > 0 && isMarkdown ? '-' : '';
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @title: 金额格式化
|
|
27
|
+
* @description:
|
|
28
|
+
* @param {number} price
|
|
29
|
+
* @param {string} amountSymbol
|
|
30
|
+
* @param {number} digit
|
|
31
|
+
* @return {*}
|
|
32
|
+
* @Author: WangHan
|
|
33
|
+
* @Date: 2024-11-22 10:58
|
|
34
|
+
*/
|
|
35
|
+
export var _formatAmount = function _formatAmount() {
|
|
36
|
+
var price = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
37
|
+
var amountSymbol = arguments.length > 1 ? arguments[1] : undefined;
|
|
38
|
+
var digit = arguments.length > 2 ? arguments[2] : undefined;
|
|
39
|
+
return formatAmount(price, digit, amountSymbol);
|
|
40
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tag } from 'antd';
|
|
3
|
+
import "./index.less";
|
|
4
|
+
import { PREFIX } from "../../index";
|
|
5
|
+
var colors = ['magenta', 'volcano', 'orange', 'gold', 'green', 'cyan', 'blue', 'geekblue', 'purple'];
|
|
6
|
+
function getColor(n) {
|
|
7
|
+
// 用质数扰动 + 取余
|
|
8
|
+
return colors[n * 31 % colors.length];
|
|
9
|
+
}
|
|
10
|
+
var Resources = function Resources(props) {
|
|
11
|
+
var _props$dataSource = props.dataSource,
|
|
12
|
+
dataSource = _props$dataSource === void 0 ? {} : _props$dataSource;
|
|
13
|
+
var multiResources = dataSource.multiResources,
|
|
14
|
+
isMultipleResource = dataSource.isMultipleResource;
|
|
15
|
+
var renderResourceItem = function renderResourceItem(item, index) {
|
|
16
|
+
var ids = item.id,
|
|
17
|
+
lists = item.lists,
|
|
18
|
+
_id = item._id;
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: "resource-item",
|
|
21
|
+
key: _id
|
|
22
|
+
}, Array.isArray(ids) ? ids.map(function (id) {
|
|
23
|
+
var targetRes = lists.find(function (l) {
|
|
24
|
+
return l.id === id;
|
|
25
|
+
});
|
|
26
|
+
if (targetRes !== null && targetRes !== void 0 && targetRes.label) {
|
|
27
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
28
|
+
color: getColor(_id),
|
|
29
|
+
className: "resource-tag"
|
|
30
|
+
}, targetRes.label);
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}) : null);
|
|
34
|
+
};
|
|
35
|
+
var renderContent = function renderContent() {
|
|
36
|
+
if (isMultipleResource && (multiResources === null || multiResources === void 0 ? void 0 : multiResources.length) > 0) {
|
|
37
|
+
return multiResources.map(renderResourceItem);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: "".concat(PREFIX, "__resources")
|
|
42
|
+
}, renderContent());
|
|
43
|
+
};
|
|
44
|
+
export default Resources;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.pisell-cart-sku-card__resources {
|
|
2
|
+
margin-top: 4px;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
gap: 4px;
|
|
6
|
+
|
|
7
|
+
.resource-item {
|
|
8
|
+
min-width: calc(50% - 2px);
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
gap: 4px;
|
|
12
|
+
|
|
13
|
+
.resource-tag {
|
|
14
|
+
max-width: 120px;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
interface IProps {
|
|
3
|
+
hideDivider?: boolean;
|
|
4
|
+
dataSource: {
|
|
5
|
+
symbol?: string;
|
|
6
|
+
relation_products?: any[];
|
|
7
|
+
bundle?: any[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
declare const Sales: ({ hideDivider, dataSource }: IProps) => JSX.Element | null;
|
|
11
|
+
export default Sales;
|
|
@@ -0,0 +1,55 @@
|
|
|
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 from 'react';
|
|
8
|
+
import { Divider } from 'antd';
|
|
9
|
+
import CollapsibleList from "../../../components/Packages/components/collapsibleList";
|
|
10
|
+
import BasicInfo from "../basicInfo";
|
|
11
|
+
import { locales } from '@pisell/utils';
|
|
12
|
+
import { PREFIX } from "../../index";
|
|
13
|
+
import "./index.less";
|
|
14
|
+
var Sales = function Sales(_ref) {
|
|
15
|
+
var hideDivider = _ref.hideDivider,
|
|
16
|
+
dataSource = _ref.dataSource;
|
|
17
|
+
var _ref2 = dataSource || {},
|
|
18
|
+
_ref2$relation_produc = _ref2.relation_products,
|
|
19
|
+
relation_products = _ref2$relation_produc === void 0 ? [] : _ref2$relation_produc,
|
|
20
|
+
_ref2$symbol = _ref2.symbol,
|
|
21
|
+
symbol = _ref2$symbol === void 0 ? '$' : _ref2$symbol;
|
|
22
|
+
|
|
23
|
+
// 格式化商品数据
|
|
24
|
+
var other_products = relation_products.map(function (p) {
|
|
25
|
+
return _objectSpread(_objectSpread({}, p), {}, {
|
|
26
|
+
name: p === null || p === void 0 ? void 0 : p.product_title,
|
|
27
|
+
price: p === null || p === void 0 ? void 0 : p.payment_price,
|
|
28
|
+
symbol: symbol,
|
|
29
|
+
num: p === null || p === void 0 ? void 0 : p.product_quantity,
|
|
30
|
+
total: p === null || p === void 0 ? void 0 : p.payment_price
|
|
31
|
+
});
|
|
32
|
+
});
|
|
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
|
+
style: {
|
|
35
|
+
margin: '4px 0'
|
|
36
|
+
}
|
|
37
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: "".concat(PREFIX, "_sales-wrap")
|
|
39
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: "sales-title"
|
|
41
|
+
}, locales.getText('pisell2.cart.sku-card.sales.title')), /*#__PURE__*/React.createElement(CollapsibleList, {
|
|
42
|
+
list: other_products || [],
|
|
43
|
+
renderItem: function renderItem(item) {
|
|
44
|
+
return /*#__PURE__*/React.createElement(BasicInfo, {
|
|
45
|
+
style: {
|
|
46
|
+
border: '1px solid #D0D5DD',
|
|
47
|
+
borderRadius: 4,
|
|
48
|
+
padding: 4
|
|
49
|
+
},
|
|
50
|
+
dataSource: _objectSpread({}, item)
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}))) : null;
|
|
54
|
+
};
|
|
55
|
+
export default Sales;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.pisell-cart-sku-_sales-wrap {
|
|
2
|
+
padding: 0 4px;
|
|
3
|
+
|
|
4
|
+
._sales-title {
|
|
5
|
+
color: #101828;
|
|
6
|
+
font-size: 12px;
|
|
7
|
+
font-weight: 600;
|
|
8
|
+
line-height: 18px;
|
|
9
|
+
word-wrap: break-word;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pisell2-collapsible-list {
|
|
13
|
+
gap: 4px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.product-info {
|
|
17
|
+
.product-name,
|
|
18
|
+
.product-price {
|
|
19
|
+
color: #667085;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { locales } from '@pisell/utils';
|
|
3
|
+
import "./index.less";
|
|
4
|
+
import { PREFIX } from "../../index";
|
|
5
|
+
var Specs = function Specs(props) {
|
|
6
|
+
var _props$dataSource = props.dataSource,
|
|
7
|
+
dataSource = _props$dataSource === void 0 ? {} : _props$dataSource;
|
|
8
|
+
var bundle = dataSource.bundle,
|
|
9
|
+
options = dataSource.options,
|
|
10
|
+
product_option_string = dataSource.product_option_string,
|
|
11
|
+
symbol = dataSource.symbol;
|
|
12
|
+
var more = /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
style: {
|
|
14
|
+
color: '#667085',
|
|
15
|
+
fontSize: 10
|
|
16
|
+
}
|
|
17
|
+
}, locales.getText('pisell2.cart.sku-card.more'));
|
|
18
|
+
if (Array.isArray(bundle) && (bundle === null || bundle === void 0 ? void 0 : bundle.length) > 0) {
|
|
19
|
+
var first = bundle[0];
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: "".concat(PREFIX, "__specs")
|
|
22
|
+
}, /*#__PURE__*/React.createElement("div", null, first.title), bundle.length > 1 ? more : null);
|
|
23
|
+
}
|
|
24
|
+
if (product_option_string) {
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: "".concat(PREFIX, "__specs")
|
|
27
|
+
}, /*#__PURE__*/React.createElement("div", null, product_option_string), options.length > 1 ? more : null);
|
|
28
|
+
}
|
|
29
|
+
if (options.length > 0) {
|
|
30
|
+
var _first = options[0];
|
|
31
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: "".concat(PREFIX, "__specs")
|
|
33
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: "spec-item"
|
|
35
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
className: "spec-name"
|
|
37
|
+
}, _first.name), /*#__PURE__*/React.createElement("span", {
|
|
38
|
+
className: "spec-num"
|
|
39
|
+
}, symbol, _first.price, "x", _first.num)), options.length > 1 ? more : null);
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
export default Specs;
|