//
//  YHPreviewAcademicAndProfessionalQualificationViewController.swift
//  galaxy
//
//  Created by davidhuangA on 2024/2/29.
//  Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//

import UIKit
/*
 *学历/专业资格 预览
 */
class YHPreviewAcademicAndProfessionalQualificationViewController: YHPreviewBaseViewController {
    var arrData : [YHPreviewInfoSessionModel] = []
    override func viewDidLoad() {
        super.viewDidLoad()
        setupUI()
    }
    
    
}

private extension YHPreviewAcademicAndProfessionalQualificationViewController {
    func installData() {
      
        do {
            //主申请人学历1
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "主申请人学历：", answer: "主申请人学历主申请人学历")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "授课形式：", answer: "授课形式")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "入学年月：", answer: "入学年月")
            
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "毕业年月：", answer: "1990年8月18日")
            let tmp4 = YHPreviewQuestionAndAnswerModel(question: "专业：", answer: "专业")
            let tmp5 = YHPreviewQuestionAndAnswerModel(question: "学位：", answer: "学位")
            let tmp6 = YHPreviewQuestionAndAnswerModel(question: "学位类型：", answer: "学位类型")
            let tmp7 = YHPreviewQuestionAndAnswerModel(question: "上课地点：", answer: "上课地点上课地点")
            
            let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7]
            let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "主申请人学历1", cellData0: arr)
            arrData.append(model2)
        }
        
        
        do {
            //主申请人学历2
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "主申请人学历：", answer: "主申请人学历主申请人学历")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "授课形式：", answer: "授课形式")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "入学年月：", answer: "入学年月")
            
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "毕业年月：", answer: "1990年8月18日")
            let tmp4 = YHPreviewQuestionAndAnswerModel(question: "专业：", answer: "专业")
            let tmp5 = YHPreviewQuestionAndAnswerModel(question: "学位：", answer: "学位")
            let tmp6 = YHPreviewQuestionAndAnswerModel(question: "学位类型：", answer: "学位类型")
            let tmp7 = YHPreviewQuestionAndAnswerModel(question: "上课地点：", answer: "上课地点上课地点")
            
            let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7]
            let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "主申请人学历2", cellData0: arr)
            arrData.append(model2)
        }
        
        
        
        do {
            //主申请人专业资格及会员资格1
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "资格证书名称：", answer: "资格证书名称")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "颁授机构全称：", answer: "颁授机构全称：")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "颁授年份：", answer: "颁授年份：")
            
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "颁授城市：", answer: "颁授城市：颁授城市：")
            
            let arr = [tmp0,tmp1,tmp2,tmp3]
            let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "主申请人专业资格及会员资格1", cellData0: arr)
            arrData.append(model2)
        }
        
        
        do {
            //主申请人专业资格及会员资格2
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "资格证书名称：", answer: "资格证书名称")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "颁授机构全称：", answer: "颁授机构全称：")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "颁授年份：", answer: "颁授年份：")
            
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "颁授城市：", answer: "颁授城市：颁授城市：")
            
            let arr = [tmp0,tmp1,tmp2,tmp3]
            let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "主申请人专业资格及会员资格2", cellData0: arr)
            arrData.append(model2)
        }
        
        
        
        do {
            //主申请人
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "1、您的所有学历及资格证书的姓名及出生日期，是否与身份证完全一致？（例如：身份证上是【张四】，学位证上是【张三】，则为不同", answer: "是")
            
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "2、您配偶的大学毕业证和学位证上的姓名及出生日期，是否与身份证完全一致？", answer: "否")
            let arr = [tmp0,tmp1]
            let model1 = YHPreviewInfoSessionModel(cellType: .questionAndAnswer, cellTitle: "学历证书姓名及出生日期正确性", cellData0: arr)
            arrData.append(model1)
        }
        
        
        
    }
    
    func setupUI() {
        installData()
        
        self.homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier)
        self.homeTableView.reloadData()
    }
}



// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHPreviewAcademicAndProfessionalQualificationViewController {
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return arrData.count
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withClass: YHPreviewInfoCell.self)
        cell.selectionStyle = .none
        cell.model = arrData[indexPath.row]
        return cell
    }
}
