Browse Source

gst

pull/1/head
gme_2 6 years ago
parent
commit
82a0184136
  1. 4
      GMERemittance/Module/SendMoney/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift
  2. 5
      GMERemittance/Module/SendMoney/SendMoneyReceipt/User Interface/Wireframe/SendMoneyReceiptWireframe.swift
  3. 12
      GMERemittance/Module/TransactionHistory/User Interface/Presenter/TransactionHistoryPresenter.swift
  4. 4
      GMERemittance/Module/TransactionHistory/User Interface/Wireframe/TransactionHistoryWireframe.swift
  5. 2
      GMERemittance/Module/TransactionHistory/User Interface/Wireframe/TransactionHistoryWireframeInput.swift

4
GMERemittance/Module/SendMoney/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift

@ -45,7 +45,7 @@ class SendMoneyReceiptViewController: UIViewController {
var presenter: SendMoneyReceiptModuleInterface? var presenter: SendMoneyReceiptModuleInterface?
var hudDelegate: HUDStatusDelegate? var hudDelegate: HUDStatusDelegate?
var isFromTransactionReport = false
var shouldShowCancelAmmendButton = false
var controlNo: String? var controlNo: String?
var transactionId: String? var transactionId: String?
var type: MailBoxType? var type: MailBoxType?
@ -104,7 +104,7 @@ class SendMoneyReceiptViewController: UIViewController {
} }
func setupBackButton() { func setupBackButton() {
if isFromTransactionReport {
if shouldShowCancelAmmendButton {
self.navigationController?.navigationItem.hidesBackButton = false self.navigationController?.navigationItem.hidesBackButton = false
let button = UIBarButtonItem.init(image: #imageLiteral(resourceName: "backIconBlack"), style: UIBarButtonItemStyle.plain, target: self, action: #selector(self.back)) let button = UIBarButtonItem.init(image: #imageLiteral(resourceName: "backIconBlack"), style: UIBarButtonItemStyle.plain, target: self, action: #selector(self.back))
self.navigationItem.backBarButtonItem = button self.navigationItem.backBarButtonItem = button

5
GMERemittance/Module/SendMoney/SendMoneyReceipt/User Interface/Wireframe/SendMoneyReceiptWireframe.swift

@ -27,7 +27,7 @@ extension SendMoneyReceiptWireframe: SendMoneyReceiptWireframeInput {
let viewController = viewControllerFromStoryboard(of: SendMoneyReceiptViewController.self) let viewController = viewControllerFromStoryboard(of: SendMoneyReceiptViewController.self)
viewController.controlNo = self.controlNo // todo: refractor later viewController.controlNo = self.controlNo // todo: refractor later
viewController.transactionId = self.transactionId // todo: refractor later viewController.transactionId = self.transactionId // todo: refractor later
viewController.isFromTransactionReport = self.isFromTransactionReport
viewController.shouldShowCancelAmmendButton = self.isFromTransactionReport
viewController.presenter = presenter viewController.presenter = presenter
interactor.output = presenter interactor.output = presenter
presenter.interactor = interactor presenter.interactor = interactor
@ -43,8 +43,7 @@ extension SendMoneyReceiptWireframe: SendMoneyReceiptWireframeInput {
self.pushMainView(in: source) self.pushMainView(in: source)
} }
func openRecieptFromTransactionReport(controlNo: String, transactionId: String, source: UINavigationController) {
self.isFromTransactionReport = true
func openRecieptFromTransactionReport(controlNo: String, transactionId: String, shouldShowCancelAmmendButton: Bool, source: UINavigationController) {
self.transactionId = transactionId self.transactionId = transactionId
self.controlNo = controlNo self.controlNo = controlNo
self.pushMainView(in: source) self.pushMainView(in: source)

12
GMERemittance/Module/TransactionHistory/User Interface/Presenter/TransactionHistoryPresenter.swift

@ -55,13 +55,17 @@ extension TransactionHistoryPresenter: TransactionHistoryModuleInterface {
func showDetailOf(index: Int) { func showDetailOf(index: Int) {
let element = self.models.elementAt(index: index) let element = self.models.elementAt(index: index)
if (element?.payStatus ?? "").lowercased() == TransactionModelType.unpaid.rawValue.lowercased() {
guard let id = element?.transactionId, let controlNo = element?.controlNumber else {return}
wireframe?.openReciept(transactionId: id, control: controlNo)
guard let id = element?.transactionId, let controlNo = element?.controlNumber else {return}
let status = (element?.payStatus ?? "").lowercased()
if status == TransactionModelType.paid.rawValue.lowercased() || status == "cancel" {
wireframe?.openReciept(transactionId: id, shouldShowCancelAmmendButton: false, control: controlNo)
} else {
wireframe?.openReciept(transactionId: id, shouldShowCancelAmmendButton: true, control: controlNo)
} }
} }
// func getNotificationKey
func search(text: String) { func search(text: String) {
let searchText = text.lowercased() let searchText = text.lowercased()
self.filteredModels = (models).filter({ self.filteredModels = (models).filter({

4
GMERemittance/Module/TransactionHistory/User Interface/Wireframe/TransactionHistoryWireframe.swift

@ -33,9 +33,9 @@ extension TransactionHistoryWireframe: TransactionHistoryWireframeInput {
return viewController return viewController
} }
func openReciept(transactionId: String, control: String) {
func openReciept(transactionId: String, shouldShowCancelAmmendButton: Bool, control: String) {
if let navigation = self.view.navigationController { if let navigation = self.view.navigationController {
reciptWireframe.openRecieptFromTransactionReport(controlNo: control, transactionId: transactionId, source: navigation)
reciptWireframe.openRecieptFromTransactionReport(controlNo: control, transactionId: transactionId, shouldShowCancelAmmendButton: shouldShowCancelAmmendButton, source: navigation)
} }
} }

2
GMERemittance/Module/TransactionHistory/User Interface/Wireframe/TransactionHistoryWireframeInput.swift

@ -9,5 +9,5 @@
import Foundation import Foundation
protocol TransactionHistoryWireframeInput: WireframeInput { protocol TransactionHistoryWireframeInput: WireframeInput {
func openReciept(transactionId: String, control: String)
func openReciept(transactionId: String, shouldShowCancelAmmendButton: Bool, control: String)
} }
Loading…
Cancel
Save