docs(mp): 新增小程序全页面 HTML 原型 + UI 优化指南
- 新增 12 个核心页面原型(登录/首页/咨询/预约/商城/健康等) - 新增医生端分包原型(核心 + 临床两个分包) - 新增 AI 客服对话页原型 - 新增 MP UI 优化指南文档 - 更新 wiki 基础设施和小程序文档
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 开发环境
|
||||
updated: 2026-05-03
|
||||
updated: 2026-05-16
|
||||
status: stable
|
||||
tags: [infrastructure, dev-environment, windows, postgresql]
|
||||
---
|
||||
@@ -36,6 +36,7 @@ tags: [infrastructure, dev-environment, windows, postgresql]
|
||||
| 后端 API | `http://localhost:3000/api/v1` | Axum 服务 |
|
||||
| 前端 SPA | `http://localhost:5174` | Vite 开发服务器 |
|
||||
| 微信小程序 | 微信开发者工具 | 患者端小程序(`apps/miniprogram/dist/`) |
|
||||
| 小程序 H5 调试 | `http://localhost:10086` | 浏览器预览(`apps/miniprogram/dist-h5/`,代理到 `:3000`) |
|
||||
| Ollama | `http://127.0.0.1:11434` | 本地 AI 推理(qwen3:4b) |
|
||||
|
||||
### 登录凭据
|
||||
@@ -88,8 +89,10 @@ psql: `D:\postgreSQL\bin\psql.exe -U postgres -h localhost -d erp`
|
||||
|------|------|------|
|
||||
| AppID/Secret | 环境变量 `ERP__WECHAT__APPID` / `ERP__WECHAT__SECRET` | 微信登录凭据 |
|
||||
| 加密密钥 | 环境变量 `TARO_APP_ENCRYPTION_KEY` | 小程序本地存储加密密钥 |
|
||||
| API URL | `apps/miniprogram/config/index.ts` `defineConstants` | 编译时注入,默认 `http://localhost:3000/api/v1` |
|
||||
| API URL | `apps/miniprogram/.env` / `.env.h5` | 小程序用绝对路径 `http://localhost:3000/api/v1`,H5 用相对路径 `/api/v1` |
|
||||
| 开发者工具 | `apps/miniprogram/project.config.json` | `urlCheck: false`,AppID `wx20f4ef9cc2ec66c5` |
|
||||
| H5 入口 | `apps/miniprogram/src/index.html` | HtmlWebpackPlugin 模板,H5 构建必需 |
|
||||
| H5 输出 | `apps/miniprogram/dist-h5/` | 与小程序 `dist/` 分离,互不影响 |
|
||||
|
||||
> 微信凭据和加密密钥通过环境变量注入,不硬编码在源码中
|
||||
|
||||
@@ -122,6 +125,19 @@ cd apps/web && pnpm dev # 开发模式(端口 5174)
|
||||
cd apps/web && pnpm build # 构建生产版本
|
||||
```
|
||||
|
||||
### 微信小程序
|
||||
|
||||
```bash
|
||||
cd apps/miniprogram && pnpm run dev:weapp # 小程序开发模式(微信开发者工具打开 dist/)
|
||||
cd apps/miniprogram && pnpm run build:weapp # 小程序生产构建
|
||||
cd apps/miniprogram && pnpm run dev:h5 # H5 浏览器预览(端口 10086,推荐调试用)
|
||||
cd apps/miniprogram && pnpm run build:h5 # H5 生产构建
|
||||
```
|
||||
|
||||
> **调试建议:** 日常 UI 开发和页面调试优先用 `dev:h5`(浏览器热更新 + DevTools),完成后在微信开发者工具中做最终验证。H5 模式下微信特有 API(`wx.login`、`Taro.request` 微信登录态等)不可用,但页面布局和交互可完整预览。
|
||||
>
|
||||
> H5 模式通过 `.env.h5` 将 API URL 设为 `/api/v1`(相对路径),dev server 自动代理到 `localhost:3000`,无需处理 CORS。
|
||||
|
||||
### 数据库
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user