// // CalcResultView.swift // xingchuangke // // Created by Virgil on 2019/3/23. // Copyright © 2019 Virgil. All rights reserved. // import UIKit class CalcResultView: UIView { @IBOutlet weak var btnClose: UIButton! @IBOutlet weak var lblMoney: UILabel! var backFunc: RebackFunction! func initView(money: String, reBackFunc:@escaping RebackFunction) { backFunc = reBackFunc if ScreenWidth == 30 { self.setSizeWidth(width: ScreenWidth - 40) } else if ScreenWidth == 375 { self.setSizeWidth(width: ScreenWidth - 60) } else { self.setSizeWidth(width: ScreenWidth - 80) } self.setCornerRadius(size: 12) let strMoney = "\(money)元" lblMoney.attributedText = CommonViewUntils.getAttributedStringForFont(str: strMoney, rangs: [NSRange.init(location: 0, length: strMoney.length() - 1), NSRange.init(location: strMoney.length() - 1, length: 1)], fonts: [UIFont.systemFont(ofSize: 38), UIFont.systemFont(ofSize: 16)]) btnClose.setCornerRadius(size: 8) } @IBAction func btnCloseClick(_ sender: Any) { backFunc(0, "") appDelegate.navController.hiddenBackgroudViewNoAnimate() } }