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
2023-04-05 14:31:27 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
60194858e3c24ad8dd5e386f95745831ceb196eb
60194858
1 parent
f3047ebd
Wallet changes
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
46 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponsTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
6019485
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
6019485
This diff is collapsed. Click to expand it.
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponsTableViewCell.swift
View file @
6019485
...
...
@@ -13,28 +13,9 @@ class UnifiedCouponsTableViewCell: UITableViewCell {
@IBOutlet
weak
var
couponImage
:
UIImageView
!
@IBOutlet
weak
var
borderView
:
UIView
!
@IBOutlet
weak
var
nameLabel
:
UILabel
!
@IBOutlet
weak
var
dicountLabel
:
UILabel
!
@IBOutlet
weak
var
discriptionLabel
:
UILabel
!
@IBOutlet
weak
var
expirationLabel
:
UILabel
!
var
postImageURL
:
String
?
{
didSet
{
if
let
url
=
postImageURL
{
self
.
couponImage
.
image
=
UIImage
()
// UIImage(named: "loading")
UIImage
.
loadImageUsingCacheWithUrlString
(
url
)
{
image
in
// set the image only when we are still displaying the content for the image we finished downloading
if
url
==
self
.
postImageURL
{
self
.
couponImage
.
image
=
image
}
}
}
else
{
self
.
couponImage
.
image
=
nil
}
}
}
public
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
...
...
@@ -61,37 +42,25 @@ class UnifiedCouponsTableViewCell: UITableViewCell {
}
func
configureCell
(
coupon
:
swiftApi
.
CouponItemModel
)
{
// COUPONSET: desc, img_preview, name, terms, merchant_uuid, discount_type, final_price
// COUPON: coupon, expiration, discount, status
// MERCHANT: _img_preview,_admin_name
let
merchantList
:
Array
<
swiftApi
.
MerchantModel
>
=
swiftApi
()
.
getMerchantList
()
func
configureCell
(
coupon
:
swiftApi
.
UnifiedCouponModel
)
{
var
activeCouponsCount
:
Int
=
0
for
coupon
in
coupon
.
_coupons
{
if
(
coupon
.
status
==
1
)
{
activeCouponsCount
+=
1
}
}
let
couponSetData
:
swiftApi
.
CouponSetItemModel
?
=
coupon
.
couponset_data
nameLabel
.
text
=
"COSMOTE SuperMarket Deals"
nameLabel
.
text
=
""
discriptionLabel
.
text
=
activeCouponsCount
==
1
?
"έχεις "
+
String
(
activeCouponsCount
)
+
" ενεργό κουπόνι"
:
"έχεις "
+
String
(
activeCouponsCount
)
+
" ενεργά κουπόνια"
for
merchant
in
merchantList
{
if
(
merchant
.
_uuid
==
couponSetData
?
.
merchant_uuid
)
{
// couponImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
// self.postImageURL = merchant._img_preview
nameLabel
.
text
=
merchant
.
_admin_name
break
;
}
if
let
earliestExpiration
=
coupon
.
_coupons
.
min
(
by
:
{
(
$0
.
expiration
??
""
)
<
(
$1
.
expiration
??
""
)
})
{
expirationLabel
.
text
=
"Ισχύει έως "
+
(
earliestExpiration
.
expiration
??
""
)
}
else
{
expirationLabel
.
text
=
""
}
// couponImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
// nameLabel.text = couponSetData?.name ?? ""
let
discount
=
couponSetData
?
.
discount_type
==
"value"
?
((
coupon
.
discount
??
""
)
+
"€"
)
:
couponSetData
?
.
discount_type
==
"percentage"
?
((
coupon
.
discount
??
""
)
+
"%"
)
:
couponSetData
?
.
discount_type
==
"plus_one"
?
"1+1"
:
((
coupon
.
discount
??
""
)
+
"€"
)
dicountLabel
.
text
=
discount
// let htmlText = couponSetData?.inner_text ?? ""
// discriptionLabel.text = htmlText.htmlToString
discriptionLabel
.
text
=
couponSetData
?
.
inner_text
??
""
expirationLabel
.
text
=
"Ισχύει έως "
+
(
coupon
.
expiration
??
""
)
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
View file @
6019485
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment