123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- //
- // CommonMoneyView.swift
- // xingchuangke
- //
- // Created by Apple on 2021/3/3.
- // Copyright © 2021 Virgil. All rights reserved.
- //
- import UIKit
- class CommonMoneyView: UIView {
- lazy var bgImgV: UIImageView = {
- let imgV = UIImageView.init(image: UIImage(named: "img_card_banner_07"))
- imgV.isUserInteractionEnabled = true
- return imgV
- }()
- lazy var earnTitLbl: UILabel = {
- let lbl = UILabel.init()
- lbl.text = "账户余额"
- lbl.textColor = UIColor.white
- return lbl
- }()
- lazy var allTiTle: UILabel = {
- let lbl = UILabel.init()
- lbl.text = "(=待划拨金额+可提现金额)"
- lbl.textColor = UIColor.white
- lbl.font = UIFont.systemFont(ofSize: 11)
- return lbl
- }()
- lazy var earnLbl: UILabel = {
- let lbl = UILabel.init()
- lbl.text = "¥0.00"
- lbl.textColor = UIColor.white
- return lbl
- }()
- lazy var dhMoneyt: UILabel = {
- let lbl = UILabel.init()
- lbl.text = "待划拨金额"
- lbl.textColor = UIColor.white
- lbl.font = UIFont.systemFont(ofSize: 15)
- return lbl
- }()
- lazy var dhMoney: UILabel = {
- let lbl = UILabel.init()
- lbl.text = "¥0.00"
- lbl.textColor = UIColor.white
- lbl.font = UIFont.systemFont(ofSize: 15)
- return lbl
- }()
- lazy var rewardTitLbl: UILabel = {
- let lbl = UILabel.init()
- lbl.text = "可提现金额"
- lbl.textColor = UIColor.white
- lbl.textAlignment = .right
- lbl.font = UIFont.systemFont(ofSize: 15)
- return lbl
- }()
- lazy var rewardLbl: UILabel = {
- let lbl = UILabel.init()
- lbl.text = "¥0.00"
- lbl.textColor = UIColor.white
- lbl.textAlignment = .right
- lbl.font = UIFont.systemFont(ofSize: 15)
- return lbl
- }()
- lazy var rewardControl: UIControl = {
- let btn = UIControl.init()
- btn.isUserInteractionEnabled = true
- return btn
- }()
- lazy var lineView: UIView = {
- let lbl = UIView.init()
- lbl.backgroundColor = .lightGray
- return lbl
- }()
- override init(frame: CGRect) {
- super.init(frame: frame)
- setupUI()
- }
- required init?(coder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
- func setupUI() {
- self.addSubview(bgImgV)
- bgImgV.addSubview(earnTitLbl)
- bgImgV.addSubview(allTiTle)
- bgImgV.addSubview(earnLbl)
- bgImgV.addSubview(dhMoneyt)
- bgImgV.addSubview(dhMoney)
- bgImgV.addSubview(rewardTitLbl)
- bgImgV.addSubview(rewardLbl)
- bgImgV.addSubview(lineView)
- bgImgV.addSubview(rewardControl)
- let w = self.frame.width
- let h = self.frame.height
- bgImgV.setOrigin(x: 0, y: 0)
- bgImgV.setSize(width: w, height: h)
- bgImgV.layer.cornerRadius = 10
- bgImgV.layer.masksToBounds = true
- earnTitLbl.setOrigin(x: 20, y: 15)
- earnTitLbl.setSizeHeight(height: 30)
- earnTitLbl.setSizeWidth(width: 70)
- allTiTle.setOrigin(x: 20+earnTitLbl.frame.size.width, y: 15)
- allTiTle.setSizeHeight(height: 30)
- allTiTle.setSizeWidth(width: 150)
- earnLbl.setOrigin(x: 20, y: 10+earnTitLbl.frame.size.height)
- earnLbl.setSizeHeight(height: 30)
- earnLbl.setSizeWidth(width: 150)
- lineView.setOrigin(x: 20, y: 13+earnLbl.frame.size.height+earnLbl.frame.origin.y)
- lineView.setSizeHeight(height: 1)
- lineView.setSizeWidth(width: w-40)
- dhMoneyt.setOrigin(x: 20, y: 25+earnLbl.frame.size.height+earnLbl.frame.origin.y)
- dhMoneyt.setSizeHeight(height: 30)
- dhMoneyt.setSizeWidth(width: 150)
- dhMoney.setOrigin(x: 20, y: dhMoneyt.frame.size.height+dhMoneyt.frame.origin.y)
- dhMoney.setSizeHeight(height: 30)
- dhMoney.setSizeWidth(width: 150)
- rewardTitLbl.setOrigin(x: w - 170, y: dhMoneyt.frame.origin.y)
- rewardTitLbl.setSizeHeight(height: 30)
- rewardTitLbl.setSizeWidth(width: 150)
- rewardLbl.setOrigin(x: w - 170, y: dhMoney.frame.origin.y)
- rewardLbl.setSizeHeight(height: 30)
- rewardLbl.setSizeWidth(width: 150)
- rewardControl.setOrigin(x: 0, y: earnLbl.frame.size.height+earnLbl.frame.origin.y)
- rewardControl.setSize(width: 150, height: 150)
- }
- /*
- // Only override draw() if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- override func draw(_ rect: CGRect) {
- // Drawing code
- }
- */
- }
|