Manos Chorianopoulos

dynamic CouponViewController

...@@ -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>0</integer> 10 + <integer>1</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>1</integer> 10 + <integer>0</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -13,7 +13,10 @@ import UIKit ...@@ -13,7 +13,10 @@ import UIKit
13 @IBOutlet weak var backgroundImage: UIImageView! 13 @IBOutlet weak var backgroundImage: UIImageView!
14 @IBOutlet weak var scrollView: UIScrollView! 14 @IBOutlet weak var scrollView: UIScrollView!
15 @IBOutlet weak var scrollContentView: UIView! 15 @IBOutlet weak var scrollContentView: UIView!
16 + @IBOutlet weak var couponImage: UIImageView!
16 @IBOutlet weak var couponImageHeight: NSLayoutConstraint! 17 @IBOutlet weak var couponImageHeight: NSLayoutConstraint!
18 + @IBOutlet weak var nameLabel: UILabel!
19 + @IBOutlet weak var descriptionLabel: UILabel!
17 @IBOutlet weak var redeemButton: UIButton! 20 @IBOutlet weak var redeemButton: UIButton!
18 @IBOutlet weak var termsButton: UIButton! 21 @IBOutlet weak var termsButton: UIButton!
19 @IBOutlet weak var termsTextView: UITextView! 22 @IBOutlet weak var termsTextView: UITextView!
...@@ -22,6 +25,8 @@ import UIKit ...@@ -22,6 +25,8 @@ import UIKit
22 let uiscreen: CGRect = UIScreen.main.bounds 25 let uiscreen: CGRect = UIScreen.main.bounds
23 26
24 var termsVisible: Bool = false; 27 var termsVisible: Bool = false;
28 +
29 + public var couponset: swiftApi.CouponSetItemModel?
25 30
26 public override func viewDidLoad() { 31 public override func viewDidLoad() {
27 super.viewDidLoad() 32 super.viewDidLoad()
...@@ -36,14 +41,19 @@ import UIKit ...@@ -36,14 +41,19 @@ import UIKit
36 scrollView.layer.cornerRadius = 30 41 scrollView.layer.cornerRadius = 30
37 scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius 42 scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
38 43
44 + couponImage.load(link: couponset?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
45 + couponImage.contentMode = .scaleAspectFill
39 couponImageHeight.constant = self.uiscreen.height * 0.25 46 couponImageHeight.constant = self.uiscreen.height * 0.25
47 +
48 + nameLabel.text = couponset?.name ?? ""
49 + descriptionLabel.text = couponset?.short_description ?? ""
40 50
41 redeemButton.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium) 51 redeemButton.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium)
42 52
43 termsButton.titleLabel?.font = .systemFont(ofSize: 15.0, weight: .semibold) 53 termsButton.titleLabel?.font = .systemFont(ofSize: 15.0, weight: .semibold)
44 // termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5) 54 // termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
45 55
46 - let htmlText = "<p>Το κουπόνι ισχύει έως 05/12/2022</p>\n" 56 + let htmlText = couponset?.terms ?? ""
47 termsTextView.attributedText = htmlText.htmlToAttributedString 57 termsTextView.attributedText = htmlText.htmlToAttributedString
48 termsTextView.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.regular) 58 termsTextView.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.regular)
49 termsTextView.textColor = UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00) 59 termsTextView.textColor = UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00)
......
...@@ -730,8 +730,11 @@ ...@@ -730,8 +730,11 @@
730 </view> 730 </view>
731 <connections> 731 <connections>
732 <outlet property="backgroundImage" destination="Oep-XD-blB" id="YaT-qr-rry"/> 732 <outlet property="backgroundImage" destination="Oep-XD-blB" id="YaT-qr-rry"/>
733 + <outlet property="couponImage" destination="3SX-fR-ph2" id="Ov2-Bw-eWL"/>
733 <outlet property="couponImageHeight" destination="zUx-Yd-in7" id="7vo-8L-d8o"/> 734 <outlet property="couponImageHeight" destination="zUx-Yd-in7" id="7vo-8L-d8o"/>
735 + <outlet property="descriptionLabel" destination="dSA-lM-N5v" id="v6k-3l-uaA"/>
734 <outlet property="mainView" destination="Jqu-cp-CWU" id="Q0Z-dO-MXL"/> 736 <outlet property="mainView" destination="Jqu-cp-CWU" id="Q0Z-dO-MXL"/>
737 + <outlet property="nameLabel" destination="isU-Qv-94G" id="Vc8-gh-Cth"/>
735 <outlet property="redeemButton" destination="FCd-hv-dHg" id="3Jw-Yn-uNr"/> 738 <outlet property="redeemButton" destination="FCd-hv-dHg" id="3Jw-Yn-uNr"/>
736 <outlet property="scrollContentView" destination="uTN-Qr-wBi" id="pPq-Lh-qVN"/> 739 <outlet property="scrollContentView" destination="uTN-Qr-wBi" id="pPq-Lh-qVN"/>
737 <outlet property="scrollView" destination="1N5-oA-ZTb" id="qee-AV-Oev"/> 740 <outlet property="scrollView" destination="1N5-oA-ZTb" id="qee-AV-Oev"/>
......