// // EverybodyLoveItem.swift // ADHTuanCan // // Created by 敖德亨 on 2023/9/30. // import UIKit class EverybodyLoveItem: UIView { @IBOutlet weak var priceLab: UILabel! @IBOutlet weak var foodImg: UIImageView! @IBOutlet weak var nameLab: UILabel! @IBOutlet weak var scoreLab: UILabel! @IBOutlet weak var rightBtn: UIButton! var touchUpActionBlock : (()->Void)? override func awakeFromNib() { super.awakeFromNib() // self.priceLab.addCorner(YDRectCorner(topLeft: 0, topRight: 15, bottomRight: 15)) self.rightBtn.addCorner(YDRectCorner(topLeft: 15, topRight: 0, bottomLeft: 0,bottomRight: 0)) } func configModel(model : HomeFoodDetailModel){ self.priceLab.text = "s$\(model.price ?? "")" self.nameLab.text = "\(model.name ?? "")" self.scoreLab.text = "\(model.score ?? "0")" self.foodImg.sd_setImage(url: URL.init(string: model.link ?? "") ,placeHolderImage: UIImage.init(named: "placeHolderImage")) self.priceLab.addCorner(YDRectCorner(topLeft: 0, topRight: 15, bottomRight: 15)) } @IBAction func touchUpAction(_ sender: UIButton) { if self.touchUpActionBlock != nil{ self.touchUpActionBlock!() } } }