//
//  RecommendTableViewCell.swift
//  MobilePortal
//
//  Created by caiyang on 2020/4/8.
//  Copyright © 2020 yin chen. All rights reserved.
//

import UIKit

class RecommendTableViewCell: BaseTableViewCell {

    var xinfo = RecommendTableViewCellModel()
    
    lazy var subImageView: UIImageView = {
        let subImageView = UIImageView.init()
        //subImageView.contentMode = .scaleToFill
        subImageView.contentMode = .scaleAspectFill
        subImageView.image = UIImage.init(named: "q_image")
        self.addSubview(subImageView)
        return subImageView
    }()
    lazy var titleLabel: UILabel = {
        let titleLabel = UILabel.init()
        titleLabel.textAlignment = .left
        titleLabel.numberOfLines = 0
        titleLabel.font = UIFont.test_systemFont(ofSize: 12)
//        titleLabel.font = UIFont.boldSystemFont(ofSize: 21.33)
//        titleLabel.font = UIFont.init(name: "Helvetica-Bold", size: 21.33)
        titleLabel.textColor = UIColorFromRGB(rgbValue: 0x1E202C)
        self.addSubview(titleLabel)
        return titleLabel
    }()
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.separatorInset=UIEdgeInsetsMake(0, SCREEN_WHIDTH(), 0, 0)
        // Initialization code
    }
    override func configurateTheCell(_ info: BaseCellModel) {
        xinfo = info as! RecommendTableViewCellModel
        titleLabel.text = xinfo.titleStr
        subImageView.frame = CGRect(x:13.67, y: 9, width:12 , height:16 )
        subImageView.centerY = self.height/2
        let titleLabelW = SCREEN_WHIDTH()-(subImageView.originX+subImageView.width+26.67)
        titleLabel.frame = CGRect(x:subImageView.originX+subImageView.width+11.67, y: 0, width:titleLabelW , height:self.height )
        titleLabel.centerY = subImageView.centerY
        titleLabel.text = xinfo.titleStr
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
class RecommendTableViewCellModel: BaseCellModel {
    var titleStr:String?
    var imageUrl:String?
    var timeStr:String?
    var block:selectBlock!
}
//class RecommendTitleTableViewCell: BaseTableViewCell {
//
//    var xinfo = RecommendTitleTableViewCellModel()
//
//    lazy var titleLabel: UILabel = {
//        let titleLabel = UILabel.init()
//        titleLabel.textAlignment = .left
//        titleLabel.numberOfLines = 0
//        titleLabel.font = UIFont.systemFont(ofSize: 14)
//        //        titleLabel.font = UIFont.boldSystemFont(ofSize: 21.33)
//        //        titleLabel.font = UIFont.init(name: "Helvetica-Bold", size: 21.33)
//        titleLabel.textColor = UIColorFromRGB(rgbValue: 0x1E202C)
//        self.addSubview(titleLabel)
//        return titleLabel
//    }()
//
//    override func awakeFromNib() {
//        super.awakeFromNib()
//        self.separatorInset=UIEdgeInsetsMake(0, SCREEN_WHIDTH(), 0, 0)
//        // Initialization code
//    }
//    override func configurateTheCell(_ info: BaseCellModel) {
//        xinfo = info as! RecommendTitleTableViewCellModel
//        titleLabel.frame = CGRect(x:13.67, y: 0, width:self.width , height:self.height )
//        titleLabel.centerY = self.height/2
//        titleLabel.text = xinfo.titleStr
//    }
//    override func setSelected(_ selected: Bool, animated: Bool) {
//        super.setSelected(selected, animated: animated)
//
//        // Configure the view for the selected state
//    }
//
//}
//class RecommendTitleTableViewCellModel: BaseCellModel {
//    var titleStr:String?
//    var imageUrl:String?
//    var timeStr:String?
//    var block:selectBlock!
//}
