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 98260da..bf86a22 100644 --- a/web/src/components/table/model-pricing/view/card/PricingCardView.jsx +++ b/web/src/components/table/model-pricing/view/card/PricingCardView.jsx @@ -244,11 +244,10 @@ const PricingCardView = ({ ); originalPrices.input.push(formatPrice(billingRates.inputRatioPrice)); - // 输出价格:仅当全局模型配置了 completion_ratio 时才展示 + // 输出价格:渠道配置了 completion_ratio 即可展示 if ( ch.completion_ratio !== undefined && - ch.completion_ratio !== null && - model.completion_ratio != null + ch.completion_ratio !== null ) { prices.output.push( formatPrice(billingRates.completionRatioPrice * usedGroupRatio), @@ -258,11 +257,10 @@ const PricingCardView = ({ ); } - // 缓存读取价格:仅当全局模型配置了 cache_ratio 时才展示 + // 缓存读取价格:渠道配置了 cache_ratio 即可展示 if ( ch.cache_ratio !== undefined && - ch.cache_ratio !== null && - model.cache_ratio != null + ch.cache_ratio !== null ) { prices.cache.push( formatPrice(billingRates.cacheRatioPrice * usedGroupRatio), @@ -270,11 +268,10 @@ const PricingCardView = ({ originalPrices.cache.push(formatPrice(billingRates.cacheRatioPrice)); } - // 缓存创建价格:仅当全局模型配置了 create_cache_ratio 时才展示 + // 缓存创建价格:渠道配置了 create_cache_ratio 即可展示 if ( ch.create_cache_ratio !== undefined && - ch.create_cache_ratio !== null && - model.create_cache_ratio != null + ch.create_cache_ratio !== null ) { prices.createCache.push( formatPrice( @@ -560,25 +557,25 @@ const PricingCardView = ({ }); } - // if (cache) { - // items.push({ - // key: 'cache', - // label: t('缓存读取价格'), - // value: cache.single || `${cache.symbol}${cache.min} ~ ${cache.symbol}${cache.max}`, - // suffix: unitSuffix, - // original: original?.cache, - // }); - // } + if (cache) { + items.push({ + key: 'cache', + label: t('缓存读取价格'), + value: cache.single || `${cache.symbol}${cache.min} ~ ${cache.symbol}${cache.max}`, + suffix: unitSuffix, + original: original?.cache, + }); + } - // if (createCache) { - // items.push({ - // key: 'create-cache', - // label: t('缓存创建价格'), - // value: createCache.single || `${createCache.symbol}${createCache.min} ~ ${createCache.symbol}${createCache.max}`, - // suffix: unitSuffix, - // original: original?.createCache, - // }); - // } + if (createCache) { + items.push({ + key: 'create-cache', + label: t('缓存创建价格'), + value: createCache.single || `${createCache.symbol}${createCache.min} ~ ${createCache.symbol}${createCache.max}`, + suffix: unitSuffix, + original: original?.createCache, + }); + } } if (videoFlat) { @@ -797,28 +794,11 @@ const PricingCardView = ({ > {(() => { const items = getModelPriceItemsForCard(model, priceData); - const inputItem = items.find(i => i.key === 'input'); - const outputItem = items.find(i => i.key === 'output'); + if (items.length === 0) return null; return ( -