Showing
6 changed files
with
278 additions
and
17 deletions
| ... | @@ -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> | ... | ... |
No preview for this file type
This diff is collapsed. Click to expand it.
| ... | @@ -9,9 +9,75 @@ import UIKit | ... | @@ -9,9 +9,75 @@ import UIKit |
| 9 | 9 | ||
| 10 | @objc public class WalletBannersTableViewCell: UITableViewCell { | 10 | @objc public class WalletBannersTableViewCell: UITableViewCell { |
| 11 | 11 | ||
| 12 | + @IBOutlet weak var sumBannerArrowImage: UIImageView! | ||
| 13 | + @IBOutlet weak var sumBannerInnerView: UIView! | ||
| 14 | + @IBOutlet weak var sumBadgeImage: UIImageView! | ||
| 15 | + @IBOutlet weak var sumBadgeLabel: UILabel! | ||
| 16 | + @IBOutlet weak var sumBannerLabel: UILabel! | ||
| 17 | + | ||
| 18 | + @IBOutlet weak var dfyBannerView: UIView! | ||
| 19 | + @IBOutlet weak var dfyBannerHeight: NSLayoutConstraint! | ||
| 20 | + @IBOutlet weak var dfyBannerTopSpace: NSLayoutConstraint! | ||
| 21 | + @IBOutlet weak var dfyBannerInnerView: UIView! | ||
| 22 | + @IBOutlet weak var dfyBadgeImage: UIImageView! | ||
| 23 | + @IBOutlet weak var dfyBadgeLabel: UILabel! | ||
| 24 | + @IBOutlet weak var dfyBannerLabel: UILabel! | ||
| 25 | + | ||
| 26 | + @IBOutlet weak var gfyBannerView: UIView! | ||
| 27 | + @IBOutlet weak var gfyBannerHeight: NSLayoutConstraint! | ||
| 28 | + @IBOutlet weak var gfyBannerTopSpace: NSLayoutConstraint! | ||
| 29 | + @IBOutlet weak var gfyBannerInnerView: UIView! | ||
| 30 | + @IBOutlet weak var couponBadgeImage: UIImageView! | ||
| 31 | + @IBOutlet weak var couponBadgeLabel: UILabel! | ||
| 32 | + @IBOutlet weak var gfyBannerLabel: UILabel! | ||
| 33 | + | ||
| 34 | + @IBOutlet weak var marketBannerView: UIView! | ||
| 35 | + @IBOutlet weak var marketBannerHeight: NSLayoutConstraint! | ||
| 36 | + @IBOutlet weak var marketBannerTopSpace: NSLayoutConstraint! | ||
| 37 | + @IBOutlet weak var marketBannerInnerView: UIView! | ||
| 38 | + @IBOutlet weak var marketBadgeImage: UIImageView! | ||
| 39 | + @IBOutlet weak var marketBadgeLabel: UILabel! | ||
| 40 | + @IBOutlet weak var marketBannerLabel: UILabel! | ||
| 41 | + | ||
| 42 | + public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge() | ||
| 43 | + | ||
| 12 | public override func awakeFromNib() { | 44 | public override func awakeFromNib() { |
| 13 | super.awakeFromNib() | 45 | super.awakeFromNib() |
| 14 | // Initialization code | 46 | // Initialization code |
| 47 | + | ||
| 48 | + sumBadgeImage.image = UIImage(named: "wallet_summary_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
| 49 | + dfyBadgeImage.image = UIImage(named: "wallet_dfy_3", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
| 50 | + couponBadgeImage.image = UIImage(named: "wallet_coupons_4", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
| 51 | + marketBadgeImage.image = UIImage(named: "wallet_market_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
| 52 | + | ||
| 53 | + sumBannerInnerView.layer.cornerRadius = 16.5 | ||
| 54 | + sumBannerInnerView.layer.borderWidth = 1 | ||
| 55 | + sumBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor | ||
| 56 | + | ||
| 57 | + dfyBannerInnerView.layer.cornerRadius = 16.5 | ||
| 58 | + dfyBannerInnerView.layer.borderWidth = 1 | ||
| 59 | + dfyBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor | ||
| 60 | + | ||
| 61 | + gfyBannerInnerView.layer.cornerRadius = 16.5 | ||
| 62 | + gfyBannerInnerView.layer.borderWidth = 1 | ||
| 63 | + gfyBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor | ||
| 64 | + | ||
| 65 | + marketBannerInnerView.layer.cornerRadius = 16.5 | ||
| 66 | + marketBannerInnerView.layer.borderWidth = 1 | ||
| 67 | + marketBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor | ||
| 68 | + | ||
| 69 | + dfyBannerView.isHidden = true | ||
| 70 | + dfyBannerHeight.constant = 0.0 | ||
| 71 | + dfyBannerTopSpace.constant = 0.0 | ||
| 72 | + | ||
| 73 | + gfyBannerView.isHidden = true | ||
| 74 | + gfyBannerHeight.constant = 0.0 | ||
| 75 | + gfyBannerTopSpace.constant = 0.0 | ||
| 76 | + | ||
| 77 | + marketBannerView.isHidden = true | ||
| 78 | + marketBannerHeight.constant = 0.0 | ||
| 79 | + marketBannerTopSpace.constant = 0.0 | ||
| 80 | + | ||
| 15 | } | 81 | } |
| 16 | 82 | ||
| 17 | public override func setSelected(_ selected: Bool, animated: Bool) { | 83 | public override func setSelected(_ selected: Bool, animated: Bool) { |
| ... | @@ -20,4 +86,132 @@ import UIKit | ... | @@ -20,4 +86,132 @@ import UIKit |
| 20 | // Configure the view for the selected state | 86 | // Configure the view for the selected state |
| 21 | } | 87 | } |
| 22 | 88 | ||
| 89 | + func configureCell(totalCouponValue: Float, totalCouponDiscount: Float, unifiedCouponsDiscount: Float, forYouExpanded: Bool) { | ||
| 90 | + | ||
| 91 | + if (forYouExpanded == false) { | ||
| 92 | + sumBannerArrowImage.image = UIImage(named: "ic_down_dark_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
| 93 | + | ||
| 94 | + dfyBannerView.isHidden = true | ||
| 95 | + dfyBannerHeight.constant = 0.0 | ||
| 96 | + dfyBannerTopSpace.constant = 0.0 | ||
| 97 | + | ||
| 98 | + gfyBannerView.isHidden = true | ||
| 99 | + gfyBannerHeight.constant = 0.0 | ||
| 100 | + gfyBannerTopSpace.constant = 0.0 | ||
| 101 | + | ||
| 102 | + marketBannerView.isHidden = true | ||
| 103 | + marketBannerHeight.constant = 0.0 | ||
| 104 | + marketBannerTopSpace.constant = 0.0 | ||
| 105 | + | ||
| 106 | + } else { | ||
| 107 | + sumBannerArrowImage.image = UIImage(named: "ic_up_dark_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
| 108 | + | ||
| 109 | + dfyBannerView.isHidden = false | ||
| 110 | + dfyBannerHeight.constant = 80.0 | ||
| 111 | + dfyBannerTopSpace.constant = 8.0 | ||
| 112 | + | ||
| 113 | + gfyBannerView.isHidden = false | ||
| 114 | + gfyBannerHeight.constant = 80.0 | ||
| 115 | + gfyBannerTopSpace.constant = 8.0 | ||
| 116 | + | ||
| 117 | + marketBannerView.isHidden = false | ||
| 118 | + marketBannerHeight.constant = 80.0 | ||
| 119 | + marketBannerTopSpace.constant = 8.0 | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + if (totalCouponValue == 0.0 && loyaltyBadge._couponCount == 0 && unifiedCouponsDiscount == 0.0) { | ||
| 123 | + sumBannerArrowImage.isHidden = true | ||
| 124 | + } else { | ||
| 125 | + sumBannerArrowImage.isHidden = false | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + // === | ||
| 129 | + | ||
| 130 | + let sumRewards = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount | ||
| 131 | + | ||
| 132 | +// if (sumRewards == 0.0) { | ||
| 133 | +// sumBannerArrowImage.isHidden = true | ||
| 134 | +// } else { | ||
| 135 | +// sumBannerArrowImage.isHidden = false | ||
| 136 | +// } | ||
| 137 | + | ||
| 138 | +// sumRewards = Float(round(100 * sumRewards) / 100) | ||
| 139 | + var sumRewardsString = "0" | ||
| 140 | + sumRewardsString = String(format: "%.2f", sumRewards).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil) | ||
| 141 | + sumBadgeLabel.text = sumRewardsString + "€" | ||
| 142 | + | ||
| 143 | + let sumNormalText1 = "Μέχρι τώρα έχεις κερδίσει " | ||
| 144 | + let sumBoldText = sumRewardsString + "€" | ||
| 145 | + let sumNormalText2 = " στο For You!" | ||
| 146 | + | ||
| 147 | + let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 14) ?? UIFont.systemFont(ofSize: 13), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)] | ||
| 148 | + let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 14) ?? UIFont.boldSystemFont(ofSize: 13), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)] | ||
| 149 | + | ||
| 150 | + let sumAttributedString = NSMutableAttributedString(string:sumNormalText1, attributes:attrRegular) | ||
| 151 | + let sumBoldString = NSMutableAttributedString(string: sumBoldText, attributes:attrBold) | ||
| 152 | + let sumNormalString = NSMutableAttributedString(string:sumNormalText2, attributes:attrRegular) | ||
| 153 | + | ||
| 154 | + sumAttributedString.append(sumBoldString) | ||
| 155 | + sumAttributedString.append(sumNormalString) | ||
| 156 | + sumBannerLabel.attributedText = sumAttributedString | ||
| 157 | + | ||
| 158 | + // === | ||
| 159 | + | ||
| 160 | + let totalCouponValueFixed = Float(round(100 * totalCouponValue) / 100) | ||
| 161 | + var totalCouponValueString = "0" | ||
| 162 | + totalCouponValueString = String(format: "%.2f", totalCouponValueFixed).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil) | ||
| 163 | + dfyBadgeLabel.text = totalCouponValueString + "€" | ||
| 164 | + | ||
| 165 | + let dfyNormalText1 = "Έχεις κερδίσει " | ||
| 166 | + let dfyBoldText = totalCouponValueString + "€" | ||
| 167 | + let dfyNormalText2 = " με το DEALS for YOU!" | ||
| 168 | + | ||
| 169 | + let dfyAttributedString = NSMutableAttributedString(string:dfyNormalText1, attributes:attrRegular) | ||
| 170 | + let dfyBoldString = NSMutableAttributedString(string: dfyBoldText, attributes:attrBold) | ||
| 171 | + let dfyNormalString = NSMutableAttributedString(string:dfyNormalText2, attributes:attrRegular) | ||
| 172 | + | ||
| 173 | + dfyAttributedString.append(dfyBoldString) | ||
| 174 | + dfyAttributedString.append(dfyNormalString) | ||
| 175 | + dfyBannerLabel.attributedText = dfyAttributedString | ||
| 176 | + | ||
| 177 | + // === | ||
| 178 | + | ||
| 179 | + var totalCouponDiscountString = "0" | ||
| 180 | + totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil) | ||
| 181 | + couponBadgeLabel.text = totalCouponDiscountString + "€" | ||
| 182 | + | ||
| 183 | + let gfyNormalText1 = "Έχεις κερδίσει " | ||
| 184 | + let gfyBoldText = totalCouponDiscountString + "€" | ||
| 185 | + let gfyNormalText2 = " με το GIFTS for YOU!" | ||
| 186 | + | ||
| 187 | + let gfyAttributedString = NSMutableAttributedString(string:gfyNormalText1, attributes:attrRegular) | ||
| 188 | + let gfyBoldString = NSMutableAttributedString(string: gfyBoldText, attributes:attrBold) | ||
| 189 | + let gfyNormalString = NSMutableAttributedString(string:gfyNormalText2, attributes:attrRegular) | ||
| 190 | + | ||
| 191 | + gfyAttributedString.append(gfyBoldString) | ||
| 192 | + gfyAttributedString.append(gfyNormalString) | ||
| 193 | + gfyBannerLabel.attributedText = gfyAttributedString | ||
| 194 | + | ||
| 195 | + // === | ||
| 196 | + | ||
| 197 | + let marketDiscount = Float(round(100 * unifiedCouponsDiscount) / 100) | ||
| 198 | + var marketDiscountString = "0" | ||
| 199 | + marketDiscountString = String(format: "%.2f", marketDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil) | ||
| 200 | + | ||
| 201 | + self.marketBadgeLabel.text = marketDiscountString + "€" | ||
| 202 | + | ||
| 203 | + let marketNormalText1 = "Έχεις κερδίσει " | ||
| 204 | + let marketBoldText = marketDiscountString + "€" | ||
| 205 | + let marketNormalText2 = " με τα SuperMarket Deals!" | ||
| 206 | + | ||
| 207 | + let marketAttributedString = NSMutableAttributedString(string:marketNormalText1, attributes:attrRegular) | ||
| 208 | + let marketBoldString = NSMutableAttributedString(string: marketBoldText, attributes:attrBold) | ||
| 209 | + let marketNormalString = NSMutableAttributedString(string:marketNormalText2, attributes:attrRegular) | ||
| 210 | + | ||
| 211 | + marketAttributedString.append(marketBoldString) | ||
| 212 | + marketAttributedString.append(marketNormalString) | ||
| 213 | + marketBannerLabel.attributedText = marketAttributedString | ||
| 214 | + | ||
| 215 | + } | ||
| 216 | + | ||
| 23 | } | 217 | } | ... | ... |
| ... | @@ -75,6 +75,8 @@ import SwiftEventBus | ... | @@ -75,6 +75,8 @@ import SwiftEventBus |
| 75 | let totalCouponDiscount = Float(round(100 * swiftApi().getLoyaltyBadge()._value) / 100) | 75 | let totalCouponDiscount = Float(round(100 * swiftApi().getLoyaltyBadge()._value) / 100) |
| 76 | var unifiedCouponsDiscount:Float = 0.0 | 76 | var unifiedCouponsDiscount:Float = 0.0 |
| 77 | 77 | ||
| 78 | + var forYouExpanded: Bool = false; | ||
| 79 | + | ||
| 78 | public override func viewDidLoad() { | 80 | public override func viewDidLoad() { |
| 79 | super.viewDidLoad() | 81 | super.viewDidLoad() |
| 80 | 82 | ||
| ... | @@ -191,12 +193,12 @@ import SwiftEventBus | ... | @@ -191,12 +193,12 @@ import SwiftEventBus |
| 191 | if (totalCouponValue == 0.0) { | 193 | if (totalCouponValue == 0.0) { |
| 192 | dfyEarnBannerView.isHidden = true | 194 | dfyEarnBannerView.isHidden = true |
| 193 | dfyEarnBannerHeight.constant = 0 | 195 | dfyEarnBannerHeight.constant = 0 |
| 194 | - dfyEarnBannerTopSpace.constant = 0 | 196 | +// dfyEarnBannerTopSpace.constant = 0 |
| 195 | 197 | ||
| 196 | } else { | 198 | } else { |
| 197 | dfyEarnBannerView.isHidden = false | 199 | dfyEarnBannerView.isHidden = false |
| 198 | dfyEarnBannerHeight.constant = 75 | 200 | dfyEarnBannerHeight.constant = 75 |
| 199 | - dfyEarnBannerTopSpace.constant = 30 | 201 | +// dfyEarnBannerTopSpace.constant = 30 |
| 200 | 202 | ||
| 201 | } | 203 | } |
| 202 | 204 | ||
| ... | @@ -418,6 +420,10 @@ import SwiftEventBus | ... | @@ -418,6 +420,10 @@ import SwiftEventBus |
| 418 | emptyLabel.text = "Δεν έχεις κάποιον ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές!" | 420 | emptyLabel.text = "Δεν έχεις κάποιον ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές!" |
| 419 | 421 | ||
| 420 | updateMarketBadge() | 422 | updateMarketBadge() |
| 423 | + | ||
| 424 | + // TODO: DELETE if emptyView is needed again | ||
| 425 | + emptyView.isHidden = true | ||
| 426 | + emptyViewHeight.constant = 0 | ||
| 421 | } | 427 | } |
| 422 | 428 | ||
| 423 | public override func viewWillAppear(_ animated: Bool) { | 429 | public override func viewWillAppear(_ animated: Bool) { |
| ... | @@ -563,13 +569,14 @@ import SwiftEventBus | ... | @@ -563,13 +569,14 @@ import SwiftEventBus |
| 563 | } | 569 | } |
| 564 | } | 570 | } |
| 565 | 571 | ||
| 566 | - if (totalCouponValue == 0.0 && loyaltyBadge._couponCount == 0 && dfyCoupons.count == 0 && coupons.count == 0 && unifiedCoupons.count == 0 && unifiedCouponsDiscount == 0.0) { | 572 | + // TODO: UNCOMMENT if emptyView is needed again |
| 567 | - emptyView.isHidden = false | 573 | +// if (totalCouponValue == 0.0 && loyaltyBadge._couponCount == 0 && dfyCoupons.count == 0 && coupons.count == 0 && unifiedCoupons.count == 0 && unifiedCouponsDiscount == 0.0) { |
| 568 | - emptyViewHeight.constant = emptyView.intrinsicContentSize.height | 574 | +// emptyView.isHidden = false |
| 569 | - } else { | 575 | +// emptyViewHeight.constant = emptyView.intrinsicContentSize.height |
| 570 | - emptyView.isHidden = true | 576 | +// } else { |
| 571 | - emptyViewHeight.constant = 0 | 577 | +// emptyView.isHidden = true |
| 572 | - } | 578 | +// emptyViewHeight.constant = 0 |
| 579 | +// } | ||
| 573 | } | 580 | } |
| 574 | 581 | ||
| 575 | // MARK: - API Functions | 582 | // MARK: - API Functions |
| ... | @@ -686,6 +693,63 @@ import SwiftEventBus | ... | @@ -686,6 +693,63 @@ import SwiftEventBus |
| 686 | } | 693 | } |
| 687 | } | 694 | } |
| 688 | 695 | ||
| 696 | + @IBAction func sumBannerButtonAction(_ sender: Any) { | ||
| 697 | + if (!(self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0)) { | ||
| 698 | + self.forYouExpanded = !self.forYouExpanded | ||
| 699 | + self.tableView.reloadData() | ||
| 700 | + } | ||
| 701 | + } | ||
| 702 | + | ||
| 703 | + | ||
| 704 | + @IBAction func dfyBannerButtonAction(_ sender: Any) { | ||
| 705 | + var totalCouponValue = swiftApi().getDealsCouponsSum() | ||
| 706 | + if (totalCouponValue > 0.0) { | ||
| 707 | + print("DFY coupon banner pressed!") | ||
| 708 | + // analysis_pressed event | ||
| 709 | + let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel() | ||
| 710 | + dealsAnalysis._isPressed = true | ||
| 711 | + SwiftEventBus.post("analysis_pressed", sender: dealsAnalysis) | ||
| 712 | + | ||
| 713 | + let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() | ||
| 714 | + firebaseEvent._eventName = "did_tap_gifts_for_you_badge" | ||
| 715 | + firebaseEvent.setParameter = ("screen", "Loyalty Wallet") | ||
| 716 | + SwiftEventBus.post("firebase", sender: firebaseEvent) | ||
| 717 | + | ||
| 718 | + swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "DealsBanner")) | ||
| 719 | + } | ||
| 720 | + } | ||
| 721 | + | ||
| 722 | + @IBAction func gfyBannerButtonAction(_ sender: Any) { | ||
| 723 | + if (loyaltyBadge._couponCount > 0) { | ||
| 724 | + let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() | ||
| 725 | + firebaseEvent._eventName = "did_tap_deals_for_you_badge" | ||
| 726 | + firebaseEvent.setParameter = ("screen", "Loyalty Wallet") | ||
| 727 | + SwiftEventBus.post("firebase", sender: firebaseEvent) | ||
| 728 | + | ||
| 729 | + swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyBanner")) | ||
| 730 | + | ||
| 731 | + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) | ||
| 732 | + let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyAnalysisViewController") as! SwiftWarplyFramework.LoyaltyAnalysisViewController | ||
| 733 | + self.navigationController?.pushViewController(vc, animated: true) | ||
| 734 | + } | ||
| 735 | + } | ||
| 736 | + | ||
| 737 | + @IBAction func marketBannerButtonAction(_ sender: Any) { | ||
| 738 | + // TODO: add action - open marketHistory after check | ||
| 739 | + if (self.unifiedCouponsDiscount > 0.0) { | ||
| 740 | +// let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() | ||
| 741 | +// firebaseEvent._eventName = "did_tap_deals_for_you_badge" | ||
| 742 | +// firebaseEvent.setParameter = ("screen", "Loyalty Wallet") | ||
| 743 | +// SwiftEventBus.post("firebase", sender: firebaseEvent) | ||
| 744 | + | ||
| 745 | +// swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyBanner")) | ||
| 746 | + | ||
| 747 | + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) | ||
| 748 | + let vc = storyboard.instantiateViewController(withIdentifier: "MarketLoyaltyAnalysisViewController") as! SwiftWarplyFramework.MarketLoyaltyAnalysisViewController | ||
| 749 | + self.navigationController?.pushViewController(vc, animated: true) | ||
| 750 | + } | ||
| 751 | + } | ||
| 752 | + | ||
| 689 | } | 753 | } |
| 690 | 754 | ||
| 691 | // MARK: - TableView | 755 | // MARK: - TableView |
| ... | @@ -699,9 +763,9 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ | ... | @@ -699,9 +763,9 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ |
| 699 | if (section == 0) { | 763 | if (section == 0) { |
| 700 | // TODO: Uncomment when UnifiedCoupons will be shown again | 764 | // TODO: Uncomment when UnifiedCoupons will be shown again |
| 701 | // if (self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0) { | 765 | // if (self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0) { |
| 702 | - return 0 | 766 | +// return 0 |
| 703 | // } else { | 767 | // } else { |
| 704 | -// return 1 | 768 | + return 1 |
| 705 | // } | 769 | // } |
| 706 | } else if (section == 1) { | 770 | } else if (section == 1) { |
| 707 | return self.unifiedCoupons.count | 771 | return self.unifiedCoupons.count |
| ... | @@ -722,9 +786,9 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ | ... | @@ -722,9 +786,9 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ |
| 722 | if (indexPath.section == 0) { | 786 | if (indexPath.section == 0) { |
| 723 | // TODO: Uncomment when UnifiedCoupons will be shown again | 787 | // TODO: Uncomment when UnifiedCoupons will be shown again |
| 724 | // if (self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0) { | 788 | // if (self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0) { |
| 725 | - return 0.0 | 789 | +// return 0.0 |
| 726 | // } else { | 790 | // } else { |
| 727 | -// return UITableView.automaticDimension | 791 | + return UITableView.automaticDimension |
| 728 | // } | 792 | // } |
| 729 | } else if (indexPath.section == 1) { | 793 | } else if (indexPath.section == 1) { |
| 730 | if (self.unifiedCoupons.count > 0) { | 794 | if (self.unifiedCoupons.count > 0) { |
| ... | @@ -856,9 +920,12 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ | ... | @@ -856,9 +920,12 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ |
| 856 | public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | 920 | public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| 857 | 921 | ||
| 858 | if (indexPath.section == 0) { | 922 | if (indexPath.section == 0) { |
| 859 | - let cell = tableView.dequeueReusableCell(withIdentifier: "WalletBadgesTableViewCellId", for: indexPath) as! WalletBadgesTableViewCell | 923 | + let cell = tableView.dequeueReusableCell(withIdentifier: "WalletBannersTableViewCellId", for: indexPath) as! WalletBannersTableViewCell |
| 860 | - cell.configureCell(totalCouponValue: self.totalCouponValue, totalCouponDiscount: self.totalCouponDiscount, unifiedCouponsDiscount: self.unifiedCouponsDiscount) | 924 | + cell.configureCell(totalCouponValue: self.totalCouponValue, totalCouponDiscount: self.totalCouponDiscount, unifiedCouponsDiscount: self.unifiedCouponsDiscount, forYouExpanded: self.forYouExpanded) |
| 861 | return cell | 925 | return cell |
| 926 | +// let cell = tableView.dequeueReusableCell(withIdentifier: "WalletBadgesTableViewCellId", for: indexPath) as! WalletBadgesTableViewCell | ||
| 927 | +// cell.configureCell(totalCouponValue: self.totalCouponValue, totalCouponDiscount: self.totalCouponDiscount, unifiedCouponsDiscount: self.unifiedCouponsDiscount) | ||
| 928 | +// return cell | ||
| 862 | } else if (indexPath.section == 1) { | 929 | } else if (indexPath.section == 1) { |
| 863 | let cell = tableView.dequeueReusableCell(withIdentifier: "UnifiedCouponsTableViewCellId", for: indexPath) as! UnifiedCouponsTableViewCell | 930 | let cell = tableView.dequeueReusableCell(withIdentifier: "UnifiedCouponsTableViewCellId", for: indexPath) as! UnifiedCouponsTableViewCell |
| 864 | cell.configureCell(coupon: unifiedCoupons[indexPath.row]) | 931 | cell.configureCell(coupon: unifiedCoupons[indexPath.row]) | ... | ... |
-
Please register or login to post a comment