--- name: enjoysa description: EnjoySA 畅游南澳旅游平台开发。用于前端页面开发、组件开发、i18n国际化。当用户提到 enjoysa、畅游南澳、旅游平台、供应商后台相关任务时自动激活。 --- # EnjoySA 开发技能 畅游南澳旅游平台,面向 C 端游客和 B 端供应商的在线旅游服务系统。 ## 项目信息 | 项目 | 值 | |------|-----| | 本地路径 | `/Users/donglinlai/coding/qiudl/enjoysa` | | Git 仓库 | `https://gitea.pipexerp.com/qiudl/enjoysa.git` | | 主分支 | main | | 技术栈 | Vite + React 18 + TypeScript + CSS Modules | | 部署服务器 | singapore (43.134.28.147:6066) | | 访问地址 | http://43.134.28.147:6066 | --- ## 架构概览 ``` enjoysa/ ├── web/ # React 前端 │ ├── src/ │ │ ├── components/ # 通用组件 │ │ │ ├── Common/ # Header, Footer, LanguageSwitcher │ │ │ ├── Auth/ # LoginForm, RegisterForm │ │ │ └── Supplier/ # SupplierLoginForm, SupplierRegisterForm │ │ ├── pages/ # 页面组件 │ │ │ ├── LoginPage/ # C端用户登录 │ │ │ ├── SupplierLoginPage/# B端供应商登录 │ │ │ ├── AdminLoginPage/ # 平台管理员登录 │ │ │ ├── TermsPage/ # 服务条款 │ │ │ ├── PrivacyPage/ # 隐私政策 │ │ │ └── Supplier/ # 供应商后台模块 │ │ ├── i18n/ # 国际化 │ │ │ └── locales/ # 翻译文件 │ │ │ ├── zh-CN.json │ │ │ └── en-US.json │ │ └── types/ # 类型定义 │ ├── scripts/ # 部署脚本 │ └── dist/ # 构建产物 ├── backend/ # Go 后端 (规划中) └── docs/ # 文档 ``` --- ## 页面路由 ### C 端 (游客) | 路由 | 页面 | 说明 | |------|------|------| | `/` | HomePage | 首页 | | `/login` | LoginPage | 用户登录/注册 | | `/terms` | TermsPage | 服务条款 | | `/privacy` | PrivacyPage | 隐私政策 | ### B 端 (供应商) | 路由 | 页面 | 说明 | |------|------|------| | `/supplier/login` | SupplierLoginPage | 供应商登录 | | `/supplier/register` | SupplierRegisterPage | 供应商入驻申请 | | `/supplier` | SupplierDashboard | 供应商仪表盘 | | `/supplier/products` | SupplierProducts | 产品管理 | | `/supplier/orders` | SupplierOrders | 订单处理 | | `/supplier/finance` | SupplierFinance | 财务结算 | ### 管理端 | 路由 | 页面 | 说明 | |------|------|------| | `/admin/login` | AdminLoginPage | 管理员登录 | --- ## i18n 国际化 ### 翻译文件位置 ``` web/src/i18n/locales/ ├── zh-CN.json # 简体中文 └── en-US.json # 英文 ``` ### 命名空间规范 | 命名空间 | 用途 | 示例 | |---------|------|------| | `brand.*` | 品牌信息 | brand.name, brand.tagline | | `auth.*` | 登录注册 | auth.loginTitle, auth.emailPlaceholder | | `terms.*` | 服务条款 | terms.title, terms.sections.* | | `privacy.*` | 隐私政策 | privacy.title, privacy.sections.* | | `supplier.*` | 供应商模块 | supplier.login.*, supplier.dashboard.* | | `admin.*` | 管理员模块 | admin.login.*, admin.dashboard.* | | `common.*` | 通用文本 | common.submit, common.cancel | | `footer.*` | 页脚 | footer.supplierEntry, footer.copyright | ### 添加新翻译步骤 1. 在 `zh-CN.json` 和 `en-US.json` 中同时添加新 key 2. 使用 `useTranslation()` hook 获取 `t` 函数 3. 使用 `t('namespace.key')` 获取翻译文本 ```tsx import { useTranslation } from 'react-i18next'; const MyComponent = () => { const { t } = useTranslation(); return

{t('brand.name')}

; }; ``` ### 注意事项 - **禁止硬编码中文/英文**,所有用户可见文本必须使用 i18n - 长文本内容(如条款、政策)使用 `\n` 分段 - JSON 中避免使用中文引号 `""` `''`,使用 `「」` 或英文引号 --- ## 组件规范 ### Common 组件 | 组件 | 用途 | 文件 | |------|------|------| | Header | 顶部导航栏 | `components/Common/Header/` | | Footer | 页脚(含供应商入口) | `components/Common/Footer/` | | LanguageSwitcher | 语言切换器 | `components/Common/LanguageSwitcher/` | ### Auth 组件 | 组件 | 用途 | 文件 | |------|------|------| | LoginForm | C端登录表单 | `components/Auth/LoginForm/` | | RegisterForm | C端注册表单 | `components/Auth/RegisterForm/` | ### Supplier 组件 | 组件 | 用途 | 文件 | |------|------|------| | SupplierLoginForm | 供应商登录表单 | `components/Supplier/SupplierLoginForm/` | | SupplierRegisterForm | 供应商入驻申请表单 | `components/Supplier/SupplierRegisterForm/` | --- ## 本地开发 ### 启动前端 ```bash cd /Users/donglinlai/coding/qiudl/enjoysa/web npm install npm run dev ``` ### 构建 ```bash npm run build ``` ### 部署 ```bash ./scripts/deploy.sh ``` 或手动部署: ```bash scp -r web/dist/* singapore:/opt/enjoysa/ ``` --- ## 供应商类型 系统支持以下供应商类型: | 类型 | 说明 | |------|------| | travel_agency | 旅行社 | | hotel | 酒店 | | attraction | 景区 | | restaurant | 餐厅 | | car_rental | 租车公司 | --- ## 相关技能 - `enjoysa-deploy` - 部署到新加坡服务器 - `frontend-design` - 前端界面设计 - `dev-coding` - 软件编码开发 --- ## 版本历史 | 版本 | 日期 | 变更 | |------|------|------| | 1.0.0 | 2026-01-31 | 初始版本,包含项目结构、页面路由、i18n规范 |