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-28 14:12:59 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
df7854a6178db9655999a7ad447c6042b85f3bb7
df7854a6
1 parent
b9703236
add dynamic profile data to wallet
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
5 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/default_profile_image.imageset/Contents.json
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/default_profile_image.imageset/default_profile_image-1.png
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/default_profile_image.imageset/default_profile_image-2.png
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/default_profile_image.imageset/default_profile_image.png
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
df7854a
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/default_profile_image.imageset/Contents.json
0 → 100644
View file @
df7854a
{
"images"
:
[
{
"filename"
:
"default_profile_image.png"
,
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"default_profile_image-1.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"default_profile_image-2.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/default_profile_image.imageset/default_profile_image-1.png
0 → 100644
View file @
df7854a
22.4 KB
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/default_profile_image.imageset/default_profile_image-2.png
0 → 100644
View file @
df7854a
22.4 KB
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/default_profile_image.imageset/default_profile_image.png
0 → 100644
View file @
df7854a
22.4 KB
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
View file @
df7854a
...
...
@@ -35,6 +35,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
var
profile
:
swiftApi
.
ProfileModel
?
=
swiftApi
()
.
getConsumer
()
public
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -54,9 +55,12 @@ import SwiftEventBus
profileImage
.
layer
.
cornerRadius
=
32.5
profileImage
.
layer
.
borderWidth
=
1
profileImage
.
layer
.
borderColor
=
UIColor
(
red
:
0.13
,
green
:
0.66
,
blue
:
0.71
,
alpha
:
1.00
)
.
cgColor
// TODO: dynamic
// profileImage.load(link: profile_image ?? "", placeholder: UIImage(), cache: URLCache())
profileNameLabel
.
text
=
"Γιώργος Γεωργίου"
if
(
profile
!=
nil
&&
profile
?
.
image_url
!=
nil
&&
profile
?
.
image_url
!=
""
)
{
profileImage
.
load
(
link
:
profile
?
.
image_url
??
""
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
}
else
{
profileImage
.
image
=
UIImage
(
named
:
"default_profile_image"
,
in
:
Bundle
(
for
:
MyEmptyClass
.
self
),
compatibleWith
:
nil
)
}
let
userTag
=
swiftApi
()
.
getUserTag
()
if
(
userTag
!=
""
)
{
...
...
@@ -90,7 +94,8 @@ import SwiftEventBus
var
totalCouponValue
=
self
.
dfyCoupons
.
reduce
(
0
)
{
$0
+
(
Float
(
$1
.
_value
)
??
0
)
}
totalCouponValue
=
Float
(
round
(
100
*
totalCouponValue
)
/
100
)
let
totalCouponValueString
=
String
(
format
:
"%.2f"
,
totalCouponValue
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
var
totalCouponValueString
=
"0"
totalCouponValueString
=
String
(
format
:
"%.2f"
,
totalCouponValue
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
dfyEarnLabel
.
text
=
"Μέχρι τώρα έχεις κερδίσει "
+
totalCouponValueString
+
"€ με το DEALS for YOU!"
dfyEarnAmountLabel
.
text
=
totalCouponValueString
+
"€"
...
...
@@ -102,7 +107,8 @@ import SwiftEventBus
couponEarnView
.
layer
.
shadowRadius
=
3.0
let
totalCouponDiscount
=
Float
(
round
(
100
*
loyaltyBadge
.
_value
)
/
100
)
let
totalCouponDiscountString
=
String
(
format
:
"%.2f"
,
totalCouponDiscount
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
var
totalCouponDiscountString
=
"0"
totalCouponDiscountString
=
String
(
format
:
"%.2f"
,
totalCouponDiscount
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
couponEarnLabel
.
text
=
"Μέχρι τώρα έχεις κερδίσει "
+
totalCouponDiscountString
+
"€ σε προσφορές από "
+
String
(
loyaltyBadge
.
_couponCount
)
+
" κουπόνια!"
couponEarnAmountLabel
.
text
=
totalCouponDiscountString
+
"€"
...
...
Please
register
or
login
to post a comment