From dc8df5963da7b0c567f14123d7764ffdcf59105e Mon Sep 17 00:00:00 2001 From: Amrit Giri Date: Thu, 12 Nov 2020 11:06:15 +0545 Subject: [PATCH] send money receipt success card changed --- .../View/SendMoneyReceipt.storyboard | 12 +++--- .../View/SendMoneyReceiptViewController.swift | 43 ++++++++++++++++--- .../Wireframe/SendMoneyReceiptWireframe.swift | 10 ++--- .../SendMoneyVerificationViewController.swift | 6 +-- 4 files changed, 48 insertions(+), 23 deletions(-) diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceipt.storyboard b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceipt.storyboard index 721cabb0..1fc6e271 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceipt.storyboard +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceipt.storyboard @@ -638,12 +638,12 @@ notices to get JME Number for this transfer. - + - + @@ -652,8 +652,8 @@ notices to get JME Number for this transfer. - - + + @@ -670,7 +670,7 @@ notices to get JME Number for this transfer. - + @@ -681,7 +681,7 @@ notices to get JME Number for this transfer. - + diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift index d42b8d11..b1c5a741 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift @@ -18,6 +18,12 @@ enum ReceiptType { case overseas } +enum ReceiptParent { + case sendMoney + case notice + case report +} + class SendMoneyReceiptViewController: UIViewController { // MARK: IBOutlets @@ -38,6 +44,9 @@ class SendMoneyReceiptViewController: UIViewController { let payoutAmountText = "total_payout_amount_text".localized() let gmeControlNumberText = "jme_control_no_text".localized() let doneText = "done_text".localized() + let headerSuccess = "send_money_success_header_text".localized() + let bodySuccess = "send_money_success_body_text".localized() + let footerSuccess = "send_money_success_footer_text".localized() } @IBOutlet weak var fullnameLabel: UILabel! @@ -45,6 +54,17 @@ class SendMoneyReceiptViewController: UIViewController { @IBOutlet weak var controlNoInfoLabel: UILabel! @IBOutlet weak var transactionDateLabel: UILabel! @IBOutlet weak var infoView: UIView! + @IBOutlet weak var infoViewSuccess: UIView! + @IBOutlet weak var weReceivedLabelSuccess: UILabel! + + @IBOutlet weak var amountLabelSuccess: UILabel! + + @IBOutlet weak var makePaymentLabelSuccess: UILabel! + + @IBOutlet weak var chargeLabelSuccess: UILabel! + + @IBOutlet weak var toJmeLabelSuccess: UILabel! + @IBOutlet weak var shadowView: UIView! @IBOutlet weak var exchangeRateLabel: UILabel! @IBOutlet weak var relationLabel: UILabel! @@ -97,7 +117,7 @@ class SendMoneyReceiptViewController: UIViewController { var presenter: SendMoneyReceiptModuleInterface? weak var hudDelegate: HUDStatusDelegate? var shouldShowCancelAmmendButton = false - var isFromTransactionHistory = false + var receiptParent: ReceiptParent = .sendMoney var controlNo: String? var transactionId: String? var type: MailBoxType? @@ -124,6 +144,9 @@ class SendMoneyReceiptViewController: UIViewController { self.setupNormalNavigation() self.setupBackButton() + self.infoView.isHidden = self.receiptParent == .sendMoney + self.infoViewSuccess.isHidden = self.receiptParent != .sendMoney + switch receiptType { case .overseas: transactionDateContainerView.isHidden = false @@ -148,15 +171,11 @@ class SendMoneyReceiptViewController: UIViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - -// if !isFromTransactionHistory { -// StoreReviewHelper.shared.checkAndAskForReview() -// } } // MARK: IBActions @IBAction func done(_ sender: UIButton) { - if (isFromTransactionHistory) { + if self.receiptParent == .report { self.navigationController?.popViewController(animated: true) } else { self.navigationController?.popToRootViewController(animated: true) @@ -184,12 +203,17 @@ class SendMoneyReceiptViewController: UIViewController { // all setup should be done here setupBackButton() configureLanguage() + infoViewSuccess.layer.cornerRadius = 20 infoView.layer.cornerRadius = 20 requestToCancelButton.layer.cornerRadius = 20 requestToChangeButton.layer.cornerRadius = 20 } func configureLanguage() { + self.weReceivedLabelSuccess.text = StringConstants().headerSuccess + self.makePaymentLabelSuccess.text = StringConstants().headerSuccess + self.toJmeLabelSuccess.text = StringConstants().footerSuccess + self.transferSuccessfullTitleLabel.text = StringConstants().transferSuccessText self.tansactionDateTitleLabel.text = StringConstants().transactionDateText self.recieverTitleLabel.text = StringConstants().recieverText @@ -264,7 +288,11 @@ class SendMoneyReceiptViewController: UIViewController { self.accountNoView.isHidden = accountNo == "" self.accountNoLabel.text = self.reciept?.accountNo self.relationLabel.text = self.reciept?.collAmount?.decimalToCurrency(as: .krw) - self.transferFeeLabel.text = self.reciept?.serviceCharge?.decimalToCurrency(as: .krw) + + let charge = self.reciept?.serviceCharge?.decimalToCurrency(as: .krw) + self.transferFeeLabel.text = charge + self.chargeLabelSuccess.text = charge + self.exchangeRateLabel.text = self.reciept?.exRate let controlNo = self.reciept?.controNo ?? "" @@ -276,6 +304,7 @@ class SendMoneyReceiptViewController: UIViewController { self.totalAmountLabel.text = totalAmount self.totalAmountHeaderLabel.text = totalAmount + self.amountLabelSuccess.text = totalAmount } } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/Wireframe/SendMoneyReceiptWireframe.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/Wireframe/SendMoneyReceiptWireframe.swift index 06781422..2389ad13 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/Wireframe/SendMoneyReceiptWireframe.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/Wireframe/SendMoneyReceiptWireframe.swift @@ -12,7 +12,7 @@ class SendMoneyReceiptWireframe { weak var view: UIViewController! var transactionId: String? var controlNo: String? - var isFromTransactionReport = false + var receiptParent: ReceiptParent = .sendMoney var shouldShowCancelAmmendButton = false let mailboxwireFrame = MessageComposeWireframe() @@ -31,7 +31,7 @@ extension SendMoneyReceiptWireframe: SendMoneyReceiptWireframeInput { viewController.controlNo = self.controlNo // todo: refractor later viewController.transactionId = self.transactionId // todo: refractor later viewController.shouldShowCancelAmmendButton = self.shouldShowCancelAmmendButton - viewController.isFromTransactionHistory = self.isFromTransactionReport + viewController.receiptParent = self.receiptParent viewController.receiptType = receiptType viewController.presenter = presenter interactor.output = presenter @@ -49,7 +49,7 @@ extension SendMoneyReceiptWireframe: SendMoneyReceiptWireframeInput { source: UINavigationController ) { receiptType = type - isFromTransactionReport = false + receiptParent = .sendMoney self.transactionId = transactionId self.pushMainView(in: source) @@ -63,7 +63,7 @@ extension SendMoneyReceiptWireframe: SendMoneyReceiptWireframeInput { source: UINavigationController ) { receiptType = type - isFromTransactionReport = true + receiptParent = .report self.transactionId = transactionId self.shouldShowCancelAmmendButton = shouldShowCancelAmmendButton @@ -77,7 +77,7 @@ extension SendMoneyReceiptWireframe: SendMoneyReceiptWireframeInput { shouldShowCancelAmmendButton: Bool, source: UINavigationController ) { - isFromTransactionReport = false + receiptParent = .notice self.transactionId = transactionId self.shouldShowCancelAmmendButton = shouldShowCancelAmmendButton self.controlNo = controlNo diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift index a30d7867..47786c99 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift @@ -260,11 +260,7 @@ extension SendMoneyVerificationViewController: SendMoneyVerificationViewInterfac } func showLoading() { - if hudDelegate != nil { - self.hudDelegate?.showLoading() - } else { - self.showProgressHud() - } + self.showProgressHud() }