feat(payment): sync plans and add coins rules

This commit is contained in:
2026-06-29 14:11:50 +08:00
parent 274fe87ced
commit e372d58b4c
24 changed files with 1099 additions and 224 deletions
@@ -0,0 +1,259 @@
.screen {
min-height: 100dvh;
box-sizing: border-box;
padding: 18px 20px 28px;
background:
radial-gradient(circle at 16% 5%, rgba(255, 196, 143, 0.2), transparent 28%),
radial-gradient(circle at 86% 8%, rgba(246, 87, 160, 0.2), transparent 26%),
linear-gradient(180deg, #fcf3f4 0%, #fffafa 48%, #fff 100%);
color: #191316;
}
.header {
display: flex;
flex-direction: column;
gap: 18px;
}
.backLink {
display: inline-flex;
width: 42px;
height: 42px;
align-items: center;
justify-content: center;
color: #21191d;
text-decoration: none;
border: 1px solid rgba(25, 19, 22, 0.08);
border-radius: 999px;
background: rgba(255, 255, 255, 0.82);
box-shadow: 0 10px 22px rgba(50, 30, 40, 0.08);
transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.16s ease;
}
.backLink:hover {
background: #ffffff;
box-shadow: 0 14px 26px rgba(50, 30, 40, 0.12);
transform: translateY(-1px);
}
.backLink:active {
transform: translateY(1px);
}
.backLink:focus-visible {
outline: 2px solid #f657a0;
outline-offset: 3px;
}
.hero {
position: relative;
overflow: hidden;
padding: 22px;
border: 1px solid rgba(246, 87, 160, 0.14);
border-radius: 28px;
background:
linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 237, 246, 0.94) 100%),
#ffffff;
box-shadow: 0 18px 46px rgba(86, 45, 62, 0.1);
}
.hero::after {
position: absolute;
right: -34px;
bottom: -42px;
width: 150px;
height: 150px;
border-radius: 999px;
background: radial-gradient(circle, rgba(246, 87, 160, 0.2), transparent 68%);
content: "";
}
.heroIcon {
display: inline-flex;
width: 46px;
height: 46px;
align-items: center;
justify-content: center;
border-radius: 16px;
background: linear-gradient(180deg, #ffe89c 0%, #f8b83e 100%);
color: #8f5400;
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.72),
0 12px 24px rgba(216, 132, 22, 0.2);
}
.eyebrow {
margin: 16px 0 0;
color: #f657a0;
font-size: 12px;
font-weight: 850;
letter-spacing: 0.12em;
line-height: 1;
text-transform: uppercase;
}
.title {
margin: 8px 0 0;
color: #171114;
font-size: 30px;
font-weight: 900;
letter-spacing: -0.8px;
line-height: 1.08;
}
.subtitle {
max-width: 300px;
margin: 10px 0 0;
color: #6d5d64;
font-size: 15px;
font-weight: 650;
line-height: 1.55;
}
.freeCard {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
gap: 12px;
align-items: center;
margin-top: 16px;
padding: 16px;
border: 1px solid rgba(248, 184, 62, 0.24);
border-radius: 22px;
background: rgba(255, 250, 235, 0.84);
box-shadow: 0 12px 28px rgba(142, 93, 18, 0.08);
}
.freeIcon {
display: inline-flex;
width: 40px;
height: 40px;
align-items: center;
justify-content: center;
border-radius: 14px;
background: #ffffff;
color: #d98100;
box-shadow: 0 8px 18px rgba(142, 93, 18, 0.1);
}
.freeTitle {
margin: 0;
color: #2a1f14;
font-size: 16px;
font-weight: 850;
line-height: 1.1;
}
.freeText {
margin: 5px 0 0;
color: #7a6040;
font-size: 13px;
font-weight: 650;
line-height: 1.45;
}
.ruleList {
display: flex;
flex-direction: column;
gap: 10px;
margin-top: 16px;
}
.ruleCard {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
gap: 12px;
align-items: center;
padding: 14px;
border: 1px solid rgba(25, 19, 22, 0.06);
border-radius: 20px;
background: rgba(255, 255, 255, 0.9);
box-shadow: 0 10px 26px rgba(55, 36, 44, 0.06);
animation: cardIn 0.42s ease both;
transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.ruleCard:hover {
box-shadow: 0 15px 32px rgba(55, 36, 44, 0.1);
transform: translateY(-2px);
}
.ruleIcon {
display: inline-flex;
width: 36px;
height: 36px;
align-items: center;
justify-content: center;
border-radius: 14px;
background: #fff0f6;
color: #f657a0;
}
.ruleContent {
min-width: 0;
}
.ruleTitle {
margin: 0;
color: #21191d;
font-size: 16px;
font-weight: 850;
line-height: 1.15;
}
.freeBadge {
display: inline-flex;
margin: 7px 0 0;
padding: 4px 9px;
border-radius: 999px;
background: #edf4ff;
color: #2e6eea;
font-size: 12px;
font-weight: 780;
line-height: 1;
}
.cost {
margin: 0;
color: #171114;
font-size: 15px;
font-weight: 900;
line-height: 1.15;
text-align: right;
white-space: nowrap;
}
@keyframes cardIn {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 360px) {
.screen {
padding-right: 16px;
padding-left: 16px;
}
.hero {
padding: 20px;
}
.title {
font-size: 27px;
}
.ruleCard {
grid-template-columns: auto minmax(0, 1fr);
}
.cost {
grid-column: 2;
text-align: left;
}
}
+130
View File
@@ -0,0 +1,130 @@
"use client";
import {
ArrowLeft,
Coins,
Gift,
ImageIcon,
MessageCircle,
Mic2,
Phone,
Sparkles,
} from "lucide-react";
import Link from "next/link";
import { MobileShell } from "@/app/_components/core";
import { ROUTES } from "@/router/routes";
import styles from "./coins-rules-screen.module.css";
interface CoinRuleItem {
title: string;
cost: string;
free?: string;
icon: typeof MessageCircle;
}
const COIN_RULES: readonly CoinRuleItem[] = [
{
title: "普通聊天",
cost: "2 coins / 条",
free: "每周免费 50 条",
icon: MessageCircle,
},
{
title: "私密聊天",
cost: "10 coins / 条",
free: "每天免费 1 条",
icon: Sparkles,
},
{
title: "语音消息",
cost: "20 coins / 条",
icon: Mic2,
},
{
title: "语音电话",
cost: "20 coins / 张",
icon: Phone,
},
{
title: "照片",
cost: "40 coins / 张",
icon: ImageIcon,
},
{
title: "私密相册",
cost: "10 张 300 coins",
icon: ImageIcon,
},
{
title: "私密相册",
cost: "20 张 600 coins",
icon: ImageIcon,
},
] as const;
export function CoinsRulesScreen() {
return (
<MobileShell background="#fcf3f4">
<main className={styles.screen}>
<header className={styles.header}>
<Link
href={ROUTES.sidebar}
className={styles.backLink}
aria-label="Back to sidebar"
>
<ArrowLeft size={22} strokeWidth={2.4} aria-hidden="true" />
</Link>
<div className={styles.hero}>
<span className={styles.heroIcon} aria-hidden="true">
<Coins size={24} strokeWidth={2.4} />
</span>
<p className={styles.eyebrow}>Coins Guide</p>
<h1 className={styles.title}></h1>
<p className={styles.subtitle}>
</p>
</div>
</header>
<section className={styles.freeCard} aria-label="Free quota">
<div className={styles.freeIcon} aria-hidden="true">
<Gift size={20} strokeWidth={2.3} />
</div>
<div>
<h2 className={styles.freeTitle}></h2>
<p className={styles.freeText}>
50 1
</p>
</div>
</section>
<section className={styles.ruleList} aria-label="Coins usage rules">
{COIN_RULES.map((rule, index) => {
const Icon = rule.icon;
return (
<article
key={`${rule.title}-${rule.cost}`}
className={styles.ruleCard}
style={{ animationDelay: `${index * 45}ms` }}
>
<span className={styles.ruleIcon} aria-hidden="true">
<Icon size={18} strokeWidth={2.35} />
</span>
<div className={styles.ruleContent}>
<h2 className={styles.ruleTitle}>{rule.title}</h2>
{rule.free ? (
<p className={styles.freeBadge}>{rule.free}</p>
) : null}
</div>
<p className={styles.cost}>{rule.cost}</p>
</article>
);
})}
</section>
</main>
</MobileShell>
);
}
+5
View File
@@ -0,0 +1,5 @@
import { CoinsRulesScreen } from "./coins-rules-screen";
export default function CoinsRulesPage() {
return <CoinsRulesScreen />;
}