From 9a0bdaba8e7369c5ab0225e8748d601fe0cbdfe1 Mon Sep 17 00:00:00 2001 From: erio Date: Thu, 9 Apr 2026 00:15:25 +0800 Subject: [PATCH] refactor(frontend): extract centralized platform color config Create utils/platformColors.ts as single source of truth for all platform color classes (badge, border, accent, text, icon, button, discount). Refactor SubscriptionPlanCard to use it. --- .../payment/SubscriptionPlanCard.vue | 160 ++++-------------- frontend/src/utils/platformColors.ts | 127 ++++++++++++++ 2 files changed, 159 insertions(+), 128 deletions(-) create mode 100644 frontend/src/utils/platformColors.ts diff --git a/frontend/src/components/payment/SubscriptionPlanCard.vue b/frontend/src/components/payment/SubscriptionPlanCard.vue index dd9d63ecc0..dbc084f821 100644 --- a/frontend/src/components/payment/SubscriptionPlanCard.vue +++ b/frontend/src/components/payment/SubscriptionPlanCard.vue @@ -3,20 +3,20 @@ :class="[ 'group relative flex flex-col overflow-hidden rounded-2xl border transition-all', 'hover:shadow-xl hover:-translate-y-0.5', - cardBorderClass, + borderClass, 'bg-white dark:bg-dark-800', ]" > -
+

{{ plan.name }}

- - {{ platformLabel }} + + {{ pLabel }}

@@ -31,14 +31,14 @@

¥ - {{ plan.price }} + {{ plan.price }} / {{ validitySuffix }}
¥{{ plan.original_price }} - + {{ discountText }}
@@ -46,32 +46,26 @@
-
{{ t('payment.planCard.rate') }} {{ rateDisplay }}
-
{{ t('payment.planCard.dailyLimit') }} ${{ plan.daily_limit_usd }}
-
{{ t('payment.planCard.weeklyLimit') }} ${{ plan.weekly_limit_usd }}
-
{{ t('payment.planCard.monthlyLimit') }} ${{ plan.monthly_limit_usd }}
-
{{ t('payment.planCard.quota') }} {{ t('payment.planCard.unlimited') }}
-
{{ t('payment.planCard.models') }}
@@ -85,24 +79,19 @@
-
- +
+ {{ feature }}
-
- + {{ validityLabel }}
@@ -110,11 +99,7 @@