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-10-19 17:01:23 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6f570d5221b036a14d0a36b28b55155e77307105
6f570d52
1 parent
0e23de6e
add SeeShopWebsite popup at MapVC
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
124 additions
and
63 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/CouponBarcodeViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
6f570d5
...
...
@@ -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 @
6f570d5
...
...
@@ -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 @
6f570d5
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/CouponBarcodeViewController.swift
View file @
6f570d5
...
...
@@ -173,50 +173,50 @@ import AVFoundation
// }
mapButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"PFSquareSansPro-Medium"
,
size
:
18
)
//
mapButton.setTitle("Δες τα καταστήματα", for: .normal)
mapButton
.
setTitle
(
"Δες τα καταστήματα"
,
for
:
.
normal
)
mapButton
.
setTitleColor
(
UIColor
(
red
:
0.31
,
green
:
0.62
,
blue
:
0.18
,
alpha
:
1.00
),
for
:
.
normal
)
mapButton
.
backgroundColor
=
UIColor
(
red
:
0.90
,
green
:
0.90
,
blue
:
0.90
,
alpha
:
1.00
)
mapButton
.
layer
.
cornerRadius
=
8.0
//
mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
//
mapButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
mapButton
.
frame
=
CGRect
(
x
:
0.0
,
y
:
0.0
,
width
:
mapButton
.
intrinsicContentSize
.
width
,
height
:
44
)
mapButton
.
contentEdgeInsets
=
UIEdgeInsets
(
top
:
0
,
left
:
16
,
bottom
:
0
,
right
:
16
)
mapButton
.
isHidden
=
true
mapButtonHeight
.
constant
=
0
mapButtonTopSpace
.
constant
=
0
//
mapButton.isHidden = true
//
mapButtonHeight.constant = 0
//
mapButtonTopSpace.constant = 0
let
merchantList
:
Array
<
swiftApi
.
MerchantModel
>
=
swiftApi
()
.
getMerchantList
()
//
let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
for
merchant
in
merchantList
{
if
(
merchant
.
_uuid
==
couponSetData
?
.
merchant_uuid
)
{
if
(
merchant
.
_show_map
==
true
)
{
mapButton
.
setTitle
(
"Δες τα καταστήματα"
,
for
:
.
normal
)
mapButton
.
frame
=
CGRect
(
x
:
0.0
,
y
:
0.0
,
width
:
mapButton
.
intrinsicContentSize
.
width
,
height
:
44
)
mapButton
.
contentEdgeInsets
=
UIEdgeInsets
(
top
:
0
,
left
:
16
,
bottom
:
0
,
right
:
16
)
mapButton
.
isHidden
=
false
mapBtnVisible
=
true
eshopBtnVisible
=
false
mapButtonHeight
.
constant
=
44
mapButtonTopSpace
.
constant
=
10
}
else
if
(
merchant
.
_eshop
==
true
)
{
mapButton
.
setTitle
(
"Δες το eshop"
,
for
:
.
normal
)
mapButton
.
frame
=
CGRect
(
x
:
0.0
,
y
:
0.0
,
width
:
mapButton
.
intrinsicContentSize
.
width
,
height
:
44
)
mapButton
.
contentEdgeInsets
=
UIEdgeInsets
(
top
:
0
,
left
:
16
,
bottom
:
0
,
right
:
16
)
mapButton
.
isHidden
=
false
mapBtnVisible
=
false
eshopBtnVisible
=
true
mapButtonHeight
.
constant
=
44
mapButtonTopSpace
.
constant
=
10
}
else
{
mapButton
.
isHidden
=
true
mapBtnVisible
=
false
eshopBtnVisible
=
false
mapButtonHeight
.
constant
=
0
mapButtonTopSpace
.
constant
=
0
}
eshopWebsite
=
merchant
.
_website
break
;
}
}
//
for merchant in merchantList {
//
if (merchant._uuid == couponSetData?.merchant_uuid) {
//
if (merchant._show_map == true) {
//
mapButton.setTitle("Δες τα καταστήματα", for: .normal)
//
mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
//
mapButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
//
mapButton.isHidden = false
//
mapBtnVisible = true
//
eshopBtnVisible = false
//
mapButtonHeight.constant = 44
//
mapButtonTopSpace.constant = 10
//
} else if (merchant._eshop == true) {
//
mapButton.setTitle("Δες το eshop", for: .normal)
//
mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
//
mapButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
//
mapButton.isHidden = false
//
mapBtnVisible = false
//
eshopBtnVisible = true
//
mapButtonHeight.constant = 44
//
mapButtonTopSpace.constant = 10
//
} else {
//
mapButton.isHidden = true
//
mapBtnVisible = false
//
eshopBtnVisible = false
//
mapButtonHeight.constant = 0
//
mapButtonTopSpace.constant = 0
//
}
//
eshopWebsite = merchant._website
//
break;
//
}
//
}
// Fix width for ipad
// if UIDevice.current.userInterfaceIdiom == .pad {
...
...
@@ -389,28 +389,28 @@ import AVFoundation
vc
.
couponSet
=
coupon
?
.
couponset_data
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
if
(
mapBtnVisible
==
true
)
{
swiftApi
()
.
logTrackersEvent
(
"click"
,
"SeeShops"
)
let
vc
=
SwiftWarplyFramework
.
MapsViewController
(
nibName
:
"MapsViewController"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
vc
.
couponSet
=
coupon
?
.
couponset_data
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
else
if
(
eshopBtnVisible
==
true
)
{
if
(
eshopWebsite
!=
""
)
{
guard
let
websiteUrl
=
URL
(
string
:
eshopWebsite
)
else
{
print
(
"Error creating URL"
)
return
}
// check if link can be opened.
guard
UIApplication
.
shared
.
canOpenURL
(
websiteUrl
)
else
{
return
}
swiftApi
()
.
logTrackersEvent
(
"click"
,
"SeeShopWebsite"
)
UIApplication
.
shared
.
open
(
websiteUrl
,
options
:
[:],
completionHandler
:
nil
)
}
}
//
if (mapBtnVisible == true) {
//
swiftApi().logTrackersEvent("click", "SeeShops")
//
let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
//
vc.couponSet = coupon?.couponset_data
//
self.navigationController?.pushViewController(vc, animated: true)
//
} else if (eshopBtnVisible == true) {
//
if (eshopWebsite != "") {
//
guard let websiteUrl = URL(string: eshopWebsite) else {
//
print("Error creating URL")
//
return
//
}
//
// check if link can be opened.
//
guard UIApplication.shared.canOpenURL(websiteUrl) else {
//
return
//
}
//
swiftApi().logTrackersEvent("click", "SeeShopWebsite")
//
UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
//
}
//
}
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
View file @
6f570d5
...
...
@@ -133,10 +133,71 @@ import MapKit
self
.
merchantsArray
=
merchantsData
??
[]
self
.
loadMapPins
()
let
filteredMerchants
=
self
.
merchantsArray
.
filter
({
return
((
$0
.
_latitude
!=
0.0
)
&&
(
$0
.
_longitude
!=
0.0
))
})
if
(
filteredMerchants
.
count
==
0
)
{
self
.
showDialog
(
"Καταστήματα συνεργάτη"
,
"Ο συνεργάτης διαθέτει μόνο ηλεκτρονικό κατάστημα για ηλεκτρονικές παραγγελίες."
)
}
}
return
}
}
func
showDialog
(
_
alertTitle
:
String
,
_
alertSubTitle
:
String
)
->
Void
{
let
alert
=
UIAlertController
(
title
:
alertTitle
,
message
:
alertSubTitle
,
preferredStyle
:
.
alert
)
let
cancelButton
=
UIAlertAction
(
title
:
"Άκυρο"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
self
.
dismiss
(
animated
:
true
,
completion
:
{})
case
.
cancel
:
print
(
"cancel"
)
case
.
destructive
:
print
(
"destructive"
)
}
})
// cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor")
alert
.
addAction
(
cancelButton
)
alert
.
addAction
(
UIAlertAction
(
title
:
"Δες το eshop"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
if
(
self
.
merchantsArray
.
count
>
0
)
{
for
item
in
self
.
merchantsArray
{
let
eshopWebsite
=
item
.
_website
if
(
eshopWebsite
!=
""
)
{
guard
let
websiteUrl
=
URL
(
string
:
eshopWebsite
)
else
{
print
(
"Error creating URL"
)
return
}
// check if link can be opened.
guard
UIApplication
.
shared
.
canOpenURL
(
websiteUrl
)
else
{
return
}
swiftApi
()
.
logTrackersEvent
(
"click"
,
"SeeShopWebsite"
)
UIApplication
.
shared
.
open
(
websiteUrl
,
options
:
[:],
completionHandler
:
nil
)
break
;
}
}
}
case
.
cancel
:
print
(
"cancel"
)
case
.
destructive
:
print
(
"destructive"
)
}
}))
self
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
private
func
showLoading
()
{
...
...
Please
register
or
login
to post a comment