//
//  PublishBtn.swift
//  MobilePortal
//
//  Created by caiyang on 2022/6/7.
//  Copyright © 2022 yin chen. All rights reserved.
//

import UIKit

class PublishBtn: UIButton {
    
    lazy var biaojiBtn: UIButton = {
        let biaojiBtn:UIButton = UIButton.init(type: .custom)
        biaojiBtn.frame = CGRect(x:SCREEN_WHIDTH()/5-35, y: 0, width:22 , height:22 )
        biaojiBtn.backgroundColor = UIColor.red
        biaojiBtn.titleLabel?.font = UIFont.systemFont(ofSize: 11)
        biaojiBtn.titleLabel?.textAlignment = .center
        biaojiBtn.setTitleColor(UIColor.white, for: .normal)
        
        biaojiBtn.layer.cornerRadius = biaojiBtn.width/2
        return biaojiBtn
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.addSubview(biaojiBtn)
        biaojiBtn.isHidden = true
    }
    func setNum(numBer:String){
        if (numBigData(numStr: numBer) != "0") {
            biaojiBtn.isHidden = false
            biaojiBtn.setTitle(numBigData(numStr: numBer), for: .normal)
        } else {
            biaojiBtn.isHidden = true
        }
        
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
