diff --git a/app/entry/src/main/ets/pages/FittingRoomPage.ets b/app/entry/src/main/ets/pages/FittingRoomPage.ets index 9917390..13ca215 100644 --- a/app/entry/src/main/ets/pages/FittingRoomPage.ets +++ b/app/entry/src/main/ets/pages/FittingRoomPage.ets @@ -69,6 +69,7 @@ struct FittingRoomPage { @State statusText: string = '' @State resultUrl: string = '' @State resultLocalPath: string = '' // 本机留存副本:展示与保存优先走它 + @State resultSrc: string = '' // 结果图就绪后的直绑图源(@Builder 内方法调用不被状态追踪,禁用) @State lastLocalPath: string = '' // 「上次结果」卡数据源 @State showOriginal: boolean = false @State showLeaveConfirm: boolean = false // 生成中离开的挽留确认 @@ -348,6 +349,7 @@ struct FittingRoomPage { return // 已被取消/离开,丢弃迟到结果 } this.resultUrl = url + this.resultSrc = url // 先用 OSS URL 展示,转存完成后切本机副本 this.statusText = '生成完成,正在留存到本机…' const saved: boolean = await this.persistResult(url) if (gen !== this.genSeq) { @@ -425,6 +427,7 @@ struct FittingRoomPage { task.on('fail', (err: number) => reject(new Error(`download fail: ${err}`))) }) this.resultLocalPath = path + this.resultSrc = fileUri.getUriFromPath(path) this.lastLocalPath = path return true } catch (_e) { @@ -571,7 +574,7 @@ struct FittingRoomPage { // 左上「模特/效果图」角标(黑 60% 胶囊,白字 12,距边 12) if (this.humanUri.length > 0) { - Text(this.previewBadge()) + Text(this.showOriginal || this.resultSrc === '' ? '模特' : '效果图') .fontSize(12) .fontColor(Color.White) .padding({ left: 12, right: 12, top: 8, bottom: 8 })