fix: use v9 store status for deregistration login
This commit is contained in:
@@ -164,6 +164,16 @@ final class AccountSelectionViewController: UIViewController, UITableViewDelegat
|
||||
|
||||
@objc private func confirmTapped() {
|
||||
guard canConfirm, let selectedAccount else { return }
|
||||
if selectedAccount.requiresDeregistrationConfirmation {
|
||||
present(
|
||||
makeDeregistrationLoginAlert(
|
||||
account: selectedAccount,
|
||||
onConfirm: { [weak self] in self?.onConfirm(selectedAccount) }
|
||||
),
|
||||
animated: true
|
||||
)
|
||||
return
|
||||
}
|
||||
onConfirm(selectedAccount)
|
||||
}
|
||||
|
||||
@@ -177,6 +187,23 @@ final class AccountSelectionViewController: UIViewController, UITableViewDelegat
|
||||
}
|
||||
}
|
||||
|
||||
/// 创建冷静期账号登录确认弹窗,确认后 `set-user` 会由后端自动撤销原注销申请。
|
||||
func makeDeregistrationLoginAlert(
|
||||
account: AccountSwitchAccount,
|
||||
onConfirm: @escaping () -> Void
|
||||
) -> UIAlertController {
|
||||
let accountName = account.title.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
let displayName = accountName.isEmpty ? "该门店账号" : "“\(accountName)”"
|
||||
let alert = UIAlertController(
|
||||
title: "该账号正在注销",
|
||||
message: "\(displayName)已提交注销申请,目前处于冷静期。确认登录后,将自动撤销之前的注销申请。",
|
||||
preferredStyle: .alert
|
||||
)
|
||||
alert.addAction(UIAlertAction(title: "暂不登录", style: .cancel))
|
||||
alert.addAction(UIAlertAction(title: "确认登录", style: .default) { _ in onConfirm() })
|
||||
return alert
|
||||
}
|
||||
|
||||
/// 账号选择列表 Cell。
|
||||
private final class AccountSelectionCell: UITableViewCell {
|
||||
static let reuseIdentifier = "AccountSelectionCell"
|
||||
|
||||
Reference in New Issue
Block a user