docs: 更新 CLAUDE.md 项目文档
- 新增7个页面的文档说明 - product-detail: 产品详情页,支持接收ID参数 - material-list: 资料/文档列表页 - help-center: 帮助中心和FAQ页 - search: 搜索页面 - webview: WebView外部链接包装页 - document-demo: 文档预览演示页 - document-preview: 文档预览页 - 更新业务模块描述 - 细化产品展示模块说明 - 新增资料库模块说明 - 完善导航使用说明 - 添加参数传递示例 - 添加 useLoad 接收参数的示例 - 说明产品详情页的导航流程 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Showing
1 changed file
with
68 additions
and
8 deletions
| ... | @@ -21,11 +21,15 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co | ... | @@ -21,11 +21,15 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co |
| 21 | 21 | ||
| 22 | ### Business Modules | 22 | ### Business Modules |
| 23 | The app currently includes the following main features: | 23 | The app currently includes the following main features: |
| 24 | -- **Product Showcase** - Hot products display and search | 24 | +- **Product Showcase** - Hot products display with detail pages |
| 25 | + - Home page shows hot products with "产品资料" (Product Materials) buttons | ||
| 26 | + - Product detail page displays comprehensive product information | ||
| 27 | +- **Material Library** - Training materials and document management | ||
| 28 | + - Knowledge base for training materials and case studies | ||
| 29 | + - Material list page with document preview capabilities | ||
| 25 | - **Family Office** (家办) - Family office services | 30 | - **Family Office** (家办) - Family office services |
| 26 | -- **Knowledge Base** (资料知识库) - Training materials and case studies | ||
| 27 | - **Contract Signing** (签单) - Contract signing workflow | 31 | - **Contract Signing** (签单) - Contract signing workflow |
| 28 | -- **User Center** - Personal profile, favorites, feedback | 32 | +- **User Center** - Personal profile, favorites, feedback, help center |
| 29 | 33 | ||
| 30 | ## Project Architecture | 34 | ## Project Architecture |
| 31 | 35 | ||
| ... | @@ -143,6 +147,9 @@ src/pages/your-page/ | ... | @@ -143,6 +147,9 @@ src/pages/your-page/ |
| 143 | 147 | ||
| 144 | **Core Pages**: | 148 | **Core Pages**: |
| 145 | 1. `pages/index/index` - Home page (product showcase, search, grid navigation) | 149 | 1. `pages/index/index` - Home page (product showcase, search, grid navigation) |
| 150 | + - Hot products "产品资料" buttons navigate to `product-detail` page with product ID | ||
| 151 | + - Hot materials "查看更多" navigates to `material-list` page | ||
| 152 | + - Grid navigation icons navigate to various business pages | ||
| 146 | 2. `pages/auth/index` - Authentication page | 153 | 2. `pages/auth/index` - Authentication page |
| 147 | 3. `pages/login/index` - Login page | 154 | 3. `pages/login/index` - Login page |
| 148 | 155 | ||
| ... | @@ -156,8 +163,20 @@ src/pages/your-page/ | ... | @@ -156,8 +163,20 @@ src/pages/your-page/ |
| 156 | 10. `pages/avatar/index` - Avatar settings | 163 | 10. `pages/avatar/index` - Avatar settings |
| 157 | 11. `pages/mine/index` - User profile | 164 | 11. `pages/mine/index` - User profile |
| 158 | 165 | ||
| 159 | -**Auxiliary Pages**: | 166 | +**Product & Content Pages**: |
| 160 | -12. `pages/onboarding/index` - New user onboarding | 167 | +12. `pages/product-detail/index` - Product detail page |
| 168 | + - Receives `id` parameter via Taro's `useLoad` hook | ||
| 169 | + - Example navigation: `go('/pages/product-detail/index', { id: 1 })` | ||
| 170 | + - Parameters can be used to fetch product details from API | ||
| 171 | +13. `pages/material-list/index` - Material/Document list page | ||
| 172 | +14. `pages/help-center/index` - Help center and FAQ page | ||
| 173 | +15. `pages/search/index` - Search page for products and materials | ||
| 174 | + | ||
| 175 | +**Utility Pages**: | ||
| 176 | +16. `pages/onboarding/index` - New user onboarding | ||
| 177 | +17. `pages/webview/index` - WebView wrapper for external URLs | ||
| 178 | +18. `pages/document-demo/index` - Document preview demo page | ||
| 179 | +19. `pages/document-preview/index` - Document preview page | ||
| 161 | 180 | ||
| 162 | ### Component Library | 181 | ### Component Library |
| 163 | 182 | ||
| ... | @@ -303,17 +322,38 @@ These features can be removed if not needed: | ... | @@ -303,17 +322,38 @@ These features can be removed if not needed: |
| 303 | 4. **Use composition API** in `index.vue`: | 322 | 4. **Use composition API** in `index.vue`: |
| 304 | ```vue | 323 | ```vue |
| 305 | <script setup> | 324 | <script setup> |
| 306 | - import { ref, onMounted } from 'vue' | 325 | + import { ref } from 'vue' |
| 307 | import { useLoad, useShow } from '@tarojs/taro' | 326 | import { useLoad, useShow } from '@tarojs/taro' |
| 308 | 327 | ||
| 328 | + const pageId = ref(null) | ||
| 329 | + | ||
| 309 | useLoad((options) => { | 330 | useLoad((options) => { |
| 310 | console.log('Page loaded with options:', options) | 331 | console.log('Page loaded with options:', options) |
| 332 | + // Receive navigation parameters | ||
| 333 | + if (options.id) { | ||
| 334 | + pageId.value = options.id | ||
| 335 | + // Fetch data based on ID | ||
| 336 | + } | ||
| 337 | + }) | ||
| 338 | + | ||
| 339 | + useShow(() => { | ||
| 340 | + console.log('Page shown') | ||
| 311 | }) | 341 | }) |
| 312 | 342 | ||
| 313 | // Your component logic | 343 | // Your component logic |
| 314 | </script> | 344 | </script> |
| 315 | ``` | 345 | ``` |
| 316 | 346 | ||
| 347 | + **Navigation with Parameters**: | ||
| 348 | + ```javascript | ||
| 349 | + // From another page | ||
| 350 | + import { useGo } from '@/hooks/useGo' | ||
| 351 | + const go = useGo() | ||
| 352 | + | ||
| 353 | + // Navigate with query params | ||
| 354 | + go('/pages/product-detail/index', { id: 123, type: 'insurance' }) | ||
| 355 | + ``` | ||
| 356 | + | ||
| 317 | 5. **Add navigation** (optional TabBar integration): | 357 | 5. **Add navigation** (optional TabBar integration): |
| 318 | - Import and use `TabBar` component | 358 | - Import and use `TabBar` component |
| 319 | - Configure active state based on route | 359 | - Configure active state based on route |
| ... | @@ -355,13 +395,33 @@ const go = useGo() | ... | @@ -355,13 +395,33 @@ const go = useGo() |
| 355 | // Navigate to page | 395 | // Navigate to page |
| 356 | go('/pages/detail/index') | 396 | go('/pages/detail/index') |
| 357 | 397 | ||
| 358 | -// Navigate with params | 398 | +// Navigate with params (e.g., product ID) |
| 359 | -go('/pages/detail/index', { id: 123 }) | 399 | +go('/pages/product-detail/index', { id: 123 }) |
| 400 | + | ||
| 401 | +// Navigate with multiple params | ||
| 402 | +go('/pages/material-list/index', { category: 'insurance', page: 1 }) | ||
| 360 | 403 | ||
| 361 | // Go back | 404 | // Go back |
| 362 | go.back() | 405 | go.back() |
| 363 | ``` | 406 | ``` |
| 364 | 407 | ||
| 408 | +**Receiving Parameters in Target Page**: | ||
| 409 | +```javascript | ||
| 410 | +import { useLoad } from '@tarojs/taro' | ||
| 411 | +import { ref } from 'vue' | ||
| 412 | + | ||
| 413 | +const productId = ref(null) | ||
| 414 | + | ||
| 415 | +useLoad((options) => { | ||
| 416 | + // Access navigation parameters | ||
| 417 | + console.log('Received params:', options) | ||
| 418 | + productId.value = options.id | ||
| 419 | + | ||
| 420 | + // Fetch data based on parameters | ||
| 421 | + fetchProductDetail(options.id) | ||
| 422 | +}) | ||
| 423 | +``` | ||
| 424 | + | ||
| 365 | **Alternative**: Use Taro's built-in navigation: | 425 | **Alternative**: Use Taro's built-in navigation: |
| 366 | ```javascript | 426 | ```javascript |
| 367 | import Taro from '@tarojs/taro' | 427 | import Taro from '@tarojs/taro' | ... | ... |
-
Please register or login to post a comment