Manos Chorianopoulos

ui fixes, unified barcode, sort unified by date

...@@ -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>
......
...@@ -122,7 +122,8 @@ import AVFoundation ...@@ -122,7 +122,8 @@ import AVFoundation
122 func configureCell(coupon: swiftApi.UnifiedCouponModel?, couponsVisible: Bool) { 122 func configureCell(coupon: swiftApi.UnifiedCouponModel?, couponsVisible: Bool) {
123 123
124 couponView.layer.cornerRadius = 8 124 couponView.layer.cornerRadius = 8
125 - couponNumberLabel.text = ((coupon?._code != 0) ? String(coupon?._code ?? 0) : "") 125 +// couponNumberLabel.text = ((coupon?._code != 0) ? String(coupon?._code ?? 0) : "")
126 + couponNumberLabel.text = coupon?._barcode ?? ""
126 couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55) 127 couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55)
127 128
128 let barcodeString = constructBarcode(coupon: coupon) ?? "" 129 let barcodeString = constructBarcode(coupon: coupon) ?? ""
...@@ -150,15 +151,15 @@ import AVFoundation ...@@ -150,15 +151,15 @@ import AVFoundation
150 // === Hide Barcode Section 151 // === Hide Barcode Section
151 // barcodeImage.isHidden = true 152 // barcodeImage.isHidden = true
152 // barcodeImageHeight.constant = CGFloat(0) 153 // barcodeImageHeight.constant = CGFloat(0)
153 -// barcodeLabel.isHidden = true 154 + barcodeLabel.isHidden = true
154 -// barcodeLabelHeight.constant = CGFloat(0) 155 + barcodeLabelHeight.constant = CGFloat(0)
155 // 156 //
156 // borderViewHeight.constant = CGFloat(0) 157 // borderViewHeight.constant = CGFloat(0)
157 // borderView2Height.constant = CGFloat(0) 158 // borderView2Height.constant = CGFloat(0)
158 // 159 //
159 // border1TopSpace.constant = CGFloat(0) // 20 160 // border1TopSpace.constant = CGFloat(0) // 20
160 // barcodeImageTopSpace.constant = CGFloat(0) // 10 161 // barcodeImageTopSpace.constant = CGFloat(0) // 10
161 -// barcodeLabelTopSpace.constant = CGFloat(0) // 10 162 + barcodeLabelTopSpace.constant = CGFloat(0) // 10
162 // border2TopSpace.constant = CGFloat(0) // 15 163 // border2TopSpace.constant = CGFloat(0) // 15
163 // 164 //
164 showBarcodeButton.isHidden = true 165 showBarcodeButton.isHidden = true
......
...@@ -117,7 +117,7 @@ import SwiftEventBus ...@@ -117,7 +117,7 @@ import SwiftEventBus
117 showDialog("Αδυναμία ενεργοποίησης", "Πρόσθεσε σύνδεση COSMOTE σταθερής, κινητής ή TV για να έχεις πρόσβαση στις προσφορές."); 117 showDialog("Αδυναμία ενεργοποίησης", "Πρόσθεσε σύνδεση COSMOTE σταθερής, κινητής ή TV για να έχεις πρόσβαση στις προσφορές.");
118 } 118 }
119 119
120 - headerImage.image = UIImage(named: "ic_background_circle", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) 120 + headerImage.image = UIImage(named: "ic_background_straight", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
121 dfyEarnImage.image = UIImage(named: "wallet_dfy_earn", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) 121 dfyEarnImage.image = UIImage(named: "wallet_dfy_earn", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
122 couponEarnImage.image = UIImage(named: "wallet_coupons_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) 122 couponEarnImage.image = UIImage(named: "wallet_coupons_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
123 dfyLogoImage.image = UIImage(named: "dfy_logo_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) 123 dfyLogoImage.image = UIImage(named: "dfy_logo_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
......
...@@ -6819,7 +6819,7 @@ public class swiftApi { ...@@ -6819,7 +6819,7 @@ public class swiftApi {
6819 let dateString = dictionary["created"] as? String? ?? "" 6819 let dateString = dictionary["created"] as? String? ?? ""
6820 let dateFormatter = DateFormatter() 6820 let dateFormatter = DateFormatter()
6821 dateFormatter.locale = Locale(identifier: "en_US_POSSIX") 6821 dateFormatter.locale = Locale(identifier: "en_US_POSSIX")
6822 - dateFormatter.dateFormat = "E, MMM dd yyyy HH:mm:ss" 6822 + dateFormatter.dateFormat = "E, dd MMM yyyy HH:mm:ss 'GMT'"
6823 if let date = dateFormatter.date(from: dateString ?? "") { 6823 if let date = dateFormatter.date(from: dateString ?? "") {
6824 dateFormatter.dateFormat = "dd/MM/yyyy" 6824 dateFormatter.dateFormat = "dd/MM/yyyy"
6825 let resultString = dateFormatter.string(from: date) 6825 let resultString = dateFormatter.string(from: date)
...@@ -6909,9 +6909,14 @@ public class swiftApi { ...@@ -6909,9 +6909,14 @@ public class swiftApi {
6909 } 6909 }
6910 } 6910 }
6911 6911
6912 - swiftApi().setUnifiedCouponList(unifiedCouponsArray) 6912 + // Sort by date
6913 + let dateFormatter = DateFormatter()
6914 + dateFormatter.dateFormat = "dd/MM/yyyy"
6915 + let sortedUnifiedCouponsArray = unifiedCouponsArray.sorted(by: { dateFormatter.date(from:$0._created)?.compare(dateFormatter.date(from:$1._created)!) == .orderedDescending })
6916 +
6917 + swiftApi().setUnifiedCouponList(sortedUnifiedCouponsArray)
6913 swiftApi().setOldUnifiedCouponList(oldUnifiedCouponsArray) 6918 swiftApi().setOldUnifiedCouponList(oldUnifiedCouponsArray)
6914 - successCallback(unifiedCouponsArray) 6919 + successCallback(sortedUnifiedCouponsArray)
6915 } 6920 }
6916 } else { 6921 } else {
6917 successCallback(nil) 6922 successCallback(nil)
......