Commit 41c7a862 authored by 前端-李俊鑫's avatar 前端-李俊鑫
parents 6446a6f1 1d4a2616
...@@ -82,9 +82,10 @@ const RecommendCommodity: React.FC<RecommendCommodityProps> = (props: RecommendC ...@@ -82,9 +82,10 @@ const RecommendCommodity: React.FC<RecommendCommodityProps> = (props: RecommendC
} }
if (key === 'num') { if (key === 'num') {
console.log(val, Number(val))
if (Number(val) < 0) { if (Number(val) < 0) {
newProps[key] = 1 newProps[key] = 1
} else if (val.indexOf('.')) {
newProps[key] = Math.round(Number(val))
} }
} }
...@@ -193,7 +194,7 @@ const RecommendCommodity: React.FC<RecommendCommodityProps> = (props: RecommendC ...@@ -193,7 +194,7 @@ const RecommendCommodity: React.FC<RecommendCommodityProps> = (props: RecommendC
(manageWay === 1 || manageWay === 2) && ( (manageWay === 1 || manageWay === 2) && (
<div className={styles['RecommendCommodity-box']}> <div className={styles['RecommendCommodity-box']}>
<div className={styles['RecommendCommodity-box-label']}>展示数量</div> <div className={styles['RecommendCommodity-box-label']}>展示数量</div>
<InputNumber style={{ width: '100%' }} key={`${selectedKey}-num`} min={1} defaultValue={num} onBlur={(e) => _onChangeByKey(e.target.value, 'num')} /> <InputNumber precision={0} style={{ width: '100%' }} key={`${selectedKey}-num`} min={1} defaultValue={num} onBlur={(e) => _onChangeByKey(e.target.value, 'num')} />
</div> </div>
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment