From 8f13604e0e11934abbb17bdf76f396780ee742b9 Mon Sep 17 00:00:00 2001 From: TradeMate Dev Date: Sat, 11 Jul 2026 17:08:32 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=85=A8=E7=AB=99=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=85=8D=E8=B4=B9+=E8=81=94=E7=9B=9F=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E5=8E=9F=E6=94=AF=E4=BB=98=E4=BF=9D=E7=95=99=E5=A4=87?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 课程详情页下架付费购买与扫码支付弹窗 - 首页/能力导览文案 购买→免费使用 - 付费面(会员/技能广场/用量包/课程)均已免费化,原 orders/payment 模块保留后端备用 --- docs/progress/current.md | 2 + frontend/src/app/courses/[id]/client.tsx | 80 ++---------------------- frontend/src/app/page.tsx | 2 +- frontend/src/i18n/locales/en.ts | 2 +- frontend/src/i18n/locales/zh.ts | 2 +- 5 files changed, 9 insertions(+), 79 deletions(-) diff --git a/docs/progress/current.md b/docs/progress/current.md index 7ecf611..bf8019f 100644 --- a/docs/progress/current.md +++ b/docs/progress/current.md @@ -41,6 +41,8 @@ | 技能广场 | `marketplace/page.tsx` | 所有 Skill 免费开放,下架付费购买与 PaymentModal | | 用量包 | `practices/packages/page.tsx` | 下架付费用量包,仅展示免费配额 + 赞助入口 | | 沙箱 | `sandbox/page.tsx` | 用量耗尽提示改为引导至 /donate 赞助 | +| 课程详情 | `courses/[id]/client.tsx` | 下架付费购买按钮与微信扫码支付弹窗,全部免费开放 | +| 首页/能力导览 | `page.tsx` / `models.*` | 文案由"购买即用"改为"免费使用" | | 导航/页脚 | `header.tsx` / `footer.tsx` | 新增「赞助」「联盟返佣」入口 | | i18n | `zh.ts` / `en.ts` | 新增 `donate.*`、导航 `affiliate`/`donate`、说明文案 | diff --git a/frontend/src/app/courses/[id]/client.tsx b/frontend/src/app/courses/[id]/client.tsx index 6a46312..40f85d8 100755 --- a/frontend/src/app/courses/[id]/client.tsx +++ b/frontend/src/app/courses/[id]/client.tsx @@ -5,7 +5,7 @@ import { useParams } from 'next/navigation'; import Link from 'next/link'; import { Skeleton } from '@/components/ui/skeleton'; import { API_BASE } from '@/lib/config'; -import { BookOpen, AlertTriangle, Menu, ChevronLeft, X } from 'lucide-react'; +import { BookOpen, AlertTriangle, Menu, ChevronLeft } from 'lucide-react'; interface Lesson { id: number; title: string; content?: string; sortOrder: number; status: string; @@ -33,39 +33,6 @@ function LoadingSkeleton() { ); } -function PayModal({ paying, qrCodeUrl, onClose }: { paying: boolean; qrCodeUrl: string; onClose: () => void }) { - if (!paying) return null; - return ( -
-
-
-

扫码支付

- -
- {qrCodeUrl ? ( - <> -
- 支付二维码 -
-

请使用微信扫描二维码完成支付

- - ) : ( -
-
-

正在生成支付二维码...

-
- )} -
-
- ); -} - export default function CourseDetailClient() { const params = useParams(); const [course, setCourse] = useState(null); @@ -73,8 +40,6 @@ export default function CourseDetailClient() { const [error, setError] = useState(''); const [activeLesson, setActiveLesson] = useState(null); const [sidebarOpen, setSidebarOpen] = useState(true); - const [paying, setPaying] = useState(false); - const [qrCodeUrl, setQrCodeUrl] = useState(''); useEffect(() => { if (!params.id) return; @@ -107,11 +72,6 @@ export default function CourseDetailClient() { return ( <> - { setPaying(false); setQrCodeUrl(''); }} - />
{/* Sidebar */} @@ -185,41 +145,9 @@ export default function CourseDetailClient() {
- {course.isFree ? ( - - 免费 - - ) : ( - <> - - ¥{course.price} - - - - )} + + 免费 + {course.category && ( {course.category.name} )} diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index 37ed63d..62ff18d 100755 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -234,7 +234,7 @@ export default function HomePage() { { icon: BarChart3, title: '数据分析', desc: '分析数据、生成图表、洞察趋势,让数据说话', href: '/sandbox', cta: '打开沙盒' }, { icon: FileText, title: '提示词工程', desc: '学习编写高效提示词,掌握与 AI 沟通的最佳实践', href: '/prompts', cta: '浏览提示词库' }, { icon: GraduationCap, title: '技能实战', desc: '在真实场景中练习 AI 技能,获得即时评分反馈', href: '/practices', cta: '开始练习' }, - { icon: Puzzle, title: '工作流技能', desc: '购买即用的 AI 工作流技能,解决具体业务问题', href: '/marketplace', cta: '前往技能广场' }, + { icon: Puzzle, title: '工作流技能', desc: '免费使用的 AI 工作流技能,解决具体业务问题', href: '/marketplace', cta: '前往技能广场' }, ].map((item) => { const Icon = item.icon; return ( diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts index cb79973..46a1b58 100755 --- a/frontend/src/i18n/locales/en.ts +++ b/frontend/src/i18n/locales/en.ts @@ -20,7 +20,7 @@ const en: Translations = { circles: { title: 'Circles', desc: 'Topic-based discussion groups', empty: 'No circles yet', back: 'Back to Discover', members: 'members', posts: 'posts' }, brand: { name: 'Yuzhiran', suffix: 'AI' }, footer: { tagline: 'Empowering Everyone to Master AI', explore: 'Explore', about: 'About', aboutUs: 'About Us', privacy: 'Privacy Policy', terms: 'Terms of Service', aiAgreement: 'AI Service Agreement', contact: 'Contact', copyright: '© {year} Yuzhiran Technology Center. All rights reserved.', models: 'Capabilities', aiTools: 'AI Tools', articles: 'Articles', skills: 'Skills' }, - models: { title: 'AI Capabilities Guide', desc: 'Discover what AI can do for you — from conversations to coding, find your perfect use case', capChat: 'Chat & Writing', capChatDesc: 'Chat with AI for ideas, copywriting, translation, and more', capCode: 'Coding Assistant', capCodeDesc: 'Generate code, debug errors, explain algorithms — your coding partner', capData: 'Data Analysis', capDataDesc: 'Analyze data, generate charts, uncover trends — let data speak', capPrompt: 'Prompt Engineering', capPromptDesc: 'Learn to write effective prompts, master AI communication', capPractice: 'Skill Practice', capPracticeDesc: 'Practice AI skills in real scenarios with instant scoring feedback', capMarketplace: 'Workflow Skills', capMarketplaceDesc: 'Buy ready-to-use AI workflow skills for specific business problems', goSandbox: 'Open Sandbox', goPrompts: 'Browse Prompts', goPractice: 'Start Practice', goMarketplace: 'Go to Marketplace' }, + models: { title: 'AI Capabilities Guide', desc: 'Discover what AI can do for you — from conversations to coding, find your perfect use case', capChat: 'Chat & Writing', capChatDesc: 'Chat with AI for ideas, copywriting, translation, and more', capCode: 'Coding Assistant', capCodeDesc: 'Generate code, debug errors, explain algorithms — your coding partner', capData: 'Data Analysis', capDataDesc: 'Analyze data, generate charts, uncover trends — let data speak', capPrompt: 'Prompt Engineering', capPromptDesc: 'Learn to write effective prompts, master AI communication', capPractice: 'Skill Practice', capPracticeDesc: 'Practice AI skills in real scenarios with instant scoring feedback', capMarketplace: 'Workflow Skills', capMarketplaceDesc: 'Free ready-to-use AI workflow skills for specific business problems', goSandbox: 'Open Sandbox', goPrompts: 'Browse Prompts', goPractice: 'Start Practice', goMarketplace: 'Go to Marketplace' }, error: { title: 'Something went wrong', desc: 'Page failed to load. Please try again.', reload: 'Reload' }, notFound: { title: '404', desc: 'Page not found', backToHome: 'Back to Home' }, share: { missingToken: 'Missing share token', invalidLink: 'Invalid share link', notAvailable: 'Shared content not available', expired: 'This share link may have expired', goToSandbox: 'Go to AI Sandbox', backToSandbox: 'AI Sandbox', modelInfo: 'Model: {model} · {date}' }, diff --git a/frontend/src/i18n/locales/zh.ts b/frontend/src/i18n/locales/zh.ts index bfa4cf9..0b7f3f8 100755 --- a/frontend/src/i18n/locales/zh.ts +++ b/frontend/src/i18n/locales/zh.ts @@ -18,7 +18,7 @@ const zh = { circles: { title: '圈子', desc: '按领域划分的垂直讨论区', empty: '暂无圈子', back: '返回发现', members: '人', posts: '帖' }, brand: { name: '宇之然', suffix: 'AI' }, footer: { tagline: '让每个人都能用好 AI', explore: '探索', about: '关于', aboutUs: '关于我们', privacy: '隐私政策', terms: '服务协议', aiAgreement: 'AI 服务协议', contact: '联系方式', copyright: '© {year} 北京宇之然科技中心 版权所有', models: '能力导览', aiTools: 'AI 工具', articles: '文章', skills: '技能' }, - models: { title: 'AI 能力导览', desc: '探索 AI 能为你做什么,从对话写作到编程实战,找到适合你的场景', capChat: '对话写作', capChatDesc: '与 AI 进行自然对话,获取灵感、润色文案、翻译语言', capCode: '编程辅助', capCodeDesc: '生成代码、调试错误、解释算法,你的随身编程搭档', capData: '数据分析', capDataDesc: '分析数据、生成图表、洞察趋势,让数据说话', capPrompt: '提示词工程', capPromptDesc: '学习编写高效提示词,掌握与 AI 沟通的最佳实践', capPractice: '技能实战', capPracticeDesc: '在真实场景中练习 AI 技能,获得即时评分反馈', capMarketplace: '工作流技能', capMarketplaceDesc: '购买即用的 AI 工作流技能,解决具体业务问题', goSandbox: '打开沙盒', goPrompts: '浏览提示词库', goPractice: '开始练习', goMarketplace: '前往技能广场' }, + models: { title: 'AI 能力导览', desc: '探索 AI 能为你做什么,从对话写作到编程实战,找到适合你的场景', capChat: '对话写作', capChatDesc: '与 AI 进行自然对话,获取灵感、润色文案、翻译语言', capCode: '编程辅助', capCodeDesc: '生成代码、调试错误、解释算法,你的随身编程搭档', capData: '数据分析', capDataDesc: '分析数据、生成图表、洞察趋势,让数据说话', capPrompt: '提示词工程', capPromptDesc: '学习编写高效提示词,掌握与 AI 沟通的最佳实践', capPractice: '技能实战', capPracticeDesc: '在真实场景中练习 AI 技能,获得即时评分反馈', capMarketplace: '工作流技能', capMarketplaceDesc: '免费使用的 AI 工作流技能,解决具体业务问题', goSandbox: '打开沙盒', goPrompts: '浏览提示词库', goPractice: '开始练习', goMarketplace: '前往技能广场' }, error: { title: '出错了', desc: '页面加载失败,请稍后重试', reload: '重新加载' }, notFound: { title: '404', desc: '页面未找到', backToHome: '返回首页' }, share: { missingToken: '缺少分享参数', invalidLink: '分享链接无效', notAvailable: '分享内容不可用', expired: '该分享链接可能已过期或不存在', goToSandbox: '前往 AI 沙盒', backToSandbox: 'AI 沙盒', modelInfo: '模型: {model} · {date}' },