diff --git a/app/components/auth/SubscriptionDialog.tsx b/app/components/auth/SubscriptionDialog.tsx index d1cb1ce..aa19673 100644 --- a/app/components/auth/SubscriptionDialog.tsx +++ b/app/components/auth/SubscriptionDialog.tsx @@ -1,21 +1,137 @@ import { Dialog, DialogTitle, DialogDescription, DialogRoot } from '~/components/ui/Dialog'; +import { useState } from 'react'; +import { useAuth } from '~/hooks/useAuth'; interface SubscriptionDialogProps { isOpen: boolean; onClose: () => void; } +interface SubscriptionPlan { + name: string; + tokens: number; + price: number; + description: string; + savePercentage?: number; +} + +const subscriptionPlans: SubscriptionPlan[] = [ + { + name: "专业版", + tokens: 10000000, + price: 20, + description: "适合业余爱好者和轻度用户进行探索性使用。" + }, + { + name: "专业版 50", + tokens: 26000000, + price: 50, + description: "为每周需要使用多八多几次的专业人士设计。", + savePercentage: 3 + }, + { + name: "专业版 100", + tokens: 55000000, + price: 100, + description: "适合希望提升日常工作流程的重度用户。", + savePercentage: 9 + }, + { + name: "专业版 200", + tokens: 120000000, + price: 200, + description: "最适合将多八多作为核心工具持续使用的超级用户。", + savePercentage: 17 + } +]; + export function SubscriptionDialog({ isOpen, onClose }: SubscriptionDialogProps) { + const [billingCycle, setBillingCycle] = useState<'monthly' | 'yearly'>('monthly'); + const { user } = useAuth(); + + if (!user) return null; + + const currentPlan = subscriptionPlans[1]; // 假设当前用户使用的是"专业版 50" + return ( - - 订阅信息 + + 订阅管理 -
-

- 这里显示用户的订阅信息。您可以根据实际需求添加更多详细内容。 -

- {/* 可以添加更多订阅相关的信息 */} +
+
+

+ 注册免费账户以加速您在公共项目上的工作流程,或通过即时打开的生产环境提升整个团队的效率。 +

+
+ +
+
+
+ 300万 + 代币剩余。 + 2600万代币将在17天后添加。 +
+
+ 需要更多代币? +
+ + 升级您的计划或购买 + 代币充值包 + +
+
+
+ +
+ + +
+ +
+ {subscriptionPlans.map((plan) => ( +
+

{plan.name}

+
+ {(plan.tokens / 1000000).toFixed(0)}M 代币 + {plan.savePercentage && ( + 节省 {plan.savePercentage}% + )} +
+

{plan.description}

+
+ ¥{plan.price * (billingCycle === 'yearly' ? 10 : 1)}/{billingCycle === 'yearly' ? '年' : '月'} +
+ +
+ ))} +