Showing
7 changed files
with
84 additions
and
11 deletions
No preview for this file type
| ... | @@ -417,15 +417,12 @@ import SwiftEventBus | ... | @@ -417,15 +417,12 @@ import SwiftEventBus |
| 417 | 417 | ||
| 418 | @IBAction func boxBannerButtonAction(_ sender: Any) { | 418 | @IBAction func boxBannerButtonAction(_ sender: Any) { |
| 419 | print("BOX coupon banner pressed!") | 419 | print("BOX coupon banner pressed!") |
| 420 | -// // box_analysis_pressed event | ||
| 421 | -// let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel() | ||
| 422 | -// dealsAnalysis._isPressed = true | ||
| 423 | -// SwiftEventBus.post("box_analysis_pressed", sender: dealsAnalysis) | ||
| 424 | 420 | ||
| 425 | // box_analysis_pressed event | 421 | // box_analysis_pressed event |
| 426 | - let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel() | 422 | + let dealsAnalysis = swiftApi.WarplyBoxAnalysisEventModel() |
| 427 | dealsAnalysis._isPressed = true | 423 | dealsAnalysis._isPressed = true |
| 428 | - SwiftEventBus.post("box_analysis_pressed") | 424 | + SwiftEventBus.post("box_analysis_pressed", sender: dealsAnalysis) |
| 425 | + // SwiftEventBus.post("box_analysis_pressed") | ||
| 429 | 426 | ||
| 430 | let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() | 427 | let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() |
| 431 | firebaseEvent._eventName = "did_tap_box_badge" | 428 | firebaseEvent._eventName = "did_tap_box_badge" | ... | ... |
This diff could not be displayed because it is too large.
| ... | @@ -8,13 +8,51 @@ | ... | @@ -8,13 +8,51 @@ |
| 8 | import UIKit | 8 | import UIKit |
| 9 | 9 | ||
| 10 | @objc public class WalletActiveCouponCollectionViewCell: UICollectionViewCell { | 10 | @objc public class WalletActiveCouponCollectionViewCell: UICollectionViewCell { |
| 11 | + @IBOutlet weak var badgeViewParent: UIView! | ||
| 12 | + @IBOutlet weak var badgeView: UIView! | ||
| 13 | + @IBOutlet weak var badgeImage: UIImageView! | ||
| 14 | + @IBOutlet weak var badgeLabel: UILabel! | ||
| 15 | + @IBOutlet weak var badgeCountView: UIView! | ||
| 16 | + @IBOutlet weak var badgeCountLabel: UILabel! | ||
| 11 | 17 | ||
| 12 | public override func awakeFromNib() { | 18 | public override func awakeFromNib() { |
| 13 | super.awakeFromNib() | 19 | super.awakeFromNib() |
| 14 | - | 20 | + |
| 21 | + // Badge Banner | ||
| 22 | +// badgeViewParent.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00) | ||
| 23 | + badgeViewParent.backgroundColor = .white | ||
| 24 | + badgeViewParent.layer.cornerRadius = 16.0 | ||
| 25 | + badgeViewParent.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor | ||
| 26 | + badgeViewParent.layer.shadowOffset = CGSize(width: 0.0, height: 1.0) | ||
| 27 | + badgeViewParent.layer.shadowOpacity = 1.0 | ||
| 28 | + badgeViewParent.layer.shadowRadius = 2.0 | ||
| 29 | + | ||
| 30 | +// badgeView.backgroundColor = UIColor(red: 0.46, green: 0.75, blue: 0.45, alpha: 0.05) | ||
| 31 | + badgeView.backgroundColor = .white | ||
| 32 | + badgeView.layer.cornerRadius = 16.0 | ||
| 33 | + | ||
| 34 | + badgeCountView.layer.cornerRadius = 4.0 | ||
| 35 | + badgeCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00) | ||
| 15 | } | 36 | } |
| 16 | 37 | ||
| 17 | - func configureCell() { | 38 | + func configureCell(badgeId: String, badgeCount: Int) { |
| 18 | - | 39 | + if (badgeId == "dfy") { |
| 40 | + badgeImage.image = UIImage(named: "wallet_banner_dfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
| 41 | + badgeLabel.text = "DEALS FOR YOU" | ||
| 42 | + | ||
| 43 | + } else if (badgeId == "sm") { | ||
| 44 | + badgeImage.image = UIImage(named: "wallet_banner_sm", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
| 45 | + badgeLabel.text = "SUPERMARKET DEALS" | ||
| 46 | + | ||
| 47 | + } else if (badgeId == "gfy") { | ||
| 48 | + badgeImage.image = UIImage(named: "wallet_banner_gfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
| 49 | + badgeLabel.text = "FREE COUPONS" | ||
| 50 | + | ||
| 51 | + } else if (badgeId == "box") { | ||
| 52 | + badgeImage.image = UIImage(named: "wallet_banner_box", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
| 53 | + badgeLabel.text = "BOX" | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + badgeCountLabel.text = String(badgeCount) | ||
| 19 | } | 57 | } |
| 20 | } | 58 | } | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -69,6 +69,7 @@ import SwiftEventBus | ... | @@ -69,6 +69,7 @@ import SwiftEventBus |
| 69 | public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge() | 69 | public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge() |
| 70 | public var profile:swiftApi.ProfileModel? = swiftApi().getConsumer() | 70 | public var profile:swiftApi.ProfileModel? = swiftApi().getConsumer() |
| 71 | public var unifiedCoupons:Array<swiftApi.UnifiedCouponModel> = [] | 71 | public var unifiedCoupons:Array<swiftApi.UnifiedCouponModel> = [] |
| 72 | + public var boxCoupons:Array<swiftApi.ActiveBoxCouponModel> = swiftApi().getActiveBoxCoupons() | ||
| 72 | 73 | ||
| 73 | var timerWallet: DispatchSourceTimer? | 74 | var timerWallet: DispatchSourceTimer? |
| 74 | var seconds: Int = 0 | 75 | var seconds: Int = 0 |
| ... | @@ -1386,8 +1387,9 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ | ... | @@ -1386,8 +1387,9 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ |
| 1386 | 1387 | ||
| 1387 | 1388 | ||
| 1388 | if (indexPath.section == 0) { | 1389 | if (indexPath.section == 0) { |
| 1389 | - let cell = tableView.dequeueReusableCell(withIdentifier: "WalletActiveCouponsTableViewCellId", for: indexPath) as! WalletActiveCouponsTableViewCell | 1390 | + let cell = tableView.dequeueReusableCell(withIdentifier: "WalletActiveCouponsScrollTableViewCellId", for: indexPath) as! WalletActiveCouponsScrollTableViewCell |
| 1390 | - cell.configureCell(dfyCount: self.dfyCoupons.count, smCount: self.unifiedCoupons.count, gfyCount: self.coupons.count) | 1391 | + cell.configureCell(dfyCount: self.dfyCoupons.count, smCount: self.unifiedCoupons.count, gfyCount: self.coupons.count, boxCount: self.boxCoupons.count) |
| 1392 | + cell.parent = self | ||
| 1391 | return cell | 1393 | return cell |
| 1392 | 1394 | ||
| 1393 | } else if (indexPath.section == 1) { | 1395 | } else if (indexPath.section == 1) { | ... | ... |
| ... | @@ -4920,6 +4920,24 @@ public class swiftApi { | ... | @@ -4920,6 +4920,24 @@ public class swiftApi { |
| 4920 | } | 4920 | } |
| 4921 | 4921 | ||
| 4922 | 4922 | ||
| 4923 | + public class WarplyBoxAnalysisEventModel { | ||
| 4924 | + private var isPressed: Bool | ||
| 4925 | + | ||
| 4926 | + public init() { | ||
| 4927 | + self.isPressed = false | ||
| 4928 | + } | ||
| 4929 | + | ||
| 4930 | + public var _isPressed: Bool { | ||
| 4931 | + get { // getter | ||
| 4932 | + return self.isPressed | ||
| 4933 | + } | ||
| 4934 | + set(newValue) { //setter | ||
| 4935 | + self.isPressed = newValue | ||
| 4936 | + } | ||
| 4937 | + } | ||
| 4938 | + } | ||
| 4939 | + | ||
| 4940 | + | ||
| 4923 | public class ActiveDFYCouponEventModel { | 4941 | public class ActiveDFYCouponEventModel { |
| 4924 | private var isPressed: Bool | 4942 | private var isPressed: Bool |
| 4925 | 4943 | ||
| ... | @@ -4938,6 +4956,24 @@ public class swiftApi { | ... | @@ -4938,6 +4956,24 @@ public class swiftApi { |
| 4938 | } | 4956 | } |
| 4939 | 4957 | ||
| 4940 | 4958 | ||
| 4959 | + public class ActiveBoxCouponEventModel { | ||
| 4960 | + private var isPressed: Bool | ||
| 4961 | + | ||
| 4962 | + public init() { | ||
| 4963 | + self.isPressed = false | ||
| 4964 | + } | ||
| 4965 | + | ||
| 4966 | + public var _isPressed: Bool { | ||
| 4967 | + get { // getter | ||
| 4968 | + return self.isPressed | ||
| 4969 | + } | ||
| 4970 | + set(newValue) { //setter | ||
| 4971 | + self.isPressed = newValue | ||
| 4972 | + } | ||
| 4973 | + } | ||
| 4974 | + } | ||
| 4975 | + | ||
| 4976 | + | ||
| 4941 | public class WarplyCCMSEnabledModel { | 4977 | public class WarplyCCMSEnabledModel { |
| 4942 | private var isActivated: Bool | 4978 | private var isActivated: Bool |
| 4943 | 4979 | ... | ... |
-
Please register or login to post a comment