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
2024-10-22 14:57:19 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9d7e676c2d74fd4e23dee045f27376428f8421bf
9d7e676c
1 parent
9cf59274
PopupMerchantsViewController eshops fixes
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
7 deletions
SwiftWarplyFramework/SwiftWarplyFramework/MerchantTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/PopupMerchantsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponBarcodeViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MerchantTableViewCell.swift
View file @
9d7e676
...
...
@@ -73,12 +73,18 @@ class MerchantTableViewCell: UITableViewCell {
contentView
.
frame
=
contentView
.
frame
.
inset
(
by
:
margins
)
}
func
configureCell
(
shop
:
swiftApi
.
ShopAvailabilityItemModel
,
buttonTitle
:
String
,
iconImage
:
String
?)
{
func
configureCell
(
shop
:
swiftApi
.
ShopAvailabilityItemModel
,
buttonTitle
:
String
,
iconImage
:
String
?
,
showEshops
:
Bool
?
)
{
for
merchant
in
merchantList
{
if
(
merchant
.
_uuid
==
shop
.
_merchant_uuid
)
{
self
.
postImageURL
=
merchant
.
_img_preview
break
;
if
(
showEshops
==
true
)
{
// TODO: add static image
// self.merchantImage.image = image
}
else
{
for
merchant
in
merchantList
{
if
(
merchant
.
_uuid
==
shop
.
_merchant_uuid
)
{
self
.
postImageURL
=
merchant
.
_img_preview
break
;
}
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/PopupMerchantsViewController.swift
View file @
9d7e676
...
...
@@ -19,10 +19,15 @@ class PopupMerchantsViewController: UIViewController {
public
var
buttonTitle
:
String
?
=
"Βρες το"
public
var
buttonIcon
:
String
?
public
var
footerText
:
String
?
=
"Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
public
var
showEshops
:
Bool
?
=
false
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
if
(
showEshops
==
true
)
{
setupEshopsData
()
}
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
...
...
@@ -42,6 +47,19 @@ class PopupMerchantsViewController: UIViewController {
headerLabel
.
textColor
=
UIColor
(
rgb
:
0x000000
)
}
// MARK: - Functions
func
setupEshopsData
()
{
let
tempShop1
:
swiftApi
.
ShopAvailabilityItemModel
=
swiftApi
.
ShopAvailabilityItemModel
()
tempShop1
.
_merchant_uuid
=
"ab"
tempShop1
.
_product_url
=
"https://www.ab.gr"
availableShopsList
.
append
(
tempShop1
)
let
tempShop2
:
swiftApi
.
ShopAvailabilityItemModel
=
swiftApi
.
ShopAvailabilityItemModel
()
tempShop2
.
_merchant_uuid
=
"masoutis"
tempShop2
.
_product_url
=
"https://www.masoutis.gr"
availableShopsList
.
append
(
tempShop2
)
}
// MARK: - UIButton Actions
@IBAction
func
closeButtonAction
(
_
sender
:
Any
)
{
self
.
dismiss
(
animated
:
true
,
completion
:
{})
...
...
@@ -81,7 +99,7 @@ extension PopupMerchantsViewController: UITableViewDelegate, UITableViewDataSour
public
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
(
indexPath
.
section
==
0
)
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"MerchantTableViewCellId"
,
for
:
indexPath
)
as!
MerchantTableViewCell
cell
.
configureCell
(
shop
:
availableShopsList
[
indexPath
.
row
],
buttonTitle
:
self
.
buttonTitle
??
"Βρες το"
,
iconImage
:
buttonIcon
)
cell
.
configureCell
(
shop
:
availableShopsList
[
indexPath
.
row
],
buttonTitle
:
self
.
buttonTitle
??
"Βρες το"
,
iconImage
:
self
.
buttonIcon
,
showEshops
:
self
.
showEshops
)
// Set the delegate to self
cell
.
delegate
=
self
...
...
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponBarcodeViewController.swift
View file @
9d7e676
...
...
@@ -388,11 +388,12 @@ extension UnifiedCouponBarcodeViewController: PopupMerchantCategoriesViewControl
if
let
popupVC
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"PopupMerchantsViewController"
)
as?
SwiftWarplyFramework
.
PopupMerchantsViewController
{
popupVC
.
modalPresentationStyle
=
.
overCurrentContext
popupVC
.
modalTransitionStyle
=
.
crossDissolve
// popupVC.coupon = coupon
popupVC
.
availableShopsList
=
[]
popupVC
.
headerText
=
"Δες τα eshop"
popupVC
.
buttonTitle
=
"Δες το eshop"
// popupVC.buttonIcon = "shopping_cart"
popupVC
.
footerText
=
"Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
popupVC
.
showEshops
=
true
self
.
present
(
popupVC
,
animated
:
true
,
completion
:
nil
)
}
...
...
Please
register
or
login
to post a comment