123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // BindCheckView.swift
- // xingchuangke
- //
- // Created by Virgil on 2019/3/27.
- // Copyright © 2019 Virgil. All rights reserved.
- //
- import UIKit
- class BindCheckView: UIView {
- @IBOutlet weak var imgState: UIImageView!
- @IBOutlet weak var viewContent: UIView!
- @IBOutlet weak var btnConfrim: UIButton!
- @IBOutlet weak var lblRemark: UILabel!
- var reState = 0
- var commonBackFunc: RebackFunction!
- ///state 0 不符合规则 1:符合规则
- func initView(state: Int, backFunc:@escaping RebackFunction) {
- reState = state
- commonBackFunc = backFunc
- viewContent.setCornerRadius(size: 8)
- if state == 0 {
- imgState.image = UIImage(named: "ion_opening_merchants_11")
- lblRemark.text = "抱歉,根据绑定规则,该机具不在您可绑定的范围内!"
- lblRemark.textColor = CommonUntils.getUIColorFromRGB(rgbValue: 0xff4e4e, alpha: 1.0)
- btnConfrim.setBackgroundImage(UIImage(named: "btn_opening_merchants_01"), for: .normal)
- } else {
- imgState.image = UIImage(named: "ion_opening_merchants_10")
- lblRemark.text = "已成功绑定该机具!"
- lblRemark.textColor = CommonUntils.getUIColorFromRGB(rgbValue: 0x666666, alpha: 1.0)
- btnConfrim.setBackgroundImage(UIImage(named: "btn_opening_merchants_02"), for: .normal)
- }
- }
- @IBAction func btnConfrimClick(_ sender: Any) {
- commonBackFunc!(reState, "")
- }
- }
|