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

import UIKit

class UpcomingDetailsTitleTableViewCell: BaseTableViewCell {
    lazy var typeLabel: UILabel = {
        let typeLabel = UILabel.init()
        typeLabel.textAlignment = .left
        typeLabel.numberOfLines = 0
        typeLabel.font = UIFont.test_systemFont(ofSize: 13.33)
        typeLabel.textColor = UIColorFromRGB(rgbValue: 0x23262A)
        self.addSubview(typeLabel)
        return typeLabel
    }()
    lazy var nameLabel: UILabel = {
        let nameLabel = UILabel.init()
        nameLabel.textAlignment = .left
        nameLabel.numberOfLines = 0
        nameLabel.font = UIFont.test_systemFont(ofSize: 11.33)
        nameLabel.textColor = UIColorFromRGB(rgbValue: 0x8792A4)
        self.addSubview(nameLabel)
        return nameLabel
    }()
    var xinfo = UpcomingDetailsTitleTableViewCellModel()
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.separatorInset=UIEdgeInsetsMake(0, 0, 0, 0)
        // Initialization code
    }
    override func configurateTheCell(_ info: BaseCellModel) {
        xinfo = info as! UpcomingDetailsTitleTableViewCellModel
        let typeLabelW = getTexWidth(textStr: xinfo.typeStr!, font: UIFont.test_systemFont(ofSize: 14), height: self.height)
        typeLabel.frame = CGRect(x:26.66, y: 0, width: typeLabelW, height:self.height )
        typeLabel.text = xinfo.typeStr
        let nameLabelW = getTexWidth(textStr: xinfo.typeStr!, font: UIFont.test_systemFont(ofSize: 12), height: self.height)
        nameLabel.frame = CGRect(x:typeLabel.originX+typeLabel.width+5, y: 0, width: nameLabelW, height:self.height )
        nameLabel.text = xinfo.nsme
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
class UpcomingDetailsTitleTableViewCellModel: BaseCellModel {
    var typeStr:String?
    var nsme:String?
    var upcomingType:BusinessType = .UpcomingType
    var block:selectBlock!
    var h = CGFloat()
}
