From 8bb2883d7e69ad5296852b6da516b042224b2473 Mon Sep 17 00:00:00 2001 From: fengsilin Date: Tue, 28 Apr 2026 11:41:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(home):=20=E9=A6=96=E9=A1=B5=E5=AE=9A?= =?UTF-8?q?=E4=BB=B7=E5=8D=A1=E7=89=87=E6=B7=BB=E5=8A=A0"=E5=8E=BB?= =?UTF-8?q?=E4=BD=93=E9=AA=8C"=E6=8C=89=E9=92=AE=EF=BC=8C=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=20Playground?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PricingCardView 新增 showTryButton 属性,点击跳转 Playground 并预选模型 - 移除 PricingCardView 中未使用的 props (selectedGroup, currency 等) - 首页页脚路由重命名: terms→user-agreement, usage-policy→privacy-policy - i18n: "操练场"更名为"对话" Co-Authored-By: Claude --- web/src/App.jsx | 4 +- .../view/card/PricingCardView.jsx | 38 +++++++++---------- .../model-pricing/useModelPricingData.jsx | 17 --------- web/src/i18n/locales/en.json | 5 ++- web/src/i18n/locales/zh-CN.json | 5 ++- web/src/pages/Home/HomePricingFilters.jsx | 6 +-- .../pages/Home/components/HomePageFooter.jsx | 4 +- 7 files changed, 30 insertions(+), 49 deletions(-) diff --git a/web/src/App.jsx b/web/src/App.jsx index d0498af..75edc81 100644 --- a/web/src/App.jsx +++ b/web/src/App.jsx @@ -361,7 +361,7 @@ function App() { } /> } key={location.pathname}> @@ -369,7 +369,7 @@ function App() { } /> } key={location.pathname}> diff --git a/web/src/components/table/model-pricing/view/card/PricingCardView.jsx b/web/src/components/table/model-pricing/view/card/PricingCardView.jsx index 1451512..8832f43 100644 --- a/web/src/components/table/model-pricing/view/card/PricingCardView.jsx +++ b/web/src/components/table/model-pricing/view/card/PricingCardView.jsx @@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com */ import React from 'react'; +import { useNavigate } from 'react-router-dom'; import { Card, Tag, @@ -36,8 +37,6 @@ import { } from '@douyinfe/semi-illustrations'; import { stringToColor, - calculateModelPrice, - formatPriceInfo, getLobeHubIcon, } from '../../../../../helpers'; import PricingCardSkeleton from './PricingCardSkeleton'; @@ -61,14 +60,9 @@ const PricingCardView = ({ setPageSize, currentPage, setCurrentPage, - selectedGroup, - groupRatio, copyText, setModalImageUrl, setIsModalOpenurl, - currency, - tokenUnit, - displayPrice, showRatio, t, selectedRowKeys = [], @@ -76,6 +70,7 @@ const PricingCardView = ({ openModelDetail, gridColsClass = 'grid-cols-1 xl:grid-cols-2 2xl:grid-cols-3', showPagination = true, + showTryButton = false, }) => { const showSkeleton = useMinimumLoadingTime(loading); const startIndex = (currentPage - 1) * pageSize; @@ -84,6 +79,7 @@ const PricingCardView = ({ : filteredModels; const getModelKey = (model) => model.key ?? model.model_name ?? model.id; const isMobile = useIsMobile(); + const navigate = useNavigate(); const handleCheckboxChange = (model, checked) => { if (!setSelectedRowKeys) return; @@ -240,15 +236,6 @@ const PricingCardView = ({ const modelKey = getModelKey(model); const isSelected = selectedRowKeys.includes(modelKey); - const priceData = calculateModelPrice({ - record: model, - selectedGroup, - groupRatio, - tokenUnit, - displayPrice, - currency, - }); - return ( {model.model_name} -
- {formatPriceInfo(priceData, t)} -
@@ -324,6 +308,22 @@ const PricingCardView = ({ )} + {/* 去体验按钮 */} + {showTryButton && ( + + )} + {/* 倍率信息(可选) */} {showRatio && (
diff --git a/web/src/hooks/model-pricing/useModelPricingData.jsx b/web/src/hooks/model-pricing/useModelPricingData.jsx index c82d3ef..fec9b23 100644 --- a/web/src/hooks/model-pricing/useModelPricingData.jsx +++ b/web/src/hooks/model-pricing/useModelPricingData.jsx @@ -206,23 +206,6 @@ export const useModelPricingData = () => { m.vendor_description = vendor.description; } } - models.sort((a, b) => { - return a.quota_type - b.quota_type; - }); - - models.sort((a, b) => { - if (a.model_name.startsWith('gpt') && !b.model_name.startsWith('gpt')) { - return -1; - } else if ( - !a.model_name.startsWith('gpt') && - b.model_name.startsWith('gpt') - ) { - return 1; - } else { - return a.model_name.localeCompare(b.model_name); - } - }); - setModels(models); }; diff --git a/web/src/i18n/locales/en.json b/web/src/i18n/locales/en.json index b197506..e0a9d4c 100644 --- a/web/src/i18n/locales/en.json +++ b/web/src/i18n/locales/en.json @@ -1365,8 +1365,8 @@ "操作成功完成!": "Operation completed successfully!", "操作暂时被禁用": "Operation temporarily disabled", "操作确认": "Operation confirmation", - "操练场": "Playground", - "操练场和聊天功能": "Playground and chat functions", + "操练场": "Chat", + "操练场和聊天功能": "Chat functions", "支付": "Pay", "支付地址": "Payment address", "支付失败": "Payment failed", @@ -3081,6 +3081,7 @@ "高级设置": "Advanced Settings", "高级配置": "Advanced Configuration", "黑名单": "Blacklist", + "去体验": "Try it", "默认": "Default", "默认 API 版本": "Default API Version", "默认 Responses API 版本,为空则使用上方版本": "Default Responses API version, if empty, uses the version above", diff --git a/web/src/i18n/locales/zh-CN.json b/web/src/i18n/locales/zh-CN.json index 7eddc65..46ca6af 100644 --- a/web/src/i18n/locales/zh-CN.json +++ b/web/src/i18n/locales/zh-CN.json @@ -1349,8 +1349,8 @@ "操作成功完成!": "操作成功完成!", "操作暂时被禁用": "操作暂时被禁用", "操作确认": "操作确认", - "操练场": "操练场", - "操练场和聊天功能": "操练场和聊天功能", + "操练场": "对话", + "操练场和聊天功能": "对话和聊天功能", "支付": "支付", "支付地址": "支付地址", "支付失败": "支付失败", @@ -3058,6 +3058,7 @@ "高级设置": "高级设置", "高级配置": "高级配置", "黑名单": "黑名单", + "去体验": "去体验", "默认": "默认", "默认 API 版本": "默认 API 版本", "默认 Responses API 版本,为空则使用上方版本": "默认 Responses API 版本,为空则使用上方版本", diff --git a/web/src/pages/Home/HomePricingFilters.jsx b/web/src/pages/Home/HomePricingFilters.jsx index 4f4f76d..496b8ae 100644 --- a/web/src/pages/Home/HomePricingFilters.jsx +++ b/web/src/pages/Home/HomePricingFilters.jsx @@ -178,20 +178,16 @@ const HomePricingFilters = ({ t }) => { setPageSize={pricingData.setPageSize} currentPage={pricingData.currentPage} setCurrentPage={pricingData.setCurrentPage} - selectedGroup={pricingData.selectedGroup} - groupRatio={pricingData.groupRatio} copyText={pricingData.copyText} setModalImageUrl={pricingData.setModalImageUrl} setIsModalOpenurl={pricingData.setIsModalOpenurl} - currency={pricingData.currency} - tokenUnit={pricingData.tokenUnit} - displayPrice={pricingData.displayPrice} showRatio={showRatio} t={t} selectedRowKeys={[]} openModelDetail={pricingData.openModelDetail} gridColsClass='grid-cols-1 md:grid-cols-2 lg:grid-cols-3' showPagination={true} + showTryButton={true} />
diff --git a/web/src/pages/Home/components/HomePageFooter.jsx b/web/src/pages/Home/components/HomePageFooter.jsx index d49287a..31910a2 100644 --- a/web/src/pages/Home/components/HomePageFooter.jsx +++ b/web/src/pages/Home/components/HomePageFooter.jsx @@ -30,8 +30,8 @@ const HomePageFooter = () => { const currentYear = new Date().getFullYear(); const footerLinks = [ - { label: t('服务条款'), href: '/terms', external: false }, - { label: t('使用政策'), href: '/usage-policy', external: false }, + { label: t('用户协议'), href: '/user-agreement', external: false }, + { label: t('隐私协议'), href: '/privacy-policy', external: false }, ]; return (