From 1bcf75ae39041bbf2ae8e67ac7da2e2ffec1f919 Mon Sep 17 00:00:00 2001 From: InKwon James Kim Date: Tue, 17 Dec 2019 14:30:45 +0900 Subject: [PATCH] change home --- GME Remit/APIs/Router/APIRouter.swift | 2 +- .../HomeRemainingLimitTableViewCell.swift | 32 +++ .../Home/User Interface/View/Home.storyboard | 185 ++++++++++++++---- .../View/HomeViewController.swift | 2 + .../Modules/SideMenu/SideMenu.storyboard | 182 ++++++----------- .../SideMenu/SideMenuViewController.swift | 16 -- 6 files changed, 237 insertions(+), 182 deletions(-) diff --git a/GME Remit/APIs/Router/APIRouter.swift b/GME Remit/APIs/Router/APIRouter.swift index 9835b4c5..72d71f18 100644 --- a/GME Remit/APIs/Router/APIRouter.swift +++ b/GME Remit/APIs/Router/APIRouter.swift @@ -842,7 +842,7 @@ extension APIRouter { let userID = GMEDB.shared.user.string(.userId) ?? "" var personalInformation: [String: Any]? - if model.personalInformation != nil { + if model.personalInformation != nil { personalInformation = [ "fullName": model.personalInformation?.fullName ?? "", "gender": model.personalInformation?.gender ?? "", diff --git a/GME Remit/Modules/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift b/GME Remit/Modules/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift index f2ee4046..47c05cac 100644 --- a/GME Remit/Modules/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift +++ b/GME Remit/Modules/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift @@ -24,7 +24,14 @@ class HomeRemainingLimitTableViewCell: UITableViewCell { @IBOutlet weak var pointTitleLabel: UILabel! @IBOutlet weak var rewardTapGesture: UITapGestureRecognizer! + + @IBOutlet weak var withdrawButton: UIButton! + @IBOutlet weak var walletNumberTitleLabel: UILabel! + @IBOutlet weak var walletNumberLabel: UILabel! + @IBOutlet weak var walletBankCodeLabel: UILabel! + var user: User? + weak var sideMenuDelegate: SideMenuDelegate? override func awakeFromNib() { super.awakeFromNib() @@ -55,6 +62,13 @@ class HomeRemainingLimitTableViewCell: UITableViewCell { // self.pointBackgroundView.backgroundColor = .themeRed pointContainerView.layer.cornerRadius = 5 pointBackgroundView.hero.id = "pointsView" + + walletNumberTitleLabel.text = "gme_wallet_no_text".localized() + walletNumberLabel.text = GMEDB.shared.user.string(.walletNumber) + walletBankCodeLabel.text = GMEDB.shared.user.string(.primaryBankName) + + + withdrawButtonInit() } @objc @@ -80,4 +94,22 @@ class HomeRemainingLimitTableViewCell: UITableViewCell { self.amountLabel.text = amount } } + + private func withdrawButtonInit() { + withdrawButton.setTitle("withdraw_text".localized(), for: UIControl.State.normal) + let shouldShowWithdrawButton = Utility.pennyTestVerified() && Utility.isVerifiedUser() + + withdrawButton.isHidden = !shouldShowWithdrawButton + withdrawButton.titleLabel?.adjustsFontSizeToFitWidth(true, scale: 0.5) + withdrawButton.layer.shadowColor = UIColor.darkGray.cgColor + withdrawButton.layer.shadowOpacity = 0.5 + withdrawButton.layer.shadowRadius = 2 + + let offset = CGSize(width: 1, height: 1) + withdrawButton.layer.shadowOffset = offset + } + + @IBAction func touchWithdraw(_ sender: UIButton) { + sideMenuDelegate?.didSelectMenu(UIViewController(), didSelectMenu: .withDraw) + } } diff --git a/GME Remit/Modules/Home/User Interface/View/Home.storyboard b/GME Remit/Modules/Home/User Interface/View/Home.storyboard index 2b41ef79..f866f74e 100644 --- a/GME Remit/Modules/Home/User Interface/View/Home.storyboard +++ b/GME Remit/Modules/Home/User Interface/View/Home.storyboard @@ -1,9 +1,9 @@ - + - + @@ -51,7 +51,7 @@