CNCollectMoneyCodeView.swift 1.59 KB
//
//  CNCollectMoneyCodeView.swift
//  metaCode
//
//  Created by daojian on 2023/5/30.
//

import Foundation
import UIKit
import YYCategories

///收钱码View
class CNCollectMoneyCodeView:UIView{
    
    ///懒加载
    lazy var contentView:UIView = {
        
        let contentView = UIView.init(frame: CGRect(x: 0, y: 0, width: self.width, height: self.height-150))
        contentView.backgroundColor = UIColor.white
        
        let path:UIBezierPath = UIBezierPath.init(roundedRect: contentView.bounds, byRoundingCorners: [.bottomLeft, .bottomRight], cornerRadii: CGSize.init(width: 20, height: 20))
        
        let maskLayer:CAShapeLayer = CAShapeLayer()
        maskLayer.frame = contentView.bounds
        maskLayer.path  = path.cgPath
        contentView.layer.mask = maskLayer
        
        let imageView = UIImageView(frame: CGRect(x: 10, y: 20, width: contentView.width - 20, height: contentView.height - 40))
        imageView.image = UIImage(named: "homePage_collectMoneyImage")
        contentView.addSubview(imageView)
        
        return contentView
    }()
    
    lazy var topView:UIView = {
        
        let tempTopView = UIView(frame: CGRect(x:0, y:20, width: self.width - 50, height: 70))
        
        return tempTopView
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.initUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    ///初始化UI
    func initUI(){
        self.addSubview(self.contentView)
        self.addSubview(self.topView)
    }
    
}