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

import UIKit

class UpcomingDetailsVC: BaseViewController {

    var detailsId:String?
    var httpModel = DetailsHttpModel()
    var delegate:UpcomingDetailsVCDelegate!
    var dataSource = NSMutableArray()
    var model:UpcomingListTableViewCellModel!
    var upcomingType:BusinessType = .UpcomingType
    
    lazy var myTableView: UITableView = {
        let myTableView = UITableView.init()
        if #available(iOS 11.0, *) {
            myTableView.contentInsetAdjustmentBehavior = .never
            myTableView.scrollIndicatorInsets = myTableView.contentInset
            myTableView.contentInset = UIEdgeInsetsMake(UIApplication.shared.statusBarFrame.size.height+44, 0, HEIGHT_BOTTOM_MARGIN(), 0)
        }else{
            myTableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0)
        }
        //设置遮罩
        myTableView.layer.masksToBounds = true
        //设置圆角半径(宽度的一半)，显示成圆形。
        myTableView.layer.cornerRadius = 10
        registerCell(myTableView, cell: UpcomingDetailsTableViewCell.self)
        registerCell(myTableView, cell: UpcomingDetailsTitleTableViewCell.self)
        registerCell(myTableView, cell: DetailsTitleTableViewCell.self)
        myTableView.backgroundColor = UIColor.white
        setExtraCellLineHidden(tableView: myTableView)
        return myTableView
    }()
    override func viewDidLoad() {
        super.viewDidLoad()
        initTitleBar()
        //        self.edgesForExtendedLayout = UIRectEdge.bottom
        self.view.addSubview(myTableView)
        self.actionHttpGCD()
        
        // Do any additional setup after loading the view.
    }

    func actionHttpGCD(){
        queue.async(group: group, execute: {[weak self] in
            self?.group.enter()
            self?.getDetailsHttpGetCmd()
        })
        group.notify(queue: DispatchQueue.main) {[weak self] in
            //            self?.titleView.titleLabel.text = judgmentStrNil(str: self?.httpModel.title)
            self?.addInitTableView()
        }
    }

}
