Showing
7 changed files
with
86 additions
and
14 deletions
... | @@ -7,7 +7,7 @@ | ... | @@ -7,7 +7,7 @@ |
7 | <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> | 7 | <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> |
8 | <dict> | 8 | <dict> |
9 | <key>orderHint</key> | 9 | <key>orderHint</key> |
10 | - <integer>1</integer> | 10 | + <integer>0</integer> |
11 | </dict> | 11 | </dict> |
12 | </dict> | 12 | </dict> |
13 | </dict> | 13 | </dict> | ... | ... |
... | @@ -7,7 +7,7 @@ | ... | @@ -7,7 +7,7 @@ |
7 | <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> | 7 | <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> |
8 | <dict> | 8 | <dict> |
9 | <key>orderHint</key> | 9 | <key>orderHint</key> |
10 | - <integer>0</integer> | 10 | + <integer>1</integer> |
11 | </dict> | 11 | </dict> |
12 | </dict> | 12 | </dict> |
13 | </dict> | 13 | </dict> | ... | ... |
No preview for this file type
... | @@ -16,7 +16,10 @@ import UIKit | ... | @@ -16,7 +16,10 @@ import UIKit |
16 | @IBOutlet weak var dicountLabel: UILabel! | 16 | @IBOutlet weak var dicountLabel: UILabel! |
17 | @IBOutlet weak var discriptionLabel: UILabel! | 17 | @IBOutlet weak var discriptionLabel: UILabel! |
18 | @IBOutlet weak var expirationLabel: UILabel! | 18 | @IBOutlet weak var expirationLabel: UILabel! |
19 | - | 19 | + @IBOutlet weak var expirationRedView: UIView! |
20 | + @IBOutlet weak var expirationRedImage: UIImageView! | ||
21 | + @IBOutlet weak var expirationRedLabel: UILabel! | ||
22 | + | ||
20 | var postImageURL: String? { | 23 | var postImageURL: String? { |
21 | didSet { | 24 | didSet { |
22 | if let url = postImageURL { | 25 | if let url = postImageURL { |
... | @@ -96,6 +99,77 @@ import UIKit | ... | @@ -96,6 +99,77 @@ import UIKit |
96 | // COUPONSET: desc, img_preview, name, terms, merchant_uuid | 99 | // COUPONSET: desc, img_preview, name, terms, merchant_uuid |
97 | // COUPON: coupon, expiration, discount, status | 100 | // COUPON: coupon, expiration, discount, status |
98 | // MERCHANT: _img_preview,_admin_name | 101 | // MERCHANT: _img_preview,_admin_name |
102 | + | ||
103 | + if (coupon.status == 1) { | ||
104 | + // Add shadow | ||
105 | + self.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor | ||
106 | + self.layer.shadowOffset = CGSize(width: 0.0, height: 0.0) | ||
107 | + self.layer.shadowOpacity = 1.0 | ||
108 | + self.layer.shadowRadius = 6.0 | ||
109 | + | ||
110 | + couponBgImage.image = UIImage(named: "coupon_bg", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
111 | + | ||
112 | + expirationLabel.isHidden = false | ||
113 | + expirationRedView.isHidden = true | ||
114 | + expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "") | ||
115 | + | ||
116 | + let formatter = DateFormatter() | ||
117 | + formatter.dateFormat = "dd/MM/yyyy" | ||
118 | + let today = Date() | ||
119 | +// let firstDate = formatter.date(from: "01/08/2017") | ||
120 | +// let secondDate = formatter.date(from: "22/04/2023") | ||
121 | + if let couponExpiration = coupon.expiration, let secondDate = formatter.date(from: couponExpiration) { | ||
122 | + | ||
123 | + let calendar = NSCalendar.current | ||
124 | + let date1 = calendar.startOfDay(for: today) | ||
125 | + let date2 = calendar.startOfDay(for: secondDate) | ||
126 | + | ||
127 | + let differenceComponents = calendar.dateComponents([.day], from: date1, to: date2) | ||
128 | + | ||
129 | + if let daysDifference = differenceComponents.day { | ||
130 | + if ((daysDifference >= 0) && (daysDifference <= 15)) { | ||
131 | + | ||
132 | + expirationLabel.isHidden = true | ||
133 | + expirationRedView.isHidden = false | ||
134 | + expirationRedView.layer.cornerRadius = 10.0 | ||
135 | + expirationRedView.backgroundColor = UIColor(red: 0.94, green: 0.90, blue: 0.90, alpha: 1.00) | ||
136 | + | ||
137 | + expirationRedImage.image = UIImage(named: "ic_time_forward", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
138 | + | ||
139 | + let normalText1 = "Ισχύει έως " | ||
140 | + let redText = (coupon.expiration ?? "") | ||
141 | + | ||
142 | + 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)] | ||
143 | + 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)] | ||
144 | + | ||
145 | + let attributedString = NSMutableAttributedString(string:normalText1, attributes:attrRegular) | ||
146 | + let RedString = NSMutableAttributedString(string: redText, attributes:attrRed) | ||
147 | + | ||
148 | + attributedString.append(RedString) | ||
149 | + expirationRedLabel.attributedText = attributedString | ||
150 | + | ||
151 | + } else { | ||
152 | + expirationLabel.isHidden = false | ||
153 | + expirationRedView.isHidden = true | ||
154 | + expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "") | ||
155 | + } | ||
156 | + } | ||
157 | + } | ||
158 | + | ||
159 | + } else if (coupon.status == 0) { | ||
160 | + couponBgImage.image = UIImage(named: "coupon_bg_grey", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
161 | + | ||
162 | + expirationLabel.isHidden = false | ||
163 | + expirationRedView.isHidden = true | ||
164 | + expirationLabel.text = "Το κουπόνι έληξε" | ||
165 | + | ||
166 | + couponImage.layer.opacity = 0.23 | ||
167 | + borderView.layer.opacity = 0.15 | ||
168 | + nameLabel.layer.opacity = 0.15 | ||
169 | + dicountLabel.layer.opacity = 0.15 | ||
170 | + discriptionLabel.layer.opacity = 0.15 | ||
171 | + | ||
172 | + } | ||
99 | 173 | ||
100 | let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList() | 174 | let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList() |
101 | 175 | ||
... | @@ -120,7 +194,6 @@ import UIKit | ... | @@ -120,7 +194,6 @@ import UIKit |
120 | let htmlText = coupon.inner_text ?? "" | 194 | let htmlText = coupon.inner_text ?? "" |
121 | discriptionLabel.text = htmlText.htmlToString | 195 | discriptionLabel.text = htmlText.htmlToString |
122 | // discriptionLabel.text = coupon.inner_text ?? "" | 196 | // discriptionLabel.text = coupon.inner_text ?? "" |
123 | - expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "") | ||
124 | 197 | ||
125 | } | 198 | } |
126 | 199 | ... | ... |
This diff is collapsed. Click to expand it.
... | @@ -123,6 +123,12 @@ import MapKit | ... | @@ -123,6 +123,12 @@ import MapKit |
123 | swiftApi().getMultilingualMerchantsAsync([], false, 0.0, [], "", 0, [merchantUuid], getMerchantsCallback) | 123 | swiftApi().getMultilingualMerchantsAsync([], false, 0.0, [], "", 0, [merchantUuid], getMerchantsCallback) |
124 | showContent() | 124 | showContent() |
125 | } | 125 | } |
126 | + } else { | ||
127 | + let appUuid = swiftApi().getAppUuid() | ||
128 | + let categoryUuids = appUuid == "0086a2088301440792091b9f814c2267" ? [""] : ["adcace6cab6049c7b7271bc85bc2b26d"] | ||
129 | + | ||
130 | + swiftApi().getMultilingualMerchantsAsync(categoryUuids, false, 0.0, [], "", 0, [], getMerchantsCallback) | ||
131 | + showContent() | ||
126 | } | 132 | } |
127 | 133 | ||
128 | } | 134 | } | ... | ... |
... | @@ -496,11 +496,11 @@ extension UITableView { | ... | @@ -496,11 +496,11 @@ extension UITableView { |
496 | } | 496 | } |
497 | 497 | ||
498 | @IBAction func mapButtonAction(_ sender: Any) { | 498 | @IBAction func mapButtonAction(_ sender: Any) { |
499 | -// swiftApi().logTrackersEvent("click", "SeeShops") | 499 | + swiftApi().logTrackersEvent("click", "SeeShops") |
500 | // | 500 | // |
501 | -// let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self)) | 501 | + let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self)) |
502 | // vc.couponSet = coupon?.couponset_data | 502 | // vc.couponSet = coupon?.couponset_data |
503 | -// self.navigationController?.pushViewController(vc, animated: true) | 503 | + self.navigationController?.pushViewController(vc, animated: true) |
504 | 504 | ||
505 | // if (mapBtnVisible == true) { | 505 | // if (mapBtnVisible == true) { |
506 | // swiftApi().logTrackersEvent("click", "SeeShops") | 506 | // swiftApi().logTrackersEvent("click", "SeeShops") |
... | @@ -583,13 +583,6 @@ extension UnifiedCouponBarcodeViewController: UITableViewDelegate, UITableViewDa | ... | @@ -583,13 +583,6 @@ extension UnifiedCouponBarcodeViewController: UITableViewDelegate, UITableViewDa |
583 | 583 | ||
584 | cell.configureCell(coupon: (self.coupon?._coupons[indexPath.row])!, isMarket: true) | 584 | cell.configureCell(coupon: (self.coupon?._coupons[indexPath.row])!, isMarket: true) |
585 | 585 | ||
586 | -// cell.couponBgImage.image = UIImage(named: "coupon_bg_shadow", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) | ||
587 | - | ||
588 | - cell.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor | ||
589 | - cell.layer.shadowOffset = CGSize(width: 0.0, height: 0.0) | ||
590 | - cell.layer.shadowOpacity = 1.0 | ||
591 | - cell.layer.shadowRadius = 6.0 | ||
592 | - | ||
593 | return cell | 586 | return cell |
594 | 587 | ||
595 | } else { | 588 | } else { | ... | ... |
-
Please register or login to post a comment