Skip to content

Badge each model with its discount against the official price - #6

Merged
Gyarados4157 merged 3 commits into
mainfrom
feat/pricing-discount-badge
Oct 22, 2026
Merged

Gyarados4157 merged 3 commits into
mainfrom
feat/pricing-discount-badge

Conversation

@Gyarados4157

Copy link
Copy Markdown
Collaborator

What changes

  • Each model card and the model detail header now show a discount badge such as ≈2.2折, computed by the same function as the "计费说明" dialog: Price ÷ USDExchangeRate × the group ratio the card prices use.
  • The badge appears only for a real discount. With no discount, or a markup, it isn't shown.

Why: customers clicking a model's 「详情」 saw USD list prices and no discount, because the discount lived only in the billing dialog.

With production's current settings (Price = 1, USDExchangeRate = 6.8, group ratio 1.5) every model shows ≈2.2折.

Checks

  • bun run typecheck: passes
  • bunx vitest run src/features/pricing: 15 files, 293 tests pass, including a new badge test
  • oxlint and oxfmt on the changed files: clean
  • Checked the cards and the detail panel in a browser against production data through the dev proxy

🤖 Generated with Claude Code

Gyarados4157 and others added 3 commits October 22, 2026 20:20
Customers opening a model saw USD list prices and no discount; the
discount lived only in the billing dialog. Cards and the detail header
now show "≈2.2折" from the same calculation, and nothing for a markup.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@Gyarados4157
Gyarados4157 merged commit ab554d7 into main Oct 22, 2026
@Gyarados4157
Gyarados4157 deleted the feat/pricing-discount-badge branch October 22, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant