Showing
3 changed files
with
52 additions
and
12 deletions
This diff is collapsed. Click to expand it.
| ... | @@ -98,7 +98,7 @@ import SwiftEventBus | ... | @@ -98,7 +98,7 @@ import SwiftEventBus |
| 98 | 98 | ||
| 99 | let barcodeString = "" | 99 | let barcodeString = "" |
| 100 | barcodeLabel.text = barcodeString | 100 | barcodeLabel.text = barcodeString |
| 101 | - barcodeLabel.font = UIFont(name: "PeridotPE-Regular", size: 19.0) | 101 | + barcodeLabel.font = UIFont(name: "PeridotPE-SBold", size: 19.0) |
| 102 | barcodeLabel.textColor = UIColor(rgb: 0x212121) | 102 | barcodeLabel.textColor = UIColor(rgb: 0x212121) |
| 103 | 103 | ||
| 104 | // if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.12)) { | 104 | // if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.12)) { |
| ... | @@ -112,19 +112,23 @@ import SwiftEventBus | ... | @@ -112,19 +112,23 @@ import SwiftEventBus |
| 112 | // barcodeImageHeight.constant = 0 | 112 | // barcodeImageHeight.constant = 0 |
| 113 | // } | 113 | // } |
| 114 | 114 | ||
| 115 | - let couponsValueString = "0.00" | 115 | + // let couponsValueString = "0.00" |
| 116 | - let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 17) ?? UIFont.systemFont(ofSize: 16), NSAttributedString.Key.foregroundColor: UIColor.white] | 116 | + // let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 17) ?? UIFont.systemFont(ofSize: 16), NSAttributedString.Key.foregroundColor: UIColor.white] |
| 117 | - let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 17) ?? UIFont.boldSystemFont(ofSize: 16), NSAttributedString.Key.foregroundColor: UIColor.white] | 117 | + // let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 17) ?? UIFont.boldSystemFont(ofSize: 16), NSAttributedString.Key.foregroundColor: UIColor.white] |
| 118 | 118 | ||
| 119 | - let couponsValueNormalText1 = "Με τα διαθέσιμα κουπόνια μπορείς να εξοικονομήσεις έως και " | 119 | + // let couponsValueNormalText1 = "Με τα διαθέσιμα κουπόνια μπορείς να εξοικονομήσεις έως και " |
| 120 | - let couponsValueBoldText = couponsValueString + "€." | 120 | + // let couponsValueBoldText = couponsValueString + "€." |
| 121 | 121 | ||
| 122 | - let couponsValueAttributedString = NSMutableAttributedString(string:couponsValueNormalText1, attributes:attrRegular) | 122 | + // let couponsValueAttributedString = NSMutableAttributedString(string:couponsValueNormalText1, attributes:attrRegular) |
| 123 | - let couponsValueBoldString = NSMutableAttributedString(string: couponsValueBoldText, attributes:attrBold) | 123 | + // let couponsValueBoldString = NSMutableAttributedString(string: couponsValueBoldText, attributes:attrBold) |
| 124 | 124 | ||
| 125 | - couponsValueAttributedString.append(couponsValueBoldString) | 125 | + // couponsValueAttributedString.append(couponsValueBoldString) |
| 126 | - couponsValueLabel.attributedText = couponsValueAttributedString | 126 | + // couponsValueLabel.attributedText = couponsValueAttributedString |
| 127 | + | ||
| 128 | + couponsValueLabel.text = "Χρησιμοποίησε τη SUPERMARKET DEALS CARD σου για να κερδίσεις έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα διαθέσιμα εκπτωτικά κουπόνια στο For You." | ||
| 127 | couponsValueLabel.textAlignment = .left | 129 | couponsValueLabel.textAlignment = .left |
| 130 | + couponsValueLabel.font = UIFont(name: "PeridotPE-Regular", size: 13.0) | ||
| 131 | + couponsValueLabel.textColor = .white | ||
| 128 | 132 | ||
| 129 | mapButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 16) | 133 | mapButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 16) |
| 130 | mapButton.setTitle("Δες στο χάρτη", for: .normal) | 134 | mapButton.setTitle("Δες στο χάρτη", for: .normal) |
| ... | @@ -232,11 +236,16 @@ import SwiftEventBus | ... | @@ -232,11 +236,16 @@ import SwiftEventBus |
| 232 | 236 | ||
| 233 | couponsValueAttributedString.append(couponsValueBoldString) | 237 | couponsValueAttributedString.append(couponsValueBoldString) |
| 234 | couponsValueLabel.attributedText = couponsValueAttributedString | 238 | couponsValueLabel.attributedText = couponsValueAttributedString |
| 239 | + | ||
| 240 | + couponsValueLabel.text = "Χρησιμοποίησε τη SUPERMARKET DEALS CARD σου για να κερδίσεις έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα διαθέσιμα εκπτωτικά κουπόνια στο For You." | ||
| 235 | couponsValueLabel.textAlignment = .left | 241 | couponsValueLabel.textAlignment = .left |
| 242 | + couponsValueLabel.font = UIFont(name: "PeridotPE-Regular", size: 13.0) | ||
| 243 | + couponsValueLabel.textColor = .white | ||
| 236 | 244 | ||
| 237 | - let formattedCost = couponsValueString.replacingOccurrences(of: ".", with: ",") | 245 | + // let formattedCost = couponsValueString.replacingOccurrences(of: ".", with: ",") |
| 238 | couponsValueLabel.isAccessibilityElement = true | 246 | couponsValueLabel.isAccessibilityElement = true |
| 239 | - couponsValueLabel.accessibilityLabel = "Έχεις κουπόνια συνολικής αξίας " + formattedCost + "€" | 247 | + // couponsValueLabel.accessibilityLabel = "Έχεις κουπόνια συνολικής αξίας " + formattedCost + "€" |
| 248 | + couponsValueLabel.accessibilityLabel = "Χρησιμοποίησε τη SUPERMARKET DEALS CARD σου για να κερδίσεις έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα διαθέσιμα εκπτωτικά κουπόνια στο For You." | ||
| 240 | 249 | ||
| 241 | let supermarkets: Array<swiftApi.SupermarketModel> = marketPassDetails?._supermarkets ?? [] | 250 | let supermarkets: Array<swiftApi.SupermarketModel> = marketPassDetails?._supermarkets ?? [] |
| 242 | 251 | ||
| ... | @@ -380,6 +389,10 @@ import SwiftEventBus | ... | @@ -380,6 +389,10 @@ import SwiftEventBus |
| 380 | // } | 389 | // } |
| 381 | 390 | ||
| 382 | // MARK: - Actions | 391 | // MARK: - Actions |
| 392 | + @IBAction func supermakrtPassButtonAction(_ sender: Any) { | ||
| 393 | + swiftApi().openSupermarketPass(self) | ||
| 394 | + } | ||
| 395 | + | ||
| 383 | @IBAction func mapButtonAction(_ sender: Any) { | 396 | @IBAction func mapButtonAction(_ sender: Any) { |
| 384 | swiftApi().openSupermarketMap(self) | 397 | swiftApi().openSupermarketMap(self) |
| 385 | } | 398 | } | ... | ... |
| ... | @@ -9421,6 +9421,33 @@ public class swiftApi { | ... | @@ -9421,6 +9421,33 @@ public class swiftApi { |
| 9421 | } | 9421 | } |
| 9422 | } | 9422 | } |
| 9423 | 9423 | ||
| 9424 | + public func getMarketPassUrl() -> String { | ||
| 9425 | + let appUuid = swiftApi().getAppUuid() | ||
| 9426 | + if (appUuid == "f83dfde1145e4c2da69793abb2f579af") { | ||
| 9427 | + return "https://dev.supermarketdeals.eu" | ||
| 9428 | + } else { | ||
| 9429 | + return "https://supermarketdeals.eu" | ||
| 9430 | + } | ||
| 9431 | + } | ||
| 9432 | + | ||
| 9433 | + public func openSupermarketPass(_ controller: UIViewController) -> Void { | ||
| 9434 | + let status = swiftApi().getNetworkStatus() | ||
| 9435 | + if (status == -1 || status == 0) { | ||
| 9436 | + swiftApi().showDialog(controller, "Δεν υπάρχει σύνδεση","Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.") | ||
| 9437 | + | ||
| 9438 | + } else { | ||
| 9439 | + let tempCampaign = CampaignItemModel() | ||
| 9440 | + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) | ||
| 9441 | + let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController | ||
| 9442 | + let url = swiftApi().getMarketPassUrl() | ||
| 9443 | + let params = swiftApi().constructCampaignParams(tempCampaign) | ||
| 9444 | + vc.campaignUrl = url | ||
| 9445 | + vc.params = params | ||
| 9446 | + vc.showHeader = false | ||
| 9447 | + controller.navigationController?.pushViewController(vc, animated: true) | ||
| 9448 | + } | ||
| 9449 | + } | ||
| 9450 | + | ||
| 9424 | 9451 | ||
| 9425 | /* | 9452 | /* |
| 9426 | { | 9453 | { | ... | ... |
-
Please register or login to post a comment