Manos Chorianopoulos

UnifiedCouponBarcodeVC coupons fixes, Markets Map

......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -16,7 +16,10 @@ import UIKit
@IBOutlet weak var dicountLabel: UILabel!
@IBOutlet weak var discriptionLabel: UILabel!
@IBOutlet weak var expirationLabel: UILabel!
@IBOutlet weak var expirationRedView: UIView!
@IBOutlet weak var expirationRedImage: UIImageView!
@IBOutlet weak var expirationRedLabel: UILabel!
var postImageURL: String? {
didSet {
if let url = postImageURL {
......@@ -96,6 +99,77 @@ import UIKit
// COUPONSET: desc, img_preview, name, terms, merchant_uuid
// COUPON: coupon, expiration, discount, status
// MERCHANT: _img_preview,_admin_name
if (coupon.status == 1) {
// Add shadow
self.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor
self.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
self.layer.shadowOpacity = 1.0
self.layer.shadowRadius = 6.0
couponBgImage.image = UIImage(named: "coupon_bg", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
expirationLabel.isHidden = false
expirationRedView.isHidden = true
expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "")
let formatter = DateFormatter()
formatter.dateFormat = "dd/MM/yyyy"
let today = Date()
// let firstDate = formatter.date(from: "01/08/2017")
// let secondDate = formatter.date(from: "22/04/2023")
if let couponExpiration = coupon.expiration, let secondDate = formatter.date(from: couponExpiration) {
let calendar = NSCalendar.current
let date1 = calendar.startOfDay(for: today)
let date2 = calendar.startOfDay(for: secondDate)
let differenceComponents = calendar.dateComponents([.day], from: date1, to: date2)
if let daysDifference = differenceComponents.day {
if ((daysDifference >= 0) && (daysDifference <= 15)) {
expirationLabel.isHidden = true
expirationRedView.isHidden = false
expirationRedView.layer.cornerRadius = 10.0
expirationRedView.backgroundColor = UIColor(red: 0.94, green: 0.90, blue: 0.90, alpha: 1.00)
expirationRedImage.image = UIImage(named: "ic_time_forward", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
let normalText1 = "Ισχύει έως "
let redText = (coupon.expiration ?? "")
let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PFSquareSansPro-Medium", size: 12) ?? UIFont.systemFont(ofSize: 11), NSAttributedString.Key.foregroundColor: UIColor(red: 0.38, green: 0.44, blue: 0.51, alpha: 1.00)]
let attrRed = [NSAttributedString.Key.font : UIFont(name: "PFSquareSansPro-Medium", size: 12) ?? UIFont.systemFont(ofSize: 11), NSAttributedString.Key.foregroundColor: UIColor(red: 1.00, green: 0.42, blue: 0.42, alpha: 1.00)]
let attributedString = NSMutableAttributedString(string:normalText1, attributes:attrRegular)
let RedString = NSMutableAttributedString(string: redText, attributes:attrRed)
attributedString.append(RedString)
expirationRedLabel.attributedText = attributedString
} else {
expirationLabel.isHidden = false
expirationRedView.isHidden = true
expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "")
}
}
}
} else if (coupon.status == 0) {
couponBgImage.image = UIImage(named: "coupon_bg_grey", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
expirationLabel.isHidden = false
expirationRedView.isHidden = true
expirationLabel.text = "Το κουπόνι έληξε"
couponImage.layer.opacity = 0.23
borderView.layer.opacity = 0.15
nameLabel.layer.opacity = 0.15
dicountLabel.layer.opacity = 0.15
discriptionLabel.layer.opacity = 0.15
}
let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
......@@ -120,7 +194,6 @@ import UIKit
let htmlText = coupon.inner_text ?? ""
discriptionLabel.text = htmlText.htmlToString
// discriptionLabel.text = coupon.inner_text ?? ""
expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "")
}
......
......@@ -2611,24 +2611,24 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="CouponsTableViewCellId" id="TAK-Ug-AzU" customClass="CouponsTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="897.5" width="414" height="110"/>
<rect key="frame" x="0.0" y="897.5" width="414" height="118"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="TAK-Ug-AzU" id="LFe-Vj-kjJ">
<rect key="frame" x="0.0" y="0.0" width="414" height="110"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="118"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="35i-Iq-TId">
<rect key="frame" x="10" y="5" width="394" height="105"/>
<rect key="frame" x="10" y="5" width="394" height="113"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coupon_bg" translatesAutoresizingMaskIntoConstraints="NO" id="58G-jP-FMr">
<rect key="frame" x="0.0" y="0.0" width="394" height="105"/>
<rect key="frame" x="0.0" y="0.0" width="394" height="113"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="jcR-bh-Fhz">
<rect key="frame" x="20" y="10" width="79" height="85"/>
<rect key="frame" x="20" y="10" width="79" height="93"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZDK-3b-8MQ">
<rect key="frame" x="104" y="5" width="10" height="95"/>
<rect key="frame" x="104" y="5" width="10" height="103"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="10" id="sq7-pL-kd5"/>
......@@ -2641,7 +2641,7 @@
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="NmF-B8-BxN">
<rect key="frame" x="119" y="37" width="255" height="31"/>
<rect key="frame" x="119" y="41" width="255" height="31"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9CO-TF-h6H">
<rect key="frame" x="0.0" y="0.0" width="127.5" height="31"/>
......@@ -2662,11 +2662,38 @@
</constraints>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u51-sv-YiH">
<rect key="frame" x="119" y="78" width="255" height="12"/>
<rect key="frame" x="119" y="86" width="255" height="12"/>
<fontDescription key="fontDescription" name="PFSquareSansPro-Medium" family="PF Square Sans Pro" pointSize="12"/>
<color key="textColor" red="0.3803921569" green="0.4431372549" blue="0.50588235290000005" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="G6f-Nu-2R5">
<rect key="frame" x="119" y="77" width="58.5" height="21"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="LGs-y6-UbY">
<rect key="frame" x="5" y="3" width="15" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="9tK-aY-Rdn"/>
<constraint firstAttribute="width" constant="15" id="m2Y-SE-d4q"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dF5-HE-P9n">
<rect key="frame" x="25" y="4.5" width="28.5" height="12"/>
<fontDescription key="fontDescription" name="PFSquareSansPro-Medium" family="PF Square Sans Pro" pointSize="12"/>
<color key="textColor" red="0.3803921569" green="0.4431372549" blue="0.50588235290000005" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.94117647058823528" green="0.90196078431372551" blue="0.90196078431372551" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="dF5-HE-P9n" firstAttribute="centerY" secondItem="G6f-Nu-2R5" secondAttribute="centerY" id="6wF-K3-vDp"/>
<constraint firstAttribute="bottom" secondItem="LGs-y6-UbY" secondAttribute="bottom" constant="3" id="AZn-5e-SkV"/>
<constraint firstAttribute="trailing" secondItem="dF5-HE-P9n" secondAttribute="trailing" constant="5" id="Vk4-0L-NMa"/>
<constraint firstItem="dF5-HE-P9n" firstAttribute="leading" secondItem="LGs-y6-UbY" secondAttribute="trailing" constant="5" id="lg8-t3-laT"/>
<constraint firstItem="LGs-y6-UbY" firstAttribute="leading" secondItem="G6f-Nu-2R5" secondAttribute="leading" constant="5" id="n88-zW-8hr"/>
<constraint firstItem="LGs-y6-UbY" firstAttribute="top" secondItem="G6f-Nu-2R5" secondAttribute="top" constant="3" id="yeQ-49-Bc4"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
......@@ -2686,12 +2713,16 @@
<constraint firstItem="u51-sv-YiH" firstAttribute="top" relation="greaterThanOrEqual" secondItem="NmF-B8-BxN" secondAttribute="bottom" constant="5" id="RUi-pY-M3y"/>
<constraint firstItem="jcR-bh-Fhz" firstAttribute="top" secondItem="35i-Iq-TId" secondAttribute="top" constant="10" id="W7a-RI-eFK"/>
<constraint firstAttribute="trailing" secondItem="NmF-B8-BxN" secondAttribute="trailing" constant="20" id="WXz-rG-ZBX"/>
<constraint firstItem="G6f-Nu-2R5" firstAttribute="leading" secondItem="ZDK-3b-8MQ" secondAttribute="trailing" constant="5" id="ZgC-Py-yjC"/>
<constraint firstItem="G6f-Nu-2R5" firstAttribute="top" relation="greaterThanOrEqual" secondItem="NmF-B8-BxN" secondAttribute="bottom" constant="5" id="b5v-do-Gik"/>
<constraint firstItem="mOO-dc-RyS" firstAttribute="top" secondItem="35i-Iq-TId" secondAttribute="top" constant="15" id="bB4-81-G6R"/>
<constraint firstItem="mOO-dc-RyS" firstAttribute="leading" secondItem="ZDK-3b-8MQ" secondAttribute="trailing" constant="5" id="dfS-C5-yrS"/>
<constraint firstItem="NmF-B8-BxN" firstAttribute="top" relation="greaterThanOrEqual" secondItem="mOO-dc-RyS" secondAttribute="bottom" constant="5" id="hwb-y3-RPk"/>
<constraint firstAttribute="bottom" secondItem="jcR-bh-Fhz" secondAttribute="bottom" constant="10" id="jGC-H8-LPk"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="G6f-Nu-2R5" secondAttribute="trailing" constant="20" id="k22-dw-mnk"/>
<constraint firstAttribute="trailing" secondItem="58G-jP-FMr" secondAttribute="trailing" id="ndw-7x-qT3"/>
<constraint firstAttribute="trailing" secondItem="u51-sv-YiH" secondAttribute="trailing" constant="20" id="vZk-48-uaD"/>
<constraint firstAttribute="bottom" secondItem="G6f-Nu-2R5" secondAttribute="bottom" constant="15" id="wJc-Mw-Ctl"/>
</constraints>
</view>
</subviews>
......@@ -2711,11 +2742,14 @@
<outlet property="dicountLabel" destination="9CO-TF-h6H" id="n8h-DI-pzv"/>
<outlet property="discriptionLabel" destination="XTf-q6-vau" id="0th-ti-mlx"/>
<outlet property="expirationLabel" destination="u51-sv-YiH" id="SLL-Xy-SY4"/>
<outlet property="expirationRedImage" destination="LGs-y6-UbY" id="thT-fX-W5Q"/>
<outlet property="expirationRedLabel" destination="dF5-HE-P9n" id="7sq-E0-jcW"/>
<outlet property="expirationRedView" destination="G6f-Nu-2R5" id="Qyj-fV-S3E"/>
<outlet property="nameLabel" destination="mOO-dc-RyS" id="zZp-my-uZI"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="UnifiedCouponBCFooterTableViewCell" id="LD5-ES-J67" customClass="UnifiedCouponBCFooterTableViewCell" customModule="SwiftWarplyFramework">
<rect key="frame" x="0.0" y="1007.5" width="414" height="189"/>
<rect key="frame" x="0.0" y="1015.5" width="414" height="189"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="LD5-ES-J67" id="DmN-AA-8n5">
<rect key="frame" x="0.0" y="0.0" width="414" height="189"/>
......
......@@ -123,6 +123,12 @@ import MapKit
swiftApi().getMultilingualMerchantsAsync([], false, 0.0, [], "", 0, [merchantUuid], getMerchantsCallback)
showContent()
}
} else {
let appUuid = swiftApi().getAppUuid()
let categoryUuids = appUuid == "0086a2088301440792091b9f814c2267" ? [""] : ["adcace6cab6049c7b7271bc85bc2b26d"]
swiftApi().getMultilingualMerchantsAsync(categoryUuids, false, 0.0, [], "", 0, [], getMerchantsCallback)
showContent()
}
}
......
......@@ -496,11 +496,11 @@ extension UITableView {
}
@IBAction func mapButtonAction(_ sender: Any) {
// swiftApi().logTrackersEvent("click", "SeeShops")
swiftApi().logTrackersEvent("click", "SeeShops")
//
// let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
// vc.couponSet = coupon?.couponset_data
// self.navigationController?.pushViewController(vc, animated: true)
self.navigationController?.pushViewController(vc, animated: true)
// if (mapBtnVisible == true) {
// swiftApi().logTrackersEvent("click", "SeeShops")
......@@ -583,13 +583,6 @@ extension UnifiedCouponBarcodeViewController: UITableViewDelegate, UITableViewDa
cell.configureCell(coupon: (self.coupon?._coupons[indexPath.row])!, isMarket: true)
// cell.couponBgImage.image = UIImage(named: "coupon_bg_shadow", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
cell.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor
cell.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
cell.layer.shadowOpacity = 1.0
cell.layer.shadowRadius = 6.0
return cell
} else {
......