//
//  CustomerServiceVC+initTableView.swift
//  MobilePortal
//
//  Created by caiyang on 2020/4/7.
//  Copyright © 2020 yin chen. All rights reserved.
//

import UIKit

extension CustomerServiceVC {
    func addInitTableView() {
        initData()
        self.delegate = CustomerServiceVCDelegate()
        self.delegate.dataSource = self.dataSource
        self.myTableView.delegate = self.delegate
        self.myTableView.dataSource = self.delegate
    }
    func initData(){
        for index in 0..<self.httpArray.count {
            let httpModel:CustomerServiewListModel = self.httpArray[index] as! CustomerServiewListModel
            let model = CustomerTableViewCellModel()
            model.className = "CustomerTableViewCell"
            model.titleStr = httpModel.title
            model.block = {[weak self] in
                self?.block(httpModel.id!)
//                self?.gotoDetalisVC(id: httpModel.id!)
            }
            self.dataSource.add(model)
        }
    }
    
}
class CustomerServiceVCDelegate: BaseOneTableViewDelegate {
    var cellNum:Double!
    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 infoMode:AdvisoryTableViewCellModel = self.dataSource[indexPath.row] as! AdvisoryTableViewCellModel
        return 53.33
    }
}
