hookehuyr

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
### Business Modules
The app currently includes the following main features:
- **Product Showcase** - Hot products display and search
- **Product Showcase** - Hot products display with detail pages
- Home page shows hot products with "产品资料" (Product Materials) buttons
- Product detail page displays comprehensive product information
- **Material Library** - Training materials and document management
- Knowledge base for training materials and case studies
- Material list page with document preview capabilities
- **Family Office** (家办) - Family office services
- **Knowledge Base** (资料知识库) - Training materials and case studies
- **Contract Signing** (签单) - Contract signing workflow
- **User Center** - Personal profile, favorites, feedback
- **User Center** - Personal profile, favorites, feedback, help center
## Project Architecture
......@@ -143,6 +147,9 @@ src/pages/your-page/
**Core Pages**:
1. `pages/index/index` - Home page (product showcase, search, grid navigation)
- Hot products "产品资料" buttons navigate to `product-detail` page with product ID
- Hot materials "查看更多" navigates to `material-list` page
- Grid navigation icons navigate to various business pages
2. `pages/auth/index` - Authentication page
3. `pages/login/index` - Login page
......@@ -156,8 +163,20 @@ src/pages/your-page/
10. `pages/avatar/index` - Avatar settings
11. `pages/mine/index` - User profile
**Auxiliary Pages**:
12. `pages/onboarding/index` - New user onboarding
**Product & Content Pages**:
12. `pages/product-detail/index` - Product detail page
- Receives `id` parameter via Taro's `useLoad` hook
- Example navigation: `go('/pages/product-detail/index', { id: 1 })`
- Parameters can be used to fetch product details from API
13. `pages/material-list/index` - Material/Document list page
14. `pages/help-center/index` - Help center and FAQ page
15. `pages/search/index` - Search page for products and materials
**Utility Pages**:
16. `pages/onboarding/index` - New user onboarding
17. `pages/webview/index` - WebView wrapper for external URLs
18. `pages/document-demo/index` - Document preview demo page
19. `pages/document-preview/index` - Document preview page
### Component Library
......@@ -303,17 +322,38 @@ These features can be removed if not needed:
4. **Use composition API** in `index.vue`:
```vue
<script setup>
import { ref, onMounted } from 'vue'
import { ref } from 'vue'
import { useLoad, useShow } from '@tarojs/taro'
const pageId = ref(null)
useLoad((options) => {
console.log('Page loaded with options:', options)
// Receive navigation parameters
if (options.id) {
pageId.value = options.id
// Fetch data based on ID
}
})
useShow(() => {
console.log('Page shown')
})
// Your component logic
</script>
```
**Navigation with Parameters**:
```javascript
// From another page
import { useGo } from '@/hooks/useGo'
const go = useGo()
// Navigate with query params
go('/pages/product-detail/index', { id: 123, type: 'insurance' })
```
5. **Add navigation** (optional TabBar integration):
- Import and use `TabBar` component
- Configure active state based on route
......@@ -355,13 +395,33 @@ const go = useGo()
// Navigate to page
go('/pages/detail/index')
// Navigate with params
go('/pages/detail/index', { id: 123 })
// Navigate with params (e.g., product ID)
go('/pages/product-detail/index', { id: 123 })
// Navigate with multiple params
go('/pages/material-list/index', { category: 'insurance', page: 1 })
// Go back
go.back()
```
**Receiving Parameters in Target Page**:
```javascript
import { useLoad } from '@tarojs/taro'
import { ref } from 'vue'
const productId = ref(null)
useLoad((options) => {
// Access navigation parameters
console.log('Received params:', options)
productId.value = options.id
// Fetch data based on parameters
fetchProductDetail(options.id)
})
```
**Alternative**: Use Taro's built-in navigation:
```javascript
import Taro from '@tarojs/taro'
......