Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-09-01 18:30:21 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ca48e0f849025b72574aef670d68290e001693d6
ca48e0f8
1 parent
26089b5b
add ccmsList at MFYViewController
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
View file @
ca48e0f
...
...
@@ -14,6 +14,7 @@ import SwiftEventBus
@IBOutlet
weak
var
tableView
:
UITableView
!
public
var
campaigns
:
Array
<
swiftApi
.
CampaignItemModel
>
=
swiftApi
()
.
mergeMFYCCMSLoyaltyCampaigns
(
campaigns
:
swiftApi
()
.
getCCMSLoyaltyCampaigns
())
public
var
ccmsList
:
Array
<
swiftApi
.
LoyaltyContextualOfferModel
>
=
swiftApi
()
.
getCCMSLoyaltyCampaigns
()
public
override
func
viewDidLoad
()
{
...
...
@@ -21,6 +22,20 @@ import SwiftEventBus
self
.
hidesBottomBarWhenPushed
=
true
if
(
ccmsList
.
count
>
0
)
{
for
ccmsItem
in
ccmsList
{
if
(((
ccmsItem
.
_loyaltyCampaignId
==
""
)
||
(
ccmsItem
.
_loyaltyCampaignId
==
"NA"
))
&&
(
ccmsItem
.
_zone
==
"COSMOTE_APP_MORE4U"
))
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
ccmsItem
.
_title
newCampaign
.
_logo_url
=
ccmsItem
.
_imageUrl
newCampaign
.
_subtitle
=
ccmsItem
.
_subtitle
newCampaign
.
_message
=
ccmsItem
.
_message
newCampaign
.
_ccms
=
ccmsItem
campaigns
.
append
(
newCampaign
)
}
}
}
setBackButton
()
setNavigationTitle
(
"MORE for YOU"
,
"bold"
)
...
...
@@ -94,7 +109,10 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
}
public
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
(
campaigns
[
indexPath
.
row
]
.
_type
!=
nil
&&
campaigns
[
indexPath
.
row
]
.
_type
==
"telco"
)
{
if
(
campaigns
[
indexPath
.
row
]
.
_ccms
!=
nil
)
{
// TODO: open new screen with param campaigns[indexPath.row]._ccms
}
else
if
(
campaigns
[
indexPath
.
row
]
.
_type
!=
nil
&&
campaigns
[
indexPath
.
row
]
.
_type
==
"telco"
)
{
let
ccmsCampaigns
=
swiftApi
()
.
getCCMSLoyaltyCampaigns
()
let
loyaltyCampaignIdExists
=
ccmsCampaigns
.
contains
{
$0
.
_loyaltyCampaignId
==
campaigns
[
indexPath
.
row
]
.
session_uuid
}
...
...
Please
register
or
login
to post a comment