CNLiveDuanjuTitleCell.swift 1.75 KB
//
//  CNLiveDuanjuTitleCell.swift
//  metaCode
//
//  Created by zx on 2024/1/10.
//  在追短剧详情页/全部课程详情页 --title cell

import Foundation

class CNLiveDuanjuTitleCell:UITableViewCell{
    var _blockName:String?
    var blockName:String?{
        get{
            _blockName
        }
        set{
            _blockName = newValue!
            
            if self.cellType == .course || self.cellType == .playletToCourse || self.cellType == .courseToMyCurriculum{
                self.blockTitleLabl.text = _blockName ?? "全部课程"
                self.blockTitleLabl.top = (allCourseCellHeight-30)/2+get_system_statusBar_height()
            }else if self.cellType == .playlet{
                self.blockTitleLabl.text = _blockName ?? "在追短剧"
                self.blockTitleLabl.top = (45-30)/2
            }
        }
    }
    var cellType:CNLiveHomePageCellType = .course

    //MARK: - 懒加载
    ///区块标题
    lazy var blockTitleLabl: UILabel = {
        let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: 10, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30))
        titleLbl.text = "在追短剧"
        titleLbl.font = BoldFont_21
        titleLbl.textColor = HexColor("#333333")
        return titleLbl
    }()
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI() {
        contentView.backgroundColor = .white
        self.contentView.addSubview(self.blockTitleLabl)
    }
    
    
}