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-05 15:45:33 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d92734be2698f9fc29a70d67c307183e3aa6b5c1
d92734be
1 parent
1c8bd52a
fix AnalysisItemViewCell
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
SwiftWarplyFramework/SwiftWarplyFramework/AnalysisItemViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/AnalysisItemViewCell.swift
View file @
d92734b
...
...
@@ -54,21 +54,37 @@ extension AnalysisItemViewCell {
func
configureCell
(
item
:
swiftApi
.
CouponItemModel
)
{
// COUPONSET: desc, img_preview, name, terms
// COUPONSET: desc, img_preview, name, terms
, merchant_uuid
// COUPON: coupon, expiration, discount, status
// MERCHANT: _img_preview,_admin_name
let
merchantList
:
Array
<
swiftApi
.
MerchantModel
>
=
swiftApi
()
.
getMerchantList
()
let
couponSetData
:
swiftApi
.
CouponSetItemModel
?
=
item
.
couponset_data
titleLabel
.
text
=
""
for
merchant
in
merchantList
{
if
(
merchant
.
_uuid
==
couponSetData
?
.
merchant_uuid
)
{
itemImage
.
load
(
link
:
merchant
.
_img_preview
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
titleLabel
.
text
=
merchant
.
_admin_name
break
;
}
}
dateLabel
.
text
=
item
.
expiration
??
""
// TODO: change
itemImage
.
load
(
link
:
couponSetData
?
.
img_preview
??
""
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
titleLabel
.
text
=
couponSetData
?
.
name
??
""
//
itemImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
//
titleLabel.text = couponSetData?.name ?? ""
let
priceFloat
=
Float
(
round
(
100
*
(
Float
(
item
.
discount
??
""
)
??
0.0
))
/
100
)
var
priceString
=
"0"
priceString
=
String
(
format
:
"%.2f"
,
priceFloat
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
priceLabel
.
text
=
priceString
+
"€"
subtitleLabel
.
text
=
couponSetData
?
.
short_description
??
""
subtitleLabel
.
text
=
"Έκπτωτικό κουπόνι"
// subtitleLabel.text = couponSetData?.short_description ?? ""
// OR
// let htmlText = couponSetData?.inner_text ?? ""
// subtitleLabel.text = htmlText.htmlToString
}
}
...
...
Please
register
or
login
to post a comment