From d781dc07ed640bbb6dbf54fc548e66d5c8fe0d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=8B=A5?= Date: Fri, 9 Jan 2026 11:58:08 +0800 Subject: [PATCH] Update remote soul-content with local content --- .gitignore | 6 + .gitignore 2 | 1 + DEPLOYMENT.md | 90 + README.md | 30 + SYNC_LOG.md | 1 + .../1_核心设计_通用协议/API接口定义.md | 94 + .../1_核心设计_通用协议/标准配置模板.yaml | 70 + .../2_智能对接_AI指令/通用集成指令.md | 44 + .../3_逻辑参考_通用实现/前端收银台Demo.html | 141 ++ addons/Universal_Payment_Module/README.md | 58 + app/about/page.tsx | 152 ++ app/admin/content/loading.tsx | 3 + app/admin/content/page.tsx | 335 +++ app/admin/layout.tsx | 77 + app/admin/loading.tsx | 3 + app/admin/login/loading.tsx | 3 + app/admin/login/page.tsx | 111 + app/admin/page.tsx | 118 + app/admin/payment/loading.tsx | 3 + app/admin/payment/page.tsx | 375 ++++ app/admin/qrcodes/loading.tsx | 3 + app/admin/qrcodes/page.tsx | 225 ++ app/admin/settings/loading.tsx | 3 + app/admin/settings/page.tsx | 224 ++ app/admin/users/loading.tsx | 3 + app/admin/users/page.tsx | 136 ++ app/admin/withdrawals/loading.tsx | 3 + app/admin/withdrawals/page.tsx | 172 ++ app/api/config/route.ts | 55 + app/api/content/route.ts | 36 + app/api/documentation/generate/route.ts | 55 + app/api/menu/route.ts | 12 + app/api/orders/route.ts | 27 + app/api/payment/alipay/notify/route.ts | 48 + app/api/payment/callback/route.ts | 46 + app/api/payment/create-order/route.ts | 88 + app/api/payment/verify/route.ts | 46 + app/api/payment/wechat/notify/route.ts | 59 + app/chapters/page.tsx | 54 + app/docs/page.tsx | 112 + app/documentation/capture/loading.tsx | 3 + app/documentation/capture/page.tsx | 78 + app/documentation/page.tsx | 306 +++ app/globals.css | 143 ++ app/layout.tsx | 47 + app/my/page.tsx | 151 ++ app/my/purchases/page.tsx | 109 + app/my/referral/page.tsx | 233 ++ app/my/settings/page.tsx | 96 + app/page.tsx | 26 + app/read/[id]/page.tsx | 40 + book | 1 + components.json | 21 + components/auth-modal.tsx | 225 ++ components/book-cover.tsx | 111 + components/book-intro.tsx | 34 + components/bottom-nav.tsx | 62 + components/buy-full-book-button.tsx | 56 + components/chapter-content.tsx | 290 +++ components/chapters-list.tsx | 135 ++ components/config-loader.tsx | 14 + components/footer.tsx | 12 + components/layout-wrapper.tsx | 27 + components/modules/auth/auth-modal.tsx | 225 ++ .../modules/marketing/qr-code-modal.tsx | 123 ++ components/modules/payment/payment-modal.tsx | 343 +++ components/modules/referral/poster-modal.tsx | 76 + .../modules/referral/referral-share.tsx | 48 + .../modules/referral/withdrawal-modal.tsx | 172 ++ components/party-group-section.tsx | 35 + components/payment-modal.tsx | 384 ++++ components/purchase-section.tsx | 96 + components/qr-code-modal.tsx | 78 + components/table-of-contents.tsx | 65 + components/theme-provider.tsx | 11 + components/ui/badge.tsx | 46 + components/ui/button.tsx | 60 + components/ui/card.tsx | 76 + components/ui/dialog.tsx | 143 ++ components/ui/input.tsx | 21 + components/ui/label.tsx | 22 + components/ui/select.tsx | 160 ++ components/ui/slider.tsx | 63 + components/ui/switch.tsx | 28 + components/ui/table.tsx | 117 + components/ui/tabs.tsx | 54 + components/ui/textarea.tsx | 20 + components/user-menu.tsx | 107 + lib/book-data.ts | 676 ++++++ lib/book-file-system.ts | 169 ++ lib/documentation/catalog.ts | 151 ++ lib/documentation/docx.ts | 272 +++ lib/documentation/screenshot.ts | 93 + lib/markdown.ts | 39 + lib/modules/marketing/types.ts | 37 + lib/modules/payment/types.ts | 26 + lib/modules/referral/types.ts | 32 + lib/payment-service.ts | 117 + lib/payment-store.ts | 115 + lib/payment/alipay.ts | 75 + lib/payment/wechat.tsx | 99 + lib/store.ts | 664 ++++++ lib/utils.ts | 6 + next-env.d.ts | 6 + next.config.mjs | 12 + package.json | 46 + pnpm-lock.yaml | 1956 +++++++++++++++++ postcss.config.mjs | 8 + public/apple-icon.png | Bin 0 -> 2626 bytes public/icon-dark-32x32.png | Bin 0 -> 585 bytes public/icon-light-32x32.png | Bin 0 -> 566 bytes public/icon.svg | 26 + public/images/alipay.png | Bin 0 -> 378643 bytes .../b05c111ec1aefab166379b5d146b3efc.jpg | Bin 0 -> 99156 bytes public/images/image.png | Bin 0 -> 378643 bytes public/images/party-group-qr.png | Bin 0 -> 378643 bytes public/images/wechat-pay.png | Bin 0 -> 378643 bytes public/placeholder-logo.png | Bin 0 -> 568 bytes public/placeholder-logo.svg | 1 + public/placeholder-user.jpg | Bin 0 -> 1635 bytes public/placeholder.jpg | Bin 0 -> 1064 bytes public/placeholder.svg | 1 + scripts/autosync.sh | 51 + styles/globals.css | 125 ++ tsconfig.json | 41 + vercel.json | 34 + .../.github/workflows/sync_from_coding.yml | 36 + 开发文档/0、Mycontent-book 项目总览.md | 47 + 开发文档/10、项目管理/项目管理提示词.md | 58 + 开发文档/10、项目管理/项目落地推进表.md | 355 +++ 开发文档/1、需求/业务需求.md | 59 + 开发文档/1、需求/卡若角色设定.md | 62 + 开发文档/1、需求/成本.md | 50 + 开发文档/1、需求/技术需求.md | 22 + 开发文档/2、架构/前后端架构分离策略.md | 70 + 开发文档/2、架构/变现模块设计.md | 60 + 开发文档/2、架构/技术选型.md | 24 + 开发文档/2、架构/技术选型与全景图.md | 79 + 开发文档/2、架构/数据库.md | 22 + 开发文档/2、架构/系统架构.md | 61 + 开发文档/3、原型/原型设计规范.md | 45 + 开发文档/4、前端/前端开发规范.md | 56 + 开发文档/4、前端/前端架构.md | 94 + 开发文档/5、接口/API接口.md | 104 + 开发文档/5、接口/接口定义规范.md | 58 + 开发文档/6、后端/后端开发规范.md | 64 + 开发文档/6、后端/后端架构.md | 68 + 开发文档/7、数据库/数据库管理规范.md | 62 + 开发文档/7、数据库/数据库设计.md | 77 + 开发文档/8、部署/Next.js自动化部署流程.md | 280 +++ 开发文档/8、部署/WEBHOOK部署的提示词.md | 45 + ... GitHub Webhook 与宝塔面板的自动化部署流程文档.md | 103 + 开发文档/8、部署/本地运行.md | 36 + 开发文档/8、部署/本项目部署总览.md | 27 + 开发文档/8、部署/自动同步与分支策略.md | 45 + 开发文档/8、部署/项目程序提示词.md | 55 + 开发文档/9、手册/使用手册提示词.md | 48 + 开发文档/9、手册/写作与结构维护手册.md | 43 + 开发文档/9、手册/提示词/使用手册提示词.md | 13 + 开发文档/9、手册/提示词/落地方案提示词.md | 5 + 开发文档/9、手册/提示词/说明手册提示词.md | 5 + 开发文档/9、手册/落地方案提示词.md | 26 + 开发文档/9、手册/说明手册提示词.md | 28 + 开发文档/AI开发流程.jpg | Bin 0 -> 2116057 bytes 开发文档/API/配置清单.md | 53 + 开发文档/README_模板体系总览.md | 321 +++ 开发文档/功能迭代记录.md | 51 + 开发文档/智能项目生成引擎v3.0.md | 381 ++++ 开发文档/模板使用说明书.md | 62 + 开发文档/生成指南_HTML输出.md | 290 +++ 开发文档/项目文档生成器_核心提示词.md | 105 + 记忆.md | 129 ++ 172 files changed, 16577 insertions(+) create mode 100644 .gitignore create mode 100644 .gitignore 2 create mode 100644 DEPLOYMENT.md create mode 100644 README.md create mode 100644 SYNC_LOG.md create mode 100644 addons/Universal_Payment_Module/1_核心设计_通用协议/API接口定义.md create mode 100644 addons/Universal_Payment_Module/1_核心设计_通用协议/标准配置模板.yaml create mode 100644 addons/Universal_Payment_Module/2_智能对接_AI指令/通用集成指令.md create mode 100644 addons/Universal_Payment_Module/3_逻辑参考_通用实现/前端收银台Demo.html create mode 100644 addons/Universal_Payment_Module/README.md create mode 100644 app/about/page.tsx create mode 100644 app/admin/content/loading.tsx create mode 100644 app/admin/content/page.tsx create mode 100644 app/admin/layout.tsx create mode 100644 app/admin/loading.tsx create mode 100644 app/admin/login/loading.tsx create mode 100644 app/admin/login/page.tsx create mode 100644 app/admin/page.tsx create mode 100644 app/admin/payment/loading.tsx create mode 100644 app/admin/payment/page.tsx create mode 100644 app/admin/qrcodes/loading.tsx create mode 100644 app/admin/qrcodes/page.tsx create mode 100644 app/admin/settings/loading.tsx create mode 100644 app/admin/settings/page.tsx create mode 100644 app/admin/users/loading.tsx create mode 100644 app/admin/users/page.tsx create mode 100644 app/admin/withdrawals/loading.tsx create mode 100644 app/admin/withdrawals/page.tsx create mode 100644 app/api/config/route.ts create mode 100644 app/api/content/route.ts create mode 100644 app/api/documentation/generate/route.ts create mode 100644 app/api/menu/route.ts create mode 100644 app/api/orders/route.ts create mode 100644 app/api/payment/alipay/notify/route.ts create mode 100644 app/api/payment/callback/route.ts create mode 100644 app/api/payment/create-order/route.ts create mode 100644 app/api/payment/verify/route.ts create mode 100644 app/api/payment/wechat/notify/route.ts create mode 100644 app/chapters/page.tsx create mode 100644 app/docs/page.tsx create mode 100644 app/documentation/capture/loading.tsx create mode 100644 app/documentation/capture/page.tsx create mode 100644 app/documentation/page.tsx create mode 100644 app/globals.css create mode 100644 app/layout.tsx create mode 100644 app/my/page.tsx create mode 100644 app/my/purchases/page.tsx create mode 100644 app/my/referral/page.tsx create mode 100644 app/my/settings/page.tsx create mode 100644 app/page.tsx create mode 100644 app/read/[id]/page.tsx create mode 160000 book create mode 100644 components.json create mode 100644 components/auth-modal.tsx create mode 100644 components/book-cover.tsx create mode 100644 components/book-intro.tsx create mode 100644 components/bottom-nav.tsx create mode 100644 components/buy-full-book-button.tsx create mode 100644 components/chapter-content.tsx create mode 100644 components/chapters-list.tsx create mode 100644 components/config-loader.tsx create mode 100644 components/footer.tsx create mode 100644 components/layout-wrapper.tsx create mode 100644 components/modules/auth/auth-modal.tsx create mode 100644 components/modules/marketing/qr-code-modal.tsx create mode 100644 components/modules/payment/payment-modal.tsx create mode 100644 components/modules/referral/poster-modal.tsx create mode 100644 components/modules/referral/referral-share.tsx create mode 100644 components/modules/referral/withdrawal-modal.tsx create mode 100644 components/party-group-section.tsx create mode 100644 components/payment-modal.tsx create mode 100644 components/purchase-section.tsx create mode 100644 components/qr-code-modal.tsx create mode 100644 components/table-of-contents.tsx create mode 100644 components/theme-provider.tsx create mode 100644 components/ui/badge.tsx create mode 100644 components/ui/button.tsx create mode 100644 components/ui/card.tsx create mode 100644 components/ui/dialog.tsx create mode 100644 components/ui/input.tsx create mode 100644 components/ui/label.tsx create mode 100644 components/ui/select.tsx create mode 100644 components/ui/slider.tsx create mode 100644 components/ui/switch.tsx create mode 100644 components/ui/table.tsx create mode 100644 components/ui/tabs.tsx create mode 100644 components/ui/textarea.tsx create mode 100644 components/user-menu.tsx create mode 100644 lib/book-data.ts create mode 100644 lib/book-file-system.ts create mode 100644 lib/documentation/catalog.ts create mode 100644 lib/documentation/docx.ts create mode 100644 lib/documentation/screenshot.ts create mode 100644 lib/markdown.ts create mode 100644 lib/modules/marketing/types.ts create mode 100644 lib/modules/payment/types.ts create mode 100644 lib/modules/referral/types.ts create mode 100644 lib/payment-service.ts create mode 100644 lib/payment-store.ts create mode 100644 lib/payment/alipay.ts create mode 100644 lib/payment/wechat.tsx create mode 100644 lib/store.ts create mode 100644 lib/utils.ts create mode 100644 next-env.d.ts create mode 100644 next.config.mjs create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 postcss.config.mjs create mode 100644 public/apple-icon.png create mode 100644 public/icon-dark-32x32.png create mode 100644 public/icon-light-32x32.png create mode 100644 public/icon.svg create mode 100644 public/images/alipay.png create mode 100644 public/images/b05c111ec1aefab166379b5d146b3efc.jpg create mode 100644 public/images/image.png create mode 100644 public/images/party-group-qr.png create mode 100644 public/images/wechat-pay.png create mode 100644 public/placeholder-logo.png create mode 100644 public/placeholder-logo.svg create mode 100644 public/placeholder-user.jpg create mode 100644 public/placeholder.jpg create mode 100644 public/placeholder.svg create mode 100644 scripts/autosync.sh create mode 100644 styles/globals.css create mode 100644 tsconfig.json create mode 100644 vercel.json create mode 100644 开发文档/.github/workflows/sync_from_coding.yml create mode 100644 开发文档/0、Mycontent-book 项目总览.md create mode 100644 开发文档/10、项目管理/项目管理提示词.md create mode 100644 开发文档/10、项目管理/项目落地推进表.md create mode 100644 开发文档/1、需求/业务需求.md create mode 100644 开发文档/1、需求/卡若角色设定.md create mode 100644 开发文档/1、需求/成本.md create mode 100644 开发文档/1、需求/技术需求.md create mode 100644 开发文档/2、架构/前后端架构分离策略.md create mode 100644 开发文档/2、架构/变现模块设计.md create mode 100644 开发文档/2、架构/技术选型.md create mode 100644 开发文档/2、架构/技术选型与全景图.md create mode 100644 开发文档/2、架构/数据库.md create mode 100644 开发文档/2、架构/系统架构.md create mode 100644 开发文档/3、原型/原型设计规范.md create mode 100644 开发文档/4、前端/前端开发规范.md create mode 100644 开发文档/4、前端/前端架构.md create mode 100644 开发文档/5、接口/API接口.md create mode 100644 开发文档/5、接口/接口定义规范.md create mode 100644 开发文档/6、后端/后端开发规范.md create mode 100644 开发文档/6、后端/后端架构.md create mode 100644 开发文档/7、数据库/数据库管理规范.md create mode 100644 开发文档/7、数据库/数据库设计.md create mode 100644 开发文档/8、部署/Next.js自动化部署流程.md create mode 100644 开发文档/8、部署/WEBHOOK部署的提示词.md create mode 100644 开发文档/8、部署/基于 GitHub Webhook 与宝塔面板的自动化部署流程文档.md create mode 100644 开发文档/8、部署/本地运行.md create mode 100644 开发文档/8、部署/本项目部署总览.md create mode 100644 开发文档/8、部署/自动同步与分支策略.md create mode 100644 开发文档/8、部署/项目程序提示词.md create mode 100644 开发文档/9、手册/使用手册提示词.md create mode 100644 开发文档/9、手册/写作与结构维护手册.md create mode 100644 开发文档/9、手册/提示词/使用手册提示词.md create mode 100644 开发文档/9、手册/提示词/落地方案提示词.md create mode 100644 开发文档/9、手册/提示词/说明手册提示词.md create mode 100644 开发文档/9、手册/落地方案提示词.md create mode 100644 开发文档/9、手册/说明手册提示词.md create mode 100644 开发文档/AI开发流程.jpg create mode 100644 开发文档/API/配置清单.md create mode 100644 开发文档/README_模板体系总览.md create mode 100644 开发文档/功能迭代记录.md create mode 100644 开发文档/智能项目生成引擎v3.0.md create mode 100644 开发文档/模板使用说明书.md create mode 100644 开发文档/生成指南_HTML输出.md create mode 100644 开发文档/项目文档生成器_核心提示词.md create mode 100644 记忆.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d75c7b --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules/ +.next/ +.env.local +.DS_Store +.trae/ +*.log diff --git a/.gitignore 2 b/.gitignore 2 new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.gitignore 2 @@ -0,0 +1 @@ +node_modules/ diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md new file mode 100644 index 0000000..eac2e65 --- /dev/null +++ b/DEPLOYMENT.md @@ -0,0 +1,90 @@ +# 部署指南 + +## 生产环境部署步骤 + +### 1. Vercel部署 + +```bash +# 安装Vercel CLI +npm install -g vercel + +# 登录Vercel +vercel login + +# 部署项目 +vercel --prod +``` + +### 2. 环境变量配置 + +在Vercel项目设置中添加以下环境变量: + +**支付宝配置:** +- `ALIPAY_PARTNER_ID`: 2088511801157159 +- `ALIPAY_KEY`: lz6ey1h3kl9zqkgtjz3avb5gk37wzbrp +- `ALIPAY_APP_ID`: wx432c93e275548671 +- `ALIPAY_RETURN_URL`: https://your-domain.com/payment/success +- `ALIPAY_NOTIFY_URL`: https://your-domain.com/api/payment/alipay/notify + +**微信支付配置:** +- `WECHAT_APP_ID`: wx432c93e275548671 +- `WECHAT_APP_SECRET`: 25b7e7fdb7998e5107e242ebb6ddabd0 +- `WECHAT_MCH_ID`: 1318592501 +- `WECHAT_API_KEY`: wx3e31b068be59ddc131b068be59ddc2 +- `WECHAT_NOTIFY_URL`: https://your-domain.com/api/payment/wechat/notify + +**基础配置:** +- `NEXT_PUBLIC_BASE_URL`: https://your-domain.com + +### 3. 域名配置 + +1. 在Vercel项目设置中绑定自定义域名 +2. 配置DNS记录指向Vercel +3. 启用HTTPS(Vercel自动配置SSL证书) + +### 4. 支付回调配置 + +**支付宝配置:** +1. 登录支付宝开放平台 +2. 在应用详情中配置异步通知地址:`https://your-domain.com/api/payment/alipay/notify` +3. 配置同步返回地址:`https://your-domain.com/payment/success` + +**微信支付配置:** +1. 登录微信商户平台 +2. 在产品中心配置支付回调URL:`https://your-domain.com/api/payment/wechat/notify` +3. 添加支付授权域名:`your-domain.com` + +### 5. 测试流程 + +1. 创建测试订单 +2. 使用沙箱环境测试支付宝支付 +3. 使用微信开发者工具测试微信支付 +4. 验证回调接口正常接收 +5. 确认订单状态更新正确 +6. 验证内容解锁功能 + +### 6. 监控和日志 + +- 在Vercel Dashboard查看部署日志 +- 使用Vercel Analytics监控访问数据 +- 配置错误告警通知 + +## 本地开发 + +```bash +# 安装依赖 +npm install + +# 启动开发服务器 +npm run dev + +# 访问 http://localhost:3000 +``` + +## 注意事项 + +1. 生产环境必须使用HTTPS +2. 定期更新支付密钥 +3. 保护环境变量安全 +4. 备份用户数据 +5. 监控支付异常 diff --git a/README.md b/README.md new file mode 100644 index 0000000..abb72cd --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# AI phone branding + +*Automatically synced with your [v0.app](https://v0.app) deployments* + +[![Deployed on Vercel](https://img.shields.io/badge/Deployed%20on-Vercel-black?style=for-the-badge&logo=vercel)](https://vercel.com/fnvtks-projects/v0--ap) +[![Built with v0](https://img.shields.io/badge/Built%20with-v0.app-black?style=for-the-badge)](https://v0.app/chat/tPF15XbLAKD) + +## Overview + +This repository will stay in sync with your deployed chats on [v0.app](https://v0.app). +Any changes you make to your deployed app will be automatically pushed to this repository from [v0.app](https://v0.app). + +## Deployment + +Your project is live at: + +**[https://vercel.com/fnvtks-projects/v0--ap](https://vercel.com/fnvtks-projects/v0--ap)** + +## Build your app + +Continue building your app on: + +**[https://v0.app/chat/tPF15XbLAKD](https://v0.app/chat/tPF15XbLAKD)** + +## How It Works + +1. Create and modify your project using [v0.app](https://v0.app) +2. Deploy your chats from the v0 interface +3. Changes are automatically pushed to this repository +4. Vercel deploys the latest version from this repository diff --git a/SYNC_LOG.md b/SYNC_LOG.md new file mode 100644 index 0000000..27097d7 --- /dev/null +++ b/SYNC_LOG.md @@ -0,0 +1 @@ +Mon Dec 29 18:11:24 CST 2025 diff --git a/addons/Universal_Payment_Module/1_核心设计_通用协议/API接口定义.md b/addons/Universal_Payment_Module/1_核心设计_通用协议/API接口定义.md new file mode 100644 index 0000000..1000824 --- /dev/null +++ b/addons/Universal_Payment_Module/1_核心设计_通用协议/API接口定义.md @@ -0,0 +1,94 @@ +# 通用支付模块 API 接口定义 (Universal Payment API) + +无论后端使用何种语言(Python/Node/Go),请严格实现以下 RESTful 接口。 + +## 1. 核心交易接口 (Core Transaction) + +### 1.1 创建订单 +* **URL**: `POST /api/payment/create_order` +* **Description**: 业务系统通知支付模块创建一个待支付订单。 +* **Request Body**: + \`\`\`json + { + "user_id": "u1001", // 用户ID + "title": "VIP Membership", // 订单标题 + "amount": 99.00, // 金额 (法币单位: 元 / 美元) + "currency": "CNY", // 币种: CNY, USD + "product_id": "vip_01", // 商品ID + "extra_params": {} // 扩展参数 + } + \`\`\` +* **Response**: + \`\`\`json + { + "code": 200, + "data": { + "order_sn": "202310270001", // 支付系统生成的唯一订单号 + "status": "created" + } + } + \`\`\` + +### 1.2 发起支付 (收银台) +* **URL**: `POST /api/payment/checkout` +* **Description**: 用户选择支付方式后,获取支付参数。 +* **Request Body**: + \`\`\`json + { + "order_sn": "202310270001", + "gateway": "alipay_qr", // 支付方式: alipay_qr, wechat_jsapi, paypal, usdt, stripe + "return_url": "https://...", // 支付成功后前端跳转地址 + "openid": "..." // 微信JSAPI支付必填 + } + \`\`\` +* **Response**: + \`\`\`json + { + "code": 200, + "data": { + "type": "url", // url (跳转), qrcode (扫码), json (SDK参数), address (USDT) + "payload": "https://...", // 具体内容 + "expiration": 1800 // 过期时间(秒) + } + } + \`\`\` + +### 1.3 查询订单状态 +* **URL**: `GET /api/payment/status/{order_sn}` +* **Description**: 前端轮询使用。 +* **Response**: + \`\`\`json + { + "code": 200, + "data": { + "status": "paid", // created, paying, paid, closed + "paid_amount": 99.00, + "paid_at": "2023-10-27 10:00:00" + } + } + \`\`\` + +--- + +## 2. 回调通知接口 (Webhook) + +### 2.1 统一回调入口 +* **URL**: `POST /api/payment/notify/{gateway}` +* **Description**: 接收第三方支付平台的异步通知。 +* **Path Params**: + * `gateway`: `alipay`, `wechat`, `paypal`, `stripe`, `nowpayments` +* **Logic**: + 1. 根据 gateway 加载对应驱动。 + 2. 验签 (Verify Signature)。 + 3. 幂等性检查 (Idempotency Check)。 + 4. 更新订单状态。 + 5. 返回平台所需的响应字符串 (e.g. `success`, `200 OK`). + +--- + +## 3. 辅助接口 + +### 3.1 获取汇率 +* **URL**: `GET /api/payment/exchange_rate` +* **Params**: `from=USD&to=CNY` +* **Response**: `{"rate": 7.21}` diff --git a/addons/Universal_Payment_Module/1_核心设计_通用协议/标准配置模板.yaml b/addons/Universal_Payment_Module/1_核心设计_通用协议/标准配置模板.yaml new file mode 100644 index 0000000..03dd6fe --- /dev/null +++ b/addons/Universal_Payment_Module/1_核心设计_通用协议/标准配置模板.yaml @@ -0,0 +1,70 @@ +# 全球支付模块标准配置模板 (Standard Config) + +# 无论你使用 Python, Node.js, Go 还是 Java,请将此配置映射到你的环境(如 .env, config.py, config.js) + +# ------------------------------------------------------------------- +# 1. 基础环境 (Environment) +# ------------------------------------------------------------------- +APP_ENV: "production" # development / production +APP_URL: "https://your-site.com" # 你的网站域名 (用于回调) + +# ------------------------------------------------------------------- +# 2. 数据库 (Database) +# ------------------------------------------------------------------- +# 系统会自动生成 order 和 pay_trade 表 +DB_CONNECTION: "mysql" # mysql / postgres / sqlite +DB_HOST: "127.0.0.1" +DB_PORT: "3306" +DB_DATABASE: "payment_db" +DB_USERNAME: "root" +DB_PASSWORD: "password" + +# ------------------------------------------------------------------- +# 3. 支付宝 (Alipay) - CN +# ------------------------------------------------------------------- +ALIPAY_ENABLED: true +ALIPAY_APP_ID: "20210001..." +ALIPAY_PRIVATE_KEY: "MIIETv..." # 商户私钥 +ALIPAY_PUBLIC_KEY: "MIIBIj..." # 支付宝公钥 + +# ------------------------------------------------------------------- +# 4. 微信支付 (Wechat Pay) - CN +# ------------------------------------------------------------------- +WECHAT_ENABLED: true +WECHAT_APP_ID: "wx123456..." # 公众号/小程序 AppID +WECHAT_MCH_ID: "1234567890" # 商户号 +WECHAT_API_V3_KEY: "abcdef..." # APIv3 密钥 (32位) +WECHAT_CERT_SERIAL: "45F59C..." # 证书序列号 +WECHAT_PRIVATE_KEY_PATH: "./cert/apiclient_key.pem" +WECHAT_CERT_PATH: "./cert/apiclient_cert.pem" + +# ------------------------------------------------------------------- +# 5. PayPal - Global +# ------------------------------------------------------------------- +PAYPAL_ENABLED: true +PAYPAL_MODE: "live" # sandbox / live +PAYPAL_CLIENT_ID: "Af7s8..." +PAYPAL_CLIENT_SECRET: "EKd9..." + +# ------------------------------------------------------------------- +# 6. Stripe - Global +# ------------------------------------------------------------------- +STRIPE_ENABLED: true +STRIPE_PUBLIC_KEY: "pk_live_..." +STRIPE_SECRET_KEY: "sk_live_..." +STRIPE_WEBHOOK_SECRET: "whsec_..." + +# ------------------------------------------------------------------- +# 7. USDT (Crypto) - Web3 +# ------------------------------------------------------------------- +USDT_ENABLED: true +USDT_GATEWAY_TYPE: "nowpayments" # nowpayments / native (原生监听) + +# 选项 A: NOWPayments (第三方网关) +NOWPAYMENTS_API_KEY: "R1G..." +NOWPAYMENTS_IPN_SECRET: "secret..." + +# 选项 B: Native (原生监听 - TRC20) +TRON_NODE_API: "https://api.trongrid.io" +TRON_WALLET_ADDRESS: "T9yD14Nj9..." # 你的收款地址 +TRON_CHECK_INTERVAL: 60 # 轮询间隔 (秒) diff --git a/addons/Universal_Payment_Module/2_智能对接_AI指令/通用集成指令.md b/addons/Universal_Payment_Module/2_智能对接_AI指令/通用集成指令.md new file mode 100644 index 0000000..f89dc28 --- /dev/null +++ b/addons/Universal_Payment_Module/2_智能对接_AI指令/通用集成指令.md @@ -0,0 +1,44 @@ +# 通用支付模块智能对接指令 (AI Integration Prompt) v3.0 + +**角色设定**: 你是一位精通全球支付架构(Alipay/Wechat/PayPal/Stripe/USDT)的资深全栈架构师。 + +**任务目标**: +我提供了一个**完全配置驱动 (Configuration-Driven)** 的通用支付模块设计。 +请你根据我的目标项目环境,将此支付功能无缝集成进去。 + +**核心资源 (Input)**: +1. **标准配置模板**: `1_核心设计_通用协议/标准配置模板.yaml` (所有支付参数的 Key) +2. **API 接口契约**: `1_核心设计_通用协议/API接口定义.md` (标准 RESTful 接口) +3. **核心业务模型**: `1_核心设计_通用协议/业务逻辑与模型.md` (数据库表结构) + +**集成模式 (选择一种)**: + +### 模式 A: 嵌入式集成 (Library Mode) - *推荐* +适用于将支付功能直接写在现有的后端项目中 (如 Django app, NestJS module)。 + +**步骤**: +1. **环境识别**: 检查我的项目语言 (Python/Node/Go/Java)。 +2. **依赖安装**: 根据语言推荐 SDK (e.g. `alipay-sdk-python`, `stripe`). +3. **配置加载**: 创建代码读取 `标准配置模板.yaml` 中的环境变量。 +4. **模型生成**: 根据 `业务逻辑与模型.md` 生成 ORM 代码 (User/Order/PayTrade)。 +5. **接口实现**: 严格按照 `API接口定义.md` 实现 Controller/View。 + * *要求*: 使用工厂模式 (`PaymentFactory`) 管理不同网关。 + +### 模式 B: 微服务集成 (Microservice Mode) +适用于将支付功能独立部署为一个 Docker 容器。 + +**步骤**: +1. **服务生成**: 用 Go (Gin) 或 Node.js (Express) 生成一个独立服务。 +2. **Docker化**: 编写 `Dockerfile` 和 `docker-compose.yml`。 +3. **网关代理**: 配置 Nginx 或 API Gateway 将 `/api/payment` 转发给此服务。 + +--- + +**给 AI 的执行指令 (Prompt)**: + +> "请读取 `Universal_Payment_Module` 目录下的所有设计文档。 +> 我的当前项目是基于 **[你的语言/框架]** 的。 +> 请采用 **[模式 A / 模式 B]** 为我集成支付功能。 +> 1. 首先生成依赖安装命令。 +> 2. 然后生成数据库模型代码。 +> 3. 最后实现符合 `API接口定义.md` 的核心接口代码。" diff --git a/addons/Universal_Payment_Module/3_逻辑参考_通用实现/前端收银台Demo.html b/addons/Universal_Payment_Module/3_逻辑参考_通用实现/前端收银台Demo.html new file mode 100644 index 0000000..3a68421 --- /dev/null +++ b/addons/Universal_Payment_Module/3_逻辑参考_通用实现/前端收银台Demo.html @@ -0,0 +1,141 @@ + + + + + + 通用收银台 Demo + + + + +
+
+
订单支付
+
¥ 99.00
+
订单号: 202310270001
+
+ +
+ +
+ 🔵 支付宝 (Alipay) + +
+ +
+ 🟢 微信支付 (Wechat) + +
+ +
+ 🅿️ PayPal (USD) + +
+ +
+ 🪙 USDT (TRC20) + +
+
+ +
+ QRCode +

请扫描二维码支付

+
+ + +
+ + + + + diff --git a/addons/Universal_Payment_Module/README.md b/addons/Universal_Payment_Module/README.md new file mode 100644 index 0000000..06c4ae2 --- /dev/null +++ b/addons/Universal_Payment_Module/README.md @@ -0,0 +1,58 @@ +# 全球通用支付模块 (Universal Payment Module) v3.0 + +这是一个**配置驱动 (Configuration-Driven)**、**API 优先 (API-First)** 的全球支付解决方案包。 +它通过标准化的协议和 AI 指令,让任何语言的项目都能在 5 分钟内接入支付宝、微信、PayPal、Stripe 和 USDT。 + +## 📂 模块结构 (Directory Structure) + +\`\`\` +Universal_Payment_Module/ +├── 1_核心设计_通用协议/ # [灵魂] 定义了支付的“法律” +│ ├── 标准配置模板.yaml # [新增] 填空即可配置所有支付参数 +│ ├── API接口定义.md # [新增] 无论用什么语言,接口都长这样 +│ ├── 业务逻辑与模型.md # 数据库表结构设计 (Order/PayTrade) +│ └── 接口注册指南.md # 申请 Key 的教程 +│ +├── 2_智能对接_AI指令/ # [工具] AI 编译器 +│ └── 通用集成指令.md # 发给 AI,自动生成代码 +│ +├── 3_逻辑参考_通用实现/ # [参考] +│ ├── 前端收银台Demo.html # [新增] 原生 JS 实现的通用收银台 +│ ├── 后端源码/ # PHP 参考实现 +│ └── 前端模板/ # Twig 参考模板 +│ +└── README.md # 本说明文档 +\`\`\` + +## 🚀 极速对接 (Integration Guide) + +### 第一步:配置 (Config) +1. 打开 `1_核心设计_通用协议/标准配置模板.yaml`。 +2. 将文件内容复制到你项目的配置文件中(如 `.env` 或 `config.py`)。 +3. 填入你申请到的 `APP_ID`, `PRIVATE_KEY` 等参数。 + +### 第二步:生成代码 (Generate) +1. 复制 `2_智能对接_AI指令/通用集成指令.md` 的内容。 +2. 打开 AI 助手,发送指令: + > "我的项目是用 **Python FastAPI** 写的。请根据上述文档,采用 **模式 A (嵌入式)** 为我集成支付功能。" +3. AI 会为你生成: + * `pip install ...` 命令 + * `models.py` (数据库模型) + * `payment_router.py` (API 接口) + +### 第三步:前端接入 (Frontend) +1. 参考 `3_逻辑参考_通用实现/前端收银台Demo.html`。 +2. 将其中的 `API_BASE` 替换为你后端实际的 API 地址。 +3. 即可拥有一个支持 **扫码、跳转、加密货币支付** 的全功能收银台。 + +## 🌍 支持能力 +| 渠道 | 能力 | 适用场景 | +| :--- | :--- | :--- | +| **Alipay / Wechat** | 扫码 / H5 / APP | 中国市场 (CNY) | +| **PayPal / Stripe** | 信用卡 / 订阅 | 全球市场 (USD/EUR...) | +| **USDT (TRC20)** | 链上转账 / 监听 | Web3 / 抗审查支付 | + +## ✨ v3.0 优化亮点 +* **配置驱动**: 不再需要改代码里的硬编码,所有参数通过配置文件注入。 +* **API 契约**: 明确了输入输出格式,前后端对接不再扯皮。 +* **前端 Demo**: 提供了一个不依赖任何框架的原生 JS 收银台,复制即用。 diff --git a/app/about/page.tsx b/app/about/page.tsx new file mode 100644 index 0000000..e8b129e --- /dev/null +++ b/app/about/page.tsx @@ -0,0 +1,152 @@ +"use client" + +import Link from "next/link" +import { ChevronLeft, Clock, MessageCircle, BookOpen, Users, Award, TrendingUp } from "lucide-react" +import { Button } from "@/components/ui/button" +import { useState } from "react" +import { QRCodeModal } from "@/components/modules/marketing/qr-code-modal" +import { useStore } from "@/lib/store" + +export default function AboutPage() { + const [showQRModal, setShowQRModal] = useState(false) + const { settings } = useStore() + const authorInfo = settings?.authorInfo || { + name: "卡若", + description: "连续创业者,私域运营专家", + liveTime: "06:00-09:00", + platform: "Soul派对房", + } + + const milestones = [ + { year: "2012", event: "开始做游戏推广,从魔兽世界外挂代理起步" }, + { year: "2015", event: "转型电商,做天猫虚拟充值,月流水380万" }, + { year: "2017", event: "团队扩张到200人,年流水3000万" }, + { year: "2018", event: "公司破产,负债数百万,开始全国旅行反思" }, + { year: "2019", event: "重新出发,专注私域运营和个人IP" }, + { year: "2024", event: "在Soul派对房每日直播,分享真实商业故事" }, + ] + + const stats = [ + { icon: BookOpen, value: "55+", label: "真实案例" }, + { icon: Users, value: "10000+", label: "派对房听众" }, + { icon: Award, value: "15年", label: "创业经验" }, + { icon: TrendingUp, value: "3000万", label: "最高年流水" }, + ] + + return ( +
+ {/* Header */} +
+
+ + + 返回 + +

关于作者

+
+
+
+ +
+ {/* Author Card */} +
+
+
+ {authorInfo.name.charAt(0)} +
+
+

{authorInfo.name}

+

{authorInfo.description}

+
+ + + 每日 {authorInfo.liveTime} + + + + {authorInfo.platform} + +
+
+ +
+
+ + {/* Stats */} +
+ {stats.map((stat, index) => ( +
+ +

{stat.value}

+

{stat.label}

+
+ ))} +
+ + {/* Introduction */} +
+

关于这本书

+
+

"这不是一本教你成功的鸡汤书。"

+

+ 这是我每天早上6点到9点,在Soul派对房和几百个陌生人分享的真实故事。 有人来找项目,有人来找钱,有人来找方向。 +

+

+ 我见过凌晨四点还在撸运费险的年轻人,见过七十岁还在开滴滴做生意的老人, + 见过一个月赚七八块却拼命倒卖游戏金币的大学生。 +

+

"社会不是靠努力,是靠洞察与选择。"

+

+ 这本书,就是把那些在派对房里讲过的、能让人清醒的故事,整理成文字。每个案例都真实发生过,每个教训都是用钱换来的。 +

+
+
+ + {/* Timeline */} +
+

创业历程

+
+ {milestones.map((item, index) => ( +
+
+
+ {index < milestones.length - 1 &&
} +
+
+

{item.year}

+

{item.event}

+
+
+ ))} +
+
+ + {/* CTA */} +
+

想听更多真实故事?

+

每天早上6-9点,卡若在Soul派对房免费分享

+
+ + + + +
+
+
+ + setShowQRModal(false)} /> +
+ ) +} diff --git a/app/admin/content/loading.tsx b/app/admin/content/loading.tsx new file mode 100644 index 0000000..f15322a --- /dev/null +++ b/app/admin/content/loading.tsx @@ -0,0 +1,3 @@ +export default function Loading() { + return null +} diff --git a/app/admin/content/page.tsx b/app/admin/content/page.tsx new file mode 100644 index 0000000..2da17e9 --- /dev/null +++ b/app/admin/content/page.tsx @@ -0,0 +1,335 @@ +"use client" + +import { useState } from "react" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { Button } from "@/components/ui/button" +import { Input } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" +import { Textarea } from "@/components/ui/textarea" +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" +import { Badge } from "@/components/ui/badge" +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog" +import { bookData } from "@/lib/book-data" +import { + FileText, + BookOpen, + Settings2, + ChevronRight, + CheckCircle, + Edit3, + Save, + X, + RefreshCw, + Link2, +} from "lucide-react" + +interface EditingSection { + id: string + title: string + price: number + content?: string +} + +export default function ContentPage() { + const [expandedParts, setExpandedParts] = useState(["part-1"]) + const [editingSection, setEditingSection] = useState(null) + const [isSyncing, setIsSyncing] = useState(false) + const [feishuDocUrl, setFeishuDocUrl] = useState("") + const [showFeishuModal, setShowFeishuModal] = useState(false) + + const togglePart = (partId: string) => { + setExpandedParts((prev) => (prev.includes(partId) ? prev.filter((id) => id !== partId) : [...prev, partId])) + } + + const totalSections = bookData.reduce( + (sum, part) => sum + part.chapters.reduce((cSum, ch) => cSum + ch.sections.length, 0), + 0, + ) + + const handleEditSection = (section: { id: string; title: string; price: number }) => { + setEditingSection({ + id: section.id, + title: section.title, + price: section.price, + content: "", + }) + } + + const handleSaveSection = () => { + if (editingSection) { + // 保存到本地存储或API + console.log("[v0] Saving section:", editingSection) + alert(`已保存章节: ${editingSection.title}`) + setEditingSection(null) + } + } + + const handleSyncFeishu = async () => { + if (!feishuDocUrl) { + alert("请输入飞书文档链接") + return + } + setIsSyncing(true) + // 模拟同步过程 + await new Promise((resolve) => setTimeout(resolve, 2000)) + setIsSyncing(false) + setShowFeishuModal(false) + alert("飞书文档同步成功!") + } + + return ( +
+
+
+

内容管理

+

+ 共 {bookData.length} 篇 · {totalSections} 节内容 +

+
+ +
+ + {/* 飞书同步弹窗 */} + + + + + + 同步飞书文档 + + +
+
+ + setFeishuDocUrl(e.target.value)} + /> +

请确保文档已开启公开访问权限

+
+
+

+ 同步说明:系统将自动解析飞书文档结构,按照标题层级导入为章节内容。 +

+
+
+ + + + +
+
+ + {/* 章节编辑弹窗 */} + setEditingSection(null)}> + + + + + 编辑章节 + + + {editingSection && ( +
+
+ + setEditingSection({ ...editingSection, title: e.target.value })} + /> +
+
+ + setEditingSection({ ...editingSection, price: Number(e.target.value) })} + /> +
+
+ +