Archive the differentiated YuXinGu product docs, AI engineering system, design contract, and Go/Vue scaffold. Next execution prioritizes Cece-parity over early innovation (see .ai/product/STRATEGY.md). Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
745 B
Markdown
34 lines
745 B
Markdown
# 06 微信小程序规范
|
||
|
||
适用:`apps/mini-program`(业务后置,先遵守结构)。
|
||
|
||
## 目录建议
|
||
|
||
```
|
||
pages/
|
||
home/
|
||
profile/
|
||
login/
|
||
setting/
|
||
components/
|
||
Avatar/
|
||
Button/
|
||
services/ # 业务请求,内部用 sdk 适配器
|
||
user.ts
|
||
order.ts
|
||
utils/
|
||
app.js / app.json / app.wxss
|
||
```
|
||
|
||
## 规则
|
||
|
||
- **不要在页面里直接写请求**;统一 `services/*`。
|
||
- 登录、存储通过适配器注入 `packages/sdk`(`wx.request` / `wx.setStorage`)。
|
||
- 组件目录 PascalCase 或微信惯用名,项目内统一一种。
|
||
- 与 H5 共享类型:`@yuxingu/types`;不共享 Vue SFC。
|
||
|
||
## 发布
|
||
|
||
- 使用独立 appid 配置,密钥不进库。
|
||
- 体验版 / 正式版环境变量与 API baseURL 分离。
|