Commit 398addd7 authored by GuanHua's avatar GuanHua

fix: 修改装修店铺bug

parent ab47bcc5
......@@ -213,8 +213,8 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
FormEffectHooks.onFieldChange$('brandId').subscribe(state => {
searchBrandOptionEffect(shopId, actions, 'brandId', memberId, memberRoleId)
})
FormEffectHooks.onFieldChange$('categoryId').subscribe(state => {
searchCustomerCategoryOptionEffect(shopId, actions, 'categoryId', memberId, memberRoleId)
FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(state => {
searchCustomerCategoryOptionEffect(shopId, actions, 'customerCategoryId', memberId, memberRoleId)
})
},
components: { ModalSearch: Search, DateRangePickerUnix, Submit, CustomInputSearch, CustomCategorySearch },
......
......@@ -56,7 +56,7 @@ const CommoditySchema: ISchema = {
fieldNames: { label: 'title', value: 'id', children: 'children' },
},
},
categoryId: {
customerCategoryId: {
type: 'string',
'x-component': 'CustomCategorySearch',
'x-component-props': {
......
import React, { useState, useEffect, useMemo } from 'react'
import { Input, Radio, Space, Select, Button, message, Tooltip } from 'antd'
import { Input, Radio, Space, Select, Button, message, Tooltip, InputNumber } from 'antd'
import { DeleteOutlined } from '@ant-design/icons'
import { changeProps } from '@lingxi-disign/core'
import { PublicApi } from '@/services/api'
......@@ -81,6 +81,18 @@ const RecommendCommodity: React.FC<RecommendCommodityProps> = (props: RecommendC
[key]: val,
}
if (key === 'num') {
console.log(val, Number(val))
if (Number(val) < 0) {
newProps[key] = 1
}
}
if(key === 'categoryId') {
newProps.idList = []
newProps.dataList = []
}
changeProps({
title: newTitle ? newTitle : title,
props: Object.assign({ ...props }, newProps)
......@@ -181,7 +193,7 @@ const RecommendCommodity: React.FC<RecommendCommodityProps> = (props: RecommendC
(manageWay === 1 || manageWay === 2) && (
<div className={styles['RecommendCommodity-box']}>
<div className={styles['RecommendCommodity-box-label']}>展示数量</div>
<Input key={`${selectedKey}-num`} type='number' defaultValue={num} onBlur={(e) => _onChangeByKey(e.target.value, 'num')} />
<InputNumber style={{ width: '100%' }} key={`${selectedKey}-num`} min={1} defaultValue={num} onBlur={(e) => _onChangeByKey(e.target.value, 'num')} />
</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