Files
one-pipe-system/openspec/changes/add-agent-distribution-registration-and-withdrawal/proposal.md
2026-09-17 12:16:20 +08:00

24 lines
2.7 KiB
Markdown
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.
# Change: 代理扫码分销注册与提现资料资格前端对接
## Why
新增强代理扫码分销注册与提现资料资格能力:代理可通过 H5 注册页扫码注册,审批通过后登录后台;代理本人可维护提现资料资格并发起/重提提现,超管可作废资格。后端契约已按 `docs/产品迭代8月份/frontend-api-simple.md` 落地,后台管理端当前缺少对应接口封装、独立注册页与资格管理入口。
本次前端按后端实际契约对齐:注册验码 `POST /api/c/v1/auth/send-code``scene``bind_phone`,返回 `cooldown_seconds`);扫码注册 `POST /api/c/v1/agent-distribution-registrations`(成功仅返回「待审批」);店铺列表/详情/更新响应新增 `distribution_code`;提现资料资格提交/查询/作废与提现申请重提/详情按新文档补齐。
## What Changes
- 新增 `agent-distribution-registration` 能力独立注册页挂在后台项目内、静态路由免登录访问H5 与 PC 同一套表单),支持分销码自动填、短信验证码 60s 倒计时、密码掩码与强度提示、省市区级联;提交成功进入「待审批」结束页,失败统一提示「分销码不可用」且不复用同一验证码。
- 新增公开 API 封装:`sendCode()``registerAgent()`,请求不带登录态(`requestOptions.withToken: false`)。
- 店铺模块补充 `distribution_code` 字段类型,店铺详情页展示分销码与注册二维码。
- 佣金模块新增:提现资料资格提交/替换、资格查询(证件号脱敏、含审批与作废信息)、资格作废(超管,`reason` 必填)、重提被驳回的提现、提现申请详情(含尝试记录与异常标记)。
- 扩展企微审批场景业务类型:`agent_distribution_approval``withdrawal_qualification_approval``commission_withdrawal_approval`
- 提现交互约束:资格替换合同/法人身份证后旧资格失效需重新审批;提现仅在有效资格且余额充足时可提交,否则不冻结、不建单。
- 不实现后端接口、数据库、企微回调;不实现 C 端(客户)登录体系。
## Impact
- Affected specs: `agent-distribution-registration``shop-management``commission-management``wecom-scenes`
- Affected code: `src/api/modules/agentDistribution.ts``src/api/modules/commission.ts``src/types/api/shop.ts``src/types/api/commission.ts``src/types/api/wecom.ts``src/router/routes/staticRoutes.ts``src/router/guards/permission.ts``src/views/agent-registration/index.vue``src/views/shop-management/detail/index.vue``src/views/commission-management/my-commission/index.vue``src/views/settings/wecom/scenes/index.vue`
- Dependencies: `docs/产品迭代8月份/frontend-api-simple.md`