Преглед изворни кода

feat(docs): 完善uni-app文档结构并添加示例代码

- 在SKILL.md中添加examples目录结构说明,包含内置组件和API示例分类
- 新增agent-browser高级命令和基础命令示例文档
- 创建AI代理工作流和基础自动化模板
- 添加uni-app内置组件(button和checkbox)完整示例代码
- 创建API媒体处理模块choose-image示例
- 建立CHECKLIST.md核对清单文档,追踪组件和API示例完成进度
- 按照官方文档创建结构化的示例文件组织方式
wandl-6A72h пре 8 месеци
родитељ
комит
b2557302fd
44 измењених фајлова са 7986 додато и 2 уклоњено
  1. 17 0
      skills/agent-browser/LICENSE.txt
  2. 109 0
      skills/agent-browser/SKILL.md
  3. 289 0
      skills/agent-browser/api/commands.md
  4. 203 0
      skills/agent-browser/api/options.md
  5. 98 0
      skills/agent-browser/api/selectors.md
  6. 139 0
      skills/agent-browser/examples/agent-mode/integration.md
  7. 126 0
      skills/agent-browser/examples/agent-mode/introduction.md
  8. 132 0
      skills/agent-browser/examples/agent-mode/optimal-workflow.md
  9. 120 0
      skills/agent-browser/examples/commands/advanced-commands.md
  10. 124 0
      skills/agent-browser/examples/commands/basic-commands.md
  11. 113 0
      skills/agent-browser/examples/getting-started/installation.md
  12. 132 0
      skills/agent-browser/examples/options/global-options.md
  13. 114 0
      skills/agent-browser/examples/options/session-options.md
  14. 143 0
      skills/agent-browser/examples/options/snapshot-options.md
  15. 82 0
      skills/agent-browser/examples/quick-start/quick-start.md
  16. 119 0
      skills/agent-browser/examples/selectors/refs.md
  17. 136 0
      skills/agent-browser/examples/selectors/traditional-selectors.md
  18. 88 0
      skills/agent-browser/templates/ai-agent-workflow.md
  19. 41 0
      skills/agent-browser/templates/basic-automation.md
  20. 317 0
      skills/uniapp-project-guide/CHECKLIST.md
  21. 17 2
      skills/uniapp-project-guide/SKILL.md
  22. 175 0
      skills/uniapp-project-guide/UPDATE_PLAN.md
  23. 209 0
      skills/uniapp-project-guide/examples/api/device/get-system-info.md
  24. 243 0
      skills/uniapp-project-guide/examples/api/location/get-location.md
  25. 222 0
      skills/uniapp-project-guide/examples/api/media/choose-image.md
  26. 234 0
      skills/uniapp-project-guide/examples/api/media/preview-image.md
  27. 177 0
      skills/uniapp-project-guide/examples/api/navigation/navigate-back.md
  28. 151 0
      skills/uniapp-project-guide/examples/api/navigation/navigate-to.md
  29. 287 0
      skills/uniapp-project-guide/examples/api/network/request.md
  30. 175 0
      skills/uniapp-project-guide/examples/api/storage/get-storage.md
  31. 160 0
      skills/uniapp-project-guide/examples/api/storage/set-storage.md
  32. 189 0
      skills/uniapp-project-guide/examples/api/ui/show-loading.md
  33. 226 0
      skills/uniapp-project-guide/examples/api/ui/show-modal.md
  34. 188 0
      skills/uniapp-project-guide/examples/api/ui/show-toast.md
  35. 233 0
      skills/uniapp-project-guide/examples/components/built-in/button.md
  36. 233 0
      skills/uniapp-project-guide/examples/components/built-in/checkbox.md
  37. 160 0
      skills/uniapp-project-guide/examples/components/built-in/icon.md
  38. 373 0
      skills/uniapp-project-guide/examples/components/built-in/image.md
  39. 331 0
      skills/uniapp-project-guide/examples/components/built-in/input.md
  40. 172 0
      skills/uniapp-project-guide/examples/components/built-in/radio.md
  41. 337 0
      skills/uniapp-project-guide/examples/components/built-in/scroll-view.md
  42. 294 0
      skills/uniapp-project-guide/examples/components/built-in/swiper.md
  43. 151 0
      skills/uniapp-project-guide/examples/components/built-in/text.md
  44. 407 0
      skills/uniapp-project-guide/examples/components/built-in/view.md

+ 17 - 0
skills/agent-browser/LICENSE.txt

@@ -0,0 +1,17 @@
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+Copyright (c) 2024 Vercel Labs
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.

+ 109 - 0
skills/agent-browser/SKILL.md

@@ -0,0 +1,109 @@
+---
+name: agent-browser
+description: A comprehensive skill for using agent-browser, a CLI tool for browser automation designed for AI agents, developed by Vercel Labs. This skill covers installation, core commands, selectors (refs, CSS, XPath, semantic locators), agent mode, options, and best practices. Use this skill whenever the user needs to automate browser interactions via CLI commands, especially for AI agents that need to interact with web pages.
+license: Complete terms in LICENSE.txt
+---
+
+## When to use this skill
+
+Use this skill whenever the user wants to:
+- Automate browser interactions via CLI commands
+- Use browser automation for AI agents
+- Navigate websites and interact with pages using command-line tools
+- Use refs-based element selection for deterministic automation
+- Integrate browser automation into AI agent workflows
+- Capture snapshots of web pages with accessibility trees
+- Fill forms, click elements, and extract content via CLI
+- Use semantic locators for more reliable element selection
+- Work with browser automation in agent mode with JSON output
+
+## How to use this skill
+
+This skill is organized to match the agent-browser official documentation structure (https://github.com/vercel-labs/agent-browser/blob/main/README.md). When working with agent-browser:
+
+1. **Install agent-browser**:
+   - Load `examples/getting-started/installation.md` for installation instructions
+
+2. **Learn core commands**:
+   - Load `examples/commands/basic-commands.md` for basic commands (open, click, fill, etc.)
+   - Load `examples/commands/advanced-commands.md` for advanced commands (snapshot, eval, etc.)
+
+3. **Understand selectors**:
+   - Load `examples/selectors/refs.md` for refs-based selection (@e1, @e2, etc.)
+   - Load `examples/selectors/traditional-selectors.md` for CSS, XPath, and semantic locators
+
+4. **Use agent mode**:
+   - Load `examples/agent-mode/introduction.md` for agent mode overview
+   - Load `examples/agent-mode/optimal-workflow.md` for optimal AI workflow
+   - Load `examples/agent-mode/integration.md` for integrating with AI agents
+
+5. **Configure options**:
+   - Load `examples/options/global-options.md` for global options
+   - Load `examples/options/snapshot-options.md` for snapshot-specific options
+   - Load `examples/options/session-options.md` for session management
+
+6. **Reference API documentation** when needed:
+   - `api/commands.md` - Complete command reference
+   - `api/selectors.md` - Selector reference
+   - `api/options.md` - Options reference
+
+7. **Use templates** for quick start:
+   - `templates/basic-automation.md` - Basic automation workflow
+   - `templates/ai-agent-workflow.md` - AI agent workflow template
+
+## Examples and Templates
+
+### Getting Started
+- **Installation**: `examples/getting-started/installation.md` - Installing agent-browser CLI tool
+
+### Commands
+- **Basic Commands**: `examples/commands/basic-commands.md` - Core commands (open, click, fill, type, etc.)
+- **Advanced Commands**: `examples/commands/advanced-commands.md` - Advanced commands (snapshot, eval, screenshot, etc.)
+
+### Selectors
+- **Refs**: `examples/selectors/refs.md` - Using refs (@e1, @e2) for deterministic element selection
+- **Traditional Selectors**: `examples/selectors/traditional-selectors.md` - CSS selectors, XPath, semantic locators
+
+### Agent Mode
+- **Introduction**: `examples/agent-mode/introduction.md` - Agent mode overview and JSON output
+- **Optimal Workflow**: `examples/agent-mode/optimal-workflow.md` - Optimal AI workflow patterns
+- **Integration**: `examples/agent-mode/integration.md` - Integrating with AI agents (Claude, Cursor, Copilot, etc.)
+
+### Options
+- **Global Options**: `examples/options/global-options.md` - Global CLI options (--session, --headers, --headed, etc.)
+- **Snapshot Options**: `examples/options/snapshot-options.md` - Snapshot-specific options (-i, -c, -d, -s)
+- **Session Options**: `examples/options/session-options.md` - Session management options
+
+### Templates
+- **Basic Automation**: `templates/basic-automation.md` - Basic browser automation workflow
+- **AI Agent Workflow**: `templates/ai-agent-workflow.md` - Complete AI agent workflow template
+
+## API Reference
+
+- **Commands API**: `api/commands.md` - Complete command reference with syntax and examples
+- **Selectors API**: `api/selectors.md` - Selector types and usage reference
+- **Options API**: `api/options.md` - All options reference
+
+## Best Practices
+
+1. **Use Refs**: Prefer refs (@e1, @e2) over traditional selectors for deterministic automation
+2. **Snapshot First**: Always snapshot before interacting with elements to get refs
+3. **Agent Mode**: Use `--json` flag for machine-readable output in agent mode
+4. **Session Management**: Use `--session` to maintain state across commands
+5. **Interactive Snapshot**: Use `-i` flag for interactive snapshot selection
+6. **Semantic Locators**: Use semantic locators (role/name) when refs are not available
+7. **Error Handling**: Check command exit codes and error messages
+8. **Wait for Navigation**: Commands automatically wait for navigation to complete
+9. **Headed Mode**: Use `--headed` for debugging, headless for production
+10. **CDP Integration**: Use `--cdp` for Chrome DevTools Protocol integration
+
+## Resources
+
+- **GitHub Repository**: https://github.com/vercel-labs/agent-browser
+- **Official README**: https://github.com/vercel-labs/agent-browser/blob/main/README.md
+- **Agent Mode Documentation**: https://agent-browser.dev/agent-mode
+- **Issues**: https://github.com/vercel-labs/agent-browser/issues
+
+## Keywords
+
+agent-browser, CLI browser automation, AI agents, browser automation CLI, refs, snapshot, agent mode, semantic locators, browser automation tool, command-line browser, AI agent browser, deterministic selectors, accessibility tree, browser commands, web automation CLI

+ 289 - 0
skills/agent-browser/api/commands.md

@@ -0,0 +1,289 @@
+# Commands API | 命令 API
+
+## API Reference
+
+Complete command reference for agent-browser CLI.
+
+### Navigation Commands
+
+#### open, goto, navigate
+
+Navigate to a URL.
+
+**Syntax:**
+```bash
+agent-browser open <url> [options]
+```
+
+**Options:**
+- `--session <name>`: Use named session
+- `--headers <json>`: Custom HTTP headers
+- `--headed`: Run in headed mode
+- `--json`: JSON output
+
+**Example:**
+```bash
+agent-browser open https://example.com --session my-session --json
+```
+
+### Interaction Commands
+
+#### click
+
+Click an element.
+
+**Syntax:**
+```bash
+agent-browser click <selector> [options]
+```
+
+**Options:**
+- `--session <name>`: Use named session
+- `--button <button>`: Mouse button (left, right, middle)
+- `--json`: JSON output
+
+**Example:**
+```bash
+agent-browser click @e1 --session my-session --json
+```
+
+#### dblclick
+
+Double-click an element.
+
+**Syntax:**
+```bash
+agent-browser dblclick <selector> [options]
+```
+
+**Example:**
+```bash
+agent-browser dblclick @e1
+```
+
+### Input Commands
+
+#### type
+
+Type text into an element.
+
+**Syntax:**
+```bash
+agent-browser type <selector> <text> [options]
+```
+
+**Example:**
+```bash
+agent-browser type @e1 "Hello World"
+```
+
+#### fill
+
+Fill an input field.
+
+**Syntax:**
+```bash
+agent-browser fill <selector> <text> [options]
+```
+
+**Example:**
+```bash
+agent-browser fill @e1 "user@example.com"
+```
+
+#### press
+
+Press a key.
+
+**Syntax:**
+```bash
+agent-browser press <selector> <key> [options]
+```
+
+**Example:**
+```bash
+agent-browser press @e1 Enter
+```
+
+#### keydown, keyup
+
+Key down/up events.
+
+**Syntax:**
+```bash
+agent-browser keydown <selector> <key> [options]
+agent-browser keyup <selector> <key> [options]
+```
+
+### Form Commands
+
+#### focus
+
+Focus an element.
+
+**Syntax:**
+```bash
+agent-browser focus <selector> [options]
+```
+
+#### select
+
+Select an option.
+
+**Syntax:**
+```bash
+agent-browser select <selector> <value> [options]
+```
+
+#### check, uncheck
+
+Check/uncheck a checkbox.
+
+**Syntax:**
+```bash
+agent-browser check <selector> [options]
+agent-browser uncheck <selector> [options]
+```
+
+### Mouse Commands
+
+#### hover
+
+Hover over an element.
+
+**Syntax:**
+```bash
+agent-browser hover <selector> [options]
+```
+
+#### scroll
+
+Scroll element or page.
+
+**Syntax:**
+```bash
+agent-browser scroll <selector> [options]
+agent-browser scroll --to <selector> [options]
+```
+
+### Information Commands
+
+#### get text
+
+Get text content.
+
+**Syntax:**
+```bash
+agent-browser get text <selector> [options]
+```
+
+#### get attribute
+
+Get attribute value.
+
+**Syntax:**
+```bash
+agent-browser get attribute <selector> <name> [options]
+```
+
+#### get property
+
+Get property value.
+
+**Syntax:**
+```bash
+agent-browser get property <selector> <name> [options]
+```
+
+### Advanced Commands
+
+#### snapshot
+
+Get accessibility tree with refs.
+
+**Syntax:**
+```bash
+agent-browser snapshot [options]
+```
+
+**Options:**
+- `-i, --interactive`: Interactive mode
+- `-c, --compact`: Compact format
+- `-d, --depth <n>`: Depth limit
+- `-s, --selector <sel>`: Filter by selector
+- `--full, -f`: Full snapshot
+- `-n, --name <name>`: Filter by name
+- `--exact, -e`: Exact name match
+- `--json`: JSON output
+
+**Example:**
+```bash
+agent-browser snapshot -i --json --session my-session
+```
+
+#### eval
+
+Evaluate JavaScript.
+
+**Syntax:**
+```bash
+agent-browser eval <expression> [options]
+```
+
+**Example:**
+```bash
+agent-browser eval "document.title"
+```
+
+#### screenshot
+
+Take screenshot.
+
+**Syntax:**
+```bash
+agent-browser screenshot <path> [options]
+```
+
+**Options:**
+- `--full`: Full page screenshot
+
+#### pdf
+
+Generate PDF.
+
+**Syntax:**
+```bash
+agent-browser pdf <path> [options]
+```
+
+**Options:**
+- `--format <format>`: Paper format
+- `--print-background`: Print background
+
+#### close
+
+Close page or browser.
+
+**Syntax:**
+```bash
+agent-browser close [options]
+```
+
+**Options:**
+- `--all`: Close all pages
+
+### Common Options
+
+All commands support:
+- `--session <name>`: Use named session
+- `--json`: JSON output
+- `--headed`: Headed mode
+- `--debug`: Debug output
+
+### Key Points
+
+- All commands support `--session` for state management
+- Use `--json` for machine-readable output
+- Commands automatically wait for navigation
+- Use refs (@e1, @e2) for reliable selection
+- Commands return appropriate exit codes

+ 203 - 0
skills/agent-browser/api/options.md

@@ -0,0 +1,203 @@
+# Options API | 选项 API
+
+## API Reference
+
+Complete options reference for agent-browser.
+
+### Global Options
+
+#### --session, -s
+
+Use named session for state management.
+
+**Example:**
+```bash
+agent-browser open https://example.com --session my-session
+```
+
+**Environment Variable:** `AGENT_BROWSER_SESSION`
+
+#### --headers
+
+Custom HTTP headers (JSON format).
+
+**Example:**
+```bash
+agent-browser open https://example.com --headers '{"User-Agent": "MyBot"}'
+```
+
+**Environment Variable:** `AGENT_BROWSER_HEADERS`
+
+#### --executable-path
+
+Custom browser executable path.
+
+**Example:**
+```bash
+agent-browser open https://example.com --executable-path /path/to/chromium
+```
+
+**Environment Variable:** `AGENT_BROWSER_EXECUTABLE_PATH`
+
+#### --headed
+
+Run in headed mode (visible browser).
+
+**Example:**
+```bash
+agent-browser open https://example.com --headed
+```
+
+#### --cdp
+
+Connect via Chrome DevTools Protocol.
+
+**Example:**
+```bash
+agent-browser open https://example.com --cdp 9222
+```
+
+#### --json
+
+JSON output format.
+
+**Example:**
+```bash
+agent-browser snapshot --json
+```
+
+#### --debug
+
+Enable debug output.
+
+**Example:**
+```bash
+agent-browser open https://example.com --debug
+```
+
+### Snapshot Options
+
+#### -i, --interactive
+
+Interactive snapshot mode.
+
+**Example:**
+```bash
+agent-browser snapshot -i
+```
+
+#### -c, --compact
+
+Compact snapshot format.
+
+**Example:**
+```bash
+agent-browser snapshot -c
+```
+
+#### -d, --depth
+
+Limit snapshot depth.
+
+**Example:**
+```bash
+agent-browser snapshot -d 2
+```
+
+#### -s, --selector
+
+Filter by selector.
+
+**Example:**
+```bash
+agent-browser snapshot -s "main"
+```
+
+#### --full, -f
+
+Full snapshot with all details.
+
+**Example:**
+```bash
+agent-browser snapshot --full
+```
+
+#### -n, --name
+
+Filter by accessible name.
+
+**Example:**
+```bash
+agent-browser snapshot -n "Submit"
+```
+
+#### --exact, -e
+
+Exact name match.
+
+**Example:**
+```bash
+agent-browser snapshot -n "Submit" --exact
+```
+
+### Command-Specific Options
+
+#### --button
+
+Mouse button for click (left, right, middle).
+
+**Example:**
+```bash
+agent-browser click @e1 --button right
+```
+
+#### --to
+
+Scroll to element.
+
+**Example:**
+```bash
+agent-browser scroll --to @e1
+```
+
+#### --all
+
+Close all pages.
+
+**Example:**
+```bash
+agent-browser close --all
+```
+
+#### --format
+
+PDF paper format.
+
+**Example:**
+```bash
+agent-browser pdf output.pdf --format A4
+```
+
+#### --print-background
+
+Print background in PDF.
+
+**Example:**
+```bash
+agent-browser pdf output.pdf --print-background
+```
+
+### Environment Variables
+
+- `AGENT_BROWSER_SESSION`: Default session name
+- `AGENT_BROWSER_HEADERS`: Default headers (JSON)
+- `AGENT_BROWSER_EXECUTABLE_PATH`: Default executable path
+
+### Key Points
+
+- Global options apply to all commands
+- Snapshot options are specific to snapshot command
+- Environment variables can set defaults
+- Options can be combined
+- Use `--json` for agent mode
+- Use `--session` for state management

+ 98 - 0
skills/agent-browser/api/selectors.md

@@ -0,0 +1,98 @@
+# Selectors API | 选择器 API
+
+## API Reference
+
+Complete selector reference for agent-browser.
+
+### Refs
+
+Deterministic element identifiers from snapshot.
+
+**Format:** `@e1`, `@e2`, `@e3`, etc.
+
+**Example:**
+```bash
+agent-browser click @e1
+agent-browser fill @e2 "text"
+```
+
+**Advantages:**
+- Deterministic
+- Fast
+- AI-friendly
+- Stable across page changes
+
+### CSS Selectors
+
+Standard CSS selector syntax.
+
+**Examples:**
+```bash
+agent-browser click button
+agent-browser click .submit-button
+agent-browser click #login-btn
+agent-browser click input[name="email"]
+agent-browser click form .submit
+```
+
+### XPath Selectors
+
+XPath expression syntax (must be quoted).
+
+**Examples:**
+```bash
+agent-browser click "//button"
+agent-browser click "//button[@type='submit']"
+agent-browser click "//button[text()='Submit']"
+agent-browser click "//form[@id='login']//button"
+```
+
+### Semantic Locators
+
+Accessibility-focused selectors.
+
+**Format:** `role=<role>`, `role=<role> name=<name>`
+
+**Examples:**
+```bash
+agent-browser click role=button
+agent-browser click role=button name="Submit"
+agent-browser click role=textbox name="Email"
+agent-browser click role=link name="Login"
+agent-browser get text role=heading name="Welcome" level=1
+```
+
+### ID and Class Selectors
+
+Simple ID and class selectors.
+
+**Examples:**
+```bash
+agent-browser click #my-button
+agent-browser click .my-class
+agent-browser click .btn.primary
+agent-browser click button.primary
+```
+
+### Selector Priority
+
+1. **Refs** (preferred): Most reliable, deterministic
+2. **Semantic Locators**: Accessibility-focused, stable
+3. **CSS Selectors**: Simple, but can break
+4. **XPath**: Powerful, but complex
+
+### When to Use Each
+
+- **Refs**: Always prefer for AI agents and deterministic automation
+- **Semantic Locators**: When structure might change, accessibility-focused
+- **CSS Selectors**: Simple, stable HTML structure
+- **XPath**: Complex relationships, text-based selection
+
+### Key Points
+
+- Refs are the most reliable selector type
+- Get refs from `snapshot` command
+- Semantic locators are more maintainable
+- CSS selectors are simple but fragile
+- XPath is powerful but complex
+- Always prefer refs when available

+ 139 - 0
skills/agent-browser/examples/agent-mode/integration.md

@@ -0,0 +1,139 @@
+# Agent Integration | 代理集成
+
+## Instructions
+
+This example demonstrates how to integrate agent-browser with AI agents.
+
+### Key Concepts
+
+- Integrating with Claude
+- Integrating with Cursor
+- Integrating with Copilot
+- Integrating with OpenAI
+- Integrating with Gemini
+- Adding to agent skills
+
+### Example: Claude Integration
+
+```bash
+# Add to Claude's skills/AGENTS.md or similar
+# agent-browser: Browser automation CLI for AI agents
+# - Use snapshot --json to get page state
+# - Use refs (@e1, @e2) for element selection
+# - Use --session to maintain state
+```
+
+### Example: Cursor Integration
+
+```bash
+# Configure Cursor to use agent-browser
+# Add agent-browser commands to Cursor's tool set
+# Use JSON output for structured responses
+```
+
+### Example: Basic Integration Pattern
+
+```javascript
+// Example: Node.js integration
+const { exec } = require('child_process');
+const util = require('util');
+const execPromise = util.promisify(exec);
+
+async function agentBrowserCommand(command) {
+  try {
+    const { stdout, stderr } = await execPromise(
+      `agent-browser ${command} --json`
+    );
+    return JSON.parse(stdout);
+  } catch (error) {
+    return { error: error.message };
+  }
+}
+
+// Usage
+const snapshot = await agentBrowserCommand('snapshot --session my-task');
+const refs = snapshot.refs;
+await agentBrowserCommand(`click ${refs['@e1'].ref} --session my-task`);
+```
+
+### Example: Python Integration
+
+```python
+import subprocess
+import json
+
+def agent_browser_command(command):
+    try:
+        result = subprocess.run(
+            f"agent-browser {command} --json",
+            shell=True,
+            capture_output=True,
+            text=True
+        )
+        return json.loads(result.stdout)
+    except Exception as e:
+        return {"error": str(e)}
+
+# Usage
+snapshot = agent_browser_command("snapshot --session my-task")
+refs = snapshot.get("refs", {})
+agent_browser_command(f"click {refs['@e1']['ref']} --session my-task")
+```
+
+### Example: Agent Skill Definition
+
+```markdown
+## agent-browser
+
+Browser automation CLI tool for AI agents.
+
+### Commands:
+- `agent-browser open <url>` - Navigate to URL
+- `agent-browser snapshot --json` - Get page snapshot with refs
+- `agent-browser click <ref>` - Click element by ref
+- `agent-browser fill <ref> <text>` - Fill input by ref
+
+### Workflow:
+1. Open page: `agent-browser open <url> --session <name> --json`
+2. Snapshot: `agent-browser snapshot --json --session <name>`
+3. Interact: Use refs from snapshot
+4. Verify: Snapshot again after changes
+```
+
+### Example: Agent Workflow Integration
+
+```bash
+# Agent receives task: "Login to example.com"
+
+# Step 1: Agent executes
+agent-browser open https://example.com/login --session task1 --json
+
+# Step 2: Agent gets snapshot
+agent-browser snapshot --json --session task1
+
+# Step 3: Agent parses JSON, identifies:
+# - @e1 = email input
+# - @e2 = password input  
+# - @e3 = login button
+
+# Step 4: Agent fills form
+agent-browser fill @e1 "user@example.com" --session task1 --json
+agent-browser fill @e2 "password" --session task1 --json
+
+# Step 5: Agent submits
+agent-browser click @e3 --session task1 --json
+
+# Step 6: Agent verifies
+agent-browser snapshot --json --session task1
+```
+
+### Key Points
+
+- Integrate via command-line interface
+- Use `--json` for structured output
+- Parse JSON responses in your agent code
+- Use sessions for state management
+- Follow standard workflow pattern
+- Handle errors appropriately
+- Document agent-browser in agent skills
+- Use refs for reliable element selection

+ 126 - 0
skills/agent-browser/examples/agent-mode/introduction.md

@@ -0,0 +1,126 @@
+# Agent Mode Introduction | 代理模式介绍
+
+## Instructions
+
+This example demonstrates agent mode in agent-browser for AI agent integration.
+
+### Key Concepts
+
+- What is agent mode
+- JSON output format
+- Machine-readable commands
+- AI agent integration
+- Agent mode benefits
+
+### Example: Basic Agent Mode
+
+```bash
+# Enable JSON output for machine-readable format
+agent-browser snapshot --json
+
+# Output example:
+# {
+#   "type": "snapshot",
+#   "refs": {
+#     "@e1": {
+#       "role": "button",
+#       "name": "Submit",
+#       "selector": "button.submit"
+#     }
+#   }
+# }
+```
+
+### Example: JSON Output for Commands
+
+```bash
+# Get text with JSON output
+agent-browser get text @e1 --json
+
+# Output:
+# {
+#   "type": "text",
+#   "value": "Submit",
+#   "ref": "@e1"
+# }
+
+# Get attribute with JSON
+agent-browser get attribute @e1 href --json
+
+# Output:
+# {
+#   "type": "attribute",
+#   "name": "href",
+#   "value": "/login",
+#   "ref": "@e1"
+# }
+```
+
+### Example: Snapshot in Agent Mode
+
+```bash
+# Snapshot with JSON for AI parsing
+agent-browser snapshot --json
+
+# Compact JSON output
+agent-browser snapshot -c --json
+
+# Interactive snapshot with JSON
+agent-browser snapshot -i --json
+```
+
+### Example: Complete Agent Mode Workflow
+
+```bash
+# 1. Open page
+agent-browser open https://example.com --json
+
+# 2. Get snapshot
+agent-browser snapshot --json
+
+# 3. Parse refs from JSON output
+# AI agent identifies: @e1 = login button, @e2 = email input
+
+# 4. Interact using refs
+agent-browser fill @e2 "user@example.com" --json
+agent-browser click @e1 --json
+
+# 5. Verify result
+agent-browser snapshot --json
+```
+
+### Example: Agent Mode with Session
+
+```bash
+# Start session
+agent-browser open https://example.com --session agent-session --json
+
+# Continue in same session
+agent-browser snapshot --session agent-session --json
+agent-browser click @e1 --session agent-session --json
+agent-browser fill @e2 "text" --session agent-session --json
+```
+
+### Example: Error Handling in Agent Mode
+
+```bash
+# Commands return JSON errors
+agent-browser click @e999 --json
+
+# Output:
+# {
+#   "error": "Element not found",
+#   "ref": "@e999",
+#   "command": "click"
+# }
+```
+
+### Key Points
+
+- Agent mode uses `--json` flag for machine-readable output
+- JSON output is essential for AI agent integration
+- Snapshot with JSON provides structured refs
+- All commands support `--json` flag
+- Use sessions to maintain state across commands
+- Error messages are also in JSON format
+- Agent mode enables deterministic automation

+ 132 - 0
skills/agent-browser/examples/agent-mode/optimal-workflow.md

@@ -0,0 +1,132 @@
+# Optimal AI Workflow | 最优 AI 工作流
+
+## Instructions
+
+This example demonstrates the optimal workflow for AI agents using agent-browser.
+
+### Key Concepts
+
+- Standard workflow steps
+- Snapshot-first approach
+- Ref-based interaction
+- State management
+- Error recovery
+
+### Example: Standard Workflow
+
+```bash
+# Step 1: Open the page
+agent-browser open https://example.com --session my-task --json
+
+# Step 2: Get snapshot with refs
+agent-browser snapshot -i --json --session my-task
+
+# Step 3: AI agent parses snapshot JSON
+# Identifies available elements and their refs:
+# @e1 = login button
+# @e2 = email input
+# @e3 = password input
+
+# Step 4: Interact using refs
+agent-browser fill @e2 "user@example.com" --session my-task --json
+agent-browser fill @e3 "password123" --session my-task --json
+agent-browser click @e1 --session my-task --json
+
+# Step 5: Verify page changed (snapshot again)
+agent-browser snapshot --json --session my-task
+
+# Step 6: Continue with new refs from updated snapshot
+agent-browser click @e4 --session my-task --json
+```
+
+### Example: Snapshot-First Pattern
+
+```bash
+# Always snapshot before interaction
+agent-browser snapshot --json > current-state.json
+
+# AI agent analyzes snapshot
+# Decides next action based on available refs
+
+# Execute action
+agent-browser click @e1 --json
+
+# Snapshot again to verify
+agent-browser snapshot --json > new-state.json
+```
+
+### Example: Ref-Based Interaction
+
+```bash
+# Get refs
+agent-browser snapshot --json
+
+# Use refs (deterministic)
+agent-browser click @e1 --json
+agent-browser fill @e2 "text" --json
+agent-browser click @e3 --json
+
+# Refs are stable and reliable
+```
+
+### Example: State Management with Sessions
+
+```bash
+# Create session
+agent-browser open https://example.com --session task1 --json
+
+# All subsequent commands use same session
+agent-browser snapshot --session task1 --json
+agent-browser click @e1 --session task1 --json
+agent-browser fill @e2 "text" --session task1 --json
+
+# Session maintains browser state
+```
+
+### Example: Error Recovery
+
+```bash
+# Try action
+agent-browser click @e1 --json
+
+# If error, snapshot again
+agent-browser snapshot --json
+
+# Get updated refs
+# Retry with new refs
+agent-browser click @e2 --json
+```
+
+### Example: Complete Task Workflow
+
+```bash
+# 1. Initialize
+agent-browser open https://example.com/login --session login-task --json
+
+# 2. Analyze page
+agent-browser snapshot --json --session login-task > page1.json
+
+# 3. Fill form
+agent-browser fill @e2 "user@example.com" --session login-task --json
+agent-browser fill @e3 "password" --session login-task --json
+
+# 4. Submit
+agent-browser click @e1 --session login-task --json
+
+# 5. Verify success
+agent-browser snapshot --json --session login-task > page2.json
+
+# 6. Continue if needed
+agent-browser click @e4 --session login-task --json
+```
+
+### Key Points
+
+- Always start with `open` command
+- Always `snapshot` before interacting
+- Use refs from snapshot for interaction
+- Use `--session` to maintain state
+- Snapshot again after page changes
+- Use `--json` for machine-readable output
+- Handle errors by re-snapshotting
+- Follow: open → snapshot → interact → snapshot pattern

+ 120 - 0
skills/agent-browser/examples/commands/advanced-commands.md

@@ -0,0 +1,120 @@
+# Advanced Commands | 高级命令
+
+## Instructions
+
+This example demonstrates how to use advanced agent-browser commands.
+
+### Key Concepts
+
+- Snapshot command
+- Eval command
+- Screenshot and PDF
+- Close command
+- Command options
+
+### Example: Snapshot
+
+```bash
+# Basic snapshot (accessibility tree with refs)
+agent-browser snapshot
+
+# Interactive snapshot
+agent-browser snapshot -i
+
+# Compact snapshot
+agent-browser snapshot -c
+
+# Snapshot with depth limit
+agent-browser snapshot -d 2
+
+# Snapshot specific element
+agent-browser snapshot -s "main"
+
+# Full snapshot
+agent-browser snapshot --full
+
+# Snapshot with JSON output
+agent-browser snapshot --json
+```
+
+### Example: Eval
+
+```bash
+# Evaluate JavaScript
+agent-browser eval "document.title"
+
+# Evaluate with return value
+agent-browser eval "document.querySelector('h1').textContent"
+
+# Evaluate complex expression
+agent-browser eval "Array.from(document.querySelectorAll('a')).map(a => a.href)"
+```
+
+### Example: Screenshot and PDF
+
+```bash
+# Take screenshot
+agent-browser screenshot output.png
+
+# Screenshot full page
+agent-browser screenshot output.png --full
+
+# Generate PDF
+agent-browser pdf output.pdf
+
+# PDF with options
+agent-browser pdf output.pdf --format A4 --print-background
+```
+
+### Example: Close
+
+```bash
+# Close current page
+agent-browser close
+
+# Close all pages
+agent-browser close --all
+```
+
+### Example: Snapshot Workflow
+
+```bash
+# 1. Open page
+agent-browser open https://example.com
+
+# 2. Get snapshot with refs
+agent-browser snapshot -i --json
+
+# 3. Use refs from snapshot
+agent-browser click @e1
+agent-browser fill @e2 "text"
+
+# 4. Snapshot again after interaction
+agent-browser snapshot --json
+```
+
+### Example: Eval Workflow
+
+```bash
+# Open page
+agent-browser open https://example.com
+
+# Extract data using eval
+agent-browser eval "document.querySelectorAll('article').length"
+
+# Get all links
+agent-browser eval "Array.from(document.querySelectorAll('a')).map(a => ({text: a.textContent, href: a.href}))"
+
+# Check if element exists
+agent-browser eval "!!document.querySelector('.modal')"
+```
+
+### Key Points
+
+- Use `snapshot` to get accessibility tree with refs
+- Use `-i` for interactive snapshot selection
+- Use `--json` for machine-readable output
+- Use `eval` for custom JavaScript execution
+- Use `screenshot` and `pdf` for capturing pages
+- Always snapshot before interacting with elements
+- Use refs from snapshot for reliable element selection

+ 124 - 0
skills/agent-browser/examples/commands/basic-commands.md

@@ -0,0 +1,124 @@
+# Basic Commands | 基础命令
+
+## Instructions
+
+This example demonstrates how to use basic agent-browser commands.
+
+### Key Concepts
+
+- Navigation commands
+- Interaction commands
+- Input commands
+- Form commands
+- Mouse commands
+
+### Example: Navigation
+
+```bash
+# Open a URL (aliases: goto, navigate)
+agent-browser open https://example.com
+
+# Open with session
+agent-browser open https://example.com --session my-session
+```
+
+### Example: Clicking Elements
+
+```bash
+# Click an element using ref
+agent-browser click @e1
+
+# Click using CSS selector
+agent-browser click button.submit
+
+# Click using XPath
+agent-browser click "//button[@type='submit']"
+
+# Double-click
+agent-browser dblclick @e2
+
+# Right-click
+agent-browser click @e3 --button right
+```
+
+### Example: Typing and Filling
+
+```bash
+# Type text into an element
+agent-browser type @e1 "Hello World"
+
+# Fill an input field
+agent-browser fill @e2 "username@example.com"
+
+# Press a key
+agent-browser press @e1 Enter
+
+# Key down
+agent-browser keydown @e1 Control
+
+# Key up
+agent-browser keyup @e1 Control
+```
+
+### Example: Form Interactions
+
+```bash
+# Focus an element
+agent-browser focus @e1
+
+# Select an option
+agent-browser select @e1 "Option 1"
+
+# Check a checkbox
+agent-browser check @e1
+
+# Uncheck a checkbox
+agent-browser uncheck @e1
+```
+
+### Example: Mouse Actions
+
+```bash
+# Hover over an element
+agent-browser hover @e1
+
+# Scroll
+agent-browser scroll @e1
+
+# Scroll to element
+agent-browser scroll @e1 --to
+```
+
+### Example: Getting Element Information
+
+```bash
+# Get text content
+agent-browser get text @e1
+
+# Get attribute
+agent-browser get attribute @e1 href
+
+# Get property
+agent-browser get property @e1 value
+```
+
+### Example: Command Chaining
+
+```bash
+# Open page, then click
+agent-browser open https://example.com && agent-browser click @e1
+
+# Using session for state
+agent-browser open https://example.com --session test
+agent-browser click @e1 --session test
+agent-browser fill @e2 "text" --session test
+```
+
+### Key Points
+
+- Use `open` to navigate to URLs
+- Use refs (@e1, @e2) for deterministic selection
+- Commands automatically wait for navigation
+- Use `--session` to maintain state
+- Commands support CSS selectors, XPath, and semantic locators
+- All commands return appropriate exit codes

+ 113 - 0
skills/agent-browser/examples/getting-started/installation.md

@@ -0,0 +1,113 @@
+# Installation | 安装
+
+## Instructions
+
+This example demonstrates how to install agent-browser CLI tool.
+
+### Key Concepts
+
+- npm global installation
+- Installing browser binaries
+- Building from source
+- System dependencies
+- Custom executable path
+
+### Example: npm Installation (Recommended)
+
+```bash
+# Install agent-browser globally
+npm install -g agent-browser
+
+# Install browser binaries
+agent-browser install
+```
+
+### Example: Building from Source
+
+```bash
+# Clone the repository
+git clone https://github.com/vercel-labs/agent-browser.git
+cd agent-browser
+
+# Install dependencies
+pnpm install
+
+# Build the project
+pnpm build
+
+# For native builds
+pnpm build:native
+
+# Link globally (optional)
+pnpm link --global
+```
+
+### Example: Linux System Dependencies
+
+```bash
+# Install with system dependencies (recommended)
+agent-browser install --with-deps
+
+# Or manually install Playwright dependencies
+# Ubuntu/Debian
+sudo apt-get install -y \
+  libnss3 \
+  libnspr4 \
+  libatk1.0-0 \
+  libatk-bridge2.0-0 \
+  libcups2 \
+  libdrm2 \
+  libdbus-1-3 \
+  libxkbcommon0 \
+  libxcomposite1 \
+  libxdamage1 \
+  libxfixes3 \
+  libxrandr2 \
+  libgbm1 \
+  libasound2
+
+# Fedora
+sudo dnf install -y \
+  nss \
+  nspr \
+  atk \
+  at-spi2-atk \
+  cups-libs \
+  libdrm \
+  dbus \
+  libxkbcommon \
+  libXcomposite \
+  libXdamage \
+  libXfixes \
+  libXrandr \
+  mesa-libgbm \
+  alsa-lib
+```
+
+### Example: Custom Executable Path
+
+```bash
+# Set custom browser executable path
+export AGENT_BROWSER_EXECUTABLE_PATH=/path/to/chromium
+
+# Or use --executable-path flag
+agent-browser open example.com --executable-path /path/to/chromium
+```
+
+### Example: Verify Installation
+
+```bash
+# Check version
+agent-browser --version
+
+# Test basic command
+agent-browser open example.com
+```
+
+### Key Points
+
+- Install globally with `npm install -g agent-browser`
+- Run `agent-browser install` to download browser binaries
+- Install system dependencies on Linux
+- Use custom executable path if needed
+- Verify installation with `--version` flag

+ 132 - 0
skills/agent-browser/examples/options/global-options.md

@@ -0,0 +1,132 @@
+# Global Options | 全局选项
+
+## Instructions
+
+This example demonstrates global options available in agent-browser.
+
+### Key Concepts
+
+- Session management
+- Headers configuration
+- Headed/headless mode
+- Executable path
+- CDP integration
+- Debug mode
+- JSON output
+
+### Example: Session Management
+
+```bash
+# Create named session
+agent-browser open https://example.com --session my-session
+
+# Use session in subsequent commands
+agent-browser click @e1 --session my-session
+agent-browser fill @e2 "text" --session my-session
+
+# Session maintains browser state
+```
+
+### Example: Headers Configuration
+
+```bash
+# Set custom headers
+agent-browser open https://example.com --headers '{"User-Agent": "MyBot/1.0"}'
+
+# Or use environment variable
+export AGENT_BROWSER_HEADERS='{"User-Agent": "MyBot/1.0"}'
+agent-browser open https://example.com
+```
+
+### Example: Headed Mode
+
+```bash
+# Run in headed mode (visible browser)
+agent-browser open https://example.com --headed
+
+# Useful for debugging
+agent-browser snapshot --headed
+agent-browser click @e1 --headed
+```
+
+### Example: Executable Path
+
+```bash
+# Use custom browser executable
+agent-browser open https://example.com --executable-path /path/to/chromium
+
+# Or use environment variable
+export AGENT_BROWSER_EXECUTABLE_PATH=/path/to/chromium
+agent-browser open https://example.com
+```
+
+### Example: CDP Integration
+
+```bash
+# Connect to existing Chrome via CDP
+agent-browser open https://example.com --cdp 9222
+
+# Use with Chrome running with remote debugging
+# chrome --remote-debugging-port=9222
+```
+
+### Example: Debug Mode
+
+```bash
+# Enable debug output
+agent-browser open https://example.com --debug
+
+# Debug shows detailed information
+agent-browser snapshot --debug
+```
+
+### Example: JSON Output
+
+```bash
+# Get JSON output for all commands
+agent-browser open https://example.com --json
+agent-browser snapshot --json
+agent-browser click @e1 --json
+agent-browser get text @e1 --json
+```
+
+### Example: Combining Options
+
+```bash
+# Use multiple options together
+agent-browser open https://example.com \
+  --session my-task \
+  --headed \
+  --headers '{"User-Agent": "MyBot"}' \
+  --json
+
+# All subsequent commands can use session
+agent-browser snapshot --session my-task --json
+agent-browser click @e1 --session my-task --json
+```
+
+### Example: Environment Variables
+
+```bash
+# Set session via environment
+export AGENT_BROWSER_SESSION=my-session
+agent-browser open https://example.com
+agent-browser click @e1  # Uses my-session automatically
+
+# Set executable path
+export AGENT_BROWSER_EXECUTABLE_PATH=/path/to/chromium
+
+# Set headers
+export AGENT_BROWSER_HEADERS='{"User-Agent": "MyBot"}'
+```
+
+### Key Points
+
+- Use `--session` to maintain state across commands
+- Use `--headers` for custom HTTP headers
+- Use `--headed` for visible browser (debugging)
+- Use `--executable-path` for custom browser
+- Use `--cdp` for Chrome DevTools Protocol
+- Use `--debug` for detailed output
+- Use `--json` for machine-readable output
+- Options can be set via environment variables

+ 114 - 0
skills/agent-browser/examples/options/session-options.md

@@ -0,0 +1,114 @@
+# Session Options | 会话选项
+
+## Instructions
+
+This example demonstrates session management options in agent-browser.
+
+### Key Concepts
+
+- Creating sessions
+- Using sessions
+- Session state
+- Session persistence
+- Environment variables
+
+### Example: Creating Sessions
+
+```bash
+# Create session on open
+agent-browser open https://example.com --session my-session
+
+# Session is created and maintained
+```
+
+### Example: Using Sessions
+
+```bash
+# All commands can use the session
+agent-browser open https://example.com --session task1
+agent-browser snapshot --session task1
+agent-browser click @e1 --session task1
+agent-browser fill @e2 "text" --session task1
+agent-browser click @e3 --session task1
+```
+
+### Example: Session State
+
+```bash
+# Session maintains browser state
+agent-browser open https://example.com --session login
+agent-browser fill @e1 "user@example.com" --session login
+agent-browser fill @e2 "password" --session login
+agent-browser click @e3 --session login
+
+# Now logged in, continue in same session
+agent-browser snapshot --session login
+agent-browser click @e4 --session login
+```
+
+### Example: Multiple Sessions
+
+```bash
+# Create multiple independent sessions
+agent-browser open https://site1.com --session session1
+agent-browser open https://site2.com --session session2
+
+# Work with each independently
+agent-browser snapshot --session session1
+agent-browser snapshot --session session2
+```
+
+### Example: Environment Variable
+
+```bash
+# Set session via environment variable
+export AGENT_BROWSER_SESSION=my-session
+
+# Commands automatically use session
+agent-browser open https://example.com
+agent-browser snapshot
+agent-browser click @e1
+```
+
+### Example: Session with JSON
+
+```bash
+# Session with JSON output
+agent-browser open https://example.com --session task1 --json
+agent-browser snapshot --session task1 --json
+agent-browser click @e1 --session task1 --json
+```
+
+### Example: Session Workflow
+
+```bash
+# Complete workflow with session
+agent-browser open https://example.com/login --session login-task --json
+
+# Step 1: Analyze page
+agent-browser snapshot --session login-task --json
+
+# Step 2: Fill form
+agent-browser fill @e1 "user@example.com" --session login-task --json
+agent-browser fill @e2 "password" --session login-task --json
+
+# Step 3: Submit
+agent-browser click @e3 --session login-task --json
+
+# Step 4: Verify
+agent-browser snapshot --session login-task --json
+
+# Step 5: Continue
+agent-browser click @e4 --session login-task --json
+```
+
+### Key Points
+
+- Use `--session <name>` to create/maintain sessions
+- Sessions preserve browser state
+- All commands can use `--session`
+- Multiple sessions can run independently
+- Set session via environment variable
+- Sessions work with JSON output
+- Sessions maintain cookies and state
+- Use sessions for multi-step workflows

+ 143 - 0
skills/agent-browser/examples/options/snapshot-options.md

@@ -0,0 +1,143 @@
+# Snapshot Options | 快照选项
+
+## Instructions
+
+This example demonstrates snapshot-specific options in agent-browser.
+
+### Key Concepts
+
+- Interactive snapshot
+- Compact format
+- Depth limit
+- Selector filter
+- Full snapshot
+- Name option
+- Exact match
+
+### Example: Interactive Snapshot
+
+```bash
+# Interactive mode for selecting elements
+agent-browser snapshot -i
+
+# Or long form
+agent-browser snapshot --interactive
+
+# Allows interactive element selection
+```
+
+### Example: Compact Format
+
+```bash
+# Compact snapshot output
+agent-browser snapshot -c
+
+# Or long form
+agent-browser snapshot --compact
+
+# More concise output format
+```
+
+### Example: Depth Limit
+
+```bash
+# Limit snapshot depth
+agent-browser snapshot -d 2
+
+# Or long form
+agent-browser snapshot --depth 2
+
+# Limits how deep the tree goes
+```
+
+### Example: Selector Filter
+
+```bash
+# Snapshot specific element and its children
+agent-browser snapshot -s "main"
+
+# Or long form
+agent-browser snapshot --selector "main"
+
+# Only snapshots matching selector
+```
+
+### Example: Full Snapshot
+
+```bash
+# Full snapshot (all details)
+agent-browser snapshot --full
+
+# Or short form
+agent-browser snapshot -f
+
+# Includes all element details
+```
+
+### Example: Name Option
+
+```bash
+# Snapshot with name filter
+agent-browser snapshot -n "Submit"
+
+# Or long form
+agent-browser snapshot --name "Submit"
+
+# Filters by accessible name
+```
+
+### Example: Exact Match
+
+```bash
+# Exact name match
+agent-browser snapshot --name "Submit" --exact
+
+# Or short form
+agent-browser snapshot -n "Submit" -e
+
+# Requires exact name match
+```
+
+### Example: Combining Snapshot Options
+
+```bash
+# Interactive, compact, with depth limit
+agent-browser snapshot -i -c -d 2
+
+# Full snapshot of specific selector
+agent-browser snapshot --full -s "form"
+
+# JSON output with compact format
+agent-browser snapshot -c --json
+
+# Interactive snapshot with JSON
+agent-browser snapshot -i --json
+```
+
+### Example: Snapshot Workflow
+
+```bash
+# 1. Get full snapshot
+agent-browser snapshot --full --json
+
+# 2. Get compact snapshot for overview
+agent-browser snapshot -c --json
+
+# 3. Get snapshot of specific area
+agent-browser snapshot -s "main" --json
+
+# 4. Interactive snapshot to find element
+agent-browser snapshot -i --json
+```
+
+### Key Points
+
+- Use `-i` for interactive element selection
+- Use `-c` for compact, concise output
+- Use `-d` to limit tree depth
+- Use `-s` to snapshot specific element
+- Use `--full` for complete details
+- Use `-n` to filter by name
+- Use `--exact` for exact name matching
+- Combine options as needed
+- Always use `--json` in agent mode

+ 82 - 0
skills/agent-browser/examples/quick-start/quick-start.md

@@ -0,0 +1,82 @@
+# Quick Start | 快速开始
+
+## Instructions
+
+This example demonstrates the quick start workflow with agent-browser.
+
+### Key Concepts
+
+- Basic workflow
+- Using refs
+- Traditional selectors
+- Common commands
+
+### Example: Basic Workflow
+
+```bash
+# 1. Open a page
+agent-browser open example.com
+
+# 2. Get snapshot with refs
+agent-browser snapshot
+# Output:
+# - heading "Example Domain" [ref=e1] [level=1]
+# - button "Submit" [ref=e2]
+# - textbox "Email" [ref=e3]
+# - link "Learn more" [ref=e4]
+
+# 3. Click by ref from snapshot
+agent-browser click @e2
+
+# 4. Fill by ref
+agent-browser fill @e3 "test@example.com"
+
+# 5. Get text by ref
+agent-browser get text @e1
+
+# 6. Take screenshot
+agent-browser screenshot page.png
+
+# 7. Close browser
+agent-browser close
+```
+
+### Example: Traditional Selectors
+
+```bash
+# Using CSS selectors
+agent-browser click "#submit"
+agent-browser fill "#email" "test@example.com"
+
+# Using semantic locators
+agent-browser find role button click --name "Submit"
+```
+
+### Example: Complete Workflow
+
+```bash
+# Navigate
+agent-browser open example.com
+
+# Get snapshot
+agent-browser snapshot
+
+# Interact using refs
+agent-browser click @e2
+agent-browser fill @e3 "test@example.com"
+agent-browser get text @e1
+
+# Capture
+agent-browser screenshot page.png
+
+# Close
+agent-browser close
+```
+
+### Key Points
+
+- Start with `open` to navigate
+- Use `snapshot` to get refs
+- Use refs (@e1, @e2) for interaction
+- Use traditional selectors as fallback
+- Always close when done

+ 119 - 0
skills/agent-browser/examples/selectors/refs.md

@@ -0,0 +1,119 @@
+# Refs | 引用
+
+## Instructions
+
+This example demonstrates how to use refs for element selection in agent-browser.
+
+### Key Concepts
+
+- What are refs
+- Getting refs from snapshot
+- Using refs in commands
+- Refs advantages
+- Refs workflow
+
+### Example: Getting Refs from Snapshot
+
+```bash
+# Get snapshot with refs
+agent-browser snapshot
+
+# Output example:
+# @e1 button "Submit"
+# @e2 input[name="email"]
+# @e3 a[href="/login"]
+```
+
+### Example: Using Refs in Commands
+
+```bash
+# Click using ref
+agent-browser click @e1
+
+# Fill using ref
+agent-browser fill @e2 "user@example.com"
+
+# Get text using ref
+agent-browser get text @e3
+
+# Multiple refs
+agent-browser click @e1
+agent-browser fill @e2 "text"
+agent-browser click @e3
+```
+
+### Example: Interactive Snapshot for Refs
+
+```bash
+# Interactive snapshot to select element and get ref
+agent-browser snapshot -i
+
+# This allows you to interactively select elements and see their refs
+```
+
+### Example: Refs with JSON Output
+
+```bash
+# Get snapshot as JSON with refs
+agent-browser snapshot --json
+
+# Output example:
+# {
+#   "refs": {
+#     "@e1": {
+#       "role": "button",
+#       "name": "Submit",
+#       "selector": "button.submit"
+#     },
+#     "@e2": {
+#       "role": "textbox",
+#       "name": "Email",
+#       "selector": "input[name='email']"
+#     }
+#   }
+# }
+```
+
+### Example: Complete Refs Workflow
+
+```bash
+# 1. Open page
+agent-browser open https://example.com
+
+# 2. Get snapshot with refs
+agent-browser snapshot --json > snapshot.json
+
+# 3. Parse refs from JSON (in your script)
+# @e1 = submit button
+# @e2 = email input
+# @e3 = password input
+
+# 4. Use refs for interaction
+agent-browser fill @e2 "user@example.com" --session login
+agent-browser fill @e3 "password123" --session login
+agent-browser click @e1 --session login
+```
+
+### Example: Refs Advantages
+
+```bash
+# Refs are deterministic - same element always gets same ref
+agent-browser snapshot
+# @e1 button "Login"
+
+# Even if page structure changes, ref points to same element
+agent-browser click @e1  # Always clicks the Login button
+
+# Traditional selector might break:
+agent-browser click "button.login"  # Might not work if class changes
+```
+
+### Key Points
+
+- Refs are deterministic identifiers (@e1, @e2, etc.)
+- Get refs from `snapshot` command
+- Refs are AI-friendly and stable
+- Use `--json` flag for machine-readable refs
+- Refs work better than CSS selectors for dynamic pages
+- Always snapshot before using refs
+- Refs persist within a session

+ 136 - 0
skills/agent-browser/examples/selectors/traditional-selectors.md

@@ -0,0 +1,136 @@
+# Traditional Selectors | 传统选择器
+
+## Instructions
+
+This example demonstrates how to use traditional selectors (CSS, XPath, semantic locators) in agent-browser.
+
+### Key Concepts
+
+- CSS selectors
+- XPath selectors
+- Semantic locators
+- ID and class selectors
+- When to use each type
+
+### Example: CSS Selectors
+
+```bash
+# Element selector
+agent-browser click button
+
+# Class selector
+agent-browser click .submit-button
+
+# ID selector
+agent-browser click #login-btn
+
+# Attribute selector
+agent-browser click input[name="email"]
+
+# Descendant selector
+agent-browser click form .submit
+
+# Pseudo-selector
+agent-browser click button:first-child
+```
+
+### Example: XPath Selectors
+
+```bash
+# Basic XPath
+agent-browser click "//button"
+
+# XPath with attribute
+agent-browser click "//button[@type='submit']"
+
+# XPath with text
+agent-browser click "//button[text()='Submit']"
+
+# XPath with contains
+agent-browser click "//button[contains(@class, 'submit')]"
+
+# Complex XPath
+agent-browser click "//form[@id='login']//button[@type='submit']"
+```
+
+### Example: Semantic Locators
+
+```bash
+# Role-based selector
+agent-browser click role=button
+
+# Role with name
+agent-browser click role=button name="Submit"
+
+# Role with accessible name
+agent-browser click role=textbox name="Email"
+
+# Link by accessible name
+agent-browser click role=link name="Login"
+
+# Heading by level and name
+agent-browser get text role=heading name="Welcome" level=1
+```
+
+### Example: ID and Class Selectors
+
+```bash
+# ID selector
+agent-browser click #my-button
+
+# Class selector
+agent-browser click .my-class
+
+# Multiple classes
+agent-browser click .btn.primary
+
+# Element with class
+agent-browser click button.primary
+```
+
+### Example: Combining Selectors
+
+```bash
+# CSS selector in command
+agent-browser fill input[name="email"] "user@example.com"
+
+# XPath in command
+agent-browser click "//form//button[@type='submit']"
+
+# Semantic locator in command
+agent-browser click role=button name="Submit"
+```
+
+### Example: When to Use Each Selector
+
+```bash
+# Use CSS selectors for:
+# - Simple, stable selectors
+# - Well-structured HTML
+agent-browser click button.submit
+
+# Use XPath for:
+# - Complex element relationships
+# - Text-based selection
+agent-browser click "//button[text()='Submit']"
+
+# Use semantic locators for:
+# - Accessibility-focused selection
+# - When structure might change
+agent-browser click role=button name="Submit"
+
+# Use refs for:
+# - Deterministic selection (preferred)
+# - AI agent workflows
+agent-browser click @e1
+```
+
+### Key Points
+
+- CSS selectors: Simple and fast, but can break with structure changes
+- XPath: Powerful but complex, good for text-based selection
+- Semantic locators: Accessibility-focused, more stable
+- Refs: Most reliable, preferred for AI agents
+- Choose selector type based on stability needs
+- Semantic locators are more maintainable than CSS
+- Always prefer refs when available

+ 88 - 0
skills/agent-browser/templates/ai-agent-workflow.md

@@ -0,0 +1,88 @@
+# AI Agent Workflow Template | AI 代理工作流模板
+
+## Template
+
+Complete AI agent workflow using agent-browser with JSON output.
+
+```bash
+#!/bin/bash
+
+SESSION="agent-task"
+
+# Step 1: Open page
+agent-browser open https://example.com/login --session $SESSION --json
+
+# Step 2: Get snapshot with refs (JSON)
+agent-browser snapshot --json --session $SESSION > snapshot1.json
+
+# Step 3: AI agent parses snapshot1.json
+# Identifies: @e1 = email input, @e2 = password input, @e3 = login button
+
+# Step 4: Fill form
+agent-browser fill @e1 "user@example.com" --session $SESSION --json
+agent-browser fill @e2 "password123" --session $SESSION --json
+
+# Step 5: Submit
+agent-browser click @e3 --session $SESSION --json
+
+# Step 6: Verify page changed
+agent-browser snapshot --json --session $SESSION > snapshot2.json
+
+# Step 7: AI agent analyzes snapshot2.json
+# Identifies new refs: @e4 = dashboard link, @e5 = settings button
+
+# Step 8: Continue interaction
+agent-browser click @e4 --session $SESSION --json
+agent-browser snapshot --json --session $SESSION > snapshot3.json
+```
+
+## Python Integration Example
+
+```python
+import subprocess
+import json
+
+def agent_browser(command):
+    result = subprocess.run(
+        f"agent-browser {command} --json",
+        shell=True,
+        capture_output=True,
+        text=True
+    )
+    return json.loads(result.stdout)
+
+# Workflow
+session = "my-task"
+
+# Open page
+agent_browser(f"open https://example.com --session {session}")
+
+# Get snapshot
+snapshot = agent_browser(f"snapshot --json --session {session}")
+refs = snapshot.get("refs", {})
+
+# Interact
+agent_browser(f"fill {refs['@e1']['ref']} user@example.com --session {session}")
+agent_browser(f"fill {refs['@e2']['ref']} password --session {session}")
+agent_browser(f"click {refs['@e3']['ref']} --session {session}")
+
+# Verify
+new_snapshot = agent_browser(f"snapshot --json --session {session}")
+```
+
+## Usage
+
+1. Install agent-browser: `npm install -g agent-browser && agent-browser install`
+2. Use the template workflow
+3. Parse JSON output in your agent code
+4. Use refs for element interaction
+5. Snapshot after each page change
+
+## Key Points
+
+- Always use `--json` for machine-readable output
+- Use `--session` to maintain state
+- Snapshot before and after interactions
+- Parse JSON to extract refs
+- Use refs for reliable element selection
+- Follow: open → snapshot → interact → snapshot pattern

+ 41 - 0
skills/agent-browser/templates/basic-automation.md

@@ -0,0 +1,41 @@
+# Basic Automation Template | 基础自动化模板
+
+## Template
+
+Basic browser automation workflow using agent-browser.
+
+```bash
+#!/bin/bash
+
+# Step 1: Open the page
+agent-browser open https://example.com --session my-task
+
+# Step 2: Get snapshot with refs
+agent-browser snapshot --session my-task
+
+# Step 3: Interact with elements using refs
+agent-browser click @e1 --session my-task
+agent-browser fill @e2 "text" --session my-task
+agent-browser click @e3 --session my-task
+
+# Step 4: Verify changes
+agent-browser snapshot --session my-task
+
+# Step 5: Take screenshot
+agent-browser screenshot output.png --session my-task
+```
+
+## Usage
+
+1. Install agent-browser: `npm install -g agent-browser && agent-browser install`
+2. Copy the template script
+3. Customize URLs and selectors
+4. Run the script: `bash script.sh`
+
+## Customization
+
+- Change the URL in `open` command
+- Modify refs based on snapshot output
+- Add more interaction commands
+- Adjust session name
+- Add error handling

+ 317 - 0
skills/uniapp-project-guide/CHECKLIST.md

@@ -0,0 +1,317 @@
+# uni-app 技能与官方文档对应核对清单
+
+## 核对目标
+
+确保所有 uni-app 相关技能与官方文档一一对应,每个组件和 API 都有独立的示例文件,包含原文档地址和官网全部示例。
+
+## 官方文档参考
+
+- **组件文档**: https://uniapp.dcloud.net.cn/component/
+- **API 文档**: https://uniapp.dcloud.net.cn/api/
+- **uni-app-x 组件**: https://doc.dcloud.net.cn/uni-app-x/component/
+- **uni-app-x API**: https://doc.dcloud.net.cn/uni-app-x/api/
+
+## 核对任务清单
+
+### 1. uni-app 内置组件核对
+
+#### 视图容器组件
+- [x] view - ✅ 已有文档 + ✅ 已创建示例文件 `examples/components/built-in/view.md`
+- [x] scroll-view - ✅ 已有文档 + ✅ 已创建示例文件 `examples/components/built-in/scroll-view.md`
+- [x] swiper - ✅ 已有文档 + ✅ 已创建示例文件 `examples/components/built-in/swiper.md`
+- [x] match-media - ✅ 已有文档
+- [x] movable-area - ✅ 已有文档
+- [x] movable-view - ✅ 已有文档
+- [x] cover-view - ✅ 已有文档
+- [x] cover-image - ✅ 已有文档
+
+#### 基础内容组件
+- [x] icon - ✅ 已有文档 + ✅ 已创建示例文件 `examples/components/built-in/icon.md`
+- [x] text - ✅ 已有文档 + ✅ 已创建示例文件 `examples/components/built-in/text.md`
+- [x] rich-text - ✅ 已有文档
+- [x] progress - ✅ 已有文档
+
+#### 表单组件
+- [x] button - ✅ 已有文档 + ✅ 已创建示例文件 `examples/components/built-in/button.md`
+- [x] checkbox - ✅ 已有文档 + ✅ 已创建示例文件 `examples/components/built-in/checkbox.md`
+- [x] editor - ✅ 已有文档
+- [x] form - ✅ 已有文档
+- [x] input - ✅ 已有文档 + ✅ 已创建示例文件 `examples/components/built-in/input.md`
+- [x] label - ✅ 已有文档
+- [x] picker - ✅ 已有文档
+- [x] picker-view - ✅ 已有文档
+- [x] radio - ✅ 已有文档 + ✅ 已创建示例文件 `examples/components/built-in/radio.md`
+- [x] slider - ✅ 已有文档
+- [x] switch - ✅ 已有文档
+- [x] textarea - ✅ 已有文档
+
+#### 导航组件
+- [x] navigator - ✅ 已有文档
+
+#### 媒体组件
+- [x] audio - ✅ 已有文档
+- [x] camera - ✅ 已有文档
+- [x] image - ✅ 已有文档 + ✅ 已创建示例文件 `examples/components/built-in/image.md`
+- [x] video - ✅ 已有文档
+- [x] live-player - ✅ 已有文档
+- [x] live-pusher - ✅ 已有文档
+
+#### 其他组件
+- [x] map - ✅ 已有文档
+- [x] canvas - ✅ 已有文档
+- [x] web-view - ✅ 已有文档
+- [x] ad - ✅ 已有文档
+- [x] ad-draw - ✅ 已有文档
+- [x] custom-tab-bar - ✅ 已有文档
+- [x] navigation-bar - ✅ 已有文档
+- [x] page-meta - ✅ 已有文档
+- [x] unicloud-db - ✅ 已有文档
+
+**状态**: ✅ 所有内置组件(40个)已有文档
+
+### 2. uni-ui 扩展组件核对
+
+**状态**: ✅ 所有 uni-ui 组件(44个)已有文档
+
+### 3. uni-app API 核对
+
+#### 网络请求 API
+- [x] uni.request - ✅ 已创建示例文件 `examples/api/network/request.md`
+- [ ] uni.uploadFile
+- [ ] uni.downloadFile
+- [ ] uni.connectSocket
+- [ ] uni.onSocketOpen
+- [ ] uni.onSocketError
+- [ ] uni.sendSocketMessage
+- [ ] uni.onSocketMessage
+- [ ] uni.closeSocket
+- [ ] uni.onSocketClose
+
+#### 数据存储 API
+- [x] uni.setStorage - ✅ 已创建示例文件 `examples/api/storage/set-storage.md`
+- [ ] uni.setStorageSync
+- [x] uni.getStorage - ✅ 已创建示例文件 `examples/api/storage/get-storage.md`
+- [ ] uni.getStorageSync
+- [ ] uni.getStorageInfo
+- [ ] uni.getStorageInfoSync
+- [ ] uni.removeStorage
+- [ ] uni.removeStorageSync
+- [ ] uni.clearStorage
+- [ ] uni.clearStorageSync
+
+#### 设备信息 API
+- [x] uni.getSystemInfo - ✅ 已创建示例文件 `examples/api/device/get-system-info.md`
+- [ ] uni.getSystemInfoSync
+- [ ] uni.getNetworkType
+- [ ] uni.onNetworkStatusChange
+- [ ] uni.getBatteryInfo
+- [ ] uni.getBatteryInfoSync
+- [ ] uni.setScreenBrightness
+- [ ] uni.getScreenBrightness
+- [ ] uni.setKeepScreenOn
+
+#### 界面交互 API
+- [x] uni.showToast - ✅ 已创建示例文件 `examples/api/ui/show-toast.md`
+- [x] uni.showLoading - ✅ 已创建示例文件 `examples/api/ui/show-loading.md`
+- [ ] uni.hideToast
+- [ ] uni.hideLoading
+- [x] uni.showModal - ✅ 已创建示例文件 `examples/api/ui/show-modal.md`
+- [ ] uni.showActionSheet
+- [ ] uni.setNavigationBarTitle
+- [ ] uni.setNavigationBarColor
+- [ ] uni.showNavigationBarLoading
+- [ ] uni.hideNavigationBarLoading
+- [ ] uni.setTabBarBadge
+- [ ] uni.removeTabBarBadge
+- [ ] uni.showTabBarRedDot
+- [ ] uni.hideTabBarRedDot
+- [ ] uni.setTabBarStyle
+- [ ] uni.setTabBarItem
+
+#### 位置服务 API
+- [x] uni.getLocation - ✅ 已创建示例文件 `examples/api/location/get-location.md`
+- [ ] uni.openLocation
+- [ ] uni.chooseLocation
+
+#### 媒体处理 API
+- [x] uni.chooseImage - ✅ 已创建示例文件 `examples/api/media/choose-image.md`
+- [x] uni.previewImage - ✅ 已创建示例文件 `examples/api/media/preview-image.md`
+- [ ] uni.getImageInfo
+- [ ] uni.saveImageToPhotosAlbum
+- [ ] uni.chooseVideo
+- [ ] uni.saveVideoToPhotosAlbum
+- [ ] uni.chooseMedia
+- [ ] uni.chooseFile
+
+#### 页面路由 API
+- [x] uni.navigateTo - ✅ 已创建示例文件 `examples/api/navigation/navigate-to.md`
+- [ ] uni.redirectTo
+- [ ] uni.reLaunch
+- [ ] uni.switchTab
+- [x] uni.navigateBack - ✅ 已创建示例文件 `examples/api/navigation/navigate-back.md`
+
+#### 文件操作 API
+- [ ] uni.saveFile
+- [ ] uni.getFileInfo
+- [ ] uni.getSavedFileList
+- [ ] uni.getSavedFileInfo
+- [ ] uni.removeSavedFile
+
+#### 支付 API
+- [ ] uni.requestPayment
+
+#### 分享 API
+- [ ] uni.share
+
+#### 其他 API
+- [ ] uni.canIUse
+- [ ] uni.getProvider
+- [ ] uni.login
+- [ ] uni.getUserInfo
+- [ ] uni.checkSession
+- [ ] uni.authorize
+- [ ] uni.openSetting
+- [ ] uni.getSetting
+
+**状态**: 🔄 进行中 - 已创建部分 API 独立示例文件(request.md, set-storage.md, get-storage.md, show-toast.md, show-modal.md, show-loading.md, navigate-to.md, navigate-back.md, choose-image.md, preview-image.md, get-location.md, get-system-info.md),需要继续创建其他 API 示例文件
+
+### 4. uni-app-x 组件和 API 核对
+
+**状态**: ❌ 需要创建完整的 uni-app-x 组件和 API 文档
+
+### 5. 文档完整性检查
+
+#### 每个组件文档应包含
+- [ ] 组件概述
+- [ ] 所有属性说明(类型、默认值、说明)
+- [ ] 所有事件说明
+- [ ] 插槽说明(如果有)
+- [ ] 平台兼容性表格
+- [ ] 使用示例(基础用法)
+- [ ] 更多示例(官网全部示例)
+- [ ] 官方文档链接
+
+#### 每个 API 文档应包含
+- [ ] API 概述
+- [ ] 参数说明
+- [ ] 返回值说明
+- [ ] 平台兼容性
+- [ ] 使用示例
+- [ ] 官方文档链接
+
+## 更新任务
+
+### 优先级 1: 为每个 API 创建独立示例文件
+
+**任务**: 在 `examples/api/` 目录下为每个 API 创建独立的示例文件
+
+**进度**: 
+- ✅ 已创建: `examples/api/network/request.md`
+- ✅ 已创建: `examples/api/storage/set-storage.md`
+- ✅ 已创建: `examples/api/ui/show-toast.md`
+- ✅ 已创建: `examples/api/navigation/navigate-to.md`
+- ✅ 已创建: `examples/api/navigation/navigate-back.md`
+- ✅ 已创建: `examples/api/media/choose-image.md`
+- ✅ 已创建: `examples/api/media/preview-image.md`
+- ✅ 已创建: `examples/api/location/get-location.md`
+- ✅ 已创建: `examples/api/device/get-system-info.md`
+- ✅ 已创建: `examples/api/storage/get-storage.md`
+- ✅ 已创建: `examples/api/ui/show-modal.md`
+- ✅ 已创建: `examples/api/ui/show-loading.md`
+- ⏳ 待创建: 其他所有 API 示例文件(约40+个)
+
+**需要创建的目录结构**:
+```
+examples/
+├── api/
+│   ├── network/
+│   │   ├── request.md ✅
+│   │   ├── upload-file.md ⏳
+│   │   ├── download-file.md ⏳
+│   │   └── websocket.md ⏳
+│   ├── storage/
+│   │   ├── set-storage.md ✅
+│   │   ├── get-storage.md ⏳
+│   │   └── ... ⏳
+│   ├── device/ ⏳
+│   ├── ui/
+│   │   ├── show-toast.md ✅
+│   │   └── ... ⏳
+│   ├── location/ ⏳
+│   ├── media/ ⏳
+│   ├── navigation/ ⏳
+│   ├── file/ ⏳
+│   ├── payment/ ⏳
+│   ├── share/ ⏳
+│   └── other/ ⏳
+```
+
+### 优先级 2: 为每个内置组件创建独立示例文件
+
+**任务**: 在 `examples/components/built-in/` 目录下为每个内置组件创建独立的示例文件
+
+**进度**:
+- ✅ 已创建: `examples/components/built-in/view.md`
+- ✅ 已创建: `examples/components/built-in/scroll-view.md`
+- ✅ 已创建: `examples/components/built-in/swiper.md`
+- ✅ 已创建: `examples/components/built-in/text.md`
+- ✅ 已创建: `examples/components/built-in/button.md`
+- ✅ 已创建: `examples/components/built-in/input.md`
+- ✅ 已创建: `examples/components/built-in/image.md`
+- ⏳ 待创建: 其他33个内置组件示例文件
+
+**当前进度统计**:
+- API 示例文件: 12/50+ (约24%)
+- 组件示例文件: 10/40 (25%)
+
+**需要创建的目录结构**:
+```
+examples/
+├── components/
+│   ├── built-in/
+│   │   ├── view.md ✅
+│   │   ├── scroll-view.md ⏳
+│   │   ├── swiper.md ⏳
+│   │   └── ... (其他37个组件) ⏳
+```
+
+### 优先级 3: 创建 uni-app-x 完整文档
+
+**任务**: 为 uniappx-project-guide 创建完整的组件和 API 文档
+
+**需要创建的目录结构**:
+```
+uniappx-project-guide/
+├── examples/
+│   ├── components/
+│   │   └── ... (所有 uni-app-x 组件)
+│   └── api/
+│       └── ... (所有 uni-app-x API)
+├── api/
+│   └── ... (API 参考文档)
+└── templates/
+```
+
+### 优先级 4: 验证所有文档链接
+
+**任务**: 检查所有组件和 API 文档中的官方文档链接是否正确
+
+### 优先级 5: 补充缺失的 API
+
+**任务**: 检查官方文档,找出所有 API,确保没有遗漏
+
+## 核对进度
+
+- [x] 内置组件文档完整性检查
+- [x] uni-ui 组件文档完整性检查
+- [ ] API 文档完整性检查
+- [ ] 每个 API 独立示例文件检查
+- [ ] 每个组件独立示例文件检查
+- [ ] uni-app-x 文档完整性检查
+- [ ] 官方文档链接验证
+
+## 下一步行动
+
+1. 先完成 API 独立示例文件的创建
+2. 再完成内置组件独立示例文件的创建
+3. 最后完成 uni-app-x 完整文档的创建

+ 17 - 2
skills/uniapp-project-guide/SKILL.md

@@ -116,13 +116,28 @@ uni-ui 是 DCloud 官方提供的跨端 UI 库,包含 40+ 个常用组件,
 **用途**:代码示例,包含完整的可运行代码
 
 **结构**:
+- `examples/components/built-in/` - 内置组件的完整示例代码(每个组件一个独立的 .md 文件,包含官网全部示例)
+- `examples/api/` - API 的完整示例代码(按分类组织,每个 API 一个独立的 .md 文件)
+  - `examples/api/network/` - 网络请求 API 示例
+  - `examples/api/storage/` - 数据存储 API 示例
+  - `examples/api/device/` - 设备信息 API 示例
+  - `examples/api/ui/` - 界面交互 API 示例
+  - `examples/api/location/` - 位置服务 API 示例
+  - `examples/api/media/` - 媒体处理 API 示例
+  - `examples/api/navigation/` - 页面路由 API 示例
+  - `examples/api/file/` - 文件操作 API 示例
+  - `examples/api/payment/` - 支付 API 示例
+  - `examples/api/share/` - 分享 API 示例
+  - `examples/api/other/` - 其他 API 示例
 - `examples/uni-ui/` - uni-ui 组件的完整示例代码(每个组件一个独立的 .vue 文件)
 
-**使用场景**:当需要查看组件的完整使用示例时,参考此目录下的示例文件。每个示例文件包含官网展示的所有示例场景,可直接复制使用。
+**使用场景**:当需要查看组件或 API 的完整使用示例时,参考此目录下的示例文件。每个示例文件包含官网展示的所有示例场景,可直接复制使用。
 
 **注意**:
 - references/ 和 examples/ 职责不同,不应合并。references/ 提供文档说明,examples/ 提供可运行代码。
-- 内置组件的示例代码请参考[官方文档](https://uniapp.dcloud.net.cn/component/)
+- 每个组件和 API 都有独立的示例文件,包含原文档地址和官网全部示例
+- 内置组件的示例代码在 `examples/components/built-in/` 目录
+- API 的示例代码在 `examples/api/` 目录,按分类组织
 - uni-ui 组件的完整示例代码在 `examples/uni-ui/` 目录
 
 ## 平台支持

+ 175 - 0
skills/uniapp-project-guide/UPDATE_PLAN.md

@@ -0,0 +1,175 @@
+# uni-app 技能更新计划
+
+## 更新目标
+
+确保所有 uni-app 相关技能与官方文档一一对应,每个组件和 API 都有独立的示例文件,包含原文档地址和官网全部示例。
+
+## 当前进度
+
+### ✅ 已完成
+
+1. **核对清单创建**: 已创建 `CHECKLIST.md`,列出所有需要核对的内容
+2. **目录结构创建**: 已创建 `examples/api/` 和 `examples/components/built-in/` 目录结构
+3. **示例文件创建**:
+   - ✅ `examples/api/network/request.md` - uni.request 完整示例
+   - ✅ `examples/api/storage/set-storage.md` - uni.setStorage 完整示例
+   - ✅ `examples/api/ui/show-toast.md` - uni.showToast 完整示例
+   - ✅ `examples/components/built-in/view.md` - view 组件完整示例
+4. **SKILL.md 更新**: 已更新 `SKILL.md`,添加对示例文件的引用说明
+
+### 🔄 进行中
+
+1. **API 示例文件创建**: 已创建3个,剩余约50+个待创建
+2. **组件示例文件创建**: 已创建1个,剩余39个待创建
+
+### ⏳ 待完成
+
+1. **完成所有 API 示例文件** (约50+个文件)
+2. **完成所有内置组件示例文件** (39个文件)
+3. **创建 uni-app-x 完整文档** (组件 + API)
+4. **验证所有文档链接**
+5. **补充缺失的 API**
+
+## 下一步行动
+
+### 立即执行
+
+1. **批量创建 API 示例文件**
+   - 优先创建常用 API: navigation, media, location, device
+   - 每个文件包含:官方文档链接、概述、基础用法、完整示例(官网全部示例)、平台差异、注意事项
+
+2. **批量创建组件示例文件**
+   - 优先创建常用组件: button, input, image, scroll-view, swiper
+   - 每个文件包含:官方文档链接、概述、基础用法、完整示例(官网全部示例)、属性说明、平台兼容性
+
+3. **创建示例文件模板**
+   - 为 API 和组件分别创建模板文件,便于批量生成
+
+### 后续计划
+
+1. **uni-app-x 文档创建**
+   - 创建 `uniappx-project-guide` 的完整组件和 API 文档
+   - 参考 uni-app 的结构,但针对 uni-app-x 的特性
+
+2. **文档链接验证**
+   - 检查所有文档中的官方链接是否正确
+   - 确保所有链接可访问
+
+3. **完整性检查**
+   - 对照官方文档,确保没有遗漏任何组件或 API
+   - 检查每个示例文件是否包含官网全部示例
+
+## 文件创建优先级
+
+### 高优先级(立即创建)
+
+**API 示例**:
+- navigation: navigateTo, redirectTo, switchTab, navigateBack
+- media: chooseImage, previewImage, chooseVideo
+- location: getLocation, openLocation, chooseLocation
+- device: getSystemInfo, getNetworkType
+
+**组件示例**:
+- button, input, image, scroll-view, swiper, text, icon
+
+### 中优先级(后续创建)
+
+**API 示例**:
+- 其他网络 API: uploadFile, downloadFile, WebSocket
+- 其他存储 API: getStorage, removeStorage, clearStorage
+- 其他 UI API: showModal, showActionSheet, showLoading
+- 文件 API: saveFile, getFileInfo
+- 支付和分享 API
+
+**组件示例**:
+- 表单组件: checkbox, radio, picker, switch, textarea
+- 媒体组件: video, audio, camera
+- 其他组件: map, canvas, web-view
+
+### 低优先级(最后创建)
+
+- 不常用的 API 和组件
+- 平台特定的 API 和组件
+
+## 示例文件格式标准
+
+每个示例文件应包含:
+
+1. **标题和官方文档链接**
+   ```markdown
+   # [组件/API名称] - [描述]
+   
+   ## 官方文档
+   参考官方文档:[链接]
+   ```
+
+2. **概述**
+   ```markdown
+   ## 概述
+   [简要说明组件/API的用途]
+   ```
+
+3. **基础用法**
+   ```markdown
+   ## 基础用法
+   [最简单的使用示例]
+   ```
+
+4. **完整示例**
+   ```markdown
+   ## 完整示例
+   ### 示例 1: [场景描述]
+   [代码示例]
+   
+   ### 示例 2: [场景描述]
+   [代码示例]
+   ...
+   ```
+
+5. **属性/参数说明**(如适用)
+   ```markdown
+   ## 属性说明
+   | 属性名 | 类型 | 默认值 | 说明 |
+   ...
+   ```
+
+6. **平台兼容性**
+   ```markdown
+   ## 平台兼容性
+   | 平台 | 支持情况 |
+   ...
+   ```
+
+7. **注意事项**
+   ```markdown
+   ## 注意事项
+   1. ...
+   2. ...
+   ```
+
+8. **参考资源**
+   ```markdown
+   ## 参考资源
+   - **官方文档**: [链接]
+   - **相关文档**: [链接]
+   ```
+
+## 质量检查清单
+
+每个示例文件创建后,需要检查:
+
+- [ ] 是否包含官方文档链接
+- [ ] 是否包含基础用法示例
+- [ ] 是否包含官网全部示例场景
+- [ ] 代码示例是否可以直接运行
+- [ ] 是否包含平台兼容性说明
+- [ ] 是否包含注意事项
+- [ ] 格式是否统一规范
+
+## 预计工作量
+
+- **API 示例文件**: 约50+个文件,每个文件约200-500行
+- **组件示例文件**: 39个文件,每个文件约200-500行
+- **uni-app-x 文档**: 组件 + API,约100+个文件
+
+总计约200+个文件需要创建或更新。

+ 209 - 0
skills/uniapp-project-guide/examples/api/device/get-system-info.md

@@ -0,0 +1,209 @@
+# uni.getSystemInfo - 获取系统信息示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/system/info.html#getsysteminfo
+
+## 概述
+
+`uni.getSystemInfo` 用于获取系统信息,包括设备信息、屏幕信息等。
+
+## 基础用法
+
+```javascript
+uni.getSystemInfo({
+  success: (res) => {
+    console.log('系统信息', res)
+  }
+})
+```
+
+## 完整示例
+
+### 示例 1: 获取系统信息
+
+```javascript
+uni.getSystemInfo({
+  success: (res) => {
+    console.log('手机品牌', res.brand)
+    console.log('手机型号', res.model)
+    console.log('系统版本', res.system)
+    console.log('平台', res.platform)
+    console.log('屏幕宽度', res.windowWidth)
+    console.log('屏幕高度', res.windowHeight)
+  }
+})
+```
+
+### 示例 2: 同步获取系统信息
+
+```javascript
+try {
+  const systemInfo = uni.getSystemInfoSync()
+  console.log('系统信息', systemInfo)
+} catch (err) {
+  console.error('获取失败', err)
+}
+```
+
+### 示例 3: 在页面中使用
+
+```vue
+<template>
+  <view class="container">
+    <button @click="getSystemInfo">获取系统信息</button>
+    <view v-if="systemInfo" class="info-list">
+      <view class="info-item">
+        <text class="label">手机品牌:</text>
+        <text>{{ systemInfo.brand }}</text>
+      </view>
+      <view class="info-item">
+        <text class="label">手机型号:</text>
+        <text>{{ systemInfo.model }}</text>
+      </view>
+      <view class="info-item">
+        <text class="label">系统版本:</text>
+        <text>{{ systemInfo.system }}</text>
+      </view>
+      <view class="info-item">
+        <text class="label">平台:</text>
+        <text>{{ systemInfo.platform }}</text>
+      </view>
+      <view class="info-item">
+        <text class="label">屏幕宽度:</text>
+        <text>{{ systemInfo.windowWidth }}px</text>
+      </view>
+      <view class="info-item">
+        <text class="label">屏幕高度:</text>
+        <text>{{ systemInfo.windowHeight }}px</text>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      systemInfo: null
+    }
+  },
+  onLoad() {
+    this.getSystemInfo()
+  },
+  methods: {
+    getSystemInfo() {
+      uni.getSystemInfo({
+        success: (res) => {
+          this.systemInfo = res
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style>
+.info-list {
+  margin-top: 20px;
+  padding: 20px;
+  background-color: #f5f5f5;
+  border-radius: 8px;
+}
+.info-item {
+  padding: 10px 0;
+  border-bottom: 1px solid #eee;
+}
+.label {
+  font-weight: bold;
+  color: #333;
+}
+</style>
+```
+
+### 示例 4: 适配不同屏幕
+
+```vue
+<template>
+  <view class="container" :style="containerStyle">
+    <text>自适应内容</text>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      containerStyle: {}
+    }
+  },
+  onLoad() {
+    const systemInfo = uni.getSystemInfoSync()
+    this.containerStyle = {
+      width: systemInfo.windowWidth + 'px',
+      height: systemInfo.windowHeight + 'px'
+    }
+  }
+}
+</script>
+```
+
+### 示例 5: 判断平台
+
+```javascript
+const systemInfo = uni.getSystemInfoSync()
+
+// 判断平台
+if (systemInfo.platform === 'ios') {
+  console.log('iOS 平台')
+} else if (systemInfo.platform === 'android') {
+  console.log('Android 平台')
+}
+
+// 判断是否为 App
+if (systemInfo.platform !== 'devtools') {
+  console.log('非开发工具环境')
+}
+```
+
+## 返回值说明
+
+| 参数名 | 类型 | 说明 |
+|--------|------|------|
+| brand | String | 手机品牌 |
+| model | String | 手机型号 |
+| system | String | 操作系统版本 |
+| platform | String | 客户端平台 |
+| windowWidth | Number | 窗口宽度 |
+| windowHeight | Number | 窗口高度 |
+| pixelRatio | Number | 设备像素比 |
+| screenWidth | Number | 屏幕宽度 |
+| screenHeight | Number | 屏幕高度 |
+| statusBarHeight | Number | 状态栏高度 |
+| safeArea | Object | 安全区域 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. 建议在 `onLoad` 中获取系统信息
+2. 同步版本 `getSystemInfoSync` 性能更好
+3. 不同平台返回的信息可能不同
+4. 使用 `windowWidth` 和 `windowHeight` 进行屏幕适配
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/system/info.html#getsysteminfo
+- **同步版本**: https://uniapp.dcloud.net.cn/api/system/info.html#getsysteminfosync

+ 243 - 0
skills/uniapp-project-guide/examples/api/location/get-location.md

@@ -0,0 +1,243 @@
+# uni.getLocation - 获取位置示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/location/location.html#getlocation
+
+## 概述
+
+`uni.getLocation` 用于获取当前地理位置。
+
+## 基础用法
+
+```javascript
+uni.getLocation({
+  type: 'wgs84',
+  success: (res) => {
+    console.log('当前位置', res.latitude, res.longitude)
+  }
+})
+```
+
+## 完整示例
+
+### 示例 1: 获取当前位置
+
+```javascript
+uni.getLocation({
+  type: 'wgs84',
+  success: (res) => {
+    console.log('纬度', res.latitude)
+    console.log('经度', res.longitude)
+    console.log('速度', res.speed)
+    console.log('精度', res.accuracy)
+  },
+  fail: (err) => {
+    console.error('获取位置失败', err)
+  }
+})
+```
+
+### 示例 2: 高精度定位
+
+```javascript
+uni.getLocation({
+  type: 'gcj02',
+  altitude: true,
+  geocode: true,
+  success: (res) => {
+    console.log('位置信息', res)
+    // res.address 包含地址信息(需要 geocode: true)
+  }
+})
+```
+
+### 示例 3: 在页面中使用
+
+```vue
+<template>
+  <view class="container">
+    <button @click="getCurrentLocation">获取当前位置</button>
+    <view v-if="location" class="location-info">
+      <text>纬度:{{ location.latitude }}</text>
+      <text>经度:{{ location.longitude }}</text>
+      <text>地址:{{ location.address || '未获取' }}</text>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      location: null
+    }
+  },
+  methods: {
+    getCurrentLocation() {
+      uni.showLoading({
+        title: '定位中...'
+      })
+      
+      uni.getLocation({
+        type: 'gcj02',
+        geocode: true,
+        success: (res) => {
+          this.location = res
+          uni.hideLoading()
+          uni.showToast({
+            title: '定位成功',
+            icon: 'success'
+          })
+        },
+        fail: (err) => {
+          uni.hideLoading()
+          uni.showToast({
+            title: '定位失败',
+            icon: 'none'
+          })
+          console.error('定位失败', err)
+        }
+      })
+    }
+  }
+}
+</script>
+```
+
+### 示例 4: 检查定位权限
+
+```javascript
+// 先检查定位权限
+uni.getSetting({
+  success: (res) => {
+    if (res.authSetting['scope.userLocation']) {
+      // 已授权,直接获取位置
+      uni.getLocation({
+        type: 'gcj02',
+        success: (res) => {
+          console.log('位置', res)
+        }
+      })
+    } else {
+      // 未授权,请求授权
+      uni.authorize({
+        scope: 'scope.userLocation',
+        success: () => {
+          uni.getLocation({
+            type: 'gcj02',
+            success: (res) => {
+              console.log('位置', res)
+            }
+          })
+        },
+        fail: () => {
+          uni.showModal({
+            title: '提示',
+            content: '需要定位权限才能使用此功能',
+            showCancel: false
+          })
+        }
+      })
+    }
+  }
+})
+```
+
+### 示例 5: 在地图上显示位置
+
+```vue
+<template>
+  <view class="container">
+    <button @click="getLocationAndShow">获取位置并显示</button>
+    <map 
+      v-if="location"
+      :latitude="location.latitude"
+      :longitude="location.longitude"
+      :markers="markers"
+      class="map"
+    ></map>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      location: null,
+      markers: []
+    }
+  },
+  methods: {
+    getLocationAndShow() {
+      uni.getLocation({
+        type: 'gcj02',
+        success: (res) => {
+          this.location = res
+          this.markers = [{
+            id: 1,
+            latitude: res.latitude,
+            longitude: res.longitude,
+            title: '我的位置'
+          }]
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style>
+.map {
+  width: 100%;
+  height: 500px;
+  margin-top: 20px;
+}
+</style>
+```
+
+## 参数说明
+
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| type | String | 否 | 坐标类型,可选值:wgs84、gcj02 |
+| altitude | Boolean | 否 | 是否返回高度信息 |
+| geocode | Boolean | 否 | 是否解析地址信息 |
+
+## 返回值
+
+| 参数名 | 类型 | 说明 |
+|--------|------|------|
+| latitude | Number | 纬度 |
+| longitude | Number | 经度 |
+| speed | Number | 速度 |
+| accuracy | Number | 位置的精确度 |
+| altitude | Number | 高度(需要 altitude: true) |
+| address | Object | 地址信息(需要 geocode: true) |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅(需要 HTTPS) |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. 需要用户授权定位权限
+2. H5 平台需要 HTTPS 协议
+3. `type` 为 `gcj02` 时返回的坐标可用于地图显示
+4. `geocode` 为 true 时才能获取地址信息
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/location/location.html#getlocation
+- **打开地图**: https://uniapp.dcloud.net.cn/api/location/location.html#openlocation
+- **选择位置**: https://uniapp.dcloud.net.cn/api/location/location.html#chooselocation

+ 222 - 0
skills/uniapp-project-guide/examples/api/media/choose-image.md

@@ -0,0 +1,222 @@
+# uni.chooseImage - 选择图片示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/media/image.html#chooseimage
+
+## 概述
+
+`uni.chooseImage` 用于从本地相册选择图片或使用相机拍照。
+
+## 基础用法
+
+```javascript
+uni.chooseImage({
+  count: 1,
+  success: (res) => {
+    console.log('选择的图片', res.tempFilePaths)
+  }
+})
+```
+
+## 完整示例
+
+### 示例 1: 选择单张图片
+
+```javascript
+uni.chooseImage({
+  count: 1,
+  sizeType: ['original', 'compressed'],
+  sourceType: ['album', 'camera'],
+  success: (res) => {
+    console.log('选择的图片路径', res.tempFilePaths)
+    console.log('图片文件信息', res.tempFiles)
+  }
+})
+```
+
+### 示例 2: 选择多张图片
+
+```javascript
+uni.chooseImage({
+  count: 9, // 最多选择9张
+  sizeType: ['compressed'], // 只选择压缩图
+  sourceType: ['album'], // 只从相册选择
+  success: (res) => {
+    console.log('选择了', res.tempFilePaths.length, '张图片')
+    res.tempFilePaths.forEach((path, index) => {
+      console.log(`图片${index + 1}:`, path)
+    })
+  }
+})
+```
+
+### 示例 3: 在页面中使用
+
+```vue
+<template>
+  <view class="container">
+    <button @click="chooseImage">选择图片</button>
+    <view class="image-list">
+      <image 
+        v-for="(item, index) in imageList" 
+        :key="index"
+        :src="item"
+        mode="aspectFill"
+        class="image-item"
+        @click="previewImage(index)"
+      ></image>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      imageList: []
+    }
+  },
+  methods: {
+    chooseImage() {
+      uni.chooseImage({
+        count: 9,
+        sizeType: ['original', 'compressed'],
+        sourceType: ['album', 'camera'],
+        success: (res) => {
+          this.imageList = res.tempFilePaths
+          uni.showToast({
+            title: `选择了${res.tempFilePaths.length}张图片`,
+            icon: 'success'
+          })
+        },
+        fail: (err) => {
+          uni.showToast({
+            title: '选择图片失败',
+            icon: 'none'
+          })
+        }
+      })
+    },
+    previewImage(index) {
+      uni.previewImage({
+        current: index,
+        urls: this.imageList
+      })
+    }
+  }
+}
+</script>
+
+<style>
+.image-list {
+  display: flex;
+  flex-wrap: wrap;
+  margin-top: 20px;
+}
+.image-item {
+  width: 200rpx;
+  height: 200rpx;
+  margin: 10rpx;
+  border-radius: 8rpx;
+}
+</style>
+```
+
+### 示例 4: 上传图片
+
+```javascript
+uni.chooseImage({
+  count: 1,
+  sizeType: ['compressed'],
+  sourceType: ['album', 'camera'],
+  success: (res) => {
+    const tempFilePath = res.tempFilePaths[0]
+    
+    // 上传图片
+    uni.uploadFile({
+      url: 'https://api.example.com/upload',
+      filePath: tempFilePath,
+      name: 'file',
+      success: (uploadRes) => {
+        const data = JSON.parse(uploadRes.data)
+        console.log('上传成功', data.url)
+        uni.showToast({
+          title: '上传成功',
+          icon: 'success'
+        })
+      },
+      fail: (err) => {
+        console.error('上传失败', err)
+        uni.showToast({
+          title: '上传失败',
+          icon: 'none'
+        })
+      }
+    })
+  }
+})
+```
+
+### 示例 5: 获取图片信息
+
+```javascript
+uni.chooseImage({
+  count: 1,
+  success: (res) => {
+    const tempFilePath = res.tempFilePaths[0]
+    
+    // 获取图片信息
+    uni.getImageInfo({
+      src: tempFilePath,
+      success: (imageInfo) => {
+        console.log('图片宽度', imageInfo.width)
+        console.log('图片高度', imageInfo.height)
+        console.log('图片路径', imageInfo.path)
+      }
+    })
+  }
+})
+```
+
+## 参数说明
+
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| count | Number | 否 | 最多可以选择的图片张数,默认 9 |
+| sizeType | Array | 否 | 所选的图片的尺寸,可选值:original(原图)、compressed(压缩图) |
+| sourceType | Array | 否 | 选择图片的来源,可选值:album(相册)、camera(相机) |
+
+## 返回值
+
+| 参数名 | 类型 | 说明 |
+|--------|------|------|
+| tempFilePaths | Array | 图片的本地文件路径列表 |
+| tempFiles | Array | 图片的本地文件列表,每个文件包含 path 和 size |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. 选择的图片是临时文件,需要上传到服务器才能永久保存
+2. 临时文件路径在不同平台格式可能不同
+3. 选择图片需要用户授权,首次使用会弹出授权提示
+4. 建议使用压缩图以节省存储空间
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/media/image.html#chooseimage
+- **预览图片**: https://uniapp.dcloud.net.cn/api/media/image.html#previewimage
+- **上传文件**: https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile

+ 234 - 0
skills/uniapp-project-guide/examples/api/media/preview-image.md

@@ -0,0 +1,234 @@
+# uni.previewImage - 预览图片示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/media/image.html#previewimage
+
+## 概述
+
+`uni.previewImage` 用于预览图片,支持缩放、滑动查看多张图片。
+
+## 基础用法
+
+```javascript
+uni.previewImage({
+  urls: ['https://example.com/image1.jpg'],
+  current: 0
+})
+```
+
+## 完整示例
+
+### 示例 1: 预览单张图片
+
+```javascript
+uni.previewImage({
+  urls: ['https://example.com/image1.jpg'],
+  current: 'https://example.com/image1.jpg'
+})
+```
+
+### 示例 2: 预览多张图片
+
+```javascript
+const imageList = [
+  'https://example.com/image1.jpg',
+  'https://example.com/image2.jpg',
+  'https://example.com/image3.jpg'
+]
+
+uni.previewImage({
+  urls: imageList,
+  current: 0 // 从第一张开始
+})
+```
+
+### 示例 3: 在页面中使用
+
+```vue
+<template>
+  <view class="container">
+    <view class="image-list">
+      <image 
+        v-for="(item, index) in imageList" 
+        :key="index"
+        :src="item"
+        mode="aspectFill"
+        class="image-item"
+        @click="previewImage(index)"
+      ></image>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      imageList: [
+        'https://example.com/image1.jpg',
+        'https://example.com/image2.jpg',
+        'https://example.com/image3.jpg'
+      ]
+    }
+  },
+  methods: {
+    previewImage(index) {
+      uni.previewImage({
+        urls: this.imageList,
+        current: index
+      })
+    }
+  }
+}
+</script>
+
+<style>
+.image-list {
+  display: flex;
+  flex-wrap: wrap;
+}
+.image-item {
+  width: 200rpx;
+  height: 200rpx;
+  margin: 10rpx;
+  border-radius: 8rpx;
+}
+</style>
+```
+
+### 示例 4: 从选择图片到预览
+
+```vue
+<template>
+  <view class="container">
+    <button @click="chooseAndPreview">选择并预览图片</button>
+    <view class="image-list">
+      <image 
+        v-for="(item, index) in selectedImages" 
+        :key="index"
+        :src="item"
+        mode="aspectFill"
+        class="image-item"
+        @click="previewSelected(index)"
+      ></image>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      selectedImages: []
+    }
+  },
+  methods: {
+    chooseAndPreview() {
+      uni.chooseImage({
+        count: 9,
+        success: (res) => {
+          this.selectedImages = res.tempFilePaths
+          // 预览第一张
+          if (res.tempFilePaths.length > 0) {
+            uni.previewImage({
+              urls: res.tempFilePaths,
+              current: 0
+            })
+          }
+        }
+      })
+    },
+    previewSelected(index) {
+      uni.previewImage({
+        urls: this.selectedImages,
+        current: index
+      })
+    }
+  }
+}
+</script>
+```
+
+### 示例 5: 长按保存图片
+
+```vue
+<template>
+  <view class="container">
+    <image 
+      :src="imageUrl"
+      mode="aspectFit"
+      @longpress="saveImage"
+      class="preview-image"
+    ></image>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      imageUrl: 'https://example.com/image.jpg'
+    }
+  },
+  methods: {
+    saveImage() {
+      uni.showActionSheet({
+        itemList: ['保存图片'],
+        success: (res) => {
+          if (res.tapIndex === 0) {
+            uni.downloadFile({
+              url: this.imageUrl,
+              success: (downloadRes) => {
+                uni.saveImageToPhotosAlbum({
+                  filePath: downloadRes.tempFilePath,
+                  success: () => {
+                    uni.showToast({
+                      title: '保存成功',
+                      icon: 'success'
+                    })
+                  }
+                })
+              }
+            })
+          }
+        }
+      })
+    }
+  }
+}
+</script>
+```
+
+## 参数说明
+
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| urls | Array | 是 | 需要预览的图片 http 链接列表 |
+| current | String/Number | 否 | 当前显示图片的索引或链接 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. `urls` 必须是网络图片或已下载的本地路径
+2. `current` 可以是索引(Number)或图片链接(String)
+3. 预览时支持手势缩放和滑动切换
+4. 建议使用网络图片时确保图片可访问
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/media/image.html#previewimage
+- **选择图片**: https://uniapp.dcloud.net.cn/api/media/image.html#chooseimage

+ 177 - 0
skills/uniapp-project-guide/examples/api/navigation/navigate-back.md

@@ -0,0 +1,177 @@
+# uni.navigateBack - 返回上一页示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/router.html#navigateback
+
+## 概述
+
+`uni.navigateBack` 用于关闭当前页面,返回上一页面或多级页面。
+
+## 基础用法
+
+```javascript
+uni.navigateBack()
+```
+
+## 完整示例
+
+### 示例 1: 基本返回
+
+```javascript
+uni.navigateBack({
+  success: () => {
+    console.log('返回成功')
+  },
+  fail: (err) => {
+    console.error('返回失败', err)
+  }
+})
+```
+
+### 示例 2: 返回多级页面
+
+```javascript
+// 返回上一页
+uni.navigateBack({
+  delta: 1
+})
+
+// 返回上两页
+uni.navigateBack({
+  delta: 2
+})
+```
+
+### 示例 3: 在页面中使用
+
+```vue
+<template>
+  <view class="container">
+    <button @click="goBack">返回</button>
+    <button @click="goBackTwoPages">返回上两页</button>
+  </view>
+</template>
+
+<script>
+export default {
+  methods: {
+    goBack() {
+      uni.navigateBack()
+    },
+    goBackTwoPages() {
+      uni.navigateBack({
+        delta: 2
+      })
+    }
+  }
+}
+</script>
+```
+
+### 示例 4: 带数据返回
+
+```vue
+<!-- 当前页面 -->
+<template>
+  <view class="container">
+    <button @click="saveAndBack">保存并返回</button>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      formData: {
+        name: 'test',
+        value: '123'
+      }
+    }
+  },
+  methods: {
+    saveAndBack() {
+      // 保存数据到上一页
+      const pages = getCurrentPages()
+      const prevPage = pages[pages.length - 2]
+      if (prevPage) {
+        prevPage.setData({
+          savedData: this.formData
+        })
+      }
+      
+      uni.navigateBack()
+    }
+  }
+}
+</script>
+```
+
+### 示例 5: 返回前确认
+
+```vue
+<template>
+  <view class="container">
+    <button @click="handleBack">返回</button>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      hasChanges: false
+    }
+  },
+  methods: {
+    handleBack() {
+      if (this.hasChanges) {
+        uni.showModal({
+          title: '提示',
+          content: '有未保存的更改,确定要返回吗?',
+          success: (res) => {
+            if (res.confirm) {
+              uni.navigateBack()
+            }
+          }
+        })
+      } else {
+        uni.navigateBack()
+      }
+    }
+  }
+}
+</script>
+```
+
+## 参数说明
+
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| delta | Number | 否 | 返回的页面数,如果 delta 大于现有页面数,则返回到首页 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. `delta` 默认为 1,表示返回上一页
+2. 如果 `delta` 大于现有页面数,会返回到首页
+3. 可以通过 `getCurrentPages()` 获取页面栈信息
+4. 返回时可以传递数据给上一页
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/router.html#navigateback
+- **页面跳转**: https://uniapp.dcloud.net.cn/api/router.html#navigateto

+ 151 - 0
skills/uniapp-project-guide/examples/api/navigation/navigate-to.md

@@ -0,0 +1,151 @@
+# uni.navigateTo - 页面跳转示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/router.html#navigateto
+
+## 概述
+
+`uni.navigateTo` 用于保留当前页面,跳转到应用内的某个页面。
+
+## 基础用法
+
+```javascript
+uni.navigateTo({
+  url: '/pages/detail/detail'
+})
+```
+
+## 完整示例
+
+### 示例 1: 基本跳转
+
+```javascript
+uni.navigateTo({
+  url: '/pages/detail/detail',
+  success: () => {
+    console.log('跳转成功')
+  },
+  fail: (err) => {
+    console.error('跳转失败', err)
+  }
+})
+```
+
+### 示例 2: 带参数跳转
+
+```javascript
+// 跳转并传递参数
+uni.navigateTo({
+  url: '/pages/detail/detail?id=123&name=test'
+})
+
+// 在目标页面接收参数
+// pages/detail/detail.vue
+export default {
+  onLoad(options) {
+    console.log('接收到的参数', options)
+    // { id: '123', name: 'test' }
+  }
+}
+```
+
+### 示例 3: 传递对象参数
+
+```javascript
+// 传递对象
+const params = {
+  id: 123,
+  name: 'test',
+  data: { key: 'value' }
+}
+
+// 需要序列化
+uni.navigateTo({
+  url: `/pages/detail/detail?data=${encodeURIComponent(JSON.stringify(params))}`
+})
+
+// 在目标页面解析
+export default {
+  onLoad(options) {
+    const data = JSON.parse(decodeURIComponent(options.data))
+    console.log('解析后的数据', data)
+  }
+}
+```
+
+### 示例 4: 在组件中使用
+
+```vue
+<template>
+  <view class="container">
+    <button @click="goToDetail">查看详情</button>
+    <button @click="goToDetailWithParams">带参数跳转</button>
+  </view>
+</template>
+
+<script>
+export default {
+  methods: {
+    goToDetail() {
+      uni.navigateTo({
+        url: '/pages/detail/detail'
+      })
+    },
+    goToDetailWithParams() {
+      uni.navigateTo({
+        url: '/pages/detail/detail?id=123&name=test'
+      })
+    }
+  }
+}
+</script>
+```
+
+### 示例 5: 封装跳转函数
+
+```javascript
+// utils/navigation.js
+const navigation = {
+  // 跳转到详情页
+  toDetail(id) {
+    uni.navigateTo({
+      url: `/pages/detail/detail?id=${id}`
+    })
+  },
+  
+  // 跳转到用户页
+  toUser(userId) {
+    uni.navigateTo({
+      url: `/pages/user/user?id=${userId}`
+    })
+  },
+  
+  // 通用跳转
+  navigate(url, params = {}) {
+    const query = Object.keys(params)
+      .map(key => `${key}=${encodeURIComponent(params[key])}`)
+      .join('&')
+    const fullUrl = query ? `${url}?${query}` : url
+    uni.navigateTo({
+      url: fullUrl
+    })
+  }
+}
+
+// 使用
+navigation.toDetail(123)
+navigation.navigate('/pages/detail/detail', { id: 123, name: 'test' })
+```
+
+## 注意事项
+
+1. 不能跳转到 tabBar 页面,需要使用 `uni.switchTab`
+2. 路径前需要加 `/`,表示从根目录开始
+3. 参数会拼接在 URL 后面,长度有限制
+4. 复杂对象需要序列化后传递
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/router.html#navigateto
+- **其他路由 API**: https://uniapp.dcloud.net.cn/api/router.html

+ 287 - 0
skills/uniapp-project-guide/examples/api/network/request.md

@@ -0,0 +1,287 @@
+# uni.request - 网络请求示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/request/request.html
+
+## 概述
+
+`uni.request` 用于发起网络请求,支持 GET、POST、PUT、DELETE 等方法。
+
+## 基础用法
+
+### GET 请求
+
+```javascript
+uni.request({
+  url: 'https://api.example.com/data',
+  method: 'GET',
+  success: (res) => {
+    console.log('请求成功', res.data)
+  },
+  fail: (err) => {
+    console.error('请求失败', err)
+  }
+})
+```
+
+### POST 请求
+
+```javascript
+uni.request({
+  url: 'https://api.example.com/user',
+  method: 'POST',
+  data: {
+    name: 'John',
+    age: 30
+  },
+  header: {
+    'Content-Type': 'application/json'
+  },
+  success: (res) => {
+    console.log('请求成功', res.data)
+  }
+})
+```
+
+## 完整示例
+
+### 示例 1: 带参数的 GET 请求
+
+```javascript
+uni.request({
+  url: 'https://api.example.com/users',
+  method: 'GET',
+  data: {
+    page: 1,
+    limit: 10
+  },
+  success: (res) => {
+    if (res.statusCode === 200) {
+      console.log('用户列表', res.data)
+    }
+  },
+  fail: (err) => {
+    uni.showToast({
+      title: '请求失败',
+      icon: 'none'
+    })
+  }
+})
+```
+
+### 示例 2: POST 请求上传数据
+
+```javascript
+uni.request({
+  url: 'https://api.example.com/users',
+  method: 'POST',
+  data: {
+    name: 'John Doe',
+    email: 'john@example.com',
+    age: 30
+  },
+  header: {
+    'Content-Type': 'application/json',
+    'Authorization': 'Bearer token123'
+  },
+  success: (res) => {
+    if (res.statusCode === 200 || res.statusCode === 201) {
+      uni.showToast({
+        title: '创建成功',
+        icon: 'success'
+      })
+    }
+  }
+})
+```
+
+### 示例 3: 使用 Promise
+
+```javascript
+// Promise 方式(部分平台支持)
+uni.request({
+  url: 'https://api.example.com/data'
+}).then(res => {
+  console.log('请求成功', res.data)
+}).catch(err => {
+  console.error('请求失败', err)
+})
+```
+
+### 示例 4: 封装请求函数
+
+```javascript
+// utils/request.js
+const request = (options) => {
+  return new Promise((resolve, reject) => {
+    uni.request({
+      url: options.url,
+      method: options.method || 'GET',
+      data: options.data || {},
+      header: {
+        'Content-Type': 'application/json',
+        ...options.header
+      },
+      success: (res) => {
+        if (res.statusCode === 200) {
+          resolve(res.data)
+        } else {
+          reject(new Error(`请求失败: ${res.statusCode}`))
+        }
+      },
+      fail: (err) => {
+        reject(err)
+      }
+    })
+  })
+}
+
+// 使用
+request({
+  url: 'https://api.example.com/data',
+  method: 'GET'
+}).then(data => {
+  console.log('数据', data)
+}).catch(err => {
+  console.error('错误', err)
+})
+```
+
+### 示例 5: 请求拦截和响应拦截
+
+```javascript
+// utils/http.js
+const baseURL = 'https://api.example.com'
+
+// 请求拦截
+const requestInterceptor = (config) => {
+  // 添加 token
+  const token = uni.getStorageSync('token')
+  if (token) {
+    config.header = {
+      ...config.header,
+      'Authorization': `Bearer ${token}`
+    }
+  }
+  return config
+}
+
+// 响应拦截
+const responseInterceptor = (res) => {
+  if (res.statusCode === 401) {
+    // token 过期,跳转登录
+    uni.navigateTo({
+      url: '/pages/login/login'
+    })
+    return Promise.reject(new Error('未授权'))
+  }
+  return res.data
+}
+
+const http = {
+  request(options) {
+    const config = requestInterceptor({
+      url: baseURL + options.url,
+      method: options.method || 'GET',
+      data: options.data || {},
+      header: options.header || {}
+    })
+    
+    return new Promise((resolve, reject) => {
+      uni.request({
+        ...config,
+        success: (res) => {
+          try {
+            const data = responseInterceptor(res)
+            resolve(data)
+          } catch (err) {
+            reject(err)
+          }
+        },
+        fail: (err) => {
+          reject(err)
+        }
+      })
+    })
+  }
+}
+
+export default http
+```
+
+### 示例 6: 超时处理
+
+```javascript
+uni.request({
+  url: 'https://api.example.com/data',
+  method: 'GET',
+  timeout: 5000, // 5秒超时
+  success: (res) => {
+    console.log('请求成功', res.data)
+  },
+  fail: (err) => {
+    if (err.errMsg && err.errMsg.includes('timeout')) {
+      uni.showToast({
+        title: '请求超时',
+        icon: 'none'
+      })
+    } else {
+      uni.showToast({
+        title: '请求失败',
+        icon: 'none'
+      })
+    }
+  }
+})
+```
+
+### 示例 7: 处理不同数据类型
+
+```javascript
+// JSON 数据
+uni.request({
+  url: 'https://api.example.com/data',
+  dataType: 'json',
+  success: (res) => {
+    console.log('JSON 数据', res.data)
+  }
+})
+
+// 文本数据
+uni.request({
+  url: 'https://api.example.com/text',
+  dataType: 'text',
+  success: (res) => {
+    console.log('文本数据', res.data)
+  }
+})
+
+// ArrayBuffer 数据
+uni.request({
+  url: 'https://api.example.com/binary',
+  responseType: 'arraybuffer',
+  success: (res) => {
+    console.log('二进制数据', res.data)
+  }
+})
+```
+
+## 平台差异
+
+- **H5**: 支持 `withCredentials` 参数,用于跨域请求携带凭证
+- **App**: 支持 `sslVerify` 参数,用于验证 SSL 证书
+- **App**: 支持 `firstIpv4` 参数,DNS 解析时优先使用 IPv4
+
+## 注意事项
+
+1. 默认超时时间为 60000ms(60秒)
+2. 默认 `dataType` 为 `json`,会自动解析 JSON 数据
+3. 请求 header 中不能设置 `Referer`
+4. 部分平台支持 Promise 方式调用
+5. 建议封装统一的请求函数,便于统一处理错误和拦截
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/request/request.html
+- **网络请求最佳实践**: https://uniapp.dcloud.net.cn/api/request/request.html

+ 175 - 0
skills/uniapp-project-guide/examples/api/storage/get-storage.md

@@ -0,0 +1,175 @@
+# uni.getStorage - 获取存储数据示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorage
+
+## 概述
+
+`uni.getStorage` 用于从本地缓存中异步获取指定 key 的内容。
+
+## 基础用法
+
+```javascript
+uni.getStorage({
+  key: 'userInfo',
+  success: (res) => {
+    console.log('获取的数据', res.data)
+  }
+})
+```
+
+## 完整示例
+
+### 示例 1: 获取用户信息
+
+```javascript
+uni.getStorage({
+  key: 'userInfo',
+  success: (res) => {
+    const userInfo = res.data
+    console.log('用户信息', userInfo)
+    // 使用用户信息
+  },
+  fail: (err) => {
+    console.error('获取失败', err)
+    // 数据不存在或获取失败
+  }
+})
+```
+
+### 示例 2: 获取字符串
+
+```javascript
+uni.getStorage({
+  key: 'token',
+  success: (res) => {
+    const token = res.data
+    console.log('Token', token)
+    // 使用 token
+  }
+})
+```
+
+### 示例 3: 获取数组
+
+```javascript
+uni.getStorage({
+  key: 'shoppingCart',
+  success: (res) => {
+    const cart = res.data || []
+    console.log('购物车', cart)
+  }
+})
+```
+
+### 示例 4: 封装获取函数
+
+```javascript
+// utils/storage.js
+const storage = {
+  get(key) {
+    return new Promise((resolve, reject) => {
+      uni.getStorage({
+        key: key,
+        success: (res) => {
+          resolve(res.data)
+        },
+        fail: (err) => {
+          if (err.errMsg.includes('data not found')) {
+            resolve(null) // 数据不存在返回 null
+          } else {
+            reject(err)
+          }
+        }
+      })
+    })
+  }
+}
+
+// 使用
+storage.get('userInfo')
+  .then(data => {
+    if (data) {
+      console.log('用户信息', data)
+    } else {
+      console.log('数据不存在')
+    }
+  })
+  .catch(err => {
+    console.error('获取失败', err)
+  })
+```
+
+### 示例 5: 在页面中使用
+
+```vue
+<template>
+  <view class="container">
+    <button @click="loadUserInfo">加载用户信息</button>
+    <view v-if="userInfo" class="user-info">
+      <text>用户名:{{ userInfo.name }}</text>
+      <text>邮箱:{{ userInfo.email }}</text>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      userInfo: null
+    }
+  },
+  onLoad() {
+    this.loadUserInfo()
+  },
+  methods: {
+    loadUserInfo() {
+      uni.getStorage({
+        key: 'userInfo',
+        success: (res) => {
+          this.userInfo = res.data
+        },
+        fail: () => {
+          uni.showToast({
+            title: '未登录',
+            icon: 'none'
+          })
+        }
+      })
+    }
+  }
+}
+</script>
+```
+
+## 同步版本
+
+使用 `uni.getStorageSync` 进行同步获取:
+
+```javascript
+try {
+  const userInfo = uni.getStorageSync('userInfo')
+  if (userInfo) {
+    console.log('用户信息', userInfo)
+  } else {
+    console.log('数据不存在')
+  }
+} catch (err) {
+  console.error('获取失败', err)
+}
+```
+
+## 注意事项
+
+1. 如果 key 不存在,会触发 fail 回调
+2. 建议使用 try-catch 处理同步接口的错误
+3. 获取的数据类型与存储时一致
+4. 异步接口不会阻塞后续代码执行
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorage
+- **同步版本**: https://uniapp.dcloud.net.cn/api/storage/storage.html#getstoragesync
+- **设置存储**: https://uniapp.dcloud.net.cn/api/storage/storage.html#setstorage

+ 160 - 0
skills/uniapp-project-guide/examples/api/storage/set-storage.md

@@ -0,0 +1,160 @@
+# uni.setStorage - 数据存储示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/storage/storage.html#setstorage
+
+## 概述
+
+`uni.setStorage` 用于将数据存储在本地缓存中指定的 key 中,异步接口。
+
+## 基础用法
+
+```javascript
+uni.setStorage({
+  key: 'userInfo',
+  data: {
+    name: 'John',
+    age: 30
+  },
+  success: () => {
+    console.log('存储成功')
+  },
+  fail: (err) => {
+    console.error('存储失败', err)
+  }
+})
+```
+
+## 完整示例
+
+### 示例 1: 存储用户信息
+
+```javascript
+// 存储用户信息
+const userInfo = {
+  id: 1,
+  name: 'John Doe',
+  email: 'john@example.com',
+  avatar: 'https://example.com/avatar.jpg'
+}
+
+uni.setStorage({
+  key: 'userInfo',
+  data: userInfo,
+  success: () => {
+    uni.showToast({
+      title: '保存成功',
+      icon: 'success'
+    })
+  },
+  fail: (err) => {
+    uni.showToast({
+      title: '保存失败',
+      icon: 'none'
+    })
+  }
+})
+```
+
+### 示例 2: 存储字符串
+
+```javascript
+uni.setStorage({
+  key: 'token',
+  data: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
+  success: () => {
+    console.log('Token 已保存')
+  }
+})
+```
+
+### 示例 3: 存储数组
+
+```javascript
+const shoppingCart = [
+  { id: 1, name: '商品1', price: 99 },
+  { id: 2, name: '商品2', price: 199 }
+]
+
+uni.setStorage({
+  key: 'shoppingCart',
+  data: shoppingCart,
+  success: () => {
+    console.log('购物车已保存')
+  }
+})
+```
+
+### 示例 4: 封装存储函数
+
+```javascript
+// utils/storage.js
+const storage = {
+  set(key, data) {
+    return new Promise((resolve, reject) => {
+      uni.setStorage({
+        key: key,
+        data: data,
+        success: () => {
+          resolve()
+        },
+        fail: (err) => {
+          reject(err)
+        }
+      })
+    })
+  },
+  
+  get(key) {
+    return new Promise((resolve, reject) => {
+      uni.getStorage({
+        key: key,
+        success: (res) => {
+          resolve(res.data)
+        },
+        fail: (err) => {
+          reject(err)
+        }
+      })
+    })
+  }
+}
+
+// 使用
+storage.set('userInfo', { name: 'John' })
+  .then(() => {
+    console.log('存储成功')
+  })
+  .catch(err => {
+    console.error('存储失败', err)
+  })
+```
+
+## 同步版本
+
+使用 `uni.setStorageSync` 进行同步存储:
+
+```javascript
+try {
+  uni.setStorageSync('userInfo', {
+    name: 'John',
+    age: 30
+  })
+  console.log('存储成功')
+} catch (err) {
+  console.error('存储失败', err)
+}
+```
+
+## 注意事项
+
+1. 存储的数据会被持久化,除非手动删除或清除缓存
+2. 单个 key 允许存储的最大数据长度为 1MB
+3. 异步接口不会阻塞后续代码执行
+4. 建议使用 try-catch 处理同步接口的错误
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/storage/storage.html#setstorage
+- **同步版本**: https://uniapp.dcloud.net.cn/api/storage/storage.html#setstoragesync

+ 189 - 0
skills/uniapp-project-guide/examples/api/ui/show-loading.md

@@ -0,0 +1,189 @@
+# uni.showLoading - 加载提示示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/ui/prompt.html#showloading
+
+## 概述
+
+`uni.showLoading` 用于显示加载提示框,常用于异步操作时显示加载状态。
+
+## 基础用法
+
+```javascript
+uni.showLoading({
+  title: '加载中...'
+})
+```
+
+## 完整示例
+
+### 示例 1: 基本加载提示
+
+```javascript
+uni.showLoading({
+  title: '加载中...',
+  mask: true
+})
+
+// 操作完成后隐藏
+setTimeout(() => {
+  uni.hideLoading()
+}, 2000)
+```
+
+### 示例 2: 网络请求时显示加载
+
+```javascript
+uni.showLoading({
+  title: '加载中...',
+  mask: true
+})
+
+uni.request({
+  url: 'https://api.example.com/data',
+  success: (res) => {
+    console.log('数据', res.data)
+  },
+  complete: () => {
+    uni.hideLoading()
+  }
+})
+```
+
+### 示例 3: 在页面中使用
+
+```vue
+<template>
+  <view class="container">
+    <button @click="loadData">加载数据</button>
+    <view v-if="data">{{ data }}</view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      data: null
+    }
+  },
+  methods: {
+    loadData() {
+      uni.showLoading({
+        title: '加载中...',
+        mask: true
+      })
+      
+      // 模拟请求
+      setTimeout(() => {
+        this.data = '数据加载完成'
+        uni.hideLoading()
+        uni.showToast({
+          title: '加载成功',
+          icon: 'success'
+        })
+      }, 2000)
+    }
+  }
+}
+</script>
+```
+
+### 示例 4: 封装加载函数
+
+```javascript
+// utils/loading.js
+const loading = {
+  show(title = '加载中...') {
+    uni.showLoading({
+      title: title,
+      mask: true
+    })
+  },
+  
+  hide() {
+    uni.hideLoading()
+  },
+  
+  async withLoading(fn, title = '加载中...') {
+    this.show(title)
+    try {
+      const result = await fn()
+      return result
+    } finally {
+      this.hide()
+    }
+  }
+}
+
+// 使用
+loading.withLoading(async () => {
+  const data = await fetchData()
+  return data
+}, '加载数据中...')
+```
+
+### 示例 5: 配合请求使用
+
+```javascript
+// 显示加载
+uni.showLoading({
+  title: '提交中...',
+  mask: true
+})
+
+// 提交数据
+uni.request({
+  url: 'https://api.example.com/submit',
+  method: 'POST',
+  data: { name: 'test' },
+  success: (res) => {
+    uni.hideLoading()
+    uni.showToast({
+      title: '提交成功',
+      icon: 'success'
+    })
+  },
+  fail: (err) => {
+    uni.hideLoading()
+    uni.showToast({
+      title: '提交失败',
+      icon: 'none'
+    })
+  }
+})
+```
+
+## 参数说明
+
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| title | String | 是 | 提示的内容 |
+| mask | Boolean | 否 | 是否显示透明蒙层,防止触摸穿透 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. 必须调用 `uni.hideLoading()` 才能关闭加载提示
+2. `mask: true` 可以防止用户在加载时操作页面
+3. 建议在异步操作的开始显示,在完成时隐藏
+4. 不要在 `success` 回调中忘记调用 `hideLoading`
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/ui/prompt.html#showloading
+- **隐藏加载**: https://uniapp.dcloud.net.cn/api/ui/prompt.html#hideloading

+ 226 - 0
skills/uniapp-project-guide/examples/api/ui/show-modal.md

@@ -0,0 +1,226 @@
+# uni.showModal - 模态弹窗示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/ui/prompt.html#showmodal
+
+## 概述
+
+`uni.showModal` 用于显示模态弹窗,常用于确认操作。
+
+## 基础用法
+
+```javascript
+uni.showModal({
+  title: '提示',
+  content: '确定要删除吗?',
+  success: (res) => {
+    if (res.confirm) {
+      console.log('用户点击确定')
+    } else if (res.cancel) {
+      console.log('用户点击取消')
+    }
+  }
+})
+```
+
+## 完整示例
+
+### 示例 1: 确认删除
+
+```javascript
+uni.showModal({
+  title: '提示',
+  content: '确定要删除这条记录吗?',
+  confirmText: '删除',
+  cancelText: '取消',
+  success: (res) => {
+    if (res.confirm) {
+      // 执行删除操作
+      console.log('确认删除')
+    }
+  }
+})
+```
+
+### 示例 2: 自定义按钮文字
+
+```javascript
+uni.showModal({
+  title: '提示',
+  content: '确定要退出登录吗?',
+  confirmText: '退出',
+  cancelText: '取消',
+  confirmColor: '#ff3b30',
+  success: (res) => {
+    if (res.confirm) {
+      // 退出登录
+      uni.removeStorageSync('token')
+      uni.reLaunch({
+        url: '/pages/login/login'
+      })
+    }
+  }
+})
+```
+
+### 示例 3: 只显示确定按钮
+
+```javascript
+uni.showModal({
+  title: '提示',
+  content: '操作成功',
+  showCancel: false,
+  success: (res) => {
+    if (res.confirm) {
+      console.log('用户点击确定')
+    }
+  }
+})
+```
+
+### 示例 4: 在页面中使用
+
+```vue
+<template>
+  <view class="container">
+    <button @click="handleDelete">删除记录</button>
+    <button @click="handleLogout">退出登录</button>
+  </view>
+</template>
+
+<script>
+export default {
+  methods: {
+    handleDelete() {
+      uni.showModal({
+        title: '确认删除',
+        content: '删除后无法恢复,确定要删除吗?',
+        confirmText: '删除',
+        cancelText: '取消',
+        confirmColor: '#ff3b30',
+        success: (res) => {
+          if (res.confirm) {
+            // 执行删除
+            this.deleteRecord()
+          }
+        }
+      })
+    },
+    handleLogout() {
+      uni.showModal({
+        title: '提示',
+        content: '确定要退出登录吗?',
+        success: (res) => {
+          if (res.confirm) {
+            uni.removeStorageSync('token')
+            uni.reLaunch({
+              url: '/pages/login/login'
+            })
+          }
+        }
+      })
+    },
+    deleteRecord() {
+      // 删除逻辑
+      uni.showToast({
+        title: '删除成功',
+        icon: 'success'
+      })
+    }
+  }
+}
+</script>
+```
+
+### 示例 5: 封装确认函数
+
+```javascript
+// utils/modal.js
+const modal = {
+  confirm(title, content) {
+    return new Promise((resolve, reject) => {
+      uni.showModal({
+        title: title,
+        content: content,
+        success: (res) => {
+          if (res.confirm) {
+            resolve(true)
+          } else {
+            resolve(false)
+          }
+        },
+        fail: (err) => {
+          reject(err)
+        }
+      })
+    })
+  },
+  
+  alert(title, content) {
+    return new Promise((resolve) => {
+      uni.showModal({
+        title: title,
+        content: content,
+        showCancel: false,
+        success: () => {
+          resolve()
+        }
+      })
+    })
+  }
+}
+
+// 使用
+const result = await modal.confirm('提示', '确定要删除吗?')
+if (result) {
+  console.log('用户确认')
+} else {
+  console.log('用户取消')
+}
+```
+
+## 参数说明
+
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| title | String | 否 | 提示的标题 |
+| content | String | 否 | 提示的内容 |
+| showCancel | Boolean | 否 | 是否显示取消按钮,默认 true |
+| cancelText | String | 否 | 取消按钮的文字,默认"取消" |
+| cancelColor | String | 否 | 取消按钮的文字颜色 |
+| confirmText | String | 否 | 确认按钮的文字,默认"确定" |
+| confirmColor | String | 否 | 确认按钮的文字颜色 |
+
+## 返回值
+
+| 参数名 | 类型 | 说明 |
+|--------|------|------|
+| confirm | Boolean | 为 true 时,表示用户点击了确定按钮 |
+| cancel | Boolean | 为 true 时,表示用户点击了取消按钮 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. `title` 和 `content` 至少需要提供一个
+2. 确认和取消按钮的文字可以自定义
+3. 可以通过 `showCancel: false` 只显示确定按钮
+4. 建议用于重要的确认操作
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/ui/prompt.html#showmodal
+- **消息提示**: https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast

+ 188 - 0
skills/uniapp-project-guide/examples/api/ui/show-toast.md

@@ -0,0 +1,188 @@
+# uni.showToast - 消息提示示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast
+
+## 概述
+
+`uni.showToast` 用于显示消息提示框,常用于操作反馈。
+
+## 基础用法
+
+```javascript
+uni.showToast({
+  title: '操作成功',
+  icon: 'success'
+})
+```
+
+## 完整示例
+
+### 示例 1: 成功提示
+
+```javascript
+uni.showToast({
+  title: '操作成功',
+  icon: 'success',
+  duration: 2000
+})
+```
+
+### 示例 2: 错误提示
+
+```javascript
+uni.showToast({
+  title: '操作失败',
+  icon: 'error',
+  duration: 2000
+})
+```
+
+### 示例 3: 加载提示
+
+```javascript
+uni.showToast({
+  title: '加载中...',
+  icon: 'loading',
+  duration: 2000
+})
+```
+
+### 示例 4: 无图标提示
+
+```javascript
+uni.showToast({
+  title: '这是一条消息',
+  icon: 'none',
+  duration: 2000
+})
+```
+
+### 示例 5: 自定义图片
+
+```javascript
+uni.showToast({
+  title: '自定义图标',
+  image: '/static/custom-icon.png',
+  duration: 2000
+})
+```
+
+### 示例 6: 封装提示函数
+
+```javascript
+// utils/toast.js
+const toast = {
+  success(title, duration = 2000) {
+    uni.showToast({
+      title: title,
+      icon: 'success',
+      duration: duration
+    })
+  },
+  
+  error(title, duration = 2000) {
+    uni.showToast({
+      title: title,
+      icon: 'error',
+      duration: duration
+    })
+  },
+  
+  loading(title, duration = 2000) {
+    uni.showToast({
+      title: title,
+      icon: 'loading',
+      duration: duration
+    })
+  },
+  
+  info(title, duration = 2000) {
+    uni.showToast({
+      title: title,
+      icon: 'none',
+      duration: duration
+    })
+  }
+}
+
+// 使用
+toast.success('保存成功')
+toast.error('保存失败')
+toast.info('这是一条消息')
+```
+
+### 示例 7: 在页面中使用
+
+```vue
+<template>
+  <view class="container">
+    <button @click="handleSuccess">成功提示</button>
+    <button @click="handleError">错误提示</button>
+    <button @click="handleLoading">加载提示</button>
+  </view>
+</template>
+
+<script>
+export default {
+  methods: {
+    handleSuccess() {
+      uni.showToast({
+        title: '操作成功',
+        icon: 'success'
+      })
+    },
+    handleError() {
+      uni.showToast({
+        title: '操作失败',
+        icon: 'error'
+      })
+    },
+    handleLoading() {
+      uni.showToast({
+        title: '加载中...',
+        icon: 'loading',
+        duration: 3000
+      })
+    }
+  }
+}
+</script>
+```
+
+## 参数说明
+
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| title | String | 是 | 提示的内容 |
+| icon | String | 否 | 图标类型,可选值:success、error、loading、none |
+| image | String | 否 | 自定义图标的本地路径 |
+| duration | Number | 否 | 提示的延迟时间,单位 ms,默认 2000 |
+| mask | Boolean | 否 | 是否显示透明蒙层,防止触摸穿透 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. `title` 长度限制:微信小程序最多 7 个汉字长度
+2. 同时只能显示一个 toast,新的 toast 会覆盖旧的
+3. 使用 `uni.hideToast()` 可以手动关闭 toast
+4. `mask` 参数在某些平台可能不支持
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast
+- **隐藏提示**: https://uniapp.dcloud.net.cn/api/ui/prompt.html#hidetoast

+ 233 - 0
skills/uniapp-project-guide/examples/components/built-in/button.md

@@ -0,0 +1,233 @@
+# button 组件示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/component/button.html
+
+## 概述
+
+`button` 是按钮组件,用于触发操作。
+
+## 基础用法
+
+```vue
+<template>
+  <button @click="handleClick">点击按钮</button>
+</template>
+
+<script>
+export default {
+  methods: {
+    handleClick() {
+      console.log('按钮被点击')
+    }
+  }
+}
+</script>
+```
+
+## 完整示例
+
+### 示例 1: 按钮类型
+
+```vue
+<template>
+  <view class="container">
+    <button type="default">默认按钮</button>
+    <button type="primary">主要按钮</button>
+    <button type="warn">警告按钮</button>
+  </view>
+</template>
+
+<style>
+.container {
+  padding: 20px;
+}
+button {
+  margin-bottom: 20px;
+}
+</style>
+```
+
+### 示例 2: 按钮大小
+
+```vue
+<template>
+  <view class="container">
+    <button size="mini">小按钮</button>
+    <button size="default">默认按钮</button>
+  </view>
+</template>
+```
+
+### 示例 3: 镂空按钮
+
+```vue
+<template>
+  <view class="container">
+    <button type="primary" plain>镂空按钮</button>
+    <button type="warn" plain>镂空警告按钮</button>
+  </view>
+</template>
+```
+
+### 示例 4: 禁用按钮
+
+```vue
+<template>
+  <view class="container">
+    <button disabled>禁用按钮</button>
+    <button :disabled="isDisabled" @click="handleClick">
+      {{ isDisabled ? '已禁用' : '可点击' }}
+    </button>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      isDisabled: false
+    }
+  },
+  methods: {
+    handleClick() {
+      this.isDisabled = true
+      setTimeout(() => {
+        this.isDisabled = false
+      }, 2000)
+    }
+  }
+}
+</script>
+```
+
+### 示例 5: 加载状态
+
+```vue
+<template>
+  <view class="container">
+    <button :loading="isLoading" @click="handleSubmit">
+      提交
+    </button>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      isLoading: false
+    }
+  },
+  methods: {
+    async handleSubmit() {
+      this.isLoading = true
+      try {
+        // 模拟请求
+        await new Promise(resolve => setTimeout(resolve, 2000))
+        uni.showToast({
+          title: '提交成功',
+          icon: 'success'
+        })
+      } finally {
+        this.isLoading = false
+      }
+    }
+  }
+}
+</script>
+```
+
+### 示例 6: 表单提交
+
+```vue
+<template>
+  <form @submit="handleSubmit">
+    <input name="username" placeholder="用户名" />
+    <input name="password" type="password" placeholder="密码" />
+    <button form-type="submit">提交</button>
+    <button form-type="reset">重置</button>
+  </form>
+</template>
+
+<script>
+export default {
+  methods: {
+    handleSubmit(e) {
+      console.log('表单数据', e.detail.value)
+    }
+  }
+}
+</script>
+```
+
+### 示例 7: 开放能力(微信小程序)
+
+```vue
+<template>
+  <view class="container">
+    <!-- 获取用户信息 -->
+    <button open-type="getUserInfo" @getuserinfo="getUserInfo">
+      获取用户信息
+    </button>
+    
+    <!-- 打开客服会话 -->
+    <button open-type="contact">联系客服</button>
+    
+    <!-- 分享 -->
+    <button open-type="share">分享</button>
+    
+    <!-- 打开设置 -->
+    <button open-type="openSetting">打开设置</button>
+  </view>
+</template>
+
+<script>
+export default {
+  methods: {
+    getUserInfo(e) {
+      console.log('用户信息', e.detail.userInfo)
+    }
+  }
+}
+</script>
+```
+
+## 属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| size | String | default | 按钮的大小,可选值:default、mini |
+| type | String | default | 按钮的样式类型,可选值:primary、default、warn |
+| plain | Boolean | false | 按钮是否镂空,背景色透明 |
+| disabled | Boolean | false | 是否禁用 |
+| loading | Boolean | false | 名称前是否带 loading 图标 |
+| form-type | String | - | 用于 form 组件,可选值:submit、reset |
+| open-type | String | - | 开放能力,如:getUserInfo、contact、share 等 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. `open-type` 在不同平台支持的能力不同
+2. 按钮的样式可以通过 CSS 自定义
+3. `loading` 图标在不同平台显示可能不同
+4. 建议使用 `@click` 事件处理点击,而不是依赖 `open-type`
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/component/button.html
+- **表单组件**: https://uniapp.dcloud.net.cn/component/form.html

+ 233 - 0
skills/uniapp-project-guide/examples/components/built-in/checkbox.md

@@ -0,0 +1,233 @@
+# checkbox 组件示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/component/checkbox.html
+
+## 概述
+
+`checkbox` 是多项选择器组件,用于多选场景。
+
+## 基础用法
+
+```vue
+<template>
+  <checkbox value="option1" checked>选项1</checkbox>
+</template>
+```
+
+## 完整示例
+
+### 示例 1: 单个复选框
+
+```vue
+<template>
+  <view class="container">
+    <checkbox value="agree" :checked="isAgreed" @tap="handleChange">
+      我已阅读并同意协议
+    </checkbox>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      isAgreed: false
+    }
+  },
+  methods: {
+    handleChange(e) {
+      this.isAgreed = e.detail.value.length > 0
+      console.log('选中状态', this.isAgreed)
+    }
+  }
+}
+</script>
+```
+
+### 示例 2: 复选框组
+
+```vue
+<template>
+  <view class="container">
+    <checkbox-group @change="handleGroupChange">
+      <label v-for="item in options" :key="item.value" class="checkbox-item">
+        <checkbox :value="item.value" :checked="item.checked" />
+        <text>{{ item.label }}</text>
+      </label>
+    </checkbox-group>
+    <text>已选择:{{ selectedValues.join(', ') }}</text>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      options: [
+        { value: 'option1', label: '选项1', checked: false },
+        { value: 'option2', label: '选项2', checked: false },
+        { value: 'option3', label: '选项3', checked: false }
+      ],
+      selectedValues: []
+    }
+  },
+  methods: {
+    handleGroupChange(e) {
+      this.selectedValues = e.detail.value
+      console.log('选中的值', this.selectedValues)
+    }
+  }
+}
+</script>
+
+<style>
+.checkbox-item {
+  display: flex;
+  align-items: center;
+  padding: 10px;
+}
+</style>
+```
+
+### 示例 3: 全选功能
+
+```vue
+<template>
+  <view class="container">
+    <checkbox-group @change="handleGroupChange">
+      <label class="checkbox-item">
+        <checkbox 
+          value="all" 
+          :checked="isAllSelected"
+          @tap="handleSelectAll"
+        />
+        <text>全选</text>
+      </label>
+      <label 
+        v-for="item in list" 
+        :key="item.id"
+        class="checkbox-item"
+      >
+        <checkbox 
+          :value="item.id" 
+          :checked="item.checked"
+        />
+        <text>{{ item.name }}</text>
+      </label>
+    </checkbox-group>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      list: [
+        { id: '1', name: '项目1', checked: false },
+        { id: '2', name: '项目2', checked: false },
+        { id: '3', name: '项目3', checked: false }
+      ]
+    }
+  },
+  computed: {
+    isAllSelected() {
+      return this.list.every(item => item.checked)
+    }
+  },
+  methods: {
+    handleSelectAll() {
+      const allSelected = this.isAllSelected
+      this.list.forEach(item => {
+        item.checked = !allSelected
+      })
+    },
+    handleGroupChange(e) {
+      const selectedIds = e.detail.value.filter(id => id !== 'all')
+      this.list.forEach(item => {
+        item.checked = selectedIds.includes(item.id)
+      })
+    }
+  }
+}
+</script>
+```
+
+### 示例 4: 在表单中使用
+
+```vue
+<template>
+  <form @submit="handleSubmit">
+    <view class="form-item">
+      <text>兴趣爱好:</text>
+      <checkbox-group name="hobbies" @change="handleHobbiesChange">
+        <label v-for="hobby in hobbies" :key="hobby.value" class="checkbox-item">
+          <checkbox :value="hobby.value" />
+          <text>{{ hobby.label }}</text>
+        </label>
+      </checkbox-group>
+    </view>
+    <button form-type="submit">提交</button>
+  </form>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      hobbies: [
+        { value: 'reading', label: '阅读' },
+        { value: 'music', label: '音乐' },
+        { value: 'sports', label: '运动' },
+        { value: 'travel', label: '旅行' }
+      ],
+      selectedHobbies: []
+    }
+  },
+  methods: {
+    handleHobbiesChange(e) {
+      this.selectedHobbies = e.detail.value
+    },
+    handleSubmit(e) {
+      console.log('选中的兴趣爱好', this.selectedHobbies)
+    }
+  }
+}
+</script>
+```
+
+## 属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| value | String | - | checkbox 标识,选中时触发 change 事件,并携带 value |
+| checked | Boolean | false | 当前是否选中 |
+| disabled | Boolean | false | 是否禁用 |
+| color | String | #007aff | checkbox 的颜色 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. 需要配合 `checkbox-group` 使用才能获取选中的值
+2. `value` 用于标识不同的选项
+3. `checked` 属性控制选中状态
+4. 可以通过 `@change` 事件监听变化
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/component/checkbox.html
+- **表单组件**: https://uniapp.dcloud.net.cn/component/form.html

+ 160 - 0
skills/uniapp-project-guide/examples/components/built-in/icon.md

@@ -0,0 +1,160 @@
+# icon 组件示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/component/icon.html
+
+## 概述
+
+`icon` 是图标组件,用于显示各种图标。
+
+## 基础用法
+
+```vue
+<template>
+  <icon type="success" size="20" color="#4cd964"></icon>
+</template>
+```
+
+## 完整示例
+
+### 示例 1: 不同类型的图标
+
+```vue
+<template>
+  <view class="container">
+    <view class="icon-item">
+      <icon type="success" size="26" color="#4cd964"></icon>
+      <text>成功</text>
+    </view>
+    <view class="icon-item">
+      <icon type="info" size="26" color="#909399"></icon>
+      <text>信息</text>
+    </view>
+    <view class="icon-item">
+      <icon type="warn" size="26" color="#ff9500"></icon>
+      <text>警告</text>
+    </view>
+    <view class="icon-item">
+      <icon type="waiting" size="26" color="#007aff"></icon>
+      <text>等待</text>
+    </view>
+    <view class="icon-item">
+      <icon type="clear" size="26" color="#ff3b30"></icon>
+      <text>清除</text>
+    </view>
+    <view class="icon-item">
+      <icon type="search" size="26" color="#333"></icon>
+      <text>搜索</text>
+    </view>
+  </view>
+</template>
+
+<style>
+.container {
+  display: flex;
+  flex-wrap: wrap;
+  padding: 20px;
+}
+.icon-item {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin: 20px;
+}
+</style>
+```
+
+### 示例 2: 不同大小的图标
+
+```vue
+<template>
+  <view class="container">
+    <icon type="success" size="20" color="#4cd964"></icon>
+    <icon type="success" size="30" color="#4cd964"></icon>
+    <icon type="success" size="40" color="#4cd964"></icon>
+    <icon type="success" size="50" color="#4cd964"></icon>
+  </view>
+</template>
+
+<style>
+.container {
+  display: flex;
+  align-items: center;
+  gap: 20px;
+  padding: 20px;
+}
+</style>
+```
+
+### 示例 3: 不同颜色的图标
+
+```vue
+<template>
+  <view class="container">
+    <icon type="success" size="30" color="#4cd964"></icon>
+    <icon type="success" size="30" color="#007aff"></icon>
+    <icon type="success" size="30" color="#ff3b30"></icon>
+    <icon type="success" size="30" color="#ff9500"></icon>
+  </view>
+</template>
+```
+
+### 示例 4: 在按钮中使用
+
+```vue
+<template>
+  <view class="container">
+    <button class="icon-button">
+      <icon type="search" size="20" color="#fff"></icon>
+      <text>搜索</text>
+    </button>
+    <button class="icon-button">
+      <icon type="success" size="20" color="#fff"></icon>
+      <text>确认</text>
+    </button>
+  </view>
+</template>
+
+<style>
+.icon-button {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+}
+</style>
+```
+
+## 属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| type | String | - | icon 的类型,可选值:success、info、warn、waiting、clear、search 等 |
+| size | Number | 23 | icon 的大小,单位 px |
+| color | String | - | icon 的颜色,同 CSS 的 color |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. `type` 的值在不同平台可能不同
+2. 建议使用 uni-icons 组件库获得更多图标
+3. `size` 单位为 px,不是 rpx
+4. `color` 可以使用任何 CSS 颜色值
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/component/icon.html
+- **uni-icons**: https://ext.dcloud.net.cn/plugin?id=28

+ 373 - 0
skills/uniapp-project-guide/examples/components/built-in/image.md

@@ -0,0 +1,373 @@
+# image 组件示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/component/image.html
+
+## 概述
+
+`image` 是图片组件,用于显示图片。
+
+## 基础用法
+
+```vue
+<template>
+  <image src="/static/logo.png" mode="aspectFit"></image>
+</template>
+```
+
+## 完整示例
+
+### 示例 1: 图片显示模式
+
+```vue
+<template>
+  <view class="container">
+    <view class="image-item">
+      <text>scaleToFill(默认)</text>
+      <image 
+        src="/static/logo.png" 
+        mode="scaleToFill"
+        style="width: 200px; height: 200px;"
+      ></image>
+    </view>
+    
+    <view class="image-item">
+      <text>aspectFit</text>
+      <image 
+        src="/static/logo.png" 
+        mode="aspectFit"
+        style="width: 200px; height: 200px;"
+      ></image>
+    </view>
+    
+    <view class="image-item">
+      <text>aspectFill</text>
+      <image 
+        src="/static/logo.png" 
+        mode="aspectFill"
+        style="width: 200px; height: 200px;"
+      ></image>
+    </view>
+    
+    <view class="image-item">
+      <text>widthFix</text>
+      <image 
+        src="/static/logo.png" 
+        mode="widthFix"
+        style="width: 200px;"
+      ></image>
+    </view>
+  </view>
+</template>
+
+<style>
+.container {
+  padding: 20px;
+}
+.image-item {
+  margin-bottom: 30px;
+}
+</style>
+```
+
+### 示例 2: 图片列表
+
+```vue
+<template>
+  <view class="container">
+    <view class="image-list">
+      <image 
+        v-for="(item, index) in imageList" 
+        :key="index"
+        :src="item"
+        mode="aspectFill"
+        class="image-item"
+        @click="previewImage(index)"
+      ></image>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      imageList: [
+        'https://example.com/image1.jpg',
+        'https://example.com/image2.jpg',
+        'https://example.com/image3.jpg'
+      ]
+    }
+  },
+  methods: {
+    previewImage(index) {
+      uni.previewImage({
+        current: index,
+        urls: this.imageList
+      })
+    }
+  }
+}
+</script>
+
+<style>
+.image-list {
+  display: flex;
+  flex-wrap: wrap;
+}
+.image-item {
+  width: 200rpx;
+  height: 200rpx;
+  margin: 10rpx;
+  border-radius: 8rpx;
+}
+</style>
+```
+
+### 示例 3: 图片懒加载
+
+```vue
+<template>
+  <scroll-view scroll-y class="scroll-view">
+    <image 
+      v-for="(item, index) in imageList" 
+      :key="index"
+      :src="item"
+      mode="aspectFill"
+      lazy-load
+      class="lazy-image"
+    ></image>
+  </scroll-view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      imageList: [
+        'https://example.com/image1.jpg',
+        'https://example.com/image2.jpg',
+        // ... 更多图片
+      ]
+    }
+  }
+}
+</script>
+
+<style>
+.scroll-view {
+  height: 100vh;
+}
+.lazy-image {
+  width: 100%;
+  height: 400rpx;
+  margin-bottom: 20rpx;
+}
+</style>
+```
+
+### 示例 4: 图片加载和错误处理
+
+```vue
+<template>
+  <view class="container">
+    <image 
+      :src="imageUrl"
+      mode="aspectFit"
+      @load="handleLoad"
+      @error="handleError"
+      :class="{ 'error-image': hasError }"
+    ></image>
+    <text v-if="hasError" class="error-text">图片加载失败</text>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      imageUrl: 'https://example.com/image.jpg',
+      hasError: false
+    }
+  },
+  methods: {
+    handleLoad(e) {
+      console.log('图片加载成功', e.detail)
+      this.hasError = false
+    },
+    handleError(e) {
+      console.error('图片加载失败', e.detail)
+      this.hasError = true
+    }
+  }
+}
+</script>
+
+<style>
+.error-image {
+  background-color: #f5f5f5;
+}
+.error-text {
+  color: #ff3b30;
+  font-size: 24rpx;
+  margin-top: 10rpx;
+}
+</style>
+```
+
+### 示例 5: 占位图和加载状态
+
+```vue
+<template>
+  <view class="container">
+    <view class="image-wrapper">
+      <image 
+        v-if="!imageLoaded"
+        src="/static/placeholder.png"
+        mode="aspectFit"
+        class="placeholder"
+      ></image>
+      <image 
+        :src="imageUrl"
+        mode="aspectFit"
+        @load="imageLoaded = true"
+        :class="{ 'hidden': !imageLoaded }"
+        class="main-image"
+      ></image>
+      <view v-if="loading" class="loading">加载中...</view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      imageUrl: 'https://example.com/image.jpg',
+      imageLoaded: false,
+      loading: true
+    }
+  },
+  methods: {
+    handleLoad() {
+      this.imageLoaded = true
+      this.loading = false
+    }
+  }
+}
+</script>
+
+<style>
+.image-wrapper {
+  position: relative;
+  width: 400rpx;
+  height: 400rpx;
+}
+.placeholder {
+  width: 100%;
+  height: 100%;
+}
+.main-image {
+  width: 100%;
+  height: 100%;
+}
+.hidden {
+  display: none;
+}
+.loading {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  color: #999;
+}
+</style>
+```
+
+### 示例 6: 网络图片和本地图片
+
+```vue
+<template>
+  <view class="container">
+    <!-- 本地图片 -->
+    <image src="/static/logo.png" mode="aspectFit"></image>
+    
+    <!-- 网络图片 -->
+    <image 
+      src="https://example.com/image.jpg" 
+      mode="aspectFit"
+    ></image>
+    
+    <!-- 动态图片 -->
+    <image 
+      :src="dynamicImageUrl" 
+      mode="aspectFit"
+    ></image>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      dynamicImageUrl: 'https://example.com/image.jpg'
+    }
+  }
+}
+</script>
+```
+
+## 属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| src | String | - | 图片资源地址 |
+| mode | String | scaleToFill | 图片裁剪、缩放的模式 |
+| lazy-load | Boolean | false | 图片懒加载 |
+| webp | Boolean | false | 是否启用 webp 格式 |
+
+## mode 可选值
+
+| 值 | 说明 |
+|----|------|
+| scaleToFill | 不保持纵横比缩放图片,使图片的宽高完全拉伸至填满 image 元素 |
+| aspectFit | 保持纵横比缩放图片,使图片的长边能完全显示出来 |
+| aspectFill | 保持纵横比缩放图片,只保证图片的短边能完全显示出来 |
+| widthFix | 宽度不变,高度自动变化,保持原图宽高比不变 |
+| heightFix | 高度不变,宽度自动变化,保持原图宽高比不变 |
+| top | 不缩放图片,只显示图片的顶部区域 |
+| bottom | 不缩放图片,只显示图片的底部区域 |
+| center | 不缩放图片,只显示图片的中间区域 |
+| left | 不缩放图片,只显示图片的左边区域 |
+| right | 不缩放图片,只显示图片的右边区域 |
+| top left | 不缩放图片,只显示图片的左上边区域 |
+| top right | 不缩放图片,只显示图片的右上边区域 |
+| bottom left | 不缩放图片,只显示图片的左下边区域 |
+| bottom right | 不缩放图片,只显示图片的右下边区域 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. 网络图片需要配置合法域名
+2. 本地图片路径需要使用 `/static/` 开头
+3. `lazy-load` 只对 page 和 scroll-view 下的 image 有效
+4. 建议使用合适的 `mode` 值以优化显示效果
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/component/image.html
+- **预览图片**: https://uniapp.dcloud.net.cn/api/media/image.html#previewimage

+ 331 - 0
skills/uniapp-project-guide/examples/components/built-in/input.md

@@ -0,0 +1,331 @@
+# input 组件示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/component/input.html
+
+## 概述
+
+`input` 是单行输入框组件,用于用户输入文本。
+
+## 基础用法
+
+```vue
+<template>
+  <input v-model="value" placeholder="请输入内容" />
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      value: ''
+    }
+  }
+}
+</script>
+```
+
+## 完整示例
+
+### 示例 1: 基本输入框
+
+```vue
+<template>
+  <view class="container">
+    <input 
+      v-model="inputValue" 
+      placeholder="请输入内容"
+      @input="handleInput"
+    />
+    <text>输入的内容:{{ inputValue }}</text>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      inputValue: ''
+    }
+  },
+  methods: {
+    handleInput(e) {
+      this.inputValue = e.detail.value
+    }
+  }
+}
+</script>
+```
+
+### 示例 2: 不同类型的输入框
+
+```vue
+<template>
+  <view class="container">
+    <input type="text" placeholder="文本输入" />
+    <input type="number" placeholder="数字输入" />
+    <input type="digit" placeholder="带小数点的数字" />
+    <input type="idcard" placeholder="身份证号" />
+    <input type="tel" placeholder="电话号码" />
+    <input type="safe-password" placeholder="安全密码" />
+    <input type="nickname" placeholder="昵称" />
+  </view>
+</template>
+```
+
+### 示例 3: 密码输入框
+
+```vue
+<template>
+  <view class="container">
+    <input 
+      type="text"
+      password
+      placeholder="请输入密码"
+      v-model="password"
+    />
+    <input 
+      type="text"
+      :password="!showPassword"
+      placeholder="显示/隐藏密码"
+      v-model="password2"
+    />
+    <button @click="showPassword = !showPassword">
+      {{ showPassword ? '隐藏' : '显示' }}密码
+    </button>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      password: '',
+      password2: '',
+      showPassword: false
+    }
+  }
+}
+</script>
+```
+
+### 示例 4: 限制输入长度
+
+```vue
+<template>
+  <view class="container">
+    <input 
+      v-model="value"
+      placeholder="最多输入10个字符"
+      maxlength="10"
+      @input="handleInput"
+    />
+    <text>已输入:{{ value.length }}/10</text>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      value: ''
+    }
+  },
+  methods: {
+    handleInput(e) {
+      this.value = e.detail.value
+    }
+  }
+}
+</script>
+```
+
+### 示例 5: 获取焦点
+
+```vue
+<template>
+  <view class="container">
+    <input 
+      ref="input"
+      v-model="value"
+      placeholder="点击按钮获取焦点"
+      :focus="isFocused"
+    />
+    <button @click="focusInput">获取焦点</button>
+    <button @click="blurInput">失去焦点</button>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      value: '',
+      isFocused: false
+    }
+  },
+  methods: {
+    focusInput() {
+      this.isFocused = true
+      // 或使用组件方法
+      this.$refs.input.focus()
+    },
+    blurInput() {
+      this.isFocused = false
+      // 或使用组件方法
+      this.$refs.input.blur()
+    }
+  }
+}
+</script>
+```
+
+### 示例 6: 确认按钮
+
+```vue
+<template>
+  <view class="container">
+    <input 
+      v-model="value"
+      placeholder="输入后点击键盘确认"
+      confirm-type="search"
+      @confirm="handleConfirm"
+    />
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      value: ''
+    }
+  },
+  methods: {
+    handleConfirm(e) {
+      console.log('确认输入', e.detail.value)
+      uni.showToast({
+        title: '搜索:' + e.detail.value,
+        icon: 'none'
+      })
+    }
+  }
+}
+</script>
+```
+
+### 示例 7: 表单验证
+
+```vue
+<template>
+  <view class="container">
+    <input 
+      v-model="email"
+      type="text"
+      placeholder="请输入邮箱"
+      @blur="validateEmail"
+    />
+    <text v-if="emailError" class="error">{{ emailError }}</text>
+    
+    <input 
+      v-model="phone"
+      type="tel"
+      placeholder="请输入手机号"
+      maxlength="11"
+      @blur="validatePhone"
+    />
+    <text v-if="phoneError" class="error">{{ phoneError }}</text>
+    
+    <button @click="submit">提交</button>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      email: '',
+      phone: '',
+      emailError: '',
+      phoneError: ''
+    }
+  },
+  methods: {
+    validateEmail() {
+      const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
+      if (this.email && !emailRegex.test(this.email)) {
+        this.emailError = '邮箱格式不正确'
+      } else {
+        this.emailError = ''
+      }
+    },
+    validatePhone() {
+      const phoneRegex = /^1[3-9]\d{9}$/
+      if (this.phone && !phoneRegex.test(this.phone)) {
+        this.phoneError = '手机号格式不正确'
+      } else {
+        this.phoneError = ''
+      }
+    },
+    submit() {
+      this.validateEmail()
+      this.validatePhone()
+      if (!this.emailError && !this.phoneError) {
+        uni.showToast({
+          title: '提交成功',
+          icon: 'success'
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style>
+.error {
+  color: #ff3b30;
+  font-size: 24rpx;
+  margin-top: 10rpx;
+}
+</style>
+```
+
+## 属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| value | String | - | 输入框的初始内容 |
+| type | String | text | input 的类型,可选值:text、number、digit、idcard、tel、safe-password、nickname |
+| password | Boolean | false | 是否是密码类型 |
+| placeholder | String | - | 输入框为空时占位符 |
+| disabled | Boolean | false | 是否禁用 |
+| maxlength | Number | 140 | 最大输入长度,-1 表示不限制 |
+| focus | Boolean | false | 获取焦点 |
+| confirm-type | String | done | 设置键盘右下角按钮的文字 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. `v-model` 是双向绑定的推荐方式
+2. `maxlength` 设置为 -1 时不限制最大长度
+3. `focus` 属性在 H5 和 App 上需要特殊处理
+4. `confirm-type` 在不同平台支持的值可能不同
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/component/input.html
+- **表单组件**: https://uniapp.dcloud.net.cn/component/form.html

+ 172 - 0
skills/uniapp-project-guide/examples/components/built-in/radio.md

@@ -0,0 +1,172 @@
+# radio 组件示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/component/radio.html
+
+## 概述
+
+`radio` 是单项选择器组件,用于单选场景。
+
+## 基础用法
+
+```vue
+<template>
+  <radio value="option1" checked>选项1</radio>
+</template>
+```
+
+## 完整示例
+
+### 示例 1: 单个单选框
+
+```vue
+<template>
+  <view class="container">
+    <radio value="male" :checked="gender === 'male'" @tap="handleChange">
+      男
+    </radio>
+    <radio value="female" :checked="gender === 'female'" @tap="handleChange">
+      女
+    </radio>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      gender: 'male'
+    }
+  },
+  methods: {
+    handleChange(e) {
+      this.gender = e.detail.value
+      console.log('选择的性别', this.gender)
+    }
+  }
+}
+</script>
+```
+
+### 示例 2: 单选框组
+
+```vue
+<template>
+  <view class="container">
+    <radio-group @change="handleGroupChange">
+      <label v-for="item in options" :key="item.value" class="radio-item">
+        <radio :value="item.value" :checked="selectedValue === item.value" />
+        <text>{{ item.label }}</text>
+      </label>
+    </radio-group>
+    <text>已选择:{{ selectedValue }}</text>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      options: [
+        { value: 'option1', label: '选项1' },
+        { value: 'option2', label: '选项2' },
+        { value: 'option3', label: '选项3' }
+      ],
+      selectedValue: 'option1'
+    }
+  },
+  methods: {
+    handleGroupChange(e) {
+      this.selectedValue = e.detail.value
+      console.log('选中的值', this.selectedValue)
+    }
+  }
+}
+</script>
+
+<style>
+.radio-item {
+  display: flex;
+  align-items: center;
+  padding: 10px;
+}
+</style>
+```
+
+### 示例 3: 在表单中使用
+
+```vue
+<template>
+  <form @submit="handleSubmit">
+    <view class="form-item">
+      <text>支付方式:</text>
+      <radio-group name="payment" @change="handlePaymentChange">
+        <label v-for="method in paymentMethods" :key="method.value" class="radio-item">
+          <radio :value="method.value" />
+          <text>{{ method.label }}</text>
+        </label>
+      </radio-group>
+    </view>
+    <button form-type="submit">提交</button>
+  </form>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      paymentMethods: [
+        { value: 'alipay', label: '支付宝' },
+        { value: 'wechat', label: '微信支付' },
+        { value: 'bank', label: '银行卡' }
+      ],
+      selectedPayment: ''
+    }
+  },
+  methods: {
+    handlePaymentChange(e) {
+      this.selectedPayment = e.detail.value
+    },
+    handleSubmit(e) {
+      console.log('选择的支付方式', this.selectedPayment)
+    }
+  }
+}
+</script>
+```
+
+## 属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| value | String | - | radio 标识,选中时触发 change 事件,并携带 value |
+| checked | Boolean | false | 当前是否选中 |
+| disabled | Boolean | false | 是否禁用 |
+| color | String | #007aff | radio 的颜色 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. 需要配合 `radio-group` 使用才能获取选中的值
+2. 同一组内只能选择一个选项
+3. `value` 用于标识不同的选项
+4. `checked` 属性控制选中状态
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/component/radio.html
+- **表单组件**: https://uniapp.dcloud.net.cn/component/form.html

+ 337 - 0
skills/uniapp-project-guide/examples/components/built-in/scroll-view.md

@@ -0,0 +1,337 @@
+# scroll-view 组件示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/component/scroll-view.html
+
+## 概述
+
+`scroll-view` 是可滚动视图容器组件,用于实现可滚动的区域。
+
+## 基础用法
+
+```vue
+<template>
+  <scroll-view scroll-y class="scroll-view">
+    <view v-for="item in list" :key="item.id">{{ item.name }}</view>
+  </scroll-view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      list: [
+        { id: 1, name: '项目1' },
+        { id: 2, name: '项目2' }
+      ]
+    }
+  }
+}
+</script>
+
+<style>
+.scroll-view {
+  height: 400px;
+}
+</style>
+```
+
+## 完整示例
+
+### 示例 1: 垂直滚动
+
+```vue
+<template>
+  <scroll-view 
+    scroll-y 
+    class="scroll-view"
+    @scroll="handleScroll"
+  >
+    <view 
+      v-for="item in list" 
+      :key="item.id"
+      class="list-item"
+    >
+      {{ item.name }}
+    </view>
+  </scroll-view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      list: Array.from({ length: 50 }, (_, i) => ({
+        id: i + 1,
+        name: `项目 ${i + 1}`
+      }))
+    }
+  },
+  methods: {
+    handleScroll(e) {
+      console.log('滚动位置', e.detail.scrollTop)
+    }
+  }
+}
+</script>
+
+<style>
+.scroll-view {
+  height: 500px;
+}
+.list-item {
+  padding: 20px;
+  border-bottom: 1px solid #eee;
+}
+</style>
+```
+
+### 示例 2: 水平滚动
+
+```vue
+<template>
+  <scroll-view 
+    scroll-x 
+    class="scroll-view-horizontal"
+    show-scrollbar
+  >
+    <view 
+      v-for="item in list" 
+      :key="item.id"
+      class="horizontal-item"
+    >
+      {{ item.name }}
+    </view>
+  </scroll-view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      list: Array.from({ length: 20 }, (_, i) => ({
+        id: i + 1,
+        name: `项目 ${i + 1}`
+      }))
+    }
+  }
+}
+</script>
+
+<style>
+.scroll-view-horizontal {
+  white-space: nowrap;
+  width: 100%;
+}
+.horizontal-item {
+  display: inline-block;
+  width: 200px;
+  padding: 20px;
+  margin-right: 10px;
+  background-color: #f5f5f5;
+  border-radius: 8px;
+}
+</style>
+```
+
+### 示例 3: 下拉刷新
+
+```vue
+<template>
+  <scroll-view 
+    scroll-y 
+    class="scroll-view"
+    refresher-enabled
+    :refresher-triggered="refreshing"
+    @refresherrefresh="onRefresh"
+    @refresherrestore="onRestore"
+  >
+    <view 
+      v-for="item in list" 
+      :key="item.id"
+      class="list-item"
+    >
+      {{ item.name }}
+    </view>
+  </scroll-view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      refreshing: false,
+      list: Array.from({ length: 20 }, (_, i) => ({
+        id: i + 1,
+        name: `项目 ${i + 1}`
+      }))
+    }
+  },
+  methods: {
+    onRefresh() {
+      this.refreshing = true
+      // 模拟刷新
+      setTimeout(() => {
+        this.list = Array.from({ length: 20 }, (_, i) => ({
+          id: i + 1,
+          name: `新项目 ${i + 1}`
+        }))
+        this.refreshing = false
+        uni.showToast({
+          title: '刷新成功',
+          icon: 'success'
+        })
+      }, 2000)
+    },
+    onRestore() {
+      console.log('刷新恢复')
+    }
+  }
+}
+</script>
+```
+
+### 示例 4: 上拉加载
+
+```vue
+<template>
+  <scroll-view 
+    scroll-y 
+    class="scroll-view"
+    @scrolltolower="loadMore"
+    lower-threshold="50"
+  >
+    <view 
+      v-for="item in list" 
+      :key="item.id"
+      class="list-item"
+    >
+      {{ item.name }}
+    </view>
+    <view v-if="loading" class="loading">加载中...</view>
+  </scroll-view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      loading: false,
+      page: 1,
+      list: Array.from({ length: 20 }, (_, i) => ({
+        id: i + 1,
+        name: `项目 ${i + 1}`
+      }))
+    }
+  },
+  methods: {
+    loadMore() {
+      if (this.loading) return
+      this.loading = true
+      // 模拟加载
+      setTimeout(() => {
+        const newList = Array.from({ length: 20 }, (_, i) => ({
+          id: this.list.length + i + 1,
+          name: `项目 ${this.list.length + i + 1}`
+        }))
+        this.list = [...this.list, ...newList]
+        this.page++
+        this.loading = false
+      }, 1000)
+    }
+  }
+}
+</script>
+```
+
+### 示例 5: 滚动到指定位置
+
+```vue
+<template>
+  <view class="container">
+    <button @click="scrollToTop">滚动到顶部</button>
+    <button @click="scrollToBottom">滚动到底部</button>
+    <button @click="scrollToIndex(10)">滚动到第10项</button>
+    
+    <scroll-view 
+      scroll-y 
+      class="scroll-view"
+      :scroll-top="scrollTop"
+      scroll-with-animation
+    >
+      <view 
+        v-for="(item, index) in list" 
+        :key="item.id"
+        :id="`item-${index}`"
+        class="list-item"
+      >
+        {{ item.name }}
+      </view>
+    </scroll-view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      scrollTop: 0,
+      list: Array.from({ length: 50 }, (_, i) => ({
+        id: i + 1,
+        name: `项目 ${i + 1}`
+      }))
+    }
+  },
+  methods: {
+    scrollToTop() {
+      this.scrollTop = 0
+    },
+    scrollToBottom() {
+      this.scrollTop = 9999
+    },
+    scrollToIndex(index) {
+      // 假设每项高度为 60px
+      this.scrollTop = index * 60
+    }
+  }
+}
+</script>
+```
+
+## 属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| scroll-x | Boolean | false | 允许横向滚动 |
+| scroll-y | Boolean | false | 允许纵向滚动 |
+| scroll-top | Number | - | 设置竖向滚动条位置 |
+| scroll-left | Number | - | 设置横向滚动条位置 |
+| refresher-enabled | Boolean | false | 开启自定义下拉刷新 |
+| refresher-triggered | Boolean | false | 设置当前下拉刷新状态 |
+| lower-threshold | Number | 50 | 距底部/右边多远时触发 scrolltolower 事件 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. 使用 `scroll-y` 时必须设置固定高度
+2. 使用 `scroll-x` 时内容需要设置 `white-space: nowrap`
+3. 下拉刷新需要设置 `refresher-enabled` 和 `refresher-triggered`
+4. 上拉加载通过 `@scrolltolower` 事件实现
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/component/scroll-view.html

+ 294 - 0
skills/uniapp-project-guide/examples/components/built-in/swiper.md

@@ -0,0 +1,294 @@
+# swiper 组件示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/component/swiper.html
+
+## 概述
+
+`swiper` 是滑块视图容器组件,常用于轮播图。
+
+## 基础用法
+
+```vue
+<template>
+  <swiper class="swiper">
+    <swiper-item>
+      <view class="swiper-item">1</view>
+    </swiper-item>
+    <swiper-item>
+      <view class="swiper-item">2</view>
+    </swiper-item>
+    <swiper-item>
+      <view class="swiper-item">3</view>
+    </swiper-item>
+  </swiper>
+</template>
+
+<style>
+.swiper {
+  height: 400px;
+}
+.swiper-item {
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+</style>
+```
+
+## 完整示例
+
+### 示例 1: 基础轮播图
+
+```vue
+<template>
+  <swiper 
+    class="swiper"
+    :indicator-dots="true"
+    :autoplay="true"
+    :interval="3000"
+    :duration="500"
+  >
+    <swiper-item v-for="(item, index) in bannerList" :key="index">
+      <image 
+        :src="item.image" 
+        mode="aspectFill"
+        class="swiper-image"
+      ></image>
+    </swiper-item>
+  </swiper>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      bannerList: [
+        { image: 'https://example.com/banner1.jpg' },
+        { image: 'https://example.com/banner2.jpg' },
+        { image: 'https://example.com/banner3.jpg' }
+      ]
+    }
+  }
+}
+</script>
+
+<style>
+.swiper {
+  height: 400px;
+}
+.swiper-image {
+  width: 100%;
+  height: 100%;
+}
+</style>
+```
+
+### 示例 2: 自定义指示点
+
+```vue
+<template>
+  <swiper 
+    class="swiper"
+    :indicator-dots="true"
+    indicator-color="rgba(0, 0, 0, 0.3)"
+    indicator-active-color="#007aff"
+  >
+    <swiper-item v-for="(item, index) in list" :key="index">
+      <view class="swiper-item">{{ item }}</view>
+    </swiper-item>
+  </swiper>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      list: ['页面1', '页面2', '页面3']
+    }
+  }
+}
+</script>
+```
+
+### 示例 3: 垂直滑动
+
+```vue
+<template>
+  <swiper 
+    class="swiper-vertical"
+    :vertical="true"
+    :indicator-dots="true"
+  >
+    <swiper-item v-for="(item, index) in list" :key="index">
+      <view class="swiper-item">{{ item }}</view>
+    </swiper-item>
+  </swiper>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      list: ['页面1', '页面2', '页面3']
+    }
+  }
+}
+</script>
+
+<style>
+.swiper-vertical {
+  height: 500px;
+}
+</style>
+```
+
+### 示例 4: 切换事件
+
+```vue
+<template>
+  <view class="container">
+    <swiper 
+      class="swiper"
+      :current="current"
+      @change="handleChange"
+    >
+      <swiper-item v-for="(item, index) in list" :key="index">
+        <view class="swiper-item">{{ item }}</view>
+      </swiper-item>
+    </swiper>
+    <text>当前页:{{ current + 1 }} / {{ list.length }}</text>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      current: 0,
+      list: ['页面1', '页面2', '页面3']
+    }
+  },
+  methods: {
+    handleChange(e) {
+      this.current = e.detail.current
+      console.log('切换到', this.current + 1, '页')
+    }
+  }
+}
+</script>
+```
+
+### 示例 5: 图片轮播
+
+```vue
+<template>
+  <swiper 
+    class="swiper"
+    :indicator-dots="true"
+    :autoplay="true"
+    :interval="3000"
+    :circular="true"
+    @change="handleChange"
+  >
+    <swiper-item 
+      v-for="(item, index) in imageList" 
+      :key="index"
+      @click="handleImageClick(item)"
+    >
+      <image 
+        :src="item.url" 
+        mode="aspectFill"
+        class="swiper-image"
+      ></image>
+      <view class="image-title">{{ item.title }}</view>
+    </swiper-item>
+  </swiper>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      imageList: [
+        { url: 'https://example.com/image1.jpg', title: '标题1' },
+        { url: 'https://example.com/image2.jpg', title: '标题2' },
+        { url: 'https://example.com/image3.jpg', title: '标题3' }
+      ]
+    }
+  },
+  methods: {
+    handleChange(e) {
+      console.log('切换到', e.detail.current)
+    },
+    handleImageClick(item) {
+      uni.previewImage({
+        urls: this.imageList.map(img => img.url),
+        current: item.url
+      })
+    }
+  }
+}
+</script>
+
+<style>
+.swiper {
+  height: 400px;
+  position: relative;
+}
+.swiper-image {
+  width: 100%;
+  height: 100%;
+}
+.image-title {
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  background: linear-gradient(transparent, rgba(0,0,0,0.5));
+  color: white;
+  padding: 20px;
+}
+</style>
+```
+
+## 属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| indicator-dots | Boolean | false | 是否显示面板指示点 |
+| indicator-color | String | rgba(0, 0, 0, 0.3) | 指示点颜色 |
+| indicator-active-color | String | #000000 | 当前选中的指示点颜色 |
+| autoplay | Boolean | false | 是否自动切换 |
+| interval | Number | 5000 | 自动切换时间间隔 |
+| duration | Number | 500 | 滑动动画时长 |
+| circular | Boolean | false | 是否采用衔接滑动 |
+| vertical | Boolean | false | 滑动方向是否为纵向 |
+| current | Number | 0 | 当前所在滑块的 index |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. 必须设置固定高度才能正常显示
+2. `swiper-item` 内只能放置一个根元素
+3. `circular` 设置为 true 时可以实现循环轮播
+4. 图片轮播建议使用 `mode="aspectFill"` 保持比例
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/component/swiper.html

+ 151 - 0
skills/uniapp-project-guide/examples/components/built-in/text.md

@@ -0,0 +1,151 @@
+# text 组件示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/component/text.html
+
+## 概述
+
+`text` 是文本组件,用于显示文本内容。
+
+## 基础用法
+
+```vue
+<template>
+  <text>这是一段文本</text>
+</template>
+```
+
+## 完整示例
+
+### 示例 1: 基本文本
+
+```vue
+<template>
+  <view class="container">
+    <text>普通文本</text>
+    <text class="bold-text">加粗文本</text>
+    <text class="colored-text">彩色文本</text>
+  </view>
+</template>
+
+<style>
+.bold-text {
+  font-weight: bold;
+}
+.colored-text {
+  color: #007aff;
+}
+</style>
+```
+
+### 示例 2: 文本嵌套
+
+```vue
+<template>
+  <view class="container">
+    <text>
+      这是一段
+      <text class="highlight">高亮</text>
+      文本
+    </text>
+  </view>
+</template>
+
+<style>
+.highlight {
+  color: #ff3b30;
+  font-weight: bold;
+}
+</style>
+```
+
+### 示例 3: 文本选择
+
+```vue
+<template>
+  <view class="container">
+    <text selectable>这段文本可以选择</text>
+    <text :selectable="false">这段文本不可选择</text>
+  </view>
+</template>
+```
+
+### 示例 4: 文本换行
+
+```vue
+<template>
+  <view class="container">
+    <text class="text-wrap">
+      这是一段很长的文本,会自动换行显示。这是一段很长的文本,会自动换行显示。
+    </text>
+  </view>
+</template>
+
+<style>
+.text-wrap {
+  width: 300px;
+  word-wrap: break-word;
+}
+</style>
+```
+
+### 示例 5: 文本样式
+
+```vue
+<template>
+  <view class="container">
+    <text class="text-style">样式文本</text>
+    <text class="text-decoration">装饰文本</text>
+    <text class="text-shadow">阴影文本</text>
+  </view>
+</template>
+
+<style>
+.text-style {
+  font-size: 32rpx;
+  font-weight: bold;
+  color: #333;
+}
+.text-decoration {
+  text-decoration: underline;
+  color: #007aff;
+}
+.text-shadow {
+  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
+}
+</style>
+```
+
+## 属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| selectable | Boolean | false | 文本是否可选 |
+| user-select | Boolean | false | 文本是否可选(H5) |
+| space | String | - | 显示连续空格 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. `text` 组件内只能嵌套 `text` 组件
+2. `selectable` 属性用于控制文本是否可选择
+3. 文本样式通过 CSS 控制
+4. 建议使用 `text` 组件而不是直接在 `view` 中写文本
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/component/text.html

+ 407 - 0
skills/uniapp-project-guide/examples/components/built-in/view.md

@@ -0,0 +1,407 @@
+# view 组件示例
+
+## 官方文档
+
+参考官方文档:https://uniapp.dcloud.net.cn/component/view.html
+
+## 概述
+
+`view` 是视图容器组件,类似于 HTML 中的 `div`,用于包裹各种元素内容。
+
+## 基础用法
+
+### 基本视图容器
+
+```vue
+<template>
+  <view class="container">
+    <text>这是内容</text>
+  </view>
+</template>
+
+<style>
+.container {
+  padding: 20px;
+  background-color: #f5f5f5;
+}
+</style>
+```
+
+## 完整示例
+
+### 示例 1: Flex 布局 - 横向布局
+
+```vue
+<template>
+  <view class="uni-padding-wrap uni-common-mt">
+    <view class="uni-title uni-common-mt">
+      flex-direction: row
+      <text>\n横向布局</text>
+    </view>
+    <view class="uni-flex uni-row">
+      <view class="flex-item uni-bg-red">A</view>
+      <view class="flex-item uni-bg-green">B</view>
+      <view class="flex-item uni-bg-blue">C</view>
+    </view>
+  </view>
+</template>
+
+<style>
+.uni-flex {
+  display: flex;
+}
+.uni-row {
+  flex-direction: row;
+}
+.flex-item {
+  flex: 1;
+  height: 100px;
+  text-align: center;
+  line-height: 100px;
+}
+.uni-bg-red {
+  background-color: #ff3b30;
+}
+.uni-bg-green {
+  background-color: #4cd964;
+}
+.uni-bg-blue {
+  background-color: #007aff;
+}
+</style>
+```
+
+### 示例 2: Flex 布局 - 纵向布局
+
+```vue
+<template>
+  <view class="uni-padding-wrap uni-common-mt">
+    <view class="uni-title uni-common-mt">
+      flex-direction: column
+      <text>\n纵向布局</text>
+    </view>
+    <view class="uni-flex uni-column">
+      <view class="flex-item flex-item-V uni-bg-red">A</view>
+      <view class="flex-item flex-item-V uni-bg-green">B</view>
+      <view class="flex-item flex-item-V uni-bg-blue">C</view>
+    </view>
+  </view>
+</template>
+
+<style>
+.uni-flex {
+  display: flex;
+}
+.uni-column {
+  flex-direction: column;
+}
+.flex-item-V {
+  width: 100%;
+  height: 100px;
+  text-align: center;
+  line-height: 100px;
+}
+</style>
+```
+
+### 示例 3: 点击态效果
+
+```vue
+<template>
+  <view class="container">
+    <view 
+      class="clickable-item"
+      hover-class="hover"
+      hover-start-time="50"
+      hover-stay-time="400"
+      @click="handleClick"
+    >
+      点击我
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  methods: {
+    handleClick() {
+      uni.showToast({
+        title: '被点击了',
+        icon: 'success'
+      })
+    }
+  }
+}
+</script>
+
+<style>
+.clickable-item {
+  padding: 20px;
+  background-color: #007aff;
+  color: white;
+  text-align: center;
+  border-radius: 8px;
+}
+.hover {
+  background-color: #0051d5;
+  opacity: 0.8;
+}
+</style>
+```
+
+### 示例 4: 阻止点击态冒泡
+
+```vue
+<template>
+  <view class="container" hover-class="container-hover">
+    <view 
+      class="inner-item"
+      hover-class="inner-hover"
+      hover-stop-propagation="true"
+      @click="handleInnerClick"
+    >
+      内部元素(阻止冒泡)
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  methods: {
+    handleInnerClick() {
+      console.log('内部元素被点击')
+    }
+  }
+}
+</script>
+
+<style>
+.container {
+  padding: 40px;
+  background-color: #f5f5f5;
+}
+.container-hover {
+  background-color: #e0e0e0;
+}
+.inner-item {
+  padding: 20px;
+  background-color: #007aff;
+  color: white;
+  text-align: center;
+  border-radius: 8px;
+}
+.inner-hover {
+  background-color: #0051d5;
+}
+</style>
+```
+
+### 示例 5: 嵌套视图
+
+```vue
+<template>
+  <view class="page">
+    <view class="header">
+      <text class="title">页面标题</text>
+    </view>
+    <view class="content">
+      <view class="section">
+        <text class="section-title">第一部分</text>
+        <view class="section-content">
+          <text>这是第一部分的内容</text>
+        </view>
+      </view>
+      <view class="section">
+        <text class="section-title">第二部分</text>
+        <view class="section-content">
+          <text>这是第二部分的内容</text>
+        </view>
+      </view>
+    </view>
+    <view class="footer">
+      <text>页脚</text>
+    </view>
+  </view>
+</template>
+
+<style>
+.page {
+  min-height: 100vh;
+  display: flex;
+  flex-direction: column;
+}
+.header {
+  padding: 20px;
+  background-color: #007aff;
+  color: white;
+}
+.title {
+  font-size: 18px;
+  font-weight: bold;
+}
+.content {
+  flex: 1;
+  padding: 20px;
+}
+.section {
+  margin-bottom: 20px;
+  padding: 15px;
+  background-color: #f5f5f5;
+  border-radius: 8px;
+}
+.section-title {
+  font-size: 16px;
+  font-weight: bold;
+  margin-bottom: 10px;
+}
+.section-content {
+  padding: 10px;
+  background-color: white;
+  border-radius: 4px;
+}
+.footer {
+  padding: 20px;
+  background-color: #f5f5f5;
+  text-align: center;
+}
+</style>
+```
+
+### 示例 6: 条件渲染
+
+```vue
+<template>
+  <view class="container">
+    <view v-if="showContent" class="content">
+      <text>这是显示的内容</text>
+    </view>
+    <view v-else class="empty">
+      <text>暂无内容</text>
+    </view>
+    <button @click="toggleContent">切换显示</button>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      showContent: true
+    }
+  },
+  methods: {
+    toggleContent() {
+      this.showContent = !this.showContent
+    }
+  }
+}
+</script>
+
+<style>
+.container {
+  padding: 20px;
+}
+.content {
+  padding: 20px;
+  background-color: #4cd964;
+  color: white;
+  border-radius: 8px;
+  margin-bottom: 20px;
+}
+.empty {
+  padding: 20px;
+  background-color: #f5f5f5;
+  color: #999;
+  border-radius: 8px;
+  margin-bottom: 20px;
+  text-align: center;
+}
+</style>
+```
+
+### 示例 7: 列表渲染
+
+```vue
+<template>
+  <view class="container">
+    <view 
+      v-for="(item, index) in list" 
+      :key="index"
+      class="list-item"
+      @click="handleItemClick(item)"
+    >
+      <text>{{ item.name }}</text>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      list: [
+        { id: 1, name: '项目 1' },
+        { id: 2, name: '项目 2' },
+        { id: 3, name: '项目 3' }
+      ]
+    }
+  },
+  methods: {
+    handleItemClick(item) {
+      uni.showToast({
+        title: `点击了 ${item.name}`,
+        icon: 'none'
+      })
+    }
+  }
+}
+</script>
+
+<style>
+.container {
+  padding: 20px;
+}
+.list-item {
+  padding: 15px;
+  margin-bottom: 10px;
+  background-color: #f5f5f5;
+  border-radius: 8px;
+}
+</style>
+```
+
+## 属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| hover-class | String | none | 指定按下去的样式类 |
+| hover-stop-propagation | Boolean | false | 指定是否阻止本节点的祖先节点出现点击态 |
+| hover-start-time | Number | 50 | 按住后多久出现点击态,单位毫秒 |
+| hover-stay-time | Number | 400 | 手指松开后点击态保留时间,单位毫秒 |
+
+## 平台兼容性
+
+| 平台 | 支持情况 |
+|------|---------|
+| H5 | ✅ |
+| 微信小程序 | ✅ |
+| 支付宝小程序 | ✅ |
+| 百度小程序 | ✅ |
+| 字节跳动小程序 | ✅ |
+| QQ 小程序 | ✅ |
+| 快手小程序 | ✅ |
+| App | ✅ |
+| 快应用 | ✅ |
+
+## 注意事项
+
+1. `view` 组件本身不显示任何可视化元素,主要用于包裹其他组件
+2. 可以使用 CSS 样式控制 `view` 的显示效果
+3. 支持 Flex 布局,常用于页面布局
+4. `hover-class` 属性用于设置点击态效果
+5. `hover-stop-propagation` 在某些平台可能不支持
+
+## 参考资源
+
+- **官方文档**: https://uniapp.dcloud.net.cn/component/view.html
+- **Flex 布局**: https://uniapp.dcloud.net.cn/tutorial/css-flex.html