@yorkjs/hive-ui 0.0.6 → 0.0.7
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/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -5,4 +5,4 @@ export { default as Checkbox } from './components/Checkbox'
|
|
|
5
5
|
export { default as Tag } from './components/Tag'
|
|
6
6
|
|
|
7
7
|
export { default as FlowItem } from './item/FlowItem'
|
|
8
|
-
export { default as
|
|
8
|
+
export { default as ProductItem } from './item/ProductItem'
|
|
@@ -73,6 +73,10 @@ export interface IProductCardProps {
|
|
|
73
73
|
customization?: string
|
|
74
74
|
/** 做法描述最大显示行数 (默认3) */
|
|
75
75
|
customizationMaxLines?: number
|
|
76
|
+
/** 套餐信息描述 */
|
|
77
|
+
combo? : string
|
|
78
|
+
/** 套餐描述最大显示行数 (默认3) */
|
|
79
|
+
comboMaxLines?: number
|
|
76
80
|
/** 售价 */
|
|
77
81
|
salePrice: string | number
|
|
78
82
|
/** 原价 (划线价) */
|
|
@@ -118,7 +122,7 @@ const DEFAULT_LABELS: IProductCardLabels = {
|
|
|
118
122
|
offline: '已下架'
|
|
119
123
|
}
|
|
120
124
|
|
|
121
|
-
const
|
|
125
|
+
const ProductItem: React.FC<IProductCardProps> = (props) => {
|
|
122
126
|
const {
|
|
123
127
|
image,
|
|
124
128
|
title,
|
|
@@ -134,6 +138,8 @@ const ProductCard: React.FC<IProductCardProps> = (props) => {
|
|
|
134
138
|
deliveryTypes = [],
|
|
135
139
|
customization,
|
|
136
140
|
customizationMaxLines = 3,
|
|
141
|
+
combo,
|
|
142
|
+
comboMaxLines = 3,
|
|
137
143
|
salePrice,
|
|
138
144
|
originalPrice,
|
|
139
145
|
buyCount,
|
|
@@ -359,6 +365,18 @@ const ProductCard: React.FC<IProductCardProps> = (props) => {
|
|
|
359
365
|
)
|
|
360
366
|
: undefined
|
|
361
367
|
}
|
|
368
|
+
{
|
|
369
|
+
combo
|
|
370
|
+
? (
|
|
371
|
+
<Text
|
|
372
|
+
className={styles['customization-text']}
|
|
373
|
+
style={{ WebkitLineClamp: comboMaxLines }}
|
|
374
|
+
>
|
|
375
|
+
{combo}
|
|
376
|
+
</Text>
|
|
377
|
+
)
|
|
378
|
+
: undefined
|
|
379
|
+
}
|
|
362
380
|
</View>
|
|
363
381
|
<View className={styles['content-bottom']}>
|
|
364
382
|
<View className={styles['price-container']}>
|
|
@@ -432,4 +450,4 @@ const ProductCard: React.FC<IProductCardProps> = (props) => {
|
|
|
432
450
|
)
|
|
433
451
|
}
|
|
434
452
|
|
|
435
|
-
export default React.memo(
|
|
453
|
+
export default React.memo(ProductItem)
|
|
File without changes
|