Browse Source

add Estimated earning points at SendMoneyVerification

pull/1/head
InKwon James Kim 5 years ago
parent
commit
75d344eab9
  1. 2
      GMERemittance/Model/SendMoneyExchangeRate.swift
  2. 3
      GMERemittance/Model/SendMoneyReciept.swift
  3. 2
      GMERemittance/Model/SendMoneySubmitResponse.swift
  4. 5
      GMERemittance/Module/BiometricAuthModules/BiometricAuthentication/User Interface/View/BiometricAuthentication.storyboard
  5. 59
      GMERemittance/Module/SendMoney/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift
  6. 15
      GMERemittance/Module/SendMoney/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift
  7. 3
      bn.lproj/Localizable.strings
  8. 3
      en.lproj/Localizable.strings
  9. 3
      id.lproj/Localizable.strings
  10. 4
      km.lproj/Localizable.strings
  11. 4
      ko.lproj/Localizable.strings
  12. 4
      mn.lproj/Localizable.strings
  13. 3
      my-MM.lproj/Localizable.strings
  14. 4
      my.lproj/Localizable.strings
  15. 4
      ne.lproj/Localizable.strings
  16. 3
      ru-RU.lproj/Localizable.strings
  17. 4
      si.lproj/Localizable.strings
  18. 3
      th.lproj/Localizable.strings
  19. 4
      uz.lproj/Localizable.strings
  20. 3
      vi-VN.lproj/Localizable.strings

2
GMERemittance/Model/SendMoneyExchangeRate.swift

@ -61,7 +61,7 @@ class SendMoneyExchangeRateModel: Mappable {
schemeId != "", schemeId != "",
let name = couponName, let name = couponName,
let type = couponType, let type = couponType,
let value = discountValue else {
let value = discountValue?.likeCommaMoney() else {
return "0" return "0"
} }

3
GMERemittance/Model/SendMoneyReciept.swift

@ -76,11 +76,10 @@ class SendMoneyReciept: Mappable {
let name = couponName, let name = couponName,
name != "", name != "",
let type = discountType, let type = discountType,
let value = discountValue else {
let value = discountValue?.likeCommaMoney() else {
return "N/A" return "N/A"
} }
if type == "1", let percent = discountPercent { if type == "1", let percent = discountPercent {
return "\(name) \(percent)% (-\(value) KRW)" return "\(name) \(percent)% (-\(value) KRW)"
} }

2
GMERemittance/Model/SendMoneySubmitResponse.swift

@ -16,6 +16,7 @@ class SendMoneySubmitModelContainer: Mappable {
var errorCode: String? var errorCode: String?
var message: String? var message: String?
var id: String? var id: String?
var extra2: String?
var data: SendMoneySubmitModel? var data: SendMoneySubmitModel?
required init?(map: Map) { required init?(map: Map) {
@ -27,6 +28,7 @@ class SendMoneySubmitModelContainer: Mappable {
id <- map["Id"] id <- map["Id"]
message <- map["Msg"] message <- map["Msg"]
data <- map["Data"] data <- map["Data"]
extra2 <- map["Extra2"]
} }
} }

5
GMERemittance/Module/BiometricAuthModules/BiometricAuthentication/User Interface/View/BiometricAuthentication.storyboard

@ -24,7 +24,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="characterWrap" translatesAutoresizingMaskIntoConstraints="NO" id="aC8-3V-QpF"> <button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="characterWrap" translatesAutoresizingMaskIntoConstraints="NO" id="aC8-3V-QpF">
<rect key="frame" x="87.5" y="531" width="200" height="50"/>
<rect key="frame" x="56.5" y="531" width="262.5" height="50"/>
<color key="backgroundColor" red="0.18823529411764706" green="0.24313725490196078" blue="0.62352941176470589" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.18823529411764706" green="0.24313725490196078" blue="0.62352941176470589" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="AYP-6K-T6b"/> <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="AYP-6K-T6b"/>
@ -55,8 +55,9 @@
<constraint firstItem="fGb-qm-Mdn" firstAttribute="trailing" secondItem="aO1-jS-d16" secondAttribute="trailing" constant="20" id="PXt-b5-dBL"/> <constraint firstItem="fGb-qm-Mdn" firstAttribute="trailing" secondItem="aO1-jS-d16" secondAttribute="trailing" constant="20" id="PXt-b5-dBL"/>
<constraint firstItem="aO1-jS-d16" firstAttribute="centerX" secondItem="fGb-qm-Mdn" secondAttribute="centerX" id="Sef-hv-5aX"/> <constraint firstItem="aO1-jS-d16" firstAttribute="centerX" secondItem="fGb-qm-Mdn" secondAttribute="centerX" id="Sef-hv-5aX"/>
<constraint firstItem="aO1-jS-d16" firstAttribute="centerY" secondItem="fGb-qm-Mdn" secondAttribute="centerY" multiplier="0.55:1" id="TSI-fC-T95"/> <constraint firstItem="aO1-jS-d16" firstAttribute="centerY" secondItem="fGb-qm-Mdn" secondAttribute="centerY" multiplier="0.55:1" id="TSI-fC-T95"/>
<constraint firstItem="aC8-3V-QpF" firstAttribute="width" relation="lessThanOrEqual" secondItem="9Uc-9s-KgO" secondAttribute="width" multiplier="0.9:1" id="bW5-zZ-Nms"/>
<constraint firstItem="aC8-3V-QpF" firstAttribute="width" relation="greaterThanOrEqual" secondItem="9Uc-9s-KgO" secondAttribute="width" multiplier="0.7:1" id="bW5-zZ-Nms"/>
<constraint firstItem="wjU-xq-xRN" firstAttribute="centerY" secondItem="fGb-qm-Mdn" secondAttribute="centerY" multiplier="0.3:1" id="kiz-S3-bEe"/> <constraint firstItem="wjU-xq-xRN" firstAttribute="centerY" secondItem="fGb-qm-Mdn" secondAttribute="centerY" multiplier="0.3:1" id="kiz-S3-bEe"/>
<constraint firstItem="aC8-3V-QpF" firstAttribute="width" relation="lessThanOrEqual" secondItem="9Uc-9s-KgO" secondAttribute="width" id="yhj-Jp-OSL"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="fGb-qm-Mdn"/> <viewLayoutGuide key="safeArea" id="fGb-qm-Mdn"/>
</view> </view>

59
GMERemittance/Module/SendMoney/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift

@ -60,9 +60,9 @@ class SendMoneyExchangeRateViewController: UIViewController {
if let _action = action { if let _action = action {
switch _action { switch _action {
case .calculate: case .calculate:
self.continueButton.setTitle("calculate_text".localized(), for: .normal)
continueButton.setTitle("calculate_text".localized(), for: .normal)
case ._continue: case ._continue:
self.continueButton.setTitle("continue_text".localized(), for: .normal)
continueButton.setTitle("continue_text".localized(), for: .normal)
} }
} }
} }
@ -70,7 +70,7 @@ class SendMoneyExchangeRateViewController: UIViewController {
private var currencyInfoViewModel: [SendMoneyExchangeRateCurrencyViewModel]? { private var currencyInfoViewModel: [SendMoneyExchangeRateCurrencyViewModel]? {
didSet { didSet {
self.selectedCurrencyViewModel = self.currencyInfoViewModel?.first
selectedCurrencyViewModel = currencyInfoViewModel?.first
} }
} }
@ -83,10 +83,8 @@ class SendMoneyExchangeRateViewController: UIViewController {
let serviceCharge = exchangeRateModel?.transferFee ?? "0.00" let serviceCharge = exchangeRateModel?.transferFee ?? "0.00"
let transferFee = serviceCharge != "0.00" ? "-\(serviceCharge)" : "\(serviceCharge)" let transferFee = serviceCharge != "0.00" ? "-\(serviceCharge)" : "\(serviceCharge)"
self.transferFeeInfoLabel.text = transferFee + " (" + "transfer_fee_included_text".localized() + ")"
let exchangeRate = exchangeRateModel?.exchangeRate ?? ""
exchangeRateLabel.text = exchangeRate + " (" + "current_exchange_rate_text".localized() + ")"
transferFeeInfoLabel.text = "\(transferFee) (\("transfer_fee_included_text".localized()))"
exchangeRateLabel.text = "\(exchangeRateModel?.exchangeRate ?? "") (\("current_exchange_rate_text".localized()))"
setCoupon() setCoupon()
@ -110,24 +108,24 @@ class SendMoneyExchangeRateViewController: UIViewController {
} }
} }
private var coupons: [Coupon]? {
didSet {
}
}
private var coupons: [Coupon]?
private var calcBy = "" private var calcBy = ""
private var currencies: [String]? { private var currencies: [String]? {
didSet { didSet {
let models: [SendMoneyExchangeRateCurrencyViewModel] = let models: [SendMoneyExchangeRateCurrencyViewModel] =
(currencies ?? []).map {
(currencies ?? []).map {[weak self] in
guard let `self` = self else {
return SendMoneyExchangeRateCurrencyViewModel()
}
let viewmodel = SendMoneyExchangeRateCurrencyViewModel() let viewmodel = SendMoneyExchangeRateCurrencyViewModel()
viewmodel.countryCode = self.reciepient?.countryCode ?? "" viewmodel.countryCode = self.reciepient?.countryCode ?? ""
viewmodel.currency = $0 viewmodel.currency = $0
return viewmodel return viewmodel
} }
self.currencyInfoViewModel = models
currencyInfoViewModel = models
} }
} }
@ -172,6 +170,7 @@ class SendMoneyExchangeRateViewController: UIViewController {
action = .calculate action = .calculate
senderTextField.becomeFirstResponder() senderTextField.becomeFirstResponder()
senderTextField.delegate = self
calcBy = "c" calcBy = "c"
[backgroundViewCountryLabel1, backgroundViewCountryLabel2].forEach { $0?.layer.cornerRadius = 5 } [backgroundViewCountryLabel1, backgroundViewCountryLabel2].forEach { $0?.layer.cornerRadius = 5 }
@ -182,19 +181,8 @@ class SendMoneyExchangeRateViewController: UIViewController {
} }
configureLanguage() configureLanguage()
// senderTextField.inputView?.keyboardToolbar.doneBarButton.title = "Calculate"
// senderTextField.inputView?.keyboardToolbar.doneBarButton.setTarget(self, action: #selector(calculateRate(_:)))
// reciepientTextField.inputView?.keyboardToolbar.doneBarButton.title = "Calculate"
// reciepientTextField.inputView?.keyboardToolbar.doneBarButton.setTarget(self, action: #selector(calculateRate(_:)))
} }
// @objc private func calculateRate(_ sender: Any){
// print("calcuate!")
//// sender.resignFirstResponder()
// }
private func configureLanguage() { private func configureLanguage() {
youSendTitleLabel.text = "you_send_text".localized() youSendTitleLabel.text = "you_send_text".localized()
recipientGetsTitleLabel.text = "recepient_gets_text".localized() recipientGetsTitleLabel.text = "recepient_gets_text".localized()
@ -234,7 +222,7 @@ class SendMoneyExchangeRateViewController: UIViewController {
private func currencySelected(models: [SendMoneyExchangeRateCurrencyViewModel?]) { private func currencySelected(models: [SendMoneyExchangeRateCurrencyViewModel?]) {
if let model = models.first { if let model = models.first {
self.selectedCurrencyViewModel = model
selectedCurrencyViewModel = model
calcBy.lowercased() == "c" ? (reciepientTextField.text = "") : (senderTextField.text = "") calcBy.lowercased() == "c" ? (reciepientTextField.text = "") : (senderTextField.text = "")
} }
} }
@ -247,8 +235,10 @@ class SendMoneyExchangeRateViewController: UIViewController {
transferFeeInfoLabel.alpha = 0 transferFeeInfoLabel.alpha = 0
exchangeInfoStackView.isHidden = true exchangeInfoStackView.isHidden = true
exchangeInfoStackView.alpha = 0 exchangeInfoStackView.alpha = 0
let dropDownImage = #imageLiteral(resourceName: "dropdown_white").withRenderingMode(UIImageRenderingMode.alwaysTemplate) let dropDownImage = #imageLiteral(resourceName: "dropdown_white").withRenderingMode(UIImageRenderingMode.alwaysTemplate)
let image = dropDownImage let image = dropDownImage
dropDownImageView.image = image dropDownImageView.image = image
dropDownImageView.tintColor = UIColor.white dropDownImageView.tintColor = UIColor.white
setCountryFlag(countryCode: reciepient?.countryCode ?? "") setCountryFlag(countryCode: reciepient?.countryCode ?? "")
@ -327,7 +317,6 @@ class SendMoneyExchangeRateViewController: UIViewController {
calculateExchangeRate(senderAmount: senderAmount, reciepientAmount: reciepientAmount, calcBy: calcBy) calculateExchangeRate(senderAmount: senderAmount, reciepientAmount: reciepientAmount, calcBy: calcBy)
} }
private func goToVerification() { private func goToVerification() {
exchangeRateModel?.calcBy = calcBy exchangeRateModel?.calcBy = calcBy
exchangeRateModel?.reciepientCurrency = selectedCurrencyViewModel?.currency ?? "" exchangeRateModel?.reciepientCurrency = selectedCurrencyViewModel?.currency ?? ""
@ -397,3 +386,15 @@ extension SendMoneyExchangeRateViewController {
self.viewWillAppear(true) self.viewWillAppear(true)
} }
} }
// MARK: - UITextFieldDelegate
extension SendMoneyExchangeRateViewController: UITextFieldDelegate {
func textFieldDidEndEditing(_ textField: UITextField) {
switch textField {
case senderTextField:
calculate()
default:
break
}
}
}

15
GMERemittance/Module/SendMoney/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift

@ -211,9 +211,20 @@ class SendMoneyVerificationViewController: UITableViewController {
// MARK: SendMoneyVerificationViewInterface // MARK: SendMoneyVerificationViewInterface
extension SendMoneyVerificationViewController: SendMoneyVerificationViewInterface { extension SendMoneyVerificationViewController: SendMoneyVerificationViewInterface {
func show(model: SendMoneySubmitModelContainer?) { func show(model: SendMoneySubmitModelContainer?) {
self.alertWithOk(type: .normal, message: model?.message , title: "Success", okTitle: "OK", style: UIAlertControllerStyle.alert, OkStyle: .default) {
guard let message = model?.message, let expectedPoint = model?.extra2 else {
return
}
let successMessage = "\(message)\n(\("estimated_earning_points_text".localized()): \(expectedPoint.likeCommaMoney() ?? "0"))"
self.alertWithOk(
type: .normal,
message: successMessage,
title: "Success",
okTitle: "OK",
style: UIAlertControllerStyle.alert,
OkStyle: .default
) {
if let id = model?.id { if let id = model?.id {
self.presenter?.openReciept(transactionId: id)
self.presenter?.openReciept(transactionId: id)
}else { }else {
self.alert(message: "No Transaction recievied.") self.alert(message: "No Transaction recievied.")
} }

3
bn.lproj/Localizable.strings

@ -484,3 +484,6 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = " কুপণ"; "coupon_text" = " কুপণ";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

3
en.lproj/Localizable.strings

@ -487,3 +487,6 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "Coupon"; "coupon_text" = "Coupon";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

3
id.lproj/Localizable.strings

@ -478,3 +478,6 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "Coupon"; "coupon_text" = "Coupon";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

4
km.lproj/Localizable.strings

@ -491,3 +491,7 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "ប័ណ្ណរង្វាន់"; "coupon_text" = "ប័ណ្ណរង្វាន់";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

4
ko.lproj/Localizable.strings

@ -494,3 +494,7 @@
// Coupon // Coupon
"used_coupon_title_text" = "사용한 쿠폰"; "used_coupon_title_text" = "사용한 쿠폰";
"coupon_text" = "쿠폰"; "coupon_text" = "쿠폰";
// SendMoney For Reward
"estimated_earning_points_text" = "적립 예상 포인트";

4
mn.lproj/Localizable.strings

@ -490,3 +490,7 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "Купон"; "coupon_text" = "Купон";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

3
my-MM.lproj/Localizable.strings

@ -465,3 +465,6 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "ကူပြန္"; "coupon_text" = "ကူပြန္";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

4
my.lproj/Localizable.strings

@ -499,3 +499,7 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "ကူပြန္"; "coupon_text" = "ကူပြန္";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

4
ne.lproj/Localizable.strings

@ -490,3 +490,7 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "कुपन "; "coupon_text" = "कुपन ";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

3
ru-RU.lproj/Localizable.strings

@ -490,3 +490,6 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "Coupon"; "coupon_text" = "Coupon";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

4
si.lproj/Localizable.strings

@ -497,3 +497,7 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "කූපනය"; "coupon_text" = "කූපනය";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

3
th.lproj/Localizable.strings

@ -496,3 +496,6 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "คูปอง"; "coupon_text" = "คูปอง";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

4
uz.lproj/Localizable.strings

@ -493,3 +493,7 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "Coupon"; "coupon_text" = "Coupon";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";

3
vi-VN.lproj/Localizable.strings

@ -489,3 +489,6 @@
// Coupon // Coupon
"used_coupon_title_text" = "Used Coupon"; "used_coupon_title_text" = "Used Coupon";
"coupon_text" = "Coupon"; "coupon_text" = "Coupon";
// SendMoney For Reward
"estimated_earning_points_text" = "Estimated earning points";
Loading…
Cancel
Save