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-07-20 16:18:33 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
76d271e38ef1cbfe9f02f68485be9431cbf618c8
76d271e3
1 parent
e2b74764
fix unified coupon MapVC
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponBarcodeViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
View file @
76d271e
...
...
@@ -27,9 +27,11 @@ import MapKit
// public
public
var
couponSet
:
swiftApi
.
CouponSetItemModel
?
public
var
isMarket
:
Bool
?
=
false
var
merchantsArray
:
Array
<
swiftApi
.
MerchantModel
>
=
[]
var
selectedMerchant
:
swiftApi
.
MerchantModel
?
var
annotationGroup
=
[
MKPointAnnotation
]()
var
parentMerchant
:
swiftApi
.
MerchantModel
?
//
var
loading
:
Bool
=
false
...
...
@@ -126,7 +128,14 @@ import MapKit
}
}
else
{
let
appUuid
=
swiftApi
()
.
getAppUuid
()
let
categoryUuids
=
appUuid
==
"0086a2088301440792091b9f814c2267"
?
[
""
]
:
[
"adcace6cab6049c7b7271bc85bc2b26d"
]
// 2a6adade35f1484994a3d4c8f006b909 category is for SM only
var
categoryUuids
=
[
""
]
if
(
self
.
isMarket
==
true
)
{
categoryUuids
=
appUuid
==
"0086a2088301440792091b9f814c2267"
?
[
"2a6adade35f1484994a3d4c8f006b909"
]
:
[
"adcace6cab6049c7b7271bc85bc2b26d"
]
}
else
{
categoryUuids
=
appUuid
==
"0086a2088301440792091b9f814c2267"
?
[
""
]
:
[
"adcace6cab6049c7b7271bc85bc2b26d"
]
}
swiftApi
()
.
getMultilingualMerchantsAsync
(
categoryUuids
,
false
,
0.0
,
[],
""
,
0
,
[],
getMerchantsCallback
)
showContent
()
...
...
@@ -138,10 +147,22 @@ import MapKit
if
(
merchantsData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
self
.
merchantsArray
=
merchantsData
??
[]
let
filteredMerchants
=
(
merchantsData
??
[])
.
filter
({
return
((
$0
.
_latitude
!=
0.0
)
&&
(
$0
.
_longitude
!=
0.0
))
})
if
(
self
.
isMarket
==
true
)
{
self
.
merchantsArray
=
filteredMerchants
if
let
parent
=
(
merchantsData
??
[])
.
first
(
where
:
{((
$0
.
_latitude
==
0.0
)
&&
(
$0
.
_longitude
==
0.0
))})
{
self
.
parentMerchant
=
parent
}
}
else
{
self
.
merchantsArray
=
merchantsData
??
[]
}
self
.
loadMapPins
()
let
filteredMerchants
=
self
.
merchantsArray
.
filter
({
return
((
$0
.
_latitude
!=
0.0
)
&&
(
$0
.
_longitude
!=
0.0
))
})
//
let filteredMerchants = self.merchantsArray.filter({ return (($0._latitude != 0.0) && ($0._longitude != 0.0)) })
if
(
filteredMerchants
.
count
==
0
)
{
self
.
showDialog
(
"Καταστήματα συνεργάτη"
,
"Ο συνεργάτης διαθέτει μόνο ηλεκτρονικό κατάστημα για ηλεκτρονικές παραγγελίες."
)
}
...
...
@@ -298,7 +319,13 @@ import MapKit
self
.
selectedMerchant
=
annotation
.
model
self
.
titleView
.
text
=
self
.
selectedMerchant
?
.
_admin_name
self
.
nameImageView
.
load
(
link
:
self
.
selectedMerchant
?
.
_img_preview
??
""
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
if
(
self
.
isMarket
==
true
)
{
self
.
nameImageView
.
load
(
link
:
self
.
parentMerchant
?
.
_img_preview
??
""
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
}
else
{
self
.
nameImageView
.
load
(
link
:
self
.
selectedMerchant
?
.
_img_preview
??
""
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
}
self
.
nameView
.
text
=
self
.
selectedMerchant
?
.
_name
// TODO: Make dynamic
self
.
hoursView
.
text
=
""
...
...
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponBarcodeViewController.swift
View file @
76d271e
...
...
@@ -82,6 +82,7 @@ import AVFoundation
//
let
vc
=
SwiftWarplyFramework
.
MapsViewController
(
nibName
:
"MapsViewController"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
// vc.couponSet = coupon?.couponset_data
vc
.
isMarket
=
true
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
// if (mapBtnVisible == true) {
...
...
Please
register
or
login
to post a comment