feat(subscription): enhance styling and layout for subscription components

This commit is contained in:
2026-06-26 15:23:21 +08:00
parent fdcb7c56f1
commit f0ba1756b6
4 changed files with 113 additions and 67 deletions
@@ -1,16 +1,23 @@
.section { .section {
margin: 18px -30px 0; overflow: hidden;
border: 1px solid rgba(17, 17, 17, 0.06);
border-radius: 28px;
background: rgba(255, 255, 255, 0.82);
box-shadow: 0 16px 42px rgba(31, 21, 25, 0.08);
backdrop-filter: blur(18px);
} }
.heading { .heading {
position: relative; position: relative;
padding: 14px 16px 18px; padding: 18px 18px 22px;
background: #d9d9d9; background:
linear-gradient(135deg, #ffffff 0%, #f5f5f5 58%, #ececec 100%),
#ffffff;
} }
.title { .title {
margin: 0; margin: 0;
color: #111111; color: #181014;
font-size: 22px; font-size: 22px;
font-weight: 800; font-weight: 800;
line-height: 1.2; line-height: 1.2;
@@ -22,39 +29,37 @@
bottom: -12px; bottom: -12px;
width: 24px; width: 24px;
height: 24px; height: 24px;
background: #d9d9d9; background: #f2f2f2;
transform: translateX(-50%) rotate(45deg); transform: translateX(-50%) rotate(45deg);
} }
.panel { .panel {
position: relative; position: relative;
z-index: 1; z-index: 1;
margin-top: 12px; display: flex;
padding: 8px 16px 8px 12px; flex-direction: column;
border: 1px solid #8d8d8d; gap: 8px;
border-radius: 14px; padding: 18px 12px 14px;
background: #d9d9d9; background: transparent;
} }
.row { .row {
display: grid; display: grid;
grid-template-columns: 50px minmax(0, 1fr) auto; grid-template-columns: 48px minmax(0, 1fr) auto;
align-items: center; align-items: center;
width: 100%; width: 100%;
min-height: 42px; min-height: 48px;
padding: 0; padding: 8px 12px 8px 6px;
border: 0; border: 1px solid transparent;
border-bottom: 3px solid #828282; border-radius: 18px;
background: transparent; background: #ffffff;
color: #4f4f4f; color: #53484d;
cursor: pointer; cursor: pointer;
font: inherit; font: inherit;
text-align: left; text-align: left;
transition: background-color 0.15s ease, color 0.15s ease; box-shadow: 0 7px 18px rgba(31, 21, 25, 0.045);
} transition: background-color 0.18s ease, border-color 0.18s ease,
box-shadow 0.18s ease, color 0.18s ease, transform 0.12s ease;
.row:last-child {
border-bottom-width: 3px;
} }
.row:focus-visible { .row:focus-visible {
@@ -63,7 +68,10 @@
} }
.selected { .selected {
border-color: rgba(246, 87, 160, 0.45);
background: #fff4f8;
color: #111111; color: #111111;
box-shadow: 0 12px 28px rgba(246, 87, 160, 0.15);
} }
.coinIcon { .coinIcon {
@@ -74,8 +82,8 @@
justify-content: center; justify-content: center;
justify-self: center; justify-self: center;
border-radius: 999px; border-radius: 999px;
background: #ffffff; background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
color: #5f5f5f; color: #6a5960;
font-size: 12px; font-size: 12px;
line-height: 1; line-height: 1;
text-transform: lowercase; text-transform: lowercase;
@@ -84,13 +92,13 @@
.coins { .coins {
min-width: 0; min-width: 0;
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 700;
line-height: 1.2; line-height: 1.2;
} }
.price { .price {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 800;
line-height: 1.2; line-height: 1.2;
white-space: nowrap; white-space: nowrap;
} }
@@ -2,8 +2,11 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-height: 100dvh; min-height: 100dvh;
background: #fcf3f4; background:
padding: 18px 30px 10px; radial-gradient(circle at 8% 4%, rgba(255, 255, 255, 0.95) 0 90px, transparent 160px),
linear-gradient(180deg, #fff9fb 0%, #fcf3f4 52%, #fffefe 100%);
padding: 18px 20px 10px;
animation: pageEnter 360ms ease-out both;
} }
.header { .header {
@@ -16,6 +19,14 @@
display: inline-flex; display: inline-flex;
} }
.offerStack {
display: flex;
flex-direction: column;
gap: 18px;
margin-top: 14px;
animation: stackEnter 420ms ease-out 80ms both;
}
.userSlot { .userSlot {
margin-top: var(--spacing-md); margin-top: var(--spacing-md);
padding: 0 var(--spacing-xs); padding: 0 var(--spacing-xs);
@@ -58,11 +69,13 @@
} }
.paymentMethodSlot { .paymentMethodSlot {
margin-top: var(--spacing-lg); margin-top: 22px;
animation: stackEnter 420ms ease-out 150ms both;
} }
.ctaSlot { .ctaSlot {
margin-top: var(--spacing-xl); margin-top: 22px;
animation: stackEnter 420ms ease-out 190ms both;
} }
.agreementSlot { .agreementSlot {
@@ -83,3 +96,27 @@
.agreementLink:hover { .agreementLink:hover {
text-decoration: underline; text-decoration: underline;
} }
@keyframes pageEnter {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes stackEnter {
from {
opacity: 0;
transform: translateY(14px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@@ -1,11 +1,18 @@
.section { .section {
margin: 18px -30px 0; overflow: hidden;
border: 1px solid rgba(246, 87, 160, 0.12);
border-radius: 28px;
background: rgba(255, 255, 255, 0.78);
box-shadow: 0 18px 45px rgba(246, 87, 160, 0.11);
backdrop-filter: blur(18px);
} }
.summary { .summary {
position: relative; position: relative;
padding: 10px 10px 16px; padding: 18px 18px 22px;
background: #d9d9d9; background:
linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 235, 243, 0.92) 54%, rgba(246, 87, 160, 0.16) 100%),
#ffffff;
} }
.title { .title {
@@ -17,20 +24,20 @@
} }
.titleText { .titleText {
color: #111111; color: #181014;
font-size: 20px; font-size: 20px;
font-weight: 800; font-weight: 800;
} }
.renewText { .renewText {
color: #7d7d7d; color: #9a707e;
font-size: 14px; font-size: 13px;
font-weight: 700; font-weight: 700;
} }
.subtitle { .subtitle {
margin: 8px 0 0; margin: 8px 0 0;
color: #666666; color: #6f5961;
font-size: 15px; font-size: 15px;
font-weight: 700; font-weight: 700;
line-height: 1.3; line-height: 1.3;
@@ -42,7 +49,7 @@
bottom: -12px; bottom: -12px;
width: 24px; width: 24px;
height: 24px; height: 24px;
background: #d9d9d9; background: #ffe8f0;
transform: translateX(-50%) rotate(45deg); transform: translateX(-50%) rotate(45deg);
} }
@@ -51,26 +58,28 @@
z-index: 1; z-index: 1;
display: grid; display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 10px; gap: 9px;
padding: 14px 10px 0; padding: 18px 10px 12px;
} }
.planCard { .planCard {
display: flex; display: flex;
min-width: 0; min-width: 0;
min-height: 116px; min-height: 118px;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 12px 6px 10px; padding: 12px 6px 11px;
border: 0; border: 1px solid rgba(246, 87, 160, 0.08);
border-radius: 14px; border-radius: 20px;
background: #f4f4f4; background: #ffffff;
color: #111111; color: #181014;
cursor: pointer; cursor: pointer;
font: inherit; font: inherit;
text-align: center; text-align: center;
transition: background-color 0.15s ease, transform 0.05s ease; box-shadow: 0 8px 22px rgba(26, 16, 20, 0.05);
transition: background-color 0.18s ease, box-shadow 0.18s ease,
color 0.18s ease, transform 0.12s ease;
} }
.planCard:focus-visible { .planCard:focus-visible {
@@ -79,11 +88,14 @@
} }
.planCard:active { .planCard:active {
transform: scale(0.98); transform: translateY(1px) scale(0.985);
} }
.selected { .selected {
background: #d9d9d9; border-color: rgba(246, 87, 160, 0.55);
background: linear-gradient(180deg, #fff 0%, #fff2f8 100%);
box-shadow: 0 14px 30px rgba(246, 87, 160, 0.2);
color: #111111;
} }
.planTitle { .planTitle {
@@ -109,7 +121,7 @@
.currency { .currency {
margin-bottom: 3px; margin-bottom: 3px;
color: #777777; color: #8b717a;
font-size: 12px; font-size: 12px;
font-weight: 700; font-weight: 700;
text-transform: lowercase; text-transform: lowercase;
@@ -117,7 +129,7 @@
.originalPrice { .originalPrice {
margin-top: 10px; margin-top: 10px;
color: #7c7c7c; color: #9c8b91;
font-size: 14px; font-size: 14px;
font-weight: 800; font-weight: 800;
line-height: 1; line-height: 1;
@@ -126,7 +138,9 @@
@media (max-width: 360px) { @media (max-width: 360px) {
.planGrid { .planGrid {
gap: 8px; gap: 7px;
padding-right: 8px;
padding-left: 8px;
} }
.planTitle { .planTitle {
+2 -15
View File
@@ -1,17 +1,4 @@
"use client"; "use client";
/**
* 订阅页主屏幕
*
* 布局(顶到底):
* 1. 顶部返回箭头
* 2. 用户信息行
* 3. 渐变横幅
* 4. 三个套餐卡片
* 5. 自动续费说明
* 6. 权益列表卡片
* 7. 主操作按钮
* 8. 协议复选框
*/
import { useEffect, useMemo, useRef, useState } from "react"; import { useEffect, useMemo, useRef, useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
@@ -334,7 +321,7 @@ export function SubscriptionScreen({
</header> </header>
{isVipSubscription ? ( {isVipSubscription ? (
<> <div className={styles.offerStack}>
<SubscriptionVipOfferSection <SubscriptionVipOfferSection
plans={vipOfferPlans} plans={vipOfferPlans}
selectedPlanId={payment.selectedPlanId || selectedPlan?.id || null} selectedPlanId={payment.selectedPlanId || selectedPlan?.id || null}
@@ -355,7 +342,7 @@ export function SubscriptionScreen({
}) })
} }
/> />
</> </div>
) : ( ) : (
<> <>
<section className={styles.userSlot}> <section className={styles.userSlot}>