报告域: - 报告 Tab 列表接入 GET /reports(重启可找回);重新生成采纳新 report_id - 任务状态前后端大小写归一——轮询完成检测与「导出 PDF」按钮首次真正可达 - FAILED 重试换新幂等键;导出→重生成→再导出幂等冲突死路修复 - PDF 下载前 unlink 可重入;预览页常驻挂载+失败态重试;分享/另存文案拆分 对话页: - 「内容由 AI 生成」常驻标识(CR-05)+ 快捷问题 chips + 额度 0 置灰与恢复时间 - 发送失败回填输入+重试+request_key 幂等;40301 额度同步 试衣间/发型设计: - 人脸照片知情同意弹窗(preferences 持久化+版本+「我的」撤回入口) - 生成期防中断(keepScreenOn/返回挽留/取消出口/genSeq 防串扰) - 结果转存 filesDir/results:杀 App 回看、飞行模式离线保存、保存三态文案 - R4N1 照片输入链修复:裁除 describe 挂起载体、选图/拍照超时兜底、 openSource URI 直建失败回退 fd 口径(R5N2) - @Builder 改 $$ 对象传参修复槽位预览不刷新(R5N1);发型列表三态 全局: - 会话过期四处「重新登录」出路;UTC 时间显示归正(差 8h) - 10 处技术黑话清理;主色统一 Theme.ets;配额卡 4 张真实消耗集 - 登录页内测口径;f2 ErrorView/LoadingView 换用;调试入口 debug 守卫 门禁:App 构建 BUILD SUCCESSFUL;后端 576 单测绿(子仓 00ef56b); 28 项静态检查 PASS;真机 PDF 全链/照片送达/零崩溃验证通过
70 lines
2.0 KiB
Plaintext
70 lines
2.0 KiB
Plaintext
/**
|
||
* ErrorView —— 通用失败态组件(F2)。
|
||
*
|
||
* NFR-UX-02「失败必有原因 + 下一步指引」的落地组件:
|
||
* - message:失败原因(对应 ApiError.message)
|
||
* - hint:下一步指引(对应 ApiError.hint,可空则不渲染)
|
||
* - onRetry:可选「重试」回调,不传则不渲染按钮
|
||
* 其它 FE 任务可直接 import 本组件复用(目录带 f2 前缀,迁移由协调者做)。
|
||
*/
|
||
|
||
import { COLOR_PRIMARY } from '../../core/Theme'
|
||
|
||
const TEXT_PRIMARY: string = '#222222'
|
||
const TEXT_SECONDARY: string = '#8A9099'
|
||
const WARN: string = '#FF9F0A'
|
||
const WARN_BG: string = '#FFF4E0'
|
||
const ACCENT: string = COLOR_PRIMARY
|
||
|
||
@Component
|
||
export struct ErrorView {
|
||
@Prop message: string = '请求失败,请检查网络'
|
||
@Prop hint: string = ''
|
||
@Prop retryText: string = '重试'
|
||
onRetry?: () => void
|
||
|
||
build() {
|
||
Column({ space: 10 }) {
|
||
Text('!')
|
||
.fontSize(26)
|
||
.fontWeight(FontWeight.Bold)
|
||
.fontColor(WARN)
|
||
.width(56)
|
||
.height(56)
|
||
.textAlign(TextAlign.Center)
|
||
.borderRadius(28)
|
||
.backgroundColor(WARN_BG)
|
||
Text(this.message)
|
||
.fontSize(15)
|
||
.fontWeight(FontWeight.Medium)
|
||
.fontColor(TEXT_PRIMARY)
|
||
.textAlign(TextAlign.Center)
|
||
if (this.hint !== '') {
|
||
Text(this.hint)
|
||
.fontSize(13)
|
||
.fontColor(TEXT_SECONDARY)
|
||
.textAlign(TextAlign.Center)
|
||
}
|
||
if (this.onRetry !== undefined) {
|
||
Button(this.retryText)
|
||
.fontSize(15)
|
||
.fontColor(Color.White)
|
||
.backgroundColor(ACCENT)
|
||
.borderRadius(20)
|
||
.height(40)
|
||
.padding({ left: 32, right: 32 })
|
||
.margin({ top: 6 })
|
||
.onClick(() => {
|
||
if (this.onRetry !== undefined) {
|
||
this.onRetry()
|
||
}
|
||
})
|
||
}
|
||
}
|
||
.width('100%')
|
||
.height('100%')
|
||
.justifyContent(FlexAlign.Center)
|
||
.padding({ left: 32, right: 32 })
|
||
}
|
||
}
|