//
//  UpcomingListVC+initView.swift
//  MobilePortal
//
//  Created by caiyang on 2020/4/22.
//  Copyright © 2020 yin chen. All rights reserved.
//

import UIKit

extension UpcomingListVC {
    func addTitleView(){
        self.view.addSubview(tixingImage)
        tixingLabel.frame = CGRect(x:0, y: tixingImage.originY+tixingImage.height+20, width:SCREEN_WHIDTH() , height:20 )
        self.view.addSubview(tixingLabel)
        self.view.addSubview(headView)
        headView.upcomingType = self.upcomingType
//        headView.backgroundColor = UIColor.red
        headView.numStr = self.httpListData.total
    }
    
    func addInitTableView() {
        self.view.addSubview(myTableView)
        myTableView.frame = CGRect(x:0, y: headView.originY+headView.height, width:SCREEN_WHIDTH() , height:self.view.height-headView.height-NAV_HEIGHT()-STATUBAR_HEIGHT())
//        myTableView.snp.makeConstraints { (make) in
//            make.width.equalToSuperview()
//            make.height.equalToSuperview()
//            make.center.equalToSuperview()
//        }
        self.dataSource = NSMutableArray()
//        initDate()
        self.delegate = UpcomingListVCDelegate()
        self.delegate.dataSource = self.dataSource
        self.myTableView.delegate = self.delegate
        self.myTableView.dataSource = self.delegate
    }
}
class UpcomingListVCDelegate: BaseOneTableViewDelegate {
    
    
    override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
        return 0
    }
    
    override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        
        if (section==0){
            return 0
        }
        return 0
    }
    
    override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
//        let model:UpcomingListTableViewCellModel = self.dataSource[indexPath.section] as! UpcomingListTableViewCellModel
//        if model.retractUnfoldType == .Retractype {
//            return 100
//        }
        return 65.67
    }
}
