Browse Source

need to implement background synch

pull/1/head
Jeongbae Kong 5 years ago
parent
commit
c5ab43db5e
  1. BIN
      .DS_Store
  2. 8
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/Presenter/PhoneCardRechargePresenter.swift
  3. 51
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardBankListCell.swift
  4. 115
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRecharge.storyboard
  5. 64
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRechargeViewController.swift
  6. 8
      GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/User Interface/View/DomesticRemit.storyboard

BIN
.DS_Store

8
GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/Presenter/PhoneCardRechargePresenter.swift

@ -47,7 +47,7 @@ class PhoneCardRechargePresenter: ViewModelType {
let viewWillAppear: Driver<Void>
let selectAutodebit: Driver<Void>
let selectedIndex: Driver<Int>
let showBalanceTrigger: Driver<Account>
let showBalanceTrigger: Driver<Void>
let availableBalance: Driver<String>
let selectedMobile: Driver<String>
let contactOpenTap: Driver<Void>
@ -102,9 +102,10 @@ class PhoneCardRechargePresenter: ViewModelType {
.disposed(by: disposeBag)
input.showBalanceTrigger
.withLatestFrom(selectedPaymentMode.asDriverOnErrorJustComplete())
.drive(onNext: { [weak self] in
let fintechUseNumber = $0.fintechUseNumber ?? ""
let type = $0.type ?? "autodebit"
let fintechUseNumber = $0?.fintechUseNumber ?? ""
let type = $0?.type ?? "autodebit"
self?.progressLinker.onNext(true)
self?.interactor?.fetchBalanceForPowerCall(type: type, fintechUseNumber: fintechUseNumber)
})
@ -121,6 +122,7 @@ class PhoneCardRechargePresenter: ViewModelType {
return bank[indexPath]
}
.drive(onNext: {[weak self] in
self?.getBalanceLinker.onNext(nil)
self?.selectedPaymentMode.onNext($0)
})
.disposed(by: disposeBag)

51
GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardBankListCell.swift

@ -32,78 +32,43 @@ class PhoneCardBankListCell: UITableViewCell {
private let cellDisposeBag = DisposeBag()
let onData: Observable<BalanceModel>
private let getKFTCBalance = PublishSubject<BalanceModel>()
weak var delegate: PhoneCardBankListCellDelegate?
private var model: Account?
@IBOutlet weak var bankNameLabel: UILabel!
@IBOutlet weak var showBalanceLabel: UILabel!
@IBOutlet weak var showBalanceButton: UIButton!
@IBOutlet weak var balanceStackView: UIStackView!
@IBOutlet weak var phoneCardBankListCellBackgroundView: UIView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
required init?(coder: NSCoder) {
let data = PublishSubject<BalanceModel>()
onData = data.asObserver()
super.init(coder: coder)
data.observeOn(MainScheduler.instance)
.subscribe(onNext: { [weak self] in
self?.balanceStackView.isHidden = false
self?.showBalanceButton.isHidden = true
self?.showBalanceLabel.text = $0.balance
})
.disposed(by: cellDisposeBag)
}
func setModel(_ model: Account) {
self.model = model
if model.type == "wallet" {
bankNameLabel.text = model.bankName
showBalanceButton.isHidden = true
balanceStackView.isHidden = false
showBalanceLabel.text = GMEDB.shared.user.string(.availableBalance)
} else {
guard let account = model.accountNumMasked else {
return self.bankNameLabel.text = model.bankName
}
bankNameLabel.text = "\(model.bankName ?? "") (\(account)) "
balanceStackView.isHidden = true
showBalanceButton.isHidden = false
showBalanceButton.setTitle("account_balance_button_text".localized(), for: .normal)
showBalanceButton.backgroundColor = .themeBlue
showBalanceButton.setTitleColor(.white, for: .normal)
showBalanceButton.titleLabel?.minimumScaleFactor = 0.1
showBalanceButton.titleLabel?.adjustsFontSizeToFitWidth = true
}
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// if selected {
// phoneCardBankListCellBackgroundView.layer.borderWidth = 1
// phoneCardBankListCellBackgroundView.layer.borderColor = UIColor.themeRed.cgColor
// } else {
// phoneCardBankListCellBackgroundView.layer.borderColor = UIColor.clear.cgColor
// }
}
@IBAction func showBlanaceButton(_ sender: UIButton) {
delegate?.showBalance(with: model)
balanceStackView.isHidden = false
showBalanceButton.isHidden = true
}
}
extension PhoneCardBankListCell: showKFTCBalanceDelegate {
func KFTCBalanceShow(with balance: String) {
balanceStackView.isHidden = false
showBalanceButton.isHidden = true
showBalanceLabel.text = balance
}
}

115
GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRecharge.storyboard

@ -9,6 +9,9 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
<array key="SanFranciscoDisplay-Bold.otf">
<string>SanFranciscoDisplay-Bold</string>
</array>
<array key="SanFranciscoDisplay-Medium.otf">
<string>SanFranciscoDisplay-Medium</string>
</array>
@ -29,16 +32,16 @@
<rect key="frame" x="0.0" y="88" width="375" height="1008"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="375" placeholderIntrinsicHeight="2371" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="n2r-aQ-WLy">
<rect key="frame" x="0.0" y="0.0" width="375" height="2627.6666666666665"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="2693.3333333333335"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JUk-Ex-adc">
<rect key="frame" x="0.0" y="0.0" width="375" height="60.666666666666664"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="115.66666666666667"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="ccK-eC-TFi">
<rect key="frame" x="20" y="10" width="335" height="50"/>
<rect key="frame" x="20" y="10" width="335" height="105"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="QVg-Ii-ls0">
<rect key="frame" x="0.0" y="0.0" width="335" height="50"/>
<rect key="frame" x="0.0" y="0.0" width="335" height="105"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="EA8-0Y-03d">
<rect key="frame" x="0.0" y="0.0" width="335" height="50"/>
@ -77,6 +80,45 @@
</constraints>
</view>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="50" id="XC1-X5-LNR"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Fsi-ml-O26">
<rect key="frame" x="0.0" y="55" width="335" height="50"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="252" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SPD-dj-b9Q">
<rect key="frame" x="0.0" y="0.0" width="49" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="14"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="5" maxY="2"/>
<state key="normal" title="잔액조회">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="NgG-i6-bFj">
<rect key="frame" x="49" y="0.0" width="286" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="₩" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uBn-YF-GFl">
<rect key="frame" x="0.0" y="16" width="231.66666666666666" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Balance" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="8" translatesAutoresizingMaskIntoConstraints="NO" id="gqm-PF-EqL">
<rect key="frame" x="231.66666666666671" y="16" width="54.333333333333343" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<gestureRecognizers/>
<constraints>
<constraint firstAttribute="height" constant="50" id="qRI-zq-dMw"/>
</constraints>
</stackView>
</subviews>
</stackView>
@ -161,7 +203,7 @@
</subviews>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1cX-dc-qlz">
<rect key="frame" x="0.0" y="60" width="375" height="0.6666666666666643"/>
<rect key="frame" x="0.0" y="115" width="375" height="0.6666666666666714"/>
<color key="backgroundColor" name="ThemeSeparate"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="7xg-5N-WEe"/>
@ -180,17 +222,17 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3qq-VX-aSW">
<rect key="frame" x="0.0" y="60.666666666666657" width="375" height="150"/>
<rect key="frame" x="0.0" y="115.66666666666666" width="375" height="159.99999999999997"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="4Gb-eJ-Vkh">
<rect key="frame" x="0.0" y="0.0" width="375" height="150"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="160"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="width" constant="375" id="Fqb-oy-mHT"/>
<constraint firstAttribute="height" constant="150" id="HSf-Mm-FfF"/>
<constraint firstAttribute="height" constant="160" id="HSf-Mm-FfF"/>
</constraints>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="PhoneCardBankListCell" rowHeight="121" id="Hnk-Sj-SXn" customClass="PhoneCardBankListCell" customModule="GME_Remit" customModuleProvider="target">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="PhoneCardBankListCell" rowHeight="121" id="Hnk-Sj-SXn" customClass="PhoneCardBankListCell" customModule="GME_Remit" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="375" height="121"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Hnk-Sj-SXn" id="XXx-27-PVb">
@ -214,41 +256,11 @@
<gestureRecognizers/>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="249" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iSQ-er-2oU">
<rect key="frame" x="106.66666666666666" y="0.0" width="130" height="93"/>
<rect key="frame" x="106.66666666666664" y="0.0" width="218.33333333333337" height="93"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Q0B-Sz-Pr0">
<rect key="frame" x="250.66666666666671" y="0.0" width="74.333333333333343" height="93"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="₩" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rzr-Ch-Fdh">
<rect key="frame" x="0.0" y="0.0" width="20" height="93"/>
<constraints>
<constraint firstAttribute="width" constant="20" id="Jil-ju-d2E"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Balance" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="8" translatesAutoresizingMaskIntoConstraints="NO" id="ykE-KO-Zfn">
<rect key="frame" x="20.000000000000004" y="0.0" width="54.333333333333343" height="93"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="trailing" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rOY-4N-0Ie">
<rect key="frame" x="325" y="0.0" width="0.0" height="93"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="13"/>
<state key="normal" title="Button">
<color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="showBlanaceButton:" destination="Hnk-Sj-SXn" eventType="touchUpInside" id="zb7-Hb-Vps"/>
</connections>
</button>
</subviews>
<gestureRecognizers/>
</stackView>
@ -262,10 +274,8 @@
</tableViewCellContentView>
<color key="backgroundColor" name="ThemeSubBackground"/>
<connections>
<outlet property="balanceStackView" destination="Q0B-Sz-Pr0" id="3zV-8a-cUd"/>
<outlet property="bankNameLabel" destination="WRI-Xt-gAb" id="sb4-d3-OQ4"/>
<outlet property="showBalanceButton" destination="rOY-4N-0Ie" id="QWS-we-dSr"/>
<outlet property="showBalanceLabel" destination="ykE-KO-Zfn" id="abb-Ta-vfh"/>
<outlet property="phoneCardBankListCellBackgroundView" destination="XXx-27-PVb" id="qmH-oH-tbu"/>
</connections>
</tableViewCell>
</prototypes>
@ -280,7 +290,7 @@
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="tGD-kA-THr">
<rect key="frame" x="0.0" y="210.66666666666674" width="375" height="2417"/>
<rect key="frame" x="0.0" y="275.66666666666674" width="375" height="2417.6666666666661"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="g7K-9q-vWh">
<rect key="frame" x="0.0" y="0.0" width="375" height="55"/>
@ -306,13 +316,13 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bLc-vG-GQk">
<rect key="frame" x="0.0" y="55" width="375" height="2362"/>
<rect key="frame" x="0.0" y="55" width="375" height="2362.6666666666665"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3x2-QU-b5r">
<rect key="frame" x="0.0" y="0.0" width="375" height="2362"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="2362.6666666666665"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="rcN-b3-Pc0">
<rect key="frame" x="10" y="0.0" width="355" height="2362"/>
<rect key="frame" x="10" y="0.0" width="355" height="2362.6666666666665"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CmC-Q1-ZRq">
<rect key="frame" x="0.0" y="0.0" width="355" height="167.33333333333334"/>
@ -406,7 +416,7 @@
<rect key="frame" x="0.0" y="90" width="335" height="10.333333333333329"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="B1e-En-fth">
<rect key="frame" x="-20" y="10" width="375" height="0.33333333333333393"/>
<rect key="frame" x="-20" y="9.9999999999999432" width="375" height="0.33333333333333393"/>
<color key="backgroundColor" name="ThemeSeparate"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="du6-Yr-bcj"/>
@ -825,7 +835,7 @@
</userDefinedRuntimeAttributes>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bgJ-0n-H1h" userLabel="Separate">
<rect key="frame" x="0.0" y="60.000000000000121" width="335" height="10.333333333333336"/>
<rect key="frame" x="0.0" y="60.000000000000007" width="335" height="10.333333333333336"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tPX-0W-AwX">
<rect key="frame" x="-20" y="10" width="375" height="0.33333333333333393"/>
@ -844,7 +854,7 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hi1-a8-7Dd">
<rect key="frame" x="0.0" y="80.333333333333371" width="335" height="40"/>
<rect key="frame" x="0.0" y="80.333333333333258" width="335" height="40"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="Lbn-Mu-kTM">
<rect key="frame" x="0.0" y="10" width="335" height="30"/>
@ -897,7 +907,7 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="100" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="euR-3e-5qe">
<rect key="frame" x="0.0" y="754.33333333333314" width="355" height="1607.666666666667"/>
<rect key="frame" x="0.0" y="754.33333333333337" width="355" height="1608.333333333333"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@ -1003,12 +1013,15 @@
<outlet property="nextButton" destination="TJE-ol-Hx6" id="a16-oT-5De"/>
<outlet property="paymentTypeDropDownImageView" destination="vG3-iU-w8w" id="els-nj-o0v"/>
<outlet property="paymentTypeDropDownTap" destination="0Eu-f1-GtD" id="RJG-4R-Yek"/>
<outlet property="realBalanceLabel" destination="gqm-PF-EqL" id="H89-Pt-I4o"/>
<outlet property="regularInformationLabel1" destination="IYY-b3-pG3" id="vpV-BH-ihE"/>
<outlet property="regularInformationLabel2" destination="0i8-dF-xEP" id="DsL-s2-cqd"/>
<outlet property="regularTypeButtonsStackView" destination="2jz-Oc-Za2" id="kM8-r5-a61"/>
<outlet property="regularTypeContainerView" destination="CmC-Q1-ZRq" id="JQg-XT-9YC"/>
<outlet property="regularTypeInfoContainerView" destination="zaA-jE-elw" id="MTO-WE-ZfF"/>
<outlet property="scrollView" destination="HAO-OX-Hu1" id="TIL-Eo-54N"/>
<outlet property="showBalanceCheckButton" destination="SPD-dj-b9Q" id="04x-iY-Spp"/>
<outlet property="showBalanceStackView" destination="NgG-i6-bFj" id="56R-rw-Mz4"/>
<outlet property="tableView" destination="4Gb-eJ-Vkh" id="Z2l-6H-7cm"/>
<outlet property="typeSegment" destination="Xt5-tG-WPd" id="bk5-Gb-IQW"/>
<outlet property="walletOrAutoDebitLabel" destination="nFD-fi-y2F" id="qiT-K0-66B"/>

64
GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRechargeViewController.swift

@ -27,6 +27,7 @@ class PhoneCardRechargeViewController: UIViewController {
private let selectedMobile = PublishSubject<String>()
private let selectPaymentType = PublishSubject<Void>()
private let balanceShow = PublishSubject<Account>()
private let selectedAccount = PublishSubject<Account>()
private var amountButtons = [UIButton]()
@ -44,10 +45,15 @@ class PhoneCardRechargeViewController: UIViewController {
@IBOutlet private weak var wonCurrencyLabel: UILabel!
@IBOutlet private weak var mycashAmountLabel: UILabel!
@IBOutlet weak var realBalanceLabel: UILabel!
@IBOutlet private weak var typeSegment: UISegmentedControl!
@IBOutlet private weak var mainContainerView: UIView!
@IBOutlet private weak var menuContainerView: UIStackView!
@IBOutlet weak var balanceStackView: UIStackView!
@IBOutlet weak var showBalanceStackView: UIStackView!
@IBOutlet weak var paymentTypeDropDownImageView: UIImageView!
@IBOutlet var paymentTypeDropDownTap: UITapGestureRecognizer!
@IBOutlet weak var tableView: UITableView!
@ -62,6 +68,7 @@ class PhoneCardRechargeViewController: UIViewController {
@IBOutlet private weak var amountButton5: UIButton!
@IBOutlet private weak var amountButton6: UIButton!
@IBOutlet weak var balanceCheckButton: UIButton!
@IBOutlet weak var showBalanceCheckButton: UIButton!
@IBOutlet private weak var regularTypeInfoContainerView: UIView!
@IBOutlet private weak var regularInformationLabel1: UILabel!
@ -137,7 +144,7 @@ extension PhoneCardRechargeViewController {
}
private func setUI() {
balanceCheckButton.isHidden = true
showBalanceCheckButton.isHidden = true
regularTypeContainerView.isHidden = true
regularTypeInfoContainerView.isHidden = true
fixedChargeTypeContainerView.isHidden = true
@ -152,7 +159,7 @@ extension PhoneCardRechargeViewController {
)
nextButton.layer.cornerRadius = 5
balanceCheckButton.layer.cornerRadius = 5
showBalanceCheckButton.layer.cornerRadius = 5
regularTypeButtonsStackView.travelSubView { (view, _) in
if let button = view as? UIButton {
@ -215,7 +222,7 @@ extension PhoneCardRechargeViewController {
viewWillAppear: viewWillAppear,
selectAutodebit: selectPaymentType.asDriverOnErrorJustComplete(),
selectedIndex: tableView.rx.itemSelected.map {$0.row}.asDriverOnErrorJustComplete(),
showBalanceTrigger: balanceShow.asDriverOnErrorJustComplete(),
showBalanceTrigger: showBalanceCheckButton.rx.tap.asDriver(),
availableBalance: availableBalance.asDriverOnErrorJustComplete(),
selectedMobile: selectedMobile.asDriverOnErrorJustComplete(),
contactOpenTap: contactButton.rx.tap.asDriverOnErrorJustComplete(),
@ -250,8 +257,9 @@ extension PhoneCardRechargeViewController {
output.getBalance.map { $0?.balance?.decimalToCurrency() }
.drive(onNext: { [weak self] in
guard let balance = $0 else { return }
self?.showKFTCBalance = balance
self?.balanceDelegate?.KFTCBalanceShow(with: balance)
self?.showBalanceCheckButton.isHidden = true
self?.showBalanceStackView.isHidden = false
self?.realBalanceLabel.text = balance
}).disposed(by: disposeBag)
@ -292,31 +300,50 @@ extension PhoneCardRechargeViewController {
let model = $0 else {
return
}
self?.selectedAccount.onNext(model)
if model.type == "wallet" {
self?.balanceCheckButton.isHidden = true
self?.balanceStackView.isHidden = false
self?.mycashAmountLabel.text = GMEDB.shared.user.string(.availableBalance)
self?.showBalanceCheckButton.isHidden = true
self?.showBalanceStackView.isHidden = false
self?.realBalanceLabel.text = GMEDB.shared.user.string(.availableBalance)
} else {
self?.balanceCheckButton.isHidden = false
self?.balanceCheckButton.setTitle("account_balance_button_text".localized(), for: .normal)
self?.balanceCheckButton.backgroundColor = .themeBlue
self?.balanceCheckButton.setTitleColor(.white, for: .normal)
self?.balanceCheckButton.titleLabel?.minimumScaleFactor = 0.1
self?.balanceCheckButton.titleLabel?.adjustsFontSizeToFitWidth = true
self?.balanceStackView.isHidden = true
self?.showBalanceCheckButton.isHidden = false
self?.showBalanceStackView.isHidden = true
self?.showBalanceCheckButton.setTitle("account_balance_button_text".localized(), for: .normal)
self?.showBalanceCheckButton.backgroundColor = .themeBlue
self?.showBalanceCheckButton.setTitleColor(.white, for: .normal)
self?.showBalanceCheckButton.titleLabel?.minimumScaleFactor = 0.1
self?.showBalanceCheckButton.titleLabel?.adjustsFontSizeToFitWidth = true
}
}).disposed(by: disposeBag)
// let items = Observable.just(output.getBalance.asObservable())
tableView.rx.itemSelected.subscribe(onNext: {[weak self] indexPath in
let cell = self?.tableView.cellForRow(at: indexPath) as? PhoneCardBankListCell
cell?.phoneCardBankListCellBackgroundView.layer.borderWidth = 1
cell?.phoneCardBankListCellBackgroundView.layer.borderColor = UIColor.themeRed.cgColor
})
.disposed(by: disposeBag)
tableView.rx.itemDeselected.subscribe(onNext: {[weak self] indexPath in
let cell = self?.tableView.cellForRow(at: indexPath) as? PhoneCardBankListCell
cell?.phoneCardBankListCellBackgroundView.layer.borderColor = UIColor.clear.cgColor
})
.disposed(by: disposeBag)
// let items = Observable.just(output.getBalance.asObservable())
output
.bankModel.drive(
tableView.rx.items(cellIdentifier: "PhoneCardBankListCell")
) { ( _, element: Account, cell: PhoneCardBankListCell) in
cell.delegate = self
cell.setModel(element)
if element.type == "wallet" {
cell.phoneCardBankListCellBackgroundView.layer.borderWidth = 1
cell.phoneCardBankListCellBackgroundView.layer.borderColor = UIColor.themeRed.cgColor
}
}
.disposed(by: disposeBag)
// output
@ -380,6 +407,7 @@ extension PhoneCardRechargeViewController {
return self.walletOrAutoDebitLabel.text = model.bankName
}
self.walletOrAutoDebitLabel.text = "\(model.bankName ?? "") (\(account)) "
}
}).disposed(by: disposeBag)
@ -388,7 +416,7 @@ extension PhoneCardRechargeViewController {
.disposed(by: disposeBag)
availableBalance.asDriver(onErrorJustReturn: "").map {$0.decimalToCurrency()}
.drive(mycashAmountLabel.rx.text)
.drive(realBalanceLabel.rx.text)
.disposed(by: disposeBag)
selectedCarrierPlan.map {$0?.cardName}.asDriver(onErrorJustReturn: nil)

8
GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/User Interface/View/DomesticRemit.storyboard

@ -116,13 +116,13 @@
<rect key="frame" x="0.0" y="0.0" width="52.5" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="N/A" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="crF-eg-HNv">
<rect key="frame" x="0.0" y="0.0" width="16.5" height="30"/>
<rect key="frame" x="0.0" y="0.0" width="22" height="30"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" KRW" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JOx-My-xUB">
<rect key="frame" x="16.5" y="0.0" width="36" height="30"/>
<rect key="frame" x="22" y="0.0" width="30.5" height="30"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -381,13 +381,13 @@
<rect key="frame" x="0.0" y="20" width="315" height="16"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="253" verticalHuggingPriority="251" text="●" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PQ8-Xe-tzc">
<rect key="frame" x="0.0" y="0.0" width="8.5" height="16"/>
<rect key="frame" x="0.0" y="0.0" width="8" height="16"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="It will deduct oooKRW (Amount + ServiceFee)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="0rB-T2-pd1">
<rect key="frame" x="13.5" y="0.0" width="301.5" height="16"/>
<rect key="frame" x="13" y="0.0" width="302" height="16"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>

Loading…
Cancel
Save