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-29 12:13:55 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bdd387e0ac232e15cdbb4fbfaf90896b34c79865
bdd387e0
1 parent
27d41fe9
fix new badge functionality v2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
51 deletions
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
View file @
bdd387e
...
...
@@ -26,35 +26,35 @@ import SwiftEventBus
self
.
hidesBottomBarWhenPushed
=
true
var
tempCampaigns
:
Array
<
swiftApi
.
CampaignItemModel
>
=
[]
if
(
seasonalList
.
count
>
0
)
{
for
seasonalItem
in
seasonalList
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
seasonalItem
.
_title
newCampaign
.
_logo_url
=
seasonalItem
.
_imageUrl
newCampaign
.
_loyaltyPackageId
=
seasonalItem
.
_loyaltyPackageId
tempCampaigns
.
append
(
newCampaign
)
}
}
if
(
ccmsList
.
count
>
0
)
{
for
ccmsItem
in
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
tempCampaigns
.
append
(
newCampaign
)
}
}
}
if
(
loyaltyList
.
count
>
0
)
{
tempCampaigns
=
tempCampaigns
+
loyaltyList
}
campaigns
=
tempCampaigns
//
var tempCampaigns:Array<swiftApi.CampaignItemModel> = []
//
if (seasonalList.count > 0) {
//
for seasonalItem in seasonalList {
//
let newCampaign = swiftApi.CampaignItemModel()
//
newCampaign._title = seasonalItem._title
//
newCampaign._logo_url = seasonalItem._imageUrl
//
newCampaign._loyaltyPackageId = seasonalItem._loyaltyPackageId
//
tempCampaigns.append(newCampaign)
//
}
//
}
//
if (ccmsList.count > 0) {
//
for ccmsItem in 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
//
tempCampaigns.append(newCampaign)
//
}
//
}
//
}
//
if (loyaltyList.count > 0) {
//
tempCampaigns = tempCampaigns + loyaltyList
//
}
//
campaigns = tempCampaigns
setBackButton
()
setNavigationTitle
(
"GIFTS for YOU"
,
"bold"
)
...
...
@@ -96,13 +96,13 @@ import SwiftEventBus
}
//
public override func viewWillAppear(_ animated: Bool) {
//
super.viewWillAppear(animated)
public
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
// print("===
viewWillAppear invoked ===")
print
(
"=== gifts
viewWillAppear invoked ==="
)
//
self.refreshData()
//
}
self
.
refreshData
()
}
// MARK: - Functions
func
refreshData
()
->
Void
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
View file @
bdd387e
...
...
@@ -25,23 +25,23 @@ import SwiftEventBus
self
.
hidesBottomBarWhenPushed
=
true
var
tempCampaigns
:
Array
<
swiftApi
.
CampaignItemModel
>
=
loyaltyList
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
tempCampaigns
.
append
(
newCampaign
)
}
}
}
campaigns
=
tempCampaigns
//
var tempCampaigns:Array<swiftApi.CampaignItemModel> = loyaltyList
//
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
//
tempCampaigns.append(newCampaign)
//
}
//
}
//
}
//
campaigns = tempCampaigns
setBackButton
()
setNavigationTitle
(
"MORE for YOU"
,
"bold"
)
...
...
@@ -72,6 +72,14 @@ import SwiftEventBus
}
public
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
print
(
"=== mfy viewWillAppear invoked ==="
)
self
.
refreshData
()
}
// MARK: - Functions
func
refreshData
()
->
Void
{
self
.
loyaltyList
=
swiftApi
()
.
mergeMFYCCMSLoyaltyCampaigns
(
campaigns
:
swiftApi
()
.
getCCMSLoyaltyCampaigns
())
...
...
Please
register
or
login
to post a comment