diff --git a/app/pricing/page.tsx b/app/pricing/page.tsx index f653543..a733491 100644 --- a/app/pricing/page.tsx +++ b/app/pricing/page.tsx @@ -102,9 +102,6 @@ function HomeModule5() { }, [plans, billingType]); const handleSubscribe = async (planName: string) => { - if (planName === "Kickoff") { - return; - } try { // 使用新的Checkout Session方案(更简单!) diff --git a/components/common/userCard.tsx b/components/common/userCard.tsx new file mode 100644 index 0000000..021e240 --- /dev/null +++ b/components/common/userCard.tsx @@ -0,0 +1,90 @@ +import React from 'react'; + +interface UserCardProps { + /** 用户计划名称 */ + plan_name?: string; + /** 子组件内容 */ + children: React.ReactNode; +} + +/** + * 用户卡片组件 + * 根据用户级别显示不同的颜色和样式 + */ +export default function UserCard({ + plan_name = "none", + children +}: UserCardProps) { + // 根据计划名称获取对应的样式 + const getCardStyles = () => { + switch (plan_name) { + case "Kickoff": + return { + outerBg: "bg-[#3d3c3d]", + glowColor: "bg-[#c0c0c0]", + glowShadow: "shadow-[0_0_50px_rgba(192,192,192,0.3)]" + }; + case "Pro": + return { + outerBg: "bg-gradient-to-br from-[#1a1a2e] via-[#16213e] to-[#0f3460]", + glowColor: "bg-[#4facfe]", + glowShadow: "shadow-[0_0_50px_rgba(79,172,254,0.4)]" + }; + case "Ultra": + return { + outerBg: "bg-gradient-to-br from-[#0a4a4a] via-[#2a1f4a] to-[#4a0a4a]", + glowColor: "bg-gradient-to-r from-[rgb(106,244,249)] to-[rgb(199,59,255)]", + glowShadow: "shadow-[0_0_50px_rgba(106,244,249,0.5)]" + }; + default: // none + return { + outerBg: "bg-[#1a1a1a]", + glowColor: "bg-[#333]", + glowShadow: "shadow-[0_0_50px_rgba(51,51,51,0.3)]" + }; + } + }; + + const styles = getCardStyles(); + + return ( +
+ {/* 发光背景 */} +
+ + {/* 卡片内容区域 */} +
+ {/* 计划名称背景文字 - 非 none 时显示 */} + {plan_name !== "none" && ( +
+ {plan_name} +
+ )} + + {/* 内容区域 */} +
+ {children} +
+
+
+ ); +}; diff --git a/components/layout/top-bar.tsx b/components/layout/top-bar.tsx index f68fa5a..fc43ccb 100644 --- a/components/layout/top-bar.tsx +++ b/components/layout/top-bar.tsx @@ -2,6 +2,7 @@ import "../pages/style/top-bar.css"; import { Button } from "@/components/ui/button"; + import { GradientText } from "@/components/ui/gradient-text"; import { useTheme } from "next-themes"; import { @@ -23,6 +24,7 @@ import { redirectToPortal, getUserSubscriptionInfo, } from "@/lib/stripe"; +import UserCard from "@/components/common/userCard"; interface User { id: string; @@ -33,11 +35,7 @@ interface User { plan_name?: string; } -export function TopBar({ - collapsed, -}: { - collapsed: boolean; -}) { +export function TopBar({ collapsed }: { collapsed: boolean }) { const router = useRouter(); const [isOpen, setIsOpen] = React.useState(false); const menuRef = useRef(null); @@ -68,7 +66,7 @@ export function TopBar({ // 更新 currentUser 的 plan_name setCurrentUser((prev) => ({ ...prev, - plan_name: response.data.plan_name, + plan_name: response.data.plan_name, // HACK })); } } catch (error) { @@ -169,7 +167,7 @@ export function TopBar({ return (
@@ -264,11 +262,11 @@ export function TopBar({ }} data-alt="user-menu-trigger" style={{ - background: 'unset !important' + background: "unset !important", }} >
- {currentUser.username ? currentUser.username.charAt(0) : 'MF'} + {currentUser.username ? currentUser.username.charAt(0) : "MF"}
@@ -284,89 +282,73 @@ export function TopBar({ position: "fixed", top: "4rem", right: "1rem", - width: "18rem", zIndex: 9999, }} - className="bg-[#1E1E1E] rounded-lg shadow-lg overflow-hidden" + className="overflow-hidden rounded-xl" data-alt="user-menu-dropdown" onClick={(e) => e.stopPropagation()} > - {/* User Info */} -
-
-
- {currentUser.username ? currentUser.username.charAt(0) : 'MF'} -
-
-
-

- {currentUser.name || currentUser.username} -

- {currentUser.plan_name && - currentUser.plan_name !== "none" && ( - - {currentUser.plan_name} - - )} -
-

- {currentUser.email} -

-
-
{ - logoutUser(); - }} - title="退出登录" - > - -
-
-
+ +
+ {/* 顶部用户信息 */} +
+
+ {currentUser.username + ? currentUser.username.charAt(0) + : "MF"} +
+
+

+ {currentUser.name || currentUser.username} +

+

+ {currentUser.email} +

+
+
- {/* AI Points */} -
-
- - - {isLoadingSubscription - ? "..." - : `${credits} credits`} - -
- - {subscriptionStatus === "ACTIVE" && ( - - )} -
+ {/* AI 积分 */} +
+
+ +
+ + {isLoadingSubscription + ? "Loading..." + : `${credits} credits`} + +
+ + {/* 操作按钮区域 */} +
+ + + {currentUser.plan_name !== "none" && ( + + )} + + +
+
+
, document.body ) diff --git a/components/pages/home-page2.tsx b/components/pages/home-page2.tsx index 708b6cd..bd639fd 100644 --- a/components/pages/home-page2.tsx +++ b/components/pages/home-page2.tsx @@ -254,21 +254,21 @@ function HomeModule2() { const videoList = [ { title: "Text to Movie", - video: "https://cdn.qikongjian.com/videos/module2 (1).mp4", + video: "https://cdn.qikongjian.com/1756559467841_kn9fr9.mp4", }, { title: "Image to Movie", - video: "https://cdn.qikongjian.com/videos/module2 (2).mp4", + video: "https://cdn.qikongjian.com/1756559467840_m4ijd7.mp4", }, { title: "Template to Movie", - video: "https://cdn.qikongjian.com/videos/module2 (3).mp4", + video: "https://cdn.qikongjian.com/1756559467836_ij9y54.mp4", }, ]; return (
Just Drop A Thought -

+

Say your idea in a single line,and MovieFlow will bring it to life.

@@ -355,7 +355,7 @@ function HomeModule3() {

Ideas Made Real

-

+

High-quality films, any style, made with MovieFlow.

@@ -479,11 +479,11 @@ function HomeModule4() { return (

Create Your Way @@ -588,9 +588,6 @@ function HomeModule5() { }, [plans, billingType]); const handleSubscribe = async (planName: string) => { - if (planName === "hobby") { - return; - } localStorage.setItem("callBackUrl", pathname); try { // 使用新的Checkout Session方案(更简单!)