Manos Chorianopoulos

box redesign MyRewards

......@@ -417,15 +417,12 @@ import SwiftEventBus
@IBAction func boxBannerButtonAction(_ sender: Any) {
print("BOX coupon banner pressed!")
// // box_analysis_pressed event
// let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel()
// dealsAnalysis._isPressed = true
// SwiftEventBus.post("box_analysis_pressed", sender: dealsAnalysis)
// box_analysis_pressed event
let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel()
let dealsAnalysis = swiftApi.WarplyBoxAnalysisEventModel()
dealsAnalysis._isPressed = true
SwiftEventBus.post("box_analysis_pressed")
SwiftEventBus.post("box_analysis_pressed", sender: dealsAnalysis)
// SwiftEventBus.post("box_analysis_pressed")
let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
firebaseEvent._eventName = "did_tap_box_badge"
......
This diff could not be displayed because it is too large.
......@@ -8,13 +8,51 @@
import UIKit
@objc public class WalletActiveCouponCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var badgeViewParent: UIView!
@IBOutlet weak var badgeView: UIView!
@IBOutlet weak var badgeImage: UIImageView!
@IBOutlet weak var badgeLabel: UILabel!
@IBOutlet weak var badgeCountView: UIView!
@IBOutlet weak var badgeCountLabel: UILabel!
public override func awakeFromNib() {
super.awakeFromNib()
// Badge Banner
// badgeViewParent.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
badgeViewParent.backgroundColor = .white
badgeViewParent.layer.cornerRadius = 16.0
badgeViewParent.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
badgeViewParent.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
badgeViewParent.layer.shadowOpacity = 1.0
badgeViewParent.layer.shadowRadius = 2.0
// badgeView.backgroundColor = UIColor(red: 0.46, green: 0.75, blue: 0.45, alpha: 0.05)
badgeView.backgroundColor = .white
badgeView.layer.cornerRadius = 16.0
badgeCountView.layer.cornerRadius = 4.0
badgeCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00)
}
func configureCell() {
func configureCell(badgeId: String, badgeCount: Int) {
if (badgeId == "dfy") {
badgeImage.image = UIImage(named: "wallet_banner_dfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
badgeLabel.text = "DEALS FOR YOU"
} else if (badgeId == "sm") {
badgeImage.image = UIImage(named: "wallet_banner_sm", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
badgeLabel.text = "SUPERMARKET DEALS"
} else if (badgeId == "gfy") {
badgeImage.image = UIImage(named: "wallet_banner_gfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
badgeLabel.text = "FREE COUPONS"
} else if (badgeId == "box") {
badgeImage.image = UIImage(named: "wallet_banner_box", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
badgeLabel.text = "BOX"
}
badgeCountLabel.text = String(badgeCount)
}
}
......
......@@ -69,6 +69,7 @@ import SwiftEventBus
public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge()
public var profile:swiftApi.ProfileModel? = swiftApi().getConsumer()
public var unifiedCoupons:Array<swiftApi.UnifiedCouponModel> = []
public var boxCoupons:Array<swiftApi.ActiveBoxCouponModel> = swiftApi().getActiveBoxCoupons()
var timerWallet: DispatchSourceTimer?
var seconds: Int = 0
......@@ -1386,8 +1387,9 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
if (indexPath.section == 0) {
let cell = tableView.dequeueReusableCell(withIdentifier: "WalletActiveCouponsTableViewCellId", for: indexPath) as! WalletActiveCouponsTableViewCell
cell.configureCell(dfyCount: self.dfyCoupons.count, smCount: self.unifiedCoupons.count, gfyCount: self.coupons.count)
let cell = tableView.dequeueReusableCell(withIdentifier: "WalletActiveCouponsScrollTableViewCellId", for: indexPath) as! WalletActiveCouponsScrollTableViewCell
cell.configureCell(dfyCount: self.dfyCoupons.count, smCount: self.unifiedCoupons.count, gfyCount: self.coupons.count, boxCount: self.boxCoupons.count)
cell.parent = self
return cell
} else if (indexPath.section == 1) {
......
......@@ -4920,6 +4920,24 @@ public class swiftApi {
}
public class WarplyBoxAnalysisEventModel {
private var isPressed: Bool
public init() {
self.isPressed = false
}
public var _isPressed: Bool {
get { // getter
return self.isPressed
}
set(newValue) { //setter
self.isPressed = newValue
}
}
}
public class ActiveDFYCouponEventModel {
private var isPressed: Bool
......@@ -4938,6 +4956,24 @@ public class swiftApi {
}
public class ActiveBoxCouponEventModel {
private var isPressed: Bool
public init() {
self.isPressed = false
}
public var _isPressed: Bool {
get { // getter
return self.isPressed
}
set(newValue) { //setter
self.isPressed = newValue
}
}
}
public class WarplyCCMSEnabledModel {
private var isActivated: Bool
......