feat: update app workflows and permissions
This commit is contained in:
@ -23,6 +23,7 @@ final class WildReportSupplementEvidenceViewController: BaseViewController {
|
||||
|
||||
private var pickerTarget: WildReportPickerTarget = .image
|
||||
private weak var activeInputView: UIView?
|
||||
private var isShowingSubmitLoading = false
|
||||
|
||||
init(
|
||||
record: WildReportRecord,
|
||||
@ -111,6 +112,7 @@ final class WildReportSupplementEvidenceViewController: BaseViewController {
|
||||
viewModel.onStateChange = { [weak self] in
|
||||
Task { @MainActor in
|
||||
guard let self else { return }
|
||||
self.updateSubmitLoading()
|
||||
if self.textView.isFirstResponder {
|
||||
self.updateTextInputState()
|
||||
self.updateSubmitButton()
|
||||
@ -271,14 +273,23 @@ final class WildReportSupplementEvidenceViewController: BaseViewController {
|
||||
}
|
||||
|
||||
private func updateSubmitButton() {
|
||||
let title = viewModel.isSubmitting && !viewModel.submitProgressText.isEmpty
|
||||
? viewModel.submitProgressText
|
||||
: "提交补充证据"
|
||||
submitButton.setTitle(title, for: .normal)
|
||||
submitButton.setTitle("提交补充证据", for: .normal)
|
||||
submitButton.isEnabled = !viewModel.isSubmitting
|
||||
submitButton.alpha = viewModel.isSubmitting ? 0.78 : 1
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private func updateSubmitLoading() {
|
||||
if viewModel.isSubmitting {
|
||||
guard !isShowingSubmitLoading else { return }
|
||||
isShowingSubmitLoading = true
|
||||
showLoading()
|
||||
} else if isShowingSubmitLoading {
|
||||
isShowingSubmitLoading = false
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
private func canAddAttachment(kind: WildReportAttachmentKind, currentCount: Int, maxCount: Int) -> Bool {
|
||||
let ownRemaining = max(0, maxCount - currentCount)
|
||||
let evidenceRemaining = max(0, 9 - viewModel.images.count - viewModel.videos.count)
|
||||
|
||||
Reference in New Issue
Block a user