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

import UIKit

class StartEditingTableViewCell: BaseTableViewCell {
    var xinfo = StartEditingTableViewCellModel()
    
    lazy var bagView: UIImageView = {
        let bagView = UIImageView.init()
        bagView.image = UIImage.init(named: "addBag_image")
        return bagView
    }()
    lazy var addView: UIImageView = {
        let addView = UIImageView.init()
        addView.image = UIImage.init(named: "addApp_image")
        return addView
    }()
    lazy var titleLable: UILabel = {
        let titleLable = UILabel.init()
        titleLable.textAlignment = .center
        titleLable.font = UIFont.test_systemFont(ofSize: 11.33)
        titleLable.numberOfLines = 0
        titleLable.text = "编辑"
        titleLable.textColor = UIColorFromRGB(rgbValue: 0x282A2E)
        return titleLable
    }()
    lazy var addBtnView: UIButton = {
        let addBtnView = UIButton.init(type: .custom)
        addBtnView.addTarget(self, action: #selector(addBtnViewAction), for: .touchUpInside)
        return addBtnView
    }()
    override func awakeFromNib() {
        super.awakeFromNib()
        self.addSubview(bagView)
        self.addSubview(addView)
        self.addSubview(titleLable)
        self.addSubview(addBtnView)
        // Initialization code
    }
    override func configurateTheCell(_ info: BaseCellModel) {
        xinfo = info as! StartEditingTableViewCellModel
        bagView.frame = CGRect(x:13.67, y: 15.67, width:SCREEN_WHIDTH()-13.67*2 , height:self.height-17.67*2 )
        addView.frame = CGRect(x:(SCREEN_WHIDTH()-16.67)/2, y: bagView.originY+9.33, width:16.67 , height:16.67 )
        titleLable.frame = CGRect(x:0, y: addView.originY+addView.height+11, width:SCREEN_WHIDTH() , height:12 )
        addBtnView.frame = CGRect(x:0, y: 0, width:SCREEN_WHIDTH() , height:self.height )
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        
        // Configure the view for the selected state
    }
    @objc func addBtnViewAction(){
        self.xinfo.block()
    }
}
class StartEditingTableViewCellModel: BaseCellModel {
    var vcTitle:String?
    var height = CGFloat()
    var block:selectBlock!
    var lineViewShowType:Bool!
}
