fix(tryon): 再来一次回到初始进入界面——resetResult 漏清 resultSrc 导致效果图残留预览区;新增 resetToEntry 连本人照一起清(结果操作行与全屏查看器两个入口)
This commit is contained in:
@@ -453,14 +453,21 @@ struct FittingRoomPage {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 回到选人台:清掉上一轮生成/保存的残留。 */
|
/** 清掉上一轮生成/保存的残留(resultSrc 必须一起清,否则效果图仍挂在预览区)。 */
|
||||||
private resetResult(): void {
|
private resetResult(): void {
|
||||||
this.resultUrl = ''
|
this.resultUrl = ''
|
||||||
this.resultLocalPath = ''
|
this.resultLocalPath = ''
|
||||||
|
this.resultSrc = ''
|
||||||
this.showOriginal = false
|
this.showOriginal = false
|
||||||
this.statusText = ''
|
this.statusText = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 「再来一次」:连本人照一起清,回到初始进入界面(可重新拍照/相册选图)。 */
|
||||||
|
private resetToEntry(): void {
|
||||||
|
this.humanUri = ''
|
||||||
|
this.resetResult()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成成功即转存本机:下载结果到 filesDir/results/tryon_last.jpg。
|
* 生成成功即转存本机:下载结果到 filesDir/results/tryon_last.jpg。
|
||||||
* 下载前先清旧文件——request.downloadFile 不能覆盖已存在文件(TryonPage #21 同款坑)。
|
* 下载前先清旧文件——request.downloadFile 不能覆盖已存在文件(TryonPage #21 同款坑)。
|
||||||
@@ -1206,7 +1213,7 @@ struct FittingRoomPage {
|
|||||||
.fontSize(13)
|
.fontSize(13)
|
||||||
.fontColor(COLOR_PRIMARY)
|
.fontColor(COLOR_PRIMARY)
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.resetResult()
|
this.resetToEntry()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
@@ -1317,7 +1324,7 @@ struct FittingRoomPage {
|
|||||||
},
|
},
|
||||||
onRetry: (): void => {
|
onRetry: (): void => {
|
||||||
this.viewerOpen = false
|
this.viewerOpen = false
|
||||||
this.resetResult()
|
this.resetToEntry()
|
||||||
},
|
},
|
||||||
onClose: (): void => {
|
onClose: (): void => {
|
||||||
this.viewerOpen = false
|
this.viewerOpen = false
|
||||||
|
|||||||
Reference in New Issue
Block a user