Manos Chorianopoulos

CouponBarcodeViewController description fix and error modal

......@@ -124,7 +124,7 @@ import AVFoundation
// let couponSetData: swiftApi.CouponSetItemModel? = coupon?.couponset_data
var couponSetData: swiftApi.CouponSetItemModel?
if (isMarket == true) {
if (isMarket == true || isSMCoupon == true) {
for item in smCouponsetsList {
if (item.uuid == coupon?.couponset_uuid) {
couponSetData = item
......@@ -208,6 +208,13 @@ import AVFoundation
// nameLabel.text = htmlName.htmlToString
discriptionLabel.text = htmlDiscription.htmlToString
} else if (isSMCoupon == true) {
couponImage.contentMode = .scaleAspectFill
nameLabel.text = couponSetData?.name ?? ""
let htmlDiscription = couponSetData?.description ?? ""
discriptionLabel.text = htmlDiscription.htmlToString
} else {
couponImage.contentMode = .scaleAspectFill
nameLabel.text = couponSetData?.name ?? ""
......@@ -651,6 +658,25 @@ import AVFoundation
return ""
}
func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
switch action.style{
case .default:
print("default")
case .cancel:
print("cancel")
case .destructive:
print("destructive")
}
}))
self.present(alert, animated: true, completion: nil)
}
// MARK: - Actions
@IBAction func redeemButtomAction(_ sender: Any) {
......@@ -680,7 +706,7 @@ import AVFoundation
}
} else {
// TODO: add error popup
self.showDialog("Δεν υπάρχουν διαθέσιμα supermarkets","")
}
} else {
......