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-09-18 13:11:52 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
aaabc6a12c4aeaf998e1ee207724eb39f0f6727b
aaabc6a1
1 parent
5afd0bbf
Add Unified Coupons discount value at My Rewards
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
3 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponBCHeaderTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponsTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
aaabc6a
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
aaabc6a
This diff is collapsed. Click to expand it.
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponBCHeaderTableViewCell.swift
View file @
aaabc6a
...
...
@@ -55,7 +55,7 @@ import AVFoundation
couponImageHeight
.
constant
=
255
//230 // 253 // self.uiscreen.height * 0.25
nameLabel
.
text
=
"Εκπτωτικό κουπόνι COSMOTE SuperMarket Deals!"
discriptionLabel
.
text
=
"Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών."
//
discriptionLabel.text = "Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών."
merchantDescrTextView
.
text
=
""
merchantDescrTextViewTopSpace
.
constant
=
CGFloat
(
0
)
...
...
@@ -126,6 +126,26 @@ import AVFoundation
couponNumberLabel
.
text
=
coupon
?
.
_barcode
??
""
couponView
.
frame
=
CGRect
(
x
:
0.0
,
y
:
0.0
,
width
:
couponView
.
intrinsicContentSize
.
width
,
height
:
55
)
let
activeCoupons
=
coupon
?
.
_coupons
.
filter
{
$0
.
status
==
1
}
let
activeCouponsDiscount
=
(
activeCoupons
?
.
reduce
(
0
)
{
$0
+
(
Float
(
$1
.
discount
??
"0"
)
??
0
)
})
??
0
// discriptionLabel.text = "Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών αξίας " + String(activeCouponsDiscount) + "€."
// ========
let
discrNormalText1
=
"Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών αξίας "
let
discrBoldText
=
String
(
activeCouponsDiscount
)
+
"€."
let
attrRegular
=
[
NSAttributedString
.
Key
.
font
:
UIFont
(
name
:
"PeridotPE-Regular"
,
size
:
16
)
??
UIFont
.
systemFont
(
ofSize
:
15
),
NSAttributedString
.
Key
.
foregroundColor
:
UIColor
(
red
:
0.13
,
green
:
0.13
,
blue
:
0.13
,
alpha
:
1.00
)]
let
attrBold
=
[
NSAttributedString
.
Key
.
font
:
UIFont
(
name
:
"PeridotPE-Bold"
,
size
:
16
)
??
UIFont
.
boldSystemFont
(
ofSize
:
15
),
NSAttributedString
.
Key
.
foregroundColor
:
UIColor
(
red
:
0.13
,
green
:
0.13
,
blue
:
0.13
,
alpha
:
1.00
)]
let
sumAttributedString
=
NSMutableAttributedString
(
string
:
discrNormalText1
,
attributes
:
attrRegular
)
let
sumBoldString
=
NSMutableAttributedString
(
string
:
discrBoldText
,
attributes
:
attrBold
)
sumAttributedString
.
append
(
sumBoldString
)
discriptionLabel
.
attributedText
=
sumAttributedString
// ========
// let barcodeString = constructBarcode(coupon: coupon) ?? ""
let
barcodeString
=
coupon
?
.
_barcode
??
""
barcodeLabel
.
text
=
barcodeString
...
...
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponsTableViewCell.swift
View file @
aaabc6a
...
...
@@ -51,6 +51,7 @@ import UIKit
func
configureCell
(
coupon
:
swiftApi
.
UnifiedCouponModel
)
{
let
activeCoupons
=
coupon
.
_coupons
.
filter
{
$0
.
status
==
1
}
let
activeCouponsCount
=
activeCoupons
.
count
let
activeCouponsDiscount
=
activeCoupons
.
reduce
(
0
)
{
$0
+
(
Float
(
$1
.
discount
??
"0"
)
??
0
)
}
// var activeCouponsCount:Int = 0
// for coupon in coupon._coupons {
...
...
@@ -62,8 +63,11 @@ import UIKit
nameLabel
.
text
=
"COSMOTE SuperMarket Deals"
discriptionLabel
.
text
=
activeCouponsCount
==
1
?
"έχεις "
+
String
(
activeCouponsCount
)
+
" ενεργό κουπόνι"
:
"έχεις "
+
String
(
activeCouponsCount
)
+
" ενεργά κουπόνια"
"έχεις "
+
String
(
activeCouponsCount
)
+
(
activeCouponsCount
==
1
?
" ενεργό κουπόνι"
:
" ενεργά κουπόνια"
)
+
" αξίας "
+
String
(
activeCouponsDiscount
)
+
"€"
if
let
earliestExpiration
=
activeCoupons
.
min
(
by
:
{
(
$0
.
expiration
??
""
)
<
(
$1
.
expiration
??
""
)
})
{
expirationLabel
.
text
=
"Ισχύει έως "
+
(
earliestExpiration
.
expiration
??
""
)
...
...
Please
register
or
login
to post a comment