Files
dukang/.cursor/rules/frontend-h5.mdc
T
jacy b626db5d84 feat(ops): add global test whitelist and exclude test accounts from settlement
Unify product/store visibility on HQ whitelist, mark isTest snapshots, and fix SUPER_ADMIN access for the new module.
2026-08-07 15:46:23 +08:00

57 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: 杜康好客前端 H5 / Admin 编码规范与 OWNER 边界
globs: apps/**/*.{tsx,ts}
alwaysApply: false
---
# 前端规范
## 目录约定
```
src/
├── components/ # PascalCaseAppToast.tsx
├── pages/ # *Page.tsx
├── layouts/ # *Layout.tsx
├── contexts/ # *Context.tsx
├── lib/ # kebab-caseapi.ts, client-location.ts
├── App.tsx
└── main.tsx
```
## 四 App
| App | 端口 | 负责人 | 样式 | X-Client-App |
|-----|------|--------|------|--------------|
| h5-user | 5173 | jacy-dukang | shared-ui tokens | USER_H5 |
| h5-shop | 5174 | jacy-dukang | shared-ui tokens | SHOP_H5 |
| h5-partner | 5175 | 刘京尧 | shared-ui tokens | PARTNER_H5 |
| admin-web | 5175 | jacy-dukang | Ant Design 5 | HQ_WEB |
> h5-partner 与 admin-web 勿同时 dev。H5 三端用 `@dukang/shared-ui`admin-web 独立 Ant Design。
## 隔离与请求
- 禁止 import 其他 `apps/*` 或 `server/*`
- 类型从 `@dukang/shared-types` import
- Base: `/api/v1`Headers: `Authorization` + `X-Client-App`
- Vite dev 代理 `/api` → `localhost:3000`
## UI 约束
- 使用 shared-ui CSS 变量与组件,勿各端自造设计 token
- **mini-user 微信 `openType` Button**:祖先禁止 `e.stopPropagation()`Taro→`catchtap`,选头像/手机号等会静默失效);遮罩与 sheet 拆开绑关闭。见 `.cursor/rules/mini-user-weapp-opentype.mdc`
- C 端订单 **5 Tab**(含 pending_ship
- 门店列表仅 `OPEN` 状态
- 原型 `pages/` 只读;路由对照 `pages/ROUTE_MAP.md`
## App 归属(勿改他端)
| App | 勿改 |
|-----|------|
| h5-user | shop 核销、partner 录店 |
| h5-shop | user 出码、admin 报表 |
| h5-partner | user 下单、admin 开城 |
| admin-web | 非 V2 小程序规格 |