Manos Chorianopoulos

add LoyaltyHistoryVC part 2, wallet fixes

...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>1</integer> 10 + <integer>0</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>0</integer> 10 + <integer>1</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
This diff could not be displayed because it is too large.
...@@ -122,6 +122,16 @@ import SwiftEventBus ...@@ -122,6 +122,16 @@ import SwiftEventBus
122 } 122 }
123 } 123 }
124 124
125 + SwiftEventBus.onBackgroundThread(self, name: "vouchers_service_unavailable") { result in
126 +
127 + DispatchQueue.main.async {
128 + print("=== vouchers_service_unavailable event ===")
129 +
130 + self.showVouchersFailureDialog()
131 +
132 + }
133 + }
134 +
125 // TODO: DELETE ===> 135 // TODO: DELETE ===>
126 // let coupon = swiftApi.ActiveDFYCouponModel() 136 // let coupon = swiftApi.ActiveDFYCouponModel()
127 // coupon._value = "12" 137 // coupon._value = "12"
...@@ -149,7 +159,7 @@ import SwiftEventBus ...@@ -149,7 +159,7 @@ import SwiftEventBus
149 // TODO: Uncomment when UnifiedCoupons will be shown again 159 // TODO: Uncomment when UnifiedCoupons will be shown again
150 // getCouponsSetsDealsRequest() 160 // getCouponsSetsDealsRequest()
151 161
152 - setBackButton() 162 + setBackButton("ic_close_3")
153 setNavigationTitle("My Rewards") 163 setNavigationTitle("My Rewards")
154 164
155 tableView.delegate = self 165 tableView.delegate = self
...@@ -605,6 +615,28 @@ import SwiftEventBus ...@@ -605,6 +615,28 @@ import SwiftEventBus
605 })) 615 }))
606 self.present(alert, animated: true, completion: nil) 616 self.present(alert, animated: true, completion: nil)
607 } 617 }
618 +
619 + func showVouchersFailureDialog() -> Void {
620 +
621 + let alert = UIAlertController(title: "Προσπάθησε ξανά αργότερα", message: "Προσωρινά μη διαθέσιμη πληροφορία.\nΠαρακαλούμε δοκίμασε ξανά σε λίγο.", preferredStyle: .alert)
622 + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
623 + switch action.style{
624 + case .default:
625 +// self.handleSpinnerAndEmptyView()
626 +// self.tableView.reloadData()
627 + self.navigationController?.popViewController(animated: true)
628 + self.dismiss(animated: true, completion: {})
629 +
630 + case .cancel:
631 + print("cancel")
632 +
633 + case .destructive:
634 + print("destructive")
635 +
636 + }
637 + }))
638 + self.present(alert, animated: true, completion: nil)
639 + }
608 640
609 func startTimer() { 641 func startTimer() {
610 print("========= MyRewards Timer Started! =========") 642 print("========= MyRewards Timer Started! =========")
...@@ -720,15 +752,24 @@ import SwiftEventBus ...@@ -720,15 +752,24 @@ import SwiftEventBus
720 } 752 }
721 753
722 } else { 754 } else {
723 - self.emptyView.isHidden = true
724 - self.emptyViewHeight.constant = 0
725 -
726 self.showSpinner = false 755 self.showSpinner = false
727 - 756 +
728 if (self.dfyCoupons.count == 0 && self.unifiedCoupons.count == 0 && self.coupons.count == 0) { 757 if (self.dfyCoupons.count == 0 && self.unifiedCoupons.count == 0 && self.coupons.count == 0) {
729 self.showActiveCouponsBanners = false 758 self.showActiveCouponsBanners = false
730 759
760 + if (swiftApi().getShowVouchersBanner() == "false") {
761 + self.emptyView.isHidden = false
762 + self.emptyViewHeight.constant = self.emptyView.intrinsicContentSize.height
763 +
764 + } else {
765 + self.emptyView.isHidden = true
766 + self.emptyViewHeight.constant = 0
767 + }
768 +
731 } else { 769 } else {
770 + self.emptyView.isHidden = true
771 + self.emptyViewHeight.constant = 0
772 +
732 self.showActiveCouponsBanners = true 773 self.showActiveCouponsBanners = true
733 } 774 }
734 } 775 }
...@@ -787,8 +828,9 @@ import SwiftEventBus ...@@ -787,8 +828,9 @@ import SwiftEventBus
787 828
788 swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyHistoryBadge")) 829 swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyHistoryBadge"))
789 830
790 - // TODO: Open new HistoryVC 831 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
791 - 832 + let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyHistoryViewController") as! SwiftWarplyFramework.LoyaltyHistoryViewController
833 + self.navigationController?.pushViewController(vc, animated: true)
792 } 834 }
793 835
794 @IBAction func dfyEarnButtonAction(_ sender: Any) { 836 @IBAction func dfyEarnButtonAction(_ sender: Any) {
......