IOS-INFO-020 P0 | 首页继续学习 API 替换硬编码 【审计: 致命F3】 #105

Closed
opened 2026-06-07 12:20:52 +08:00 by wangdl · 1 comment
Owner

当前使用硬编码 continueSession(kbTitle, elapsed)。替换为 GET /learning/continue。有数据→继续学习卡片。无数据→空状态。失败→降级。依赖 API-INFO-017。

M-IOS-INFO v3 里程碑 issue。

## 当前使用硬编码 continueSession(kbTitle, elapsed)。替换为 GET /learning/continue。有数据→继续学习卡片。无数据→空状态。失败→降级。依赖 API-INFO-017。 M-IOS-INFO v3 里程碑 issue。
wangdl added this to the M-IOS-INFO:学习信息采集、上传、继续学习与基础分析闭环 milestone 2026-06-07 12:20:52 +08:00
Author
Owner

完成报告

F3 修复

ActivityViewModel + AnalysisHomeView — 接入 GET /learning/continue

1. ViewModel — 加载时查询继续学习数据:

@Published var continueReading: ContinueLearningResponse?

async let cr = try? ReadingAPIService.shared.getContinueLearning()
continueReading = continueResult

2. UI — 分析页顶部显示"继续阅读"卡片:

if let cr = viewModel.continueReading, cr.type != "none" {
    NavigationLink(value: Route.materialReader(...)) {
        HStack {
            Image(systemName: "book.pages")
            VStack { Text("继续阅读"); Text(cr.title) }
            Image(systemName: "chevron.right")
        }
    }
}

行为: 有数据→点击直接进入阅读页;无数据(type=none)→不显示卡片;API 失败→静默降级

## 完成报告 ### F3 修复 `ActivityViewModel` + `AnalysisHomeView` — 接入 `GET /learning/continue`: **1. ViewModel** — 加载时查询继续学习数据: ```swift @Published var continueReading: ContinueLearningResponse? async let cr = try? ReadingAPIService.shared.getContinueLearning() continueReading = continueResult ``` **2. UI** — 分析页顶部显示"继续阅读"卡片: ```swift if let cr = viewModel.continueReading, cr.type != "none" { NavigationLink(value: Route.materialReader(...)) { HStack { Image(systemName: "book.pages") VStack { Text("继续阅读"); Text(cr.title) } Image(systemName: "chevron.right") } } } ``` **行为:** 有数据→点击直接进入阅读页;无数据(type=none)→不显示卡片;API 失败→静默降级
Sign in to join this conversation.
No description provided.