//
//  HelpBtnView.swift
//  MobilePortal
//
//  Created by caiyang on 2020/4/8.
//  Copyright © 2020 yin chen. All rights reserved.
//

import UIKit

class HelpBtnView: UIView {

    lazy var trueItemView: HelpBtnItemView = {
        let trueItemView = HelpBtnItemView.init()
        self.addSubview(trueItemView)
        return trueItemView
    }()
    lazy var falseItemView: HelpBtnItemView = {
        let falseItemView = HelpBtnItemView.init()
        self.addSubview(falseItemView)
        return falseItemView
    }()
    lazy var advisoryItemView: HelpBtnItemView = {
        let advisoryItemView = HelpBtnItemView.init()
        self.addSubview(advisoryItemView)
        return advisoryItemView
    }()
    var titleArray = NSMutableArray()
    var imageArray = NSMutableArray()
    var trueBlock:selectBlock!
    var falseBlock:selectBlock!
    var advisoryBlock:selectBlock!
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        trueItemView.frame = CGRect(x:0, y: 0, width:SCREEN_WHIDTH()/3 , height:46.67 )
        trueItemView.addView(title: "有帮助", imageName: "noHelp_nom_image")//noHelp_select_image
        trueItemView.button.addTarget(self, action: #selector(trueAction), for: .touchUpInside)
        falseItemView.frame = CGRect(x:trueItemView.width, y: 0, width:trueItemView.width , height:trueItemView.height )
        falseItemView.addView(title: "没帮助", imageName: "yesHelp_nom_image")//yesHelp_select_image
        falseItemView.button.addTarget(self, action: #selector(falseAction), for: .touchUpInside)
        advisoryItemView.frame = CGRect(x:falseItemView.originX+falseItemView.width, y: 0, width:trueItemView.width , height:trueItemView.height )
        advisoryItemView.addView(title: "咨询客服", imageName: "advisory_nom_image")//advisory_select_image
        advisoryItemView.button.addTarget(self, action: #selector(advisoryAction), for: .touchUpInside)
    }
    @objc func trueAction() {
        self.trueBlock()
    }
    @objc func falseAction() {
        self.falseBlock()
    }
    @objc func advisoryAction() {
        self.advisoryBlock()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
