feat: add AI retouch task center
This commit is contained in:
@@ -65,7 +65,7 @@ final class TravelAlbumDetailViewController: BaseViewController {
|
||||
navigationItem.scrollEdgeAppearance = appearance
|
||||
navigationItem.compactAppearance = appearance
|
||||
|
||||
navigationItem.rightBarButtonItem = UIBarButtonItem(
|
||||
let moreItem = UIBarButtonItem(
|
||||
image: UIImage(systemName: "ellipsis"),
|
||||
menu: UIMenu(children: [
|
||||
UIAction(title: "删除相册", image: UIImage(systemName: "trash"), attributes: .destructive) { [weak self] _ in
|
||||
@@ -73,7 +73,19 @@ final class TravelAlbumDetailViewController: BaseViewController {
|
||||
},
|
||||
])
|
||||
)
|
||||
navigationItem.rightBarButtonItem?.accessibilityLabel = "更多操作"
|
||||
moreItem.accessibilityLabel = "更多操作"
|
||||
let taskItem = UIBarButtonItem(
|
||||
title: "修图任务",
|
||||
style: .plain,
|
||||
target: self,
|
||||
action: #selector(openAIJobList)
|
||||
)
|
||||
taskItem.accessibilityLabel = "查看AI修图任务"
|
||||
navigationItem.rightBarButtonItems = [moreItem, taskItem]
|
||||
}
|
||||
|
||||
@objc private func openAIJobList() {
|
||||
navigationController?.pushViewController(TravelAlbumAIJobListViewController(api: api), animated: true)
|
||||
}
|
||||
|
||||
override func setupUI() {
|
||||
@@ -446,15 +458,31 @@ final class TravelAlbumDetailViewController: BaseViewController {
|
||||
materialIds: materialIds
|
||||
),
|
||||
api: api,
|
||||
onSubmitted: { [weak self] in
|
||||
onSubmitted: { [weak self] submission in
|
||||
guard let self else { return }
|
||||
self.viewModel.completeAIRetouchSubmission()
|
||||
self.showToast("AI修图任务已提交")
|
||||
self.presentAIRetouchSubmitted(submission)
|
||||
}
|
||||
)
|
||||
present(controller, animated: true)
|
||||
}
|
||||
|
||||
private func presentAIRetouchSubmitted(_ submission: TravelAlbumAIJobSubmission) {
|
||||
let alert = UIAlertController(
|
||||
title: "AI修图任务已提交",
|
||||
message: "完成后将通过消息通知,你也可以随时查看处理进度。",
|
||||
preferredStyle: .alert
|
||||
)
|
||||
alert.addAction(UIAlertAction(title: "稍后查看", style: .cancel))
|
||||
alert.addAction(UIAlertAction(title: "查看任务", style: .default) { [weak self] _ in
|
||||
self?.navigationController?.pushViewController(
|
||||
TravelAlbumAIJobDetailViewController(batchId: submission.aiRetouchBatchId),
|
||||
animated: true
|
||||
)
|
||||
})
|
||||
present(alert, animated: true)
|
||||
}
|
||||
|
||||
@objc private func deleteSelectedTapped() {
|
||||
let count = viewModel.selectedMaterialIds.count
|
||||
guard count > 0 else { return }
|
||||
|
||||
Reference in New Issue
Block a user