Explorar o código

feat(mobile): add special training to teacher home shortcuts

彭峰 hai 1 día
pai
achega
b783c73cad

+ 23 - 0
docs/qa/coach-home-special-training-2026-11-18.md

@@ -0,0 +1,23 @@
+# 老师首页专项训练入口:本地完成
+
+用户要求在老师首页“生词本”右侧增加学生端已有的“专项训练”模块。
+
+## 修改
+
+- 复用学生入口的路由`/pages/his/well?nid=3`、GraduationCap图标和“分类强化词汇”说明,追加到老师工作入口第六项。
+- 去掉原生词本跨整行布局,老师末行两个入口共用原有双列栅格,保留行顶线、中间分隔和窄屏规则。
+- 没有新增组件、接口或首页内容请求。栏目沿用既有列表和文章页,无需选择学员;学生入口保持原样。
+
+## 验证
+
+- 先更新现有老师首页集成检查,旧界面1项失败/106项通过,失败为缺少第六项专项训练链接。
+- 实现后107/107集成检查通过。现有老师完整学习流程检查增加了实际点击专项入口、读取列表并返回首页;既有学生流程也通过。
+- 移动端生产构建及`git diff --check`通过,独立静态审查无重要问题。
+- 本地浏览器使用模拟老师会话及内容数据,分别检查320/390/1024px和390px放大字体。每种情况下入口六项,生词本和专项训练同行、等宽;触控高度76px或77px,居中分隔线和顶线存在,没有页面横向溢出。
+- 四种情况均实际点击老师入口→专项训练列表→文章正文,浏览器脚本错误0、意外接口调用0。
+- 首页请求仅既有统计/复习读取,content_list/node_get在点击入口后才发生,content_get在打开文章后发生。
+- 首轮浏览器模拟接口未匹配开发环境的/cloud-functions路径而得到本地404;修正验收脚本拦截路径后全流程通过,没有因此修改产品API或后端。
+
+原始日志、布局指标和截图在`/Users/mac/.local/state/xiaoshu/qa/2026-11-18-coach-training/`。没有使用生产账号或读取/修改生产数据;本地模拟验收不等同于线上账号或手机实机验收。
+
+**状态:本地完成并提交推送,未上线。先前16px报表批次也仍待用户确认,不在本次自动发布范围内。**

+ 7 - 1
projects/xiaoshu-mobile/src/app/core/home-learning-modules.integration.spec.ts

@@ -1965,7 +1965,13 @@ describe('home learning modules', () => {
     await harness.fixture.whenStable();
     harness.fixture.detectChanges();
     const coachLinks = Array.from(harness.routeNativeElement?.querySelectorAll('.coach-quick-grid > a') ?? []).map((link) => link.getAttribute('href'));
-    expect(coachLinks).toEqual(['/pages/home/shop', '/pages/member/ke_xiao', '/pages/his/his', '/pages/member/ke_fuxi', '/pages/member/starshop']);
+    expect(coachLinks).toEqual(['/pages/home/shop', '/pages/member/ke_xiao', '/pages/his/his', '/pages/member/ke_fuxi', '/pages/member/starshop', '/pages/his/well?nid=3']);
+    (harness.routeNativeElement?.querySelector('.coach-training-entry') as HTMLAnchorElement).click();
+    await harness.fixture.whenStable(); harness.fixture.detectChanges();
+    expect(TestBed.inject(Router).url).toBe('/pages/his/well?nid=3');
+    expect(harness.routeNativeElement?.textContent).toContain('阅读理解专项');
+    await harness.navigateByUrl('/pages/home/index');
+    await harness.fixture.whenStable(); harness.fixture.detectChanges();
     expect(harness.routeNativeElement?.querySelector('.home-header .header-action')).toBeNull();
     const coachAccountTab = (Array.from(harness.fixture.nativeElement.querySelectorAll('.tabbar a')) as HTMLAnchorElement[])
       .find((link) => link.getAttribute('href') === '/pages/home/ucenter');

+ 1 - 0
projects/xiaoshu-mobile/src/app/features/home/home-page.component.html

@@ -118,6 +118,7 @@
       <a routerLink="/pages/his/his"><span class="quick-icon history"><lucide-icon [img]="icons.BookOpen" [size]="25" /></span><span><strong>学员记录</strong><small>按学员查看学习成果</small></span><lucide-icon class="quick-arrow" [img]="icons.ChevronRight" [size]="19" /></a>
       <a routerLink="/pages/member/ke_fuxi"><span class="quick-icon exam"><lucide-icon [img]="icons.BarChart3" [size]="25" /></span><span><strong>抗遗忘费用</strong><small>查看抗遗忘复习费用</small></span><lucide-icon class="quick-arrow" [img]="icons.ChevronRight" [size]="19" /></a>
       <a class="coach-wordbook-entry" routerLink="/pages/member/starshop"><span class="quick-icon learn"><lucide-icon [img]="icons.BookMarked" [size]="25" /></span><span><strong>生词本</strong><small>选学员,带练生词</small></span><lucide-icon class="quick-arrow" [img]="icons.ChevronRight" [size]="19" /></a>
+      <a class="coach-training-entry" routerLink="/pages/his/well" [queryParams]="{ nid: 3 }"><span class="quick-icon review"><lucide-icon [img]="icons.GraduationCap" [size]="25" /></span><span><strong>专项训练</strong><small>分类强化词汇</small></span><lucide-icon class="quick-arrow" [img]="icons.ChevronRight" [size]="19" /></a>
     </section>
   } @else {
     <section class="quick-grid" aria-label="学习入口">

+ 2 - 1
projects/xiaoshu-mobile/src/app/features/home/home-page.component.scss

@@ -104,7 +104,8 @@
 .quick-grid a { display: grid; min-width: 0; min-height: 104px; grid-template-columns: 48px minmax(0, 1fr) 20px; align-items: center; padding: 14px 12px; color: var(--ink); text-decoration: none; gap: 10px; }
 .quick-grid a:nth-child(odd) { border-right: 1px solid var(--line); }
 .quick-grid a:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
-.coach-quick-grid a.coach-wordbook-entry { grid-column: 1 / -1; min-height: 76px; border-top: 1px solid var(--line); border-right: 0; }
+.coach-quick-grid a.coach-wordbook-entry,
+.coach-quick-grid a.coach-training-entry { min-height: 76px; border-top: 1px solid var(--line); }
 .quick-grid a > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
 .quick-grid strong { font-size: 15px; }
 .quick-grid small { overflow: hidden; color: var(--ink-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }