|
|
@ -62,6 +62,7 @@ class InboundReceiptViewController: UIViewController { |
|
|
|
@IBOutlet private weak var cancelButton: UIButton! |
|
|
|
@IBOutlet private weak var registerButton: UIButton! |
|
|
|
|
|
|
|
@IBOutlet private weak var bankMessageContainerView: UIStackView! |
|
|
|
@IBOutlet private weak var buttonContainerView: UIStackView! |
|
|
|
// MARK: VC's Life cycle |
|
|
|
override func viewDidLoad() { |
|
|
@ -109,7 +110,6 @@ extension InboundReceiptViewController { |
|
|
|
registerButton.layer.cornerRadius = 5 |
|
|
|
|
|
|
|
DispatchQueue.main.async {[weak self] in |
|
|
|
self?.messageTitleLabel.text = "you_have_to_register_text".localized() |
|
|
|
self?.controlTitleLabel.text = "control_no_text".localized() |
|
|
|
self?.transactionDateTitleLabel.text = "transaction_date_text".localized() |
|
|
|
self?.senderNameTitleLabel.text = "sender_name_text".localized() |
|
|
@ -172,23 +172,38 @@ extension InboundReceiptViewController { |
|
|
|
output.model.map {BankEnum(rawValue: $0.inboundBankCode ?? "")?.ciImage} |
|
|
|
.drive(receiveBankImageView.rx.image).disposed(by: disposeBag) |
|
|
|
|
|
|
|
output.model.map {$0.inboundIsAccountReg ?? true} |
|
|
|
.drive(bankMessageContainerView.rx.isHidden).disposed(by: disposeBag) |
|
|
|
|
|
|
|
output.model.map {$0.inboundIsAccountReg ?? true} |
|
|
|
.drive(buttonContainerView.rx.isHidden).disposed(by: disposeBag) |
|
|
|
|
|
|
|
Driver.combineLatest(output.model.map { $0.inboundIsAccountReg ?? true}, output.status) |
|
|
|
.drive(onNext: {[weak self] in |
|
|
|
switch $0.1 { |
|
|
|
case .hold: |
|
|
|
let message = ($0.0) ? |
|
|
|
"transaction_will_be_processed_text".localized() : "you_have_to_register_text".localized() |
|
|
|
self?.messageContainerView.isHidden = false |
|
|
|
self?.messageTitleLabel.text = message |
|
|
|
case .success, .cancel: |
|
|
|
self?.messageContainerView.isHidden = true |
|
|
|
} |
|
|
|
} |
|
|
|
).disposed(by: disposeBag) |
|
|
|
|
|
|
|
output.status.drive(onNext: {[weak self] in |
|
|
|
switch $0 { |
|
|
|
case .success: |
|
|
|
self?.statusTitleLabel.text = "transfer_success_text".localized() |
|
|
|
self?.messageContainerView.isHidden = true |
|
|
|
self?.senderToGMEProcess.isHidden = false |
|
|
|
self?.gmeToReceiverProcess.isHidden = false |
|
|
|
self?.buttonContainerView.isHidden = true |
|
|
|
case .hold: |
|
|
|
self?.statusTitleLabel.text = "transfer_holding_text".localized() |
|
|
|
self?.messageContainerView.isHidden = false |
|
|
|
self?.senderToGMEProcess.isHidden = false |
|
|
|
self?.gmeToReceiverProcess.isHidden = true |
|
|
|
self?.buttonContainerView.isHidden = false |
|
|
|
case .cancel: |
|
|
|
self?.statusTitleLabel.text = "transfer_canceled_text".localized() |
|
|
|
self?.buttonContainerView.isHidden = true |
|
|
|
} |
|
|
|
}).disposed(by: disposeBag) |
|
|
|
} |
|
|
|