Showing
1 changed file
with
17 additions
and
1 deletions
... | @@ -15,6 +15,7 @@ import SwiftEventBus | ... | @@ -15,6 +15,7 @@ import SwiftEventBus |
15 | 15 | ||
16 | public var campaigns:Array<swiftApi.CampaignItemModel> = swiftApi().mergeGFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns()) | 16 | public var campaigns:Array<swiftApi.CampaignItemModel> = swiftApi().mergeGFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns()) |
17 | public var seasonalList:Array<swiftApi.LoyaltyGiftsForYouPackage> = swiftApi().getSeasonalList() | 17 | public var seasonalList:Array<swiftApi.LoyaltyGiftsForYouPackage> = swiftApi().getSeasonalList() |
18 | + public var ccmsList:Array<swiftApi.LoyaltyContextualOfferModel> = swiftApi().getCCMSLoyaltyCampaigns() | ||
18 | 19 | ||
19 | 20 | ||
20 | public override func viewDidLoad() { | 21 | public override func viewDidLoad() { |
... | @@ -32,6 +33,18 @@ import SwiftEventBus | ... | @@ -32,6 +33,18 @@ import SwiftEventBus |
32 | } | 33 | } |
33 | } | 34 | } |
34 | 35 | ||
36 | + if (ccmsList.count > 0) { | ||
37 | + for ccmsItem in ccmsList { | ||
38 | + if (((ccmsItem._loyaltyCampaignId == "") || (ccmsItem._loyaltyCampaignId == "NA")) && (ccmsItem._zone == "COSMOTE_APP_GIFTS4U")) { | ||
39 | + let newCampaign = swiftApi.CampaignItemModel() | ||
40 | + newCampaign._title = ccmsItem._title | ||
41 | + newCampaign._logo_url = ccmsItem._imageUrl | ||
42 | + newCampaign._ccms = ccmsItem | ||
43 | + campaigns.append(newCampaign) | ||
44 | + } | ||
45 | + } | ||
46 | + } | ||
47 | + | ||
35 | setBackButton() | 48 | setBackButton() |
36 | setNavigationTitle("GIFTS for YOU", "bold") | 49 | setNavigationTitle("GIFTS for YOU", "bold") |
37 | 50 | ||
... | @@ -146,7 +159,10 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ | ... | @@ -146,7 +159,10 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ |
146 | } | 159 | } |
147 | 160 | ||
148 | public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | 161 | public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
149 | - if (campaigns[indexPath.row]._type != nil && campaigns[indexPath.row]._type == "telco") { | 162 | + if (campaigns[indexPath.row]._ccms != nil) { |
163 | + // TODO: open new screen with param campaigns[indexPath.row]._ccms | ||
164 | + | ||
165 | + } else if (campaigns[indexPath.row]._type != nil && campaigns[indexPath.row]._type == "telco") { | ||
150 | let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns() | 166 | let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns() |
151 | let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid } | 167 | let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid } |
152 | 168 | ... | ... |
-
Please register or login to post a comment