CNLiveDigitalResumeSecCell.swift 13.1 KB
//
//  CNLiveDigitalResumeSecCell.swift
//  metaCode
//
//  Created by zx on 2024/7/15.
//  数字简历-sec-cell

import Foundation

class CNLiveDigitalResumeSecCell:UITableViewCell{
    
    var _usersModel : MineGetUserMsgVerifyUsersModel?
    var usersModel : MineGetUserMsgVerifyUsersModel? {
        get{
            _usersModel
        }
        set{
            _usersModel = newValue!
            setupNewUI(model: _usersModel!)
        }
    }
    
    lazy var leftWhiteBgView :UIImageView = {
        let bottomNavView = UIImageView()
        bottomNavView.backgroundColor = HexColor("#FFFFFF")
        bottomNavView.layer.cornerRadius = 12
        bottomNavView.clipsToBounds = true
        bottomNavView.image = UIImage(named: "mine_jianli_qiuzhi")
        bottomNavView.contentMode = .scaleAspectFit
        bottomNavView.isUserInteractionEnabled = true
        bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(leftQiuZhiAction)))
        return bottomNavView
    }()
    lazy var rightWhiteBgView :UIImageView = {
        let bottomNavView = UIImageView()
        bottomNavView.backgroundColor = HexColor("#FFFFFF")
        bottomNavView.layer.cornerRadius = 12
        bottomNavView.clipsToBounds = true
        bottomNavView.image = UIImage(named: "mine_jianli_zhiye")
        bottomNavView.contentMode = .scaleAspectFit
        bottomNavView.isUserInteractionEnabled = true
        bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(rightZhiYeAction)))
        return bottomNavView
    }()
    lazy var bottomWhiteBgView :UIView = {
        let bottomNavView = UIView()
        bottomNavView.backgroundColor = HexColor("#FFFFFF")
        bottomNavView.layer.cornerRadius = 12
        bottomNavView.clipsToBounds = true
        return bottomNavView
    }()
    lazy var bottomTitleLabel: UILabel = {
        let titleLabel = UILabel()
        titleLabel.textColor = HexColor("#333333")
        titleLabel.text = "大家都在看"
        titleLabel.textAlignment = .left
        titleLabel.font = BoldFont_18
        return titleLabel
    }()
    lazy var bottomZhiYuanZheView :UIImageView = {
        let bottomNavView = UIImageView()
        bottomNavView.image = UIImage(named: "mine_jianli_zhiyuanzhe")
        bottomNavView.contentMode = .scaleAspectFit
        bottomNavView.isUserInteractionEnabled = true
        bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(zhiyuanzheAction)))
        return bottomNavView
    }()
    lazy var bottomYangLaoHuLiYuanView :UIImageView = {
        let bottomNavView = UIImageView()
        bottomNavView.image = UIImage(named: "mine_jianli_huliyuan")
        bottomNavView.contentMode = .scaleAspectFit
        bottomNavView.isUserInteractionEnabled = true
        bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(yangLaoHuLiYuanAction)))
        return bottomNavView
    }()
    lazy var bottomErTongPeiBanShiView :UIImageView = {
        let bottomNavView = UIImageView()
        bottomNavView.image = UIImage(named: "mine_jianli_peibanshi")
        bottomNavView.contentMode = .scaleAspectFit
        bottomNavView.isUserInteractionEnabled = true
        bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(erTongPeiBanShiAction)))
        return bottomNavView
    }()
    lazy var bottomXinLiZhiYunShiView :UIImageView = {
        let bottomNavView = UIImageView()
        bottomNavView.image = UIImage(named: "mine_jianli_xinli")
        bottomNavView.contentMode = .scaleAspectFit
        bottomNavView.isUserInteractionEnabled = true
        bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(xinLiZhiYunShiAction)))
        return bottomNavView
    }()
    lazy var bottomJiaTingJiaoYuView :UIImageView = {
        let bottomNavView = UIImageView()
        bottomNavView.image = UIImage(named: "mine_jianli_jiating")
        bottomNavView.contentMode = .scaleAspectFit
        bottomNavView.isUserInteractionEnabled = true
        bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(JiaTingJiaoYuAction)))
        return bottomNavView
    }()
    lazy var bottomGaoKaoYiShuView :UIImageView = {
        let bottomNavView = UIImageView()
        bottomNavView.image = UIImage(named: "mine_jianli_gaokao")
        bottomNavView.contentMode = .scaleAspectFit
        bottomNavView.isUserInteractionEnabled = true
        bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(GaoKaoYiShuAction)))
        return bottomNavView
    }()
    lazy var bottomZhiYeGuiHuaView :UIImageView = {
        let bottomNavView = UIImageView()
        bottomNavView.image = UIImage(named: "mine_jianli_zhiyeguigua")
        bottomNavView.contentMode = .scaleAspectFit
        bottomNavView.isUserInteractionEnabled = true
        bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(ZhiYeGuiHuaAction)))
        return bottomNavView
    }()
    
    lazy var bottomIconView :UIImageView = {
        let bottomNavView = UIImageView()
        bottomNavView.image = UIImage(named: "mine_jianli_grayIcon")
        bottomNavView.contentMode = .scaleAspectFit
        return bottomNavView
    }()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        self.backgroundColor = .clear
        self.contentView.backgroundColor = .clear
        self.initUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func initUI(){
        self.contentView.addSubview(self.leftWhiteBgView)
        self.leftWhiteBgView.snp.makeConstraints { make in
            make.left.top.equalTo(adapt_length(length: 15))
            make.width.equalTo(adapt_length(length: 165))
            make.height.equalTo(adapt_length(length: 242))
        }
        self.contentView.addSubview(self.rightWhiteBgView)
        self.rightWhiteBgView.snp.makeConstraints { make in
            make.top.equalTo(adapt_length(length: 15))
            make.right.equalToSuperview().offset(-adapt_length(length: 15))
            make.width.equalTo(adapt_length(length: 165))
            make.height.equalTo(adapt_length(length: 242))
        }
        
        self.contentView.addSubview(self.bottomWhiteBgView)
        self.bottomWhiteBgView.snp.makeConstraints { make in
            make.top.equalTo(self.leftWhiteBgView.snp.bottom).offset(adapt_length(length: 15))
            make.right.equalToSuperview().offset(-adapt_length(length: 15))
            make.left.equalTo(adapt_length(length: 15))
            make.height.equalTo(adapt_length(length: 471))
        }
        self.bottomWhiteBgView.addSubview(self.bottomTitleLabel)
        self.bottomTitleLabel.snp.makeConstraints { make in
            make.left.equalTo(adapt_length(length: 15))
            make.top.equalTo(adapt_length(length: 15))
        }
        
        self.bottomWhiteBgView.addSubview(self.bottomZhiYuanZheView)
        self.bottomZhiYuanZheView.snp.makeConstraints { make in
            make.left.equalTo(adapt_length(length: 15))
            make.top.equalTo(self.bottomTitleLabel.snp.bottom).offset(adapt_length(length: 15))
            make.width.equalTo(adapt_length(length: 152))
            make.height.equalTo(adapt_length(length: 92))
        }
        self.bottomWhiteBgView.addSubview(self.bottomYangLaoHuLiYuanView)
        self.bottomYangLaoHuLiYuanView.snp.makeConstraints { make in
            make.right.equalToSuperview().offset(adapt_length(length: -15))
            make.top.equalTo(self.bottomTitleLabel.snp.bottom).offset(adapt_length(length: 15))
            make.width.equalTo(self.bottomZhiYuanZheView.snp.width)
            make.height.equalTo(self.bottomZhiYuanZheView.snp.height)
        }
        
        self.bottomWhiteBgView.addSubview(self.bottomErTongPeiBanShiView)
        self.bottomErTongPeiBanShiView.snp.makeConstraints { make in
            make.left.equalTo(adapt_length(length: 15))
            make.top.equalTo(self.bottomZhiYuanZheView.snp.bottom).offset(adapt_length(length: 11))
            make.width.equalTo(adapt_length(length: 152))
            make.height.equalTo(adapt_length(length: 92))
        }
        self.bottomWhiteBgView.addSubview(self.bottomXinLiZhiYunShiView)
        self.bottomXinLiZhiYunShiView.snp.makeConstraints { make in
            make.right.equalToSuperview().offset(adapt_length(length: -15))
            make.top.equalTo(self.bottomYangLaoHuLiYuanView.snp.bottom).offset(adapt_length(length: 11))
            make.width.equalTo(self.bottomZhiYuanZheView.snp.width)
            make.height.equalTo(self.bottomZhiYuanZheView.snp.height)
        }
        
        self.bottomWhiteBgView.addSubview(self.bottomJiaTingJiaoYuView)
        self.bottomJiaTingJiaoYuView.snp.makeConstraints { make in
            make.left.equalTo(adapt_length(length: 15))
            make.top.equalTo(self.bottomErTongPeiBanShiView.snp.bottom).offset(adapt_length(length: 11))
            make.width.equalTo(adapt_length(length: 152))
            make.height.equalTo(adapt_length(length: 92))
        }
        self.bottomWhiteBgView.addSubview(self.bottomGaoKaoYiShuView)
        self.bottomGaoKaoYiShuView.snp.makeConstraints { make in
            make.right.equalToSuperview().offset(adapt_length(length: -15))
            make.top.equalTo(self.bottomXinLiZhiYunShiView.snp.bottom).offset(adapt_length(length: 11))
            make.width.equalTo(self.bottomZhiYuanZheView.snp.width)
            make.height.equalTo(self.bottomZhiYuanZheView.snp.height)
        }
        
        self.bottomWhiteBgView.addSubview(self.bottomZhiYeGuiHuaView)
        self.bottomZhiYeGuiHuaView.snp.makeConstraints { make in
            make.left.equalTo(adapt_length(length: 15))
            make.top.equalTo(self.bottomJiaTingJiaoYuView.snp.bottom).offset(adapt_length(length: 11))
            make.width.equalTo(adapt_length(length: 152))
            make.height.equalTo(adapt_length(length: 92))
        }
        
        self.contentView.addSubview(self.bottomIconView)
        self.bottomIconView.snp.makeConstraints { make in
            make.top.equalTo(self.bottomWhiteBgView.snp.bottom).offset(adapt_length(length: 15))
            make.centerX.equalToSuperview()
            make.width.equalTo(adapt_length(length: 149))
            make.height.equalTo(adapt_length(length: 25))
        }

    }
    
    func setupNewUI(model:MineGetUserMsgVerifyUsersModel){
        
    }
    
    // MARK: - buttonAction
    @objc func leftQiuZhiAction(){
        self.show17Alert()
    }
    @objc func rightZhiYeAction(){
        self.show17Alert()
    }
    @objc func zhiyuanzheAction(){
        self.show17Alert()
    }
    @objc func yangLaoHuLiYuanAction(){
        self.show17Alert()
    }
    @objc func erTongPeiBanShiAction(){
        self.show17Alert()
    }
    @objc func xinLiZhiYunShiAction(){
        self.show17Alert()
    }
    @objc func JiaTingJiaoYuAction(){
        self.show17Alert()
    }
    @objc func GaoKaoYiShuAction(){
        self.show17Alert()
    }
    @objc func ZhiYeGuiHuaAction(){
        self.show17Alert()
    }
    
    let delegate = UIApplication.shared.delegate as! AppDelegate
    /// 未认证-inputType17时弹窗背景图
    lazy var alertBgImgView:UIImageView = {
        let alertBgImgView:UIImageView = UIImageView()
        alertBgImgView.tag = 20001
        alertBgImgView.isUserInteractionEnabled = true
        let ges = UITapGestureRecognizer(target: self, action: #selector(alertBgImgViewClickAction))
        alertBgImgView.addGestureRecognizer(ges)

        return alertBgImgView
    }()
    lazy var alertBgView:UIView = {
        let alertBgView:UIView = UIView(frame: CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenHeight))
        alertBgView.backgroundColor = HexColor("#000000")
        alertBgView.alpha = 0.6
        alertBgView.isUserInteractionEnabled = true
        alertBgView.tag = 20000
        
        let ges = UITapGestureRecognizer(target: self, action: #selector(alertBgViewClickAction))
        alertBgView.addGestureRecognizer(ges)

        return alertBgView
    }()
    // MARK: - 点击弹窗,按类型跳转
    @objc func alertBgImgViewClickAction() {
        self.hiden17Alert()
    }
    @objc func alertBgViewClickAction() {
        //点击蒙版隐藏view
        self.hiden17Alert()
    }
    //弹出弹窗
    func show17Alert(){
        
        delegate.window?.addSubview(self.alertBgView)
        delegate.window?.addSubview(self.alertBgImgView)
        alertBgImgView.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.centerY.equalToSuperview()
            make.width.equalTo(KSreenWidth-80)
            make.height.equalTo((KSreenWidth-80)*170.5/295)
        }
        
        self.alertBgImgView.image = UIImage(named: "auth_alert_unOpen")
    }
    func hiden17Alert(){
        delegate.window?.subviews.forEach({ view in
            if view.tag >= 20000{
                view.removeFromSuperview()
            }
        })
    }
}