diff --git a/src/hooks/useProductsSets.js b/src/hooks/useProductsSets.js index 59674bd..17072c7 100644 --- a/src/hooks/useProductsSets.js +++ b/src/hooks/useProductsSets.js @@ -204,3 +204,6 @@ export const PackageTypes = [ { key: '35014', value: '35014', label: '其它(餐补等)' }, ]; +export const formatGroupSize = (min, max) => { + return max === 1000 ? min === 0 ? '不限人等' : `${min}人以上` : `${min}-${max}`; +}; diff --git a/src/views/products/Detail/ProductInfoQuotation.jsx b/src/views/products/Detail/ProductInfoQuotation.jsx index 22a84eb..798ae30 100644 --- a/src/views/products/Detail/ProductInfoQuotation.jsx +++ b/src/views/products/Detail/ProductInfoQuotation.jsx @@ -6,6 +6,7 @@ import { useDatePresets } from '@/hooks/useDatePresets' import dayjs from 'dayjs' import useProductsStore from '@/stores/Products/Index' import PriceCompactInput from '@/views/products/Detail/PriceCompactInput' +import { formatGroupSize } from '@/hooks/useProductsSets' const { RangePicker } = DatePicker @@ -216,7 +217,7 @@ const ProductInfoQuotation = ({ editable, ...props }) => { title: t('products:group_size'), dataIndex: 'group_size', width: '6rem', - render: (_, record) => `${record.group_size_min}-${record.group_size_max}`, + render: (_, record) => formatGroupSize(record.group_size_min,record.group_size_max), }, {