diff --git a/src/stores/Products/Index.js b/src/stores/Products/Index.js index e326e10..618fb05 100644 --- a/src/stores/Products/Index.js +++ b/src/stores/Products/Index.js @@ -193,6 +193,7 @@ export const useProductsStore = create( const generatedList = [] defList.forEach(definition => { + // 增加多个有效日期批量设置: const mappedPriceList = definition?.priceList.map(price => { return { id: null, diff --git a/src/views/App.jsx b/src/views/App.jsx index fa8a61f..34b288f 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -40,7 +40,6 @@ function App() { const href = useHref() const navigate = useNavigate() - // 除了路由 /p...以外都需要登陆系统 const needToLogin = href !== '/login' && isEmpty(loginToken) useEffect(() => { diff --git a/src/views/products/Detail/PriceCompactInput.jsx b/src/views/products/Detail/PriceCompactInput.jsx index 598ebc7..320d6fa 100644 --- a/src/views/products/Detail/PriceCompactInput.jsx +++ b/src/views/products/Detail/PriceCompactInput.jsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { Input, Space } from 'antd' -export const PriceCompactInput = (props) => { +const PriceCompactInput = (props) => { const { id, value = {}, onChange } = props const [numberStart, setNumberStart] = useState(0) const [numberEnd, setNumberEnd] = useState(0) @@ -19,7 +19,7 @@ export const PriceCompactInput = (props) => { } const onNumberStartChange = (e) => { const newNumber = parseInt(e.target.value || '0', 10) - if (Number.isNaN(numberStart)) { + if (Number.isNaN(newNumber)) { return } if (!('numberStart' in value)) { @@ -31,7 +31,7 @@ export const PriceCompactInput = (props) => { } const onNumberEndChange = (e) => { const newNumber = parseInt(e.target.value || '0', 10) - if (Number.isNaN(numberEnd)) { + if (Number.isNaN(newNumber)) { return } if (!('numberEnd' in value)) { @@ -43,7 +43,7 @@ export const PriceCompactInput = (props) => { } const onAudultPriceChange = (e) => { const newNumber = parseInt(e.target.value || '0', 10) - if (Number.isNaN(audultPrice)) { + if (Number.isNaN(newNumber)) { return } if (!('audultPrice' in value)) { @@ -55,7 +55,7 @@ export const PriceCompactInput = (props) => { } const onChildrenPriceChange = (e) => { const newNumber = parseInt(e.target.value || '0', 10) - if (Number.isNaN(childrenPrice)) { + if (Number.isNaN(newNumber)) { return } if (!('childrenPrice' in value)) { diff --git a/src/views/products/Detail/ProductInfoQuotation.jsx b/src/views/products/Detail/ProductInfoQuotation.jsx index a459412..21fae95 100644 --- a/src/views/products/Detail/ProductInfoQuotation.jsx +++ b/src/views/products/Detail/ProductInfoQuotation.jsx @@ -5,7 +5,7 @@ import { CloseOutlined, StarTwoTone, PlusOutlined, ExclamationCircleFilled } fro import { useDatePresets } from '@/hooks/useDatePresets' import dayjs from 'dayjs' import useProductsStore from '@/stores/Products/Index' -import PriceCompactInput from './PriceCompactInput' +import PriceCompactInput from '@/views/products/Detail/PriceCompactInput' const { RangePicker } = DatePicker @@ -294,16 +294,18 @@ const ProductInfoQuotation = ({ editable, ...props }) => { }} />} >