From fe9e28dbb797e91fc4c78775efb9e020af3918de Mon Sep 17 00:00:00 2001 From: Egor Date: Tue, 20 Jan 2026 06:38:25 +0300 Subject: [PATCH 1/2] Update subscription.ts --- src/api/subscription.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api/subscription.ts b/src/api/subscription.ts index c039ed2..cc723c1 100644 --- a/src/api/subscription.ts +++ b/src/api/subscription.ts @@ -156,14 +156,19 @@ export const subscriptionApi = { uuid: string name: string country_code: string | null + base_price_kopeks: number price_kopeks: number + price_per_month_kopeks: number price_rubles: number is_available: boolean is_connected: boolean - is_trial_eligible: boolean + has_discount: boolean + discount_percent: number }> connected_count: number has_subscription: boolean + days_left: number + discount_percent: number }> => { const response = await apiClient.get('/cabinet/subscription/countries') return response.data From ea47b09badb77072bb95560c3e917f681319737f Mon Sep 17 00:00:00 2001 From: Egor Date: Tue, 20 Jan 2026 06:38:51 +0300 Subject: [PATCH 2/2] Update Subscription.tsx --- src/pages/Subscription.tsx | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/pages/Subscription.tsx b/src/pages/Subscription.tsx index 1f1426f..46364f8 100644 --- a/src/pages/Subscription.tsx +++ b/src/pages/Subscription.tsx @@ -984,6 +984,12 @@ export default function Subscription() { ✅ — подключено • ➕ — будет добавлено (платно) • ➖ — будет отключено + {countriesData.discount_percent > 0 && ( +
+ 🎁 Ваша скидка на серверы: -{countriesData.discount_percent}% +
+ )} +
{countriesData.countries.map((country) => { const isCurrentlyConnected = country.is_connected @@ -1017,10 +1023,32 @@ export default function Subscription() { {willBeAdded ? '➕' : willBeRemoved ? '➖' : isSelected ? '✅' : '⚪'}
-
{country.name}
+
+ {country.name} + {country.has_discount && !isCurrentlyConnected && ( + + -{country.discount_percent}% + + )} +
{willBeAdded && (
- +{formatPrice(country.price_kopeks)}/мес (пропорционально) + +{formatPrice(country.price_kopeks)} (за {countriesData.days_left} дн.) + {country.has_discount && ( + + {formatPrice(Math.round(country.base_price_kopeks * countriesData.days_left / 30))} + + )} +
+ )} + {!willBeAdded && !isCurrentlyConnected && ( +
+ {formatPrice(country.price_per_month_kopeks)}/мес + {country.has_discount && ( + + {formatPrice(country.base_price_kopeks)} + + )}
)} {!country.is_available && !isCurrentlyConnected && (