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-06-27 18:10:33 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
07d60ace3b4ffb021108c006ed6395323584b96d
07d60ace
1 parent
5875dd7c
update wallet with LoyaltyBadgeModel
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
View file @
07d60ac
...
...
@@ -34,6 +34,7 @@ import SwiftEventBus
public
var
coupons
:
Array
<
swiftApi
.
CouponItemModel
>
=
swiftApi
()
.
getCouponList
()
public
var
dfyCoupons
:
Array
<
swiftApi
.
ActiveDFYCouponModel
>
=
swiftApi
()
.
getActiveDFYCoupons
()
public
var
loyaltyBadge
:
swiftApi
.
LoyaltyBadgeModel
=
swiftApi
()
.
getLoyaltyBadge
()
public
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -100,11 +101,10 @@ import SwiftEventBus
couponEarnView
.
layer
.
shadowOpacity
=
1.0
couponEarnView
.
layer
.
shadowRadius
=
3.0
var
totalCouponDiscount
=
coupons
.
reduce
(
0
)
{
$0
+
(
Float
(
$1
.
discount
??
""
)
??
0
)
}
totalCouponDiscount
=
Float
(
round
(
100
*
totalCouponDiscount
)
/
100
)
let
totalCouponDiscount
=
Float
(
round
(
100
*
loyaltyBadge
.
_value
)
/
100
)
let
totalCouponDiscountString
=
String
(
format
:
"%.2f"
,
totalCouponDiscount
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
couponEarnLabel
.
text
=
"Μέχρι τώρα έχεις κερδίσει "
+
totalCouponDiscountString
+
"€ σε προσφορές από "
+
String
(
coupons
.
c
ount
)
+
" κουπόνια!"
couponEarnLabel
.
text
=
"Μέχρι τώρα έχεις κερδίσει "
+
totalCouponDiscountString
+
"€ σε προσφορές από "
+
String
(
loyaltyBadge
.
_couponC
ount
)
+
" κουπόνια!"
couponEarnAmountLabel
.
text
=
totalCouponDiscountString
+
"€"
activeCodeView
.
layer
.
cornerRadius
=
5.0
...
...
Please
register
or
login
to post a comment