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
2025-01-14 16:48:40 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d4356ae03909ca4ca514a9c4b2e066c783dd3849
d4356ae0
1 parent
6a6b04bc
add MarketAnalysisItemViewCell
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
70 deletions
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/SwiftWarplyFramework/MarketAnalysisItemViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/MarketHistoryViewController.swift
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
d4356ae
...
...
@@ -7,7 +7,7 @@
<key>
Pods-SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
0
</integer>
<integer>
1
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
d4356ae
...
...
@@ -7,7 +7,7 @@
<key>
SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
1
</integer>
<integer>
0
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
d4356ae
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
d4356ae
This diff is collapsed. Click to expand it.
SwiftWarplyFramework/SwiftWarplyFramework/MarketAnalysisItemViewCell.swift
View file @
d4356ae
...
...
@@ -14,6 +14,7 @@ class MarketAnalysisItemViewCell: UITableViewCell {
@IBOutlet
weak
var
titleLabel
:
UILabel
!
@IBOutlet
weak
var
priceLabel
:
UILabel
!
@IBOutlet
weak
var
subtitleLabel
:
UILabel
!
@IBOutlet
weak
var
productTitleLabel
:
UILabel
!
var
postImageURL
:
String
?
{
didSet
{
...
...
@@ -43,7 +44,7 @@ class MarketAnalysisItemViewCell: UITableViewCell {
// title
titleLabel
.
textColor
=
UIColor
(
rgb
:
0x212121
)
titleLabel
.
font
=
UIFont
(
name
:
"PeridotPE-
Regular
"
,
size
:
17.0
)
titleLabel
.
font
=
UIFont
(
name
:
"PeridotPE-
SBold
"
,
size
:
17.0
)
// price
priceLabel
.
textColor
=
UIColor
(
rgb
:
0x212121
)
...
...
@@ -52,74 +53,15 @@ class MarketAnalysisItemViewCell: UITableViewCell {
// subtitle
// subtitleLabel.textColor = UIColor(rgb: 0x9D9D9C)
subtitleLabel
.
textColor
=
UIColor
(
rgb
:
0x212121
)
subtitleLabel
.
font
=
UIFont
(
name
:
"PeridotPE-Regular"
,
size
:
14.0
)
}
}
extension
AnalysisItemViewCell
{
func
configureCell
(
item
:
swiftApi
.
SharingCouponModel
)
{
let
merchantList
:
Array
<
swiftApi
.
MerchantModel
>
=
swiftApi
()
.
getMerchantList
()
subtitleLabel
.
font
=
UIFont
(
name
:
"PeridotPE-SBold"
,
size
:
14.0
)
titleLabel
.
text
=
""
for
merchant
in
merchantList
{
if
(
merchant
.
_uuid
==
item
.
_merchant_uuid
)
{
// itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
self
.
postImageURL
=
merchant
.
_img_preview
titleLabel
.
text
=
merchant
.
_admin_name
break
;
}
}
dateLabel
.
text
=
item
.
_date
// titleLabel.text = item._name
let
priceFloat
=
Float
(
round
(
100
*
(
Float
(
item
.
_final_price
)
))
/
100
)
var
priceString
=
"0"
priceString
=
String
(
format
:
"%.2f"
,
priceFloat
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
priceLabel
.
text
=
priceString
+
"€"
if
(
"sent"
==
item
.
_sharing_type
)
{
subtitleLabel
.
text
=
String
(
format
:
"Εκπτωτικό κουπόνι προς "
+
item
.
_receiver_msisdn
)
}
else
if
(
"received"
==
item
.
_sharing_type
)
{
subtitleLabel
.
text
=
String
(
format
:
"Εκπτωτικό κουπόνι από "
+
item
.
_sender_msisdn
)
}
}
func
configureCell
(
item
:
swiftApi
.
SharingCouponModel
,
isMarket
:
Bool
)
{
let
merchantList
:
Array
<
swiftApi
.
MerchantModel
>
=
swiftApi
()
.
getMerchantList
()
let
couponSetData
:
swiftApi
.
CouponSetItemModel
?
=
item
.
_sm_couponset_data
titleLabel
.
text
=
""
for
merchant
in
merchantList
{
if
(
merchant
.
_uuid
==
item
.
_merchant_uuid
)
{
// itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
self
.
postImageURL
=
merchant
.
_img_preview
titleLabel
.
text
=
merchant
.
_admin_name
break
;
}
}
dateLabel
.
text
=
item
.
_date
// titleLabel.text = item._name
// titleLabel.text = couponSetData?.name ?? ""
// let priceFloat = Float(round(100 * (Float(item._final_price) )) / 100)
let
priceFloat
=
Float
(
round
(
100
*
(
Float
(
couponSetData
?
.
final_price
??
0.0
)
))
/
100
)
var
priceString
=
"0"
priceString
=
String
(
format
:
"%.2f"
,
priceFloat
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
priceLabel
.
text
=
priceString
+
"€"
if
(
"sent"
==
item
.
_sharing_type
)
{
subtitleLabel
.
text
=
String
(
format
:
"Εκπτωτικό κουπόνι προς "
+
item
.
_receiver_msisdn
)
}
else
if
(
"received"
==
item
.
_sharing_type
)
{
subtitleLabel
.
text
=
String
(
format
:
"Εκπτωτικό κουπόνι από "
+
item
.
_sender_msisdn
)
}
// productTitleLabel
productTitleLabel
.
textColor
=
UIColor
(
rgb
:
0x212121
)
productTitleLabel
.
font
=
UIFont
(
name
:
"PeridotPE-Regular"
,
size
:
14.0
)
}
}
extension
MarketAnalysisItemViewCell
{
func
configureCell
(
item
:
swiftApi
.
CouponItemModel
)
{
// COUPONSET: desc, img_preview, name, terms, merchant_uuid
...
...
@@ -154,12 +96,15 @@ extension AnalysisItemViewCell {
priceString
=
String
(
format
:
"%.2f"
,
priceFloat
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
priceLabel
.
text
=
priceString
+
"€"
subtitleLabel
.
text
=
"Έκπτωτικό κουπόνι"
subtitleLabel
.
text
=
"Έκπτωτικό κουπόνι"
// TODO: FIX
// subtitleLabel.text = couponSetData?.short_description ?? ""
// OR
// let htmlText = couponSetData?.inner_text ?? ""
// subtitleLabel.text = htmlText.htmlToString
let
htmlText
=
couponSetData
?
.
inner_text
??
""
productTitleLabel
.
text
=
htmlText
.
htmlToString
}
func
configureCell
(
item
:
swiftApi
.
CouponItemModel
,
isMarket
:
Bool
)
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MarketHistoryViewController.swift
View file @
d4356ae
...
...
@@ -139,7 +139,7 @@ class MarketHistoryViewController: AnalysisChildViewController {
return
cell
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"
AnalysisItemViewCell"
,
for
:
indexPath
)
as!
SwiftWarplyFramework
.
AnalysisItemViewCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"
MarketAnalysisItemViewCell"
,
for
:
indexPath
)
as!
SwiftWarplyFramework
.
Market
AnalysisItemViewCell
// cell.configureCell(item: items[indexPath.row], isMarket: true)
cell
.
configureCell
(
item
:
items
[
indexPath
.
row
])
...
...
Please
register
or
login
to post a comment