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-13 18:19:47 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
21a0dc23a41e20458128a6c60c73953e643ed6cf
21a0dc23
1 parent
9232e878
fix dublicate seasonals ata giftsVC
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
40 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
21a0dc2
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
View file @
21a0dc2
...
...
@@ -53,55 +53,23 @@ import SwiftEventBus
SwiftEventBus
.
onMainThread
(
self
,
name
:
"ccms_retrieved"
)
{
result
in
print
(
"===== SwiftEventBus ccms_retrieved ====="
)
self
.
campaigns
=
swiftApi
()
.
mergeGFYCCMSLoyaltyCampaigns
(
campaigns
:
swiftApi
()
.
getCCMSLoyaltyCampaigns
())
self
.
seasonalList
=
swiftApi
()
.
getSeasonalList
()
if
(
self
.
seasonalList
.
count
>
0
)
{
for
seasonalItem
in
self
.
seasonalList
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
seasonalItem
.
_title
newCampaign
.
_logo_url
=
seasonalItem
.
_imageUrl
newCampaign
.
_loyaltyPackageId
=
seasonalItem
.
_loyaltyPackageId
self
.
campaigns
.
append
(
newCampaign
)
}
}
self
.
tableView
.
reloadData
()
self
.
refreshData
()
}
SwiftEventBus
.
onMainThread
(
self
,
name
:
"campaigns_retrieved"
)
{
result
in
print
(
"===== SwiftEventBus campaigns_retrieved ====="
)
self
.
campaigns
=
swiftApi
()
.
mergeGFYCCMSLoyaltyCampaigns
(
campaigns
:
swiftApi
()
.
getCCMSLoyaltyCampaigns
())
self
.
seasonalList
=
swiftApi
()
.
getSeasonalList
()
if
(
self
.
seasonalList
.
count
>
0
)
{
for
seasonalItem
in
self
.
seasonalList
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
seasonalItem
.
_title
newCampaign
.
_logo_url
=
seasonalItem
.
_imageUrl
newCampaign
.
_loyaltyPackageId
=
seasonalItem
.
_loyaltyPackageId
self
.
campaigns
.
append
(
newCampaign
)
}
}
self
.
tableView
.
reloadData
()
self
.
refreshData
()
}
SwiftEventBus
.
onMainThread
(
self
,
name
:
"seasonals_retrieved"
)
{
result
in
print
(
"===== SwiftEventBus seasonals_retrieved ====="
)
self
.
refreshData
()
self
.
seasonalList
=
swiftApi
()
.
getSeasonalList
()
if
(
self
.
seasonalList
.
count
>
0
)
{
for
seasonalItem
in
self
.
seasonalList
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
seasonalItem
.
_title
newCampaign
.
_logo_url
=
seasonalItem
.
_imageUrl
newCampaign
.
_loyaltyPackageId
=
seasonalItem
.
_loyaltyPackageId
self
.
campaigns
.
append
(
newCampaign
)
}
}
self
.
tableView
.
reloadData
()
}
tableView
.
clipsToBounds
=
true
...
...
@@ -117,6 +85,37 @@ import SwiftEventBus
}
// MARK: - Functions
func
refreshData
()
->
Void
{
self
.
campaigns
=
swiftApi
()
.
mergeGFYCCMSLoyaltyCampaigns
(
campaigns
:
swiftApi
()
.
getCCMSLoyaltyCampaigns
())
self
.
seasonalList
=
swiftApi
()
.
getSeasonalList
()
self
.
ccmsList
=
swiftApi
()
.
getCCMSLoyaltyCampaigns
()
if
(
self
.
seasonalList
.
count
>
0
)
{
for
seasonalItem
in
self
.
seasonalList
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
seasonalItem
.
_title
newCampaign
.
_logo_url
=
seasonalItem
.
_imageUrl
newCampaign
.
_loyaltyPackageId
=
seasonalItem
.
_loyaltyPackageId
self
.
campaigns
.
append
(
newCampaign
)
}
}
if
(
self
.
ccmsList
.
count
>
0
)
{
for
ccmsItem
in
self
.
ccmsList
{
if
(((
ccmsItem
.
_loyaltyCampaignId
==
""
)
||
(
ccmsItem
.
_loyaltyCampaignId
==
"NA"
))
&&
(
ccmsItem
.
_zone
==
"COSMOTE_APP_GIFTS4U"
))
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
ccmsItem
.
_title
newCampaign
.
_logo_url
=
ccmsItem
.
_imageUrl
newCampaign
.
_ccms
=
ccmsItem
self
.
campaigns
.
append
(
newCampaign
)
}
}
}
self
.
tableView
.
reloadData
()
}
}
// MARK: - TableView
...
...
Please
register
or
login
to post a comment