Manos Chorianopoulos

fix AnalysisItemViewCell

......@@ -54,21 +54,37 @@ extension AnalysisItemViewCell {
func configureCell(item: swiftApi.CouponItemModel) {
// COUPONSET: desc, img_preview, name, terms
// COUPONSET: desc, img_preview, name, terms, merchant_uuid
// COUPON: coupon, expiration, discount, status
// MERCHANT: _img_preview,_admin_name
let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
let couponSetData: swiftApi.CouponSetItemModel? = item.couponset_data
titleLabel.text = ""
for merchant in merchantList {
if (merchant._uuid == couponSetData?.merchant_uuid) {
itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
titleLabel.text = merchant._admin_name
break;
}
}
dateLabel.text = item.expiration ?? "" // TODO: change
itemImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
titleLabel.text = couponSetData?.name ?? ""
// itemImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
// titleLabel.text = couponSetData?.name ?? ""
let priceFloat = Float(round(100 * (Float(item.discount ?? "") ?? 0.0)) / 100)
var priceString = "0"
priceString = String(format: "%.2f", priceFloat).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
priceLabel.text = priceString + "€"
subtitleLabel.text = couponSetData?.short_description ?? ""
subtitleLabel.text = "Έκπτωτικό κουπόνι"
// subtitleLabel.text = couponSetData?.short_description ?? ""
// OR
// let htmlText = couponSetData?.inner_text ?? ""
// subtitleLabel.text = htmlText.htmlToString
}
}
......