feat: add taro student learning flow

This commit is contained in:
Codex
2026-06-29 12:04:59 +08:00
parent c090008f52
commit b79c4259c0
28 changed files with 1567 additions and 12 deletions

View File

@@ -25,8 +25,8 @@
## 当前可进入的前端工作
- 可以开始搭建 `apps/taro`
- 可以复刻旧题库学生端主要视觉和交互:登录、选地区、首页、刷题、背单词、知识手册、分数线、资料、商城、个人中心、勋章。
- `apps/taro` 已经建立,且学生端第一批 H5 页面已经可构建:登录、首页、题库、练习、背单词、知识手册、分数线、资料、个人中心
- 可以继续复刻旧题库学生端主要视觉和交互:选地区、刷题细节、视频解析、题目反馈、模考报告、错题复习、商城收银台、订单详情、勋章展示
- 可以按新后端主模型接入内容导航:
- `content_entries`
- `content_nodes`
@@ -54,3 +54,20 @@
- 每个页面先接后端已有接口;缺接口时把页面期望的字段写到 issue/TODO再由后端补聚合接口。
- 权限判断以后端结果为准,前端只做菜单和按钮可见性优化。
- 旧项目只作为样式、交互和字段含义参考;长期数据模型以新 API 为准。
## 已落地的 Taro 学生端页面
| 页面 | 文件 | 已接接口 |
| --- | --- | --- |
| 启动页 | `apps/taro/src/pages/bootstrap/index.tsx` | `GET /api/tenant/resolve` |
| 短信登录 | `apps/taro/src/pages/student/login/index.tsx` | `POST /api/auth/sms/send``POST /api/auth/sms/verify` |
| 首页 | `apps/taro/src/pages/student/home/index.tsx` | `content-entries``banners``announcements``profile/me` |
| 题库 | `apps/taro/src/pages/student/catalog/index.tsx` | `content-entries``content-nodes``question-collections``practice-blueprints` |
| 练习 | `apps/taro/src/pages/student/practice/index.tsx` | `practice-sessions``questions``answers``favorites/questions` |
| 背单词 | `apps/taro/src/pages/student/vocabulary/index.tsx` | `vocabulary-units``vocabulary-words``vocabulary/review-plan``vocabulary/review` |
| 知识手册 | `apps/taro/src/pages/student/handbook/index.tsx` | `handbook-subjects``handbook-chapters``handbook-entries` |
| 分数线 | `apps/taro/src/pages/student/scoreline/index.tsx` | `scoreline/records` |
| 资料 | `apps/taro/src/pages/student/assets/index.tsx` | `assets``assets/preview``assets/download` |
| 个人中心 | `apps/taro/src/pages/student/profile/index.tsx` | `profile/me``check-in``badges``exam-countdowns``svip-plans``orders``entitlements``activation-codes``leaderboard` |
当前页面主要用于打通接口和路由,后续 UI 需要继续按旧题库视觉和 Taro H5/小程序限制优化。

View File

@@ -1351,6 +1351,47 @@ ACTIVATION_CODE_REGION_MISMATCH
10. `pages/profile/index`
- 会员、订单、激活码、学习数据、勋章。
## 当前 Taro 实现进度
截至 2026-06-29`apps/taro` 已完成学生端第一阶段页面:
```text
pages/student/login/index
pages/student/home/index
pages/student/catalog/index
pages/student/practice/index
pages/student/vocabulary/index
pages/student/handbook/index
pages/student/scoreline/index
pages/student/assets/index
pages/student/profile/index
```
已新增服务层:
```text
src/services/catalog.ts 目录、题库、单词、手册、分数线、资料
src/services/learning.ts 练习 session、答题、收藏、单词复习
src/services/commerce.ts 套餐、订单、权益、激活码
src/services/profile.ts 个人中心、签到、勋章、倒计时
```
验证命令:
```bash
npm run check:taro
npm run build:taro:h5:student
```
已通过。构建仍有 Taro H5 入口体积 warning属于当前 Taro 工程既有警告,不阻断联调。
下一批前端开发重点:
- 学生端:选地区、题目视频播放、题目反馈、错题/收藏专题页、模考交卷报告、订单收银台和订单详情。
- 租户后台:数据看板、学生/班级/教师、角色模板、品牌域名、题库导入、公共题库采纳、营销、CRM、分佣。
- 平台后台租户、SaaS 套餐、订阅账单、公共题库授权、平台审计。
- 小程序:验证 `Taro.login`、微信支付、分享 scene/referral、Supabase client 兼容性;如不稳定,保留 `apps/api/auth/*` 作为小程序登录适配层。
## 租户后台前端建议
租户后台可以先做 H5 管理台,也可以后续使用 Taro H5 复用部分组件。优先页面: