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
Vasilis
2022-04-29 17:13:07 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d011f7ce5f301185f1c74aa8ac8ae7c827e6c71a
d011f7ce
1 parent
b97c23a7
couponView and couponBarcodeView changed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponBarcodeView.swift
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponView.swift
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/swiftApi.swift
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
View file @
d011f7c
No preview for this file type
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponBarcodeView.swift
View file @
d011f7c
...
...
@@ -77,7 +77,7 @@ extension CouponBarcodeView {
}
struct
couponContainer
:
View
{
@State
var
coupon
:
Dictionary
<
String
,
Any
>
@State
var
coupon
:
swiftApi
.
CouponItemModel
// @State var couponset:CouponSetItemModel
var
uiscreen
=
UIScreen
.
main
.
bounds
...
...
@@ -98,8 +98,8 @@ extension CouponBarcodeView {
func
constructBarcode
()
->
String
?
{
// EAN 13 barcode construction
let
couponData
=
coupon
[
"coupon_data"
]
as?
[
String
:
Any
]
??
[
""
:
""
]
let
couponString
=
coupon
Data
[
"coupon"
]
as?
String
??
""
let
couponData
=
coupon
.
couponset_data
let
couponString
=
coupon
.
coupon
??
""
if
(
!
couponString
.
isEmpty
)
{
var
checkDigit
=
0
;
...
...
@@ -132,17 +132,17 @@ extension CouponBarcodeView {
var
body
:
some
View
{
let
couponData
=
coupon
[
"coupon_data"
]
as?
[
String
:
Any
]
??
[
""
:
""
]
let
couponData
=
coupon
.
couponset_data
let
barcodeString
=
constructBarcode
()
??
""
GeometryReader
{
geometry
in
ScrollView
(
showsIndicators
:
false
)
{
VStack
(
alignment
:
.
leading
)
{
ImageView
(
withURL
:
coupon
[
"img_preview"
]
as?
String
??
""
)
ImageView
(
withURL
:
coupon
Data
?
.
img_preview
??
""
)
VStack
(
alignment
:
.
leading
)
{
Text
(
coupon
[
"name"
]
as?
String
??
""
)
Text
(
coupon
.
name
!
)
.
fontWeight
(
.
bold
)
.
font
(
.
system
(
size
:
16
))
.
foregroundColor
(
Color
(
red
:
0.2549019607843137
,
green
:
0.3333333333333333
,
blue
:
0.39215686274509803
))
...
...
@@ -151,7 +151,7 @@ extension CouponBarcodeView {
.
padding
(
.
top
,
self
.
uiscreen
.
height
*
0.04
)
.
frame
(
maxHeight
:
.
infinity
)
Text
(
coupon
[
"short_description"
]
as?
String
??
""
)
Text
(
coupon
Data
?
.
short_description
!
??
""
)
.
fontWeight
(
.
regular
)
.
font
(
.
system
(
size
:
14
))
.
foregroundColor
(
Color
(
red
:
0.2549019607843137
,
green
:
0.3333333333333333
,
blue
:
0.39215686274509803
))
...
...
@@ -170,7 +170,7 @@ extension CouponBarcodeView {
VStack
(
alignment
:
.
center
)
{
VStack
{
Text
(
coupon
Data
[
"coupon"
]
as?
String
??
""
)
Text
(
coupon
.
coupon
!
)
.
fontWeight
(
.
bold
)
.
font
(
.
system
(
size
:
27
))
.
foregroundColor
(
Color
(
red
:
0.2549019607843137
,
green
:
0.3333333333333333
,
blue
:
0.39215686274509803
))
...
...
@@ -185,7 +185,7 @@ extension CouponBarcodeView {
}
.
frame
(
maxWidth
:
.
infinity
)
if
(
CharacterSet
.
decimalDigits
.
isSuperset
(
of
:
CharacterSet
(
charactersIn
:
coupon
Data
[
"coupon"
]
as?
String
??
""
)))
{
if
(
CharacterSet
.
decimalDigits
.
isSuperset
(
of
:
CharacterSet
(
charactersIn
:
coupon
.
coupon
??
""
)))
{
VStack
(
alignment
:
.
center
)
{
VStack
{}
.
frame
(
height
:
1
)
...
...
@@ -233,7 +233,7 @@ extension CouponBarcodeView {
Text
(
"Το κουπόνι ισχύει έως "
+
CouponBarcodeView
.
couponContainer
.
convertDateFormat
(
inputDate
:
couponData
[
"expiration"
]
as?
String
??
""
))
Text
(
"Το κουπόνι ισχύει έως "
+
CouponBarcodeView
.
couponContainer
.
convertDateFormat
(
inputDate
:
couponData
?
.
expiration
??
""
))
.
fontWeight
(
.
medium
)
.
font
(
.
system
(
size
:
14
))
.
foregroundColor
(
Color
(
red
:
0.2549019607843137
,
green
:
0.3333333333333333
,
blue
:
0.39215686274509803
))
...
...
@@ -348,7 +348,7 @@ extension CouponBarcodeView {
@available(iOS 13.0.0, *)
struct
CouponBarcodeView
:
View
{
var
parentView
:
UIView
var
coupon
:
Dictionary
<
String
,
Any
>
var
coupon
:
swiftApi
.
CouponItemModel
@State
var
couponset
:
CouponSetItemModel
?
var
uiscreen
=
UIScreen
.
main
.
bounds
...
...
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponView.swift
View file @
d011f7c
...
...
@@ -48,7 +48,7 @@ extension CouponView {
}
struct
couponContainer
:
View
{
@State
var
coupon
:
Dictionary
<
String
,
Any
>
@State
var
coupon
:
swiftApi
.
CouponSetItemModel
// @State var couponset:CouponSetItemModel
var
uiscreen
=
UIScreen
.
main
.
bounds
...
...
@@ -58,9 +58,9 @@ extension CouponView {
ScrollView
(
showsIndicators
:
false
)
{
VStack
(
alignment
:
.
leading
)
{
ImageView
(
withURL
:
coupon
[
"img_preview"
]
as?
String
??
""
)
ImageView
(
withURL
:
coupon
.
img_preview
as?
String
??
""
)
Text
(
coupon
[
"name"
]
as?
String
??
""
)
Text
(
coupon
.
name
as?
String
??
""
)
.
fontWeight
(
.
bold
)
.
font
(
.
system
(
size
:
16
))
.
foregroundColor
(
Color
(
red
:
0.2549019607843137
,
green
:
0.3333333333333333
,
blue
:
0.39215686274509803
))
...
...
@@ -68,7 +68,7 @@ extension CouponView {
.
padding
(
.
horizontal
)
.
padding
(
.
top
,
self
.
uiscreen
.
height
*
0.04
)
Text
(
coupon
[
"short_description"
]
as?
String
??
""
)
Text
(
coupon
.
short_description
as?
String
??
""
)
.
fontWeight
(
.
regular
)
.
font
(
.
system
(
size
:
14
))
.
foregroundColor
(
Color
(
red
:
0.2549019607843137
,
green
:
0.3333333333333333
,
blue
:
0.39215686274509803
))
...
...
@@ -152,7 +152,7 @@ extension CouponView {
@available(iOS 13.0.0, *)
struct
CouponView
:
View
{
var
parentView
:
UIView
var
coupon
:
Dictionary
<
String
,
Any
>
var
coupon
:
swiftApi
.
CouponSetItemModel
@State
var
couponset
:
CouponSetItemModel
?
var
uiscreen
=
UIScreen
.
main
.
bounds
...
...
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/swiftApi.swift
View file @
d011f7c
...
...
@@ -344,7 +344,7 @@ public class swiftApi {
return
UIHostingController
(
rootView
:
CouponView
(
parentView
:
parent
,
coupon
:
coupon
))
}
public
func
openCouponBarcode
(
parent
:
UIView
,
coupon
:
Coupon
Set
ItemModel
)
->
UIViewController
{
public
func
openCouponBarcode
(
parent
:
UIView
,
coupon
:
CouponItemModel
)
->
UIViewController
{
return
UIHostingController
(
rootView
:
CouponBarcodeView
(
parentView
:
parent
,
coupon
:
coupon
))
}
}
...
...
Please
register
or
login
to post a comment