diff --git a/web/src/views/OrderHistory/components/OrderDetail.tsx b/web/src/views/OrderHistory/components/OrderDetail.tsx index 562397be..e4c5bf51 100644 --- a/web/src/views/OrderHistory/components/OrderDetail.tsx +++ b/web/src/views/OrderHistory/components/OrderDetail.tsx @@ -9,7 +9,7 @@ import { getOrderDetail } from '@/api/order' import { STATUS } from '../index'; -const OrderDetail = forwardRef((_props, ref) => { +const OrderDetail = forwardRef void; }>(({ getProductType }, ref) => { const { t } = useTranslation(); const [visible, setVisible] = useState(false); const [data, setData] = useState({}) @@ -38,7 +38,7 @@ const OrderDetail = forwardRef((_props, ref) => { : key === 'status' && value ? t(`pricing.${STATUS[value as keyof typeof STATUS].key}`) : key === 'product_type' && value - ? t(`pricing.${value.toLowerCase()}.type`) + ? t(`pricing.${getProductType(value)}.type`) : value } }) diff --git a/web/src/views/OrderHistory/index.tsx b/web/src/views/OrderHistory/index.tsx index 1dd31376..1446434b 100644 --- a/web/src/views/OrderHistory/index.tsx +++ b/web/src/views/OrderHistory/index.tsx @@ -51,10 +51,10 @@ const OrderHistory: React.FC = () => { ] const productTypeOptions = [ { label: t('pricing.allType'), value: null }, - ...PRICE_LIST.map(vo => ({ - label: t(`pricing.${vo.type}.type`), - value: vo.type - })) + { label: t('pricing.personal.type'), value: 'FREE' }, + { label: t('pricing.team.type'), value: 'TEAM' }, + { label: t('pricing.biz.type'), value: 'ENTERPRISE' }, + { label: t('pricing.commerce.type'), value: 'OEM' }, ] const handleView = (order: Order) => { @@ -128,6 +128,16 @@ const OrderHistory: React.FC = () => { end_time })) } + + const getProductType = (type: string) => { + const typeMap: Record = { + 'FREE': 'personal', + 'TEAM': 'team', + 'ENTERPRISE': 'biz', + 'OEM': 'commerce' + }; + return typeMap[type] || 'ENTERPRISE'; + }; // 表格列配置 const columns: ColumnsType = [ { @@ -140,7 +150,7 @@ const OrderHistory: React.FC = () => { title: t('pricing.product_type'), dataIndex: 'product_type', key: 'product_type', - render: (type) => t(`pricing.${type.toLowerCase()}.type`) + render: (type) => t(`pricing.${getProductType(type)}.type`) }, { title: t('pricing.payable_amount'), @@ -219,7 +229,7 @@ const OrderHistory: React.FC = () => { isScroll={true} /> - + ); };