diff --git a/web/src/helpers/render.jsx b/web/src/helpers/render.jsx index c0021c0..0e02f96 100644 --- a/web/src/helpers/render.jsx +++ b/web/src/helpers/render.jsx @@ -1893,6 +1893,7 @@ export function renderClaudeModelPrice( cacheCreationRatio5m = 1.0, cacheCreationTokens1h = 0, cacheCreationRatio1h = 1.0, + userChannelRatio, ) { const { ratio: effectiveGroupRatio, label: ratioLabel } = getEffectiveRatio( groupRatio, @@ -1950,9 +1951,11 @@ export function renderClaudeModelPrice( cacheCreationTokens5m * cacheCreationRatio5m + cacheCreationTokens1h * cacheCreationRatio1h; + const userRatio = userChannelRatio ?? 1.0; let price = - (effectiveInputTokens / 1000000) * inputRatioPrice * groupRatio + - (completionTokens / 1000000) * completionRatioPrice * groupRatio; + ((effectiveInputTokens / 1000000) * inputRatioPrice * groupRatio + + (completionTokens / 1000000) * completionRatioPrice * groupRatio) * + userRatio; const inputUnitPrice = inputRatioPrice * rate; const completionUnitPrice = completionRatioPrice * rate; @@ -2132,11 +2135,12 @@ export function renderClaudeModelPrice(
{i18next.t( - '{{breakdown}} * {{ratioType}} {{ratio}} = {{symbol}}{{total}}', + '{{breakdown}} * {{ratioType}} {{ratio}}{{userRatioText}} = {{symbol}}{{total}}', { breakdown: breakdownText, ratioType: ratioLabel, ratio: groupRatio, + userRatioText: userRatio !== 1.0 ? i18next.t(' * 用户倍率 {{userRatio}}', { userRatio }) : '', symbol: symbol, total: (price * rate).toFixed(6), },