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

import UIKit
/*
 *家庭成员信息 预览
 */
class YHPreviewFamilyMemberViewController: YHPersonInfoBaseViewController {
    var arrData : [YHPreviewInfoSessionModel] = [] //用于数据展示
    
    var arrDataForParents : [YHPreviewInfoSessionModel] = []
    var arrDataForSpouse : [YHPreviewInfoSessionModel] = []
    var arrDataForChildren : [YHPreviewInfoSessionModel] = []
    var arrDataForBrother : [YHPreviewInfoSessionModel] = []
    
    override func viewDidLoad() {
        super.viewDidLoad()
        setupUI()
    }
    
    private var buttonHoldView : UIView  = {
        let view = UIView()
        view.backgroundColor = .red
        return view
    }()
    
    private var parentButton : UIButton!
    private var spouseButton : UIButton!
    private var childrenButton : UIButton!
    private var brotherButton : UIButton!
    
    private var arrButtons : [UIButton] = []
}

private extension YHPreviewFamilyMemberViewController {
    func setupUI() {
        installData()
        
        
        view.addSubview(buttonHoldView)
        buttonHoldView.snp.makeConstraints { make in
            make.top.equalToSuperview()
            make.left.equalTo(kMargin)
            make.right.equalTo(-kMargin)
            make.height.equalTo(56)
        }
        
       
        
        
        parentButton = createButton()
        parentButton.setTitle("父母", for: .normal)
        buttonHoldView.addSubview(parentButton)
        parentButton.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalToSuperview()
            make.height.equalTo(32)
            make.width.equalTo(68)
        }
        
        
        spouseButton = createButton()
        spouseButton.setTitle("配偶", for: .normal)
        buttonHoldView.addSubview(spouseButton)
        spouseButton.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(parentButton.snp.right).offset(12)
            make.height.equalTo(32)
            make.width.equalTo(68)
        }
        
        childrenButton = createButton()
        childrenButton.setTitle("子女", for: .normal)
        buttonHoldView.addSubview(childrenButton)
        childrenButton.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(spouseButton.snp.right).offset(12)
            make.height.equalTo(32)
            make.width.equalTo(68)
        }
        
        
        brotherButton = createButton()
        brotherButton.setTitle("兄弟姐妹", for: .normal)
        buttonHoldView.addSubview(brotherButton)
        brotherButton.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(childrenButton.snp.right).offset(12)
            make.height.equalTo(32)
            make.width.equalTo(84)
        }
        
        
        arrButtons.append(parentButton)
        arrButtons.append(spouseButton)
        arrButtons.append(childrenButton)
        arrButtons.append(brotherButton)
        
        
        homeTableView.snp.removeConstraints()
        homeTableView.snp.makeConstraints { make in
            make.top.equalTo(buttonHoldView.snp.bottom)
            make.bottom.equalToSuperview()
            make.left.equalTo(kMargin)
            make.right.equalTo(-kMargin)
        }
        homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier)
        homeTableView.reloadData()
    }
    
    func createButton() -> UIButton {
        let btn = UIButton(type: .custom)
        btn.backgroundColor = UIColor.white
        btn.setTitleColor(.mainTextColor, for: .normal)
        btn.setTitleColor(.white, for: .selected)
        btn.layer.cornerRadius = 16
        btn.clipsToBounds = true
        btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
        
        btn.addTarget(self, action:#selector(clickButton(sender:)) , for: .touchUpInside)
        return btn
    }
    
    @objc func clickButton(sender : UIButton) {
        
        for button in arrButtons {
            
        }
        
        sender.addYinHeGradualLayer()
    }
    
    func installData() {
        //父母
        installDataForParents()
        //配偶
        installDataForSpouse()
        //子女
        installDataForChildren()
        //兄弟姐妹
        installDataForBrother()
    }
    
    //父母 数据
    func installDataForParents() {
        
        do {
            //父亲信息-已故
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "父亲姓名：", answer: "父亲姓名父亲姓名：父亲姓名：父亲姓名")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "是否已故：", answer: "是")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "出生日期：", answer: "1990年8月18日")
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生城市：", answer: "国内 吉林省/吉林市")
            let arr = [tmp0,tmp1,tmp2,tmp3]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "父亲信息-已故", cellData0: arr)
            arrDataForParents.append(model1)
        }
        
        
        do {
            //母亲信息-已故
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "母亲信息：", answer: "父亲姓名父亲姓名：父亲姓名：父亲姓名")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "是否已故：", answer: "是")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "出生日期：", answer: "1990年8月18日")
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生城市：", answer: "国内 吉林省/吉林市")
            let arr = [tmp0,tmp1,tmp2,tmp3]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "母亲信息-已故", cellData0: arr)
            arrDataForParents.append(model1)
        }
        
        
        do {
            //父亲信息-健在
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "父亲姓名：", answer: "父亲姓名父亲姓名：父亲姓名：父亲姓名")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "是否已故：", answer: "否")
            let tmp11 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况：", answer: "未婚")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "出生日期：", answer: "1990年8月18日")
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生城市：", answer: "国内 吉林省/吉林市")
            
            let tmp4 = YHPreviewQuestionAndAnswerModel(question: "职业：", answer: "在职")
            let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业名称：", answer: "设计师")
            let tmp6 = YHPreviewQuestionAndAnswerModel(question: "现居住国家/地区：", answer: "国内 吉林省/吉林市")
            let tmp7 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证：", answer: "国内 吉林省/吉林市")
            let tmp8 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码：", answer: "p102987（1）")
            
            let arr = [tmp0,tmp1,tmp11,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "父亲信息-健在", cellData0: arr)
            arrDataForParents.append(model1)
        }
        
        
        do {
            //母亲信息-健在
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "母亲姓名：", answer: "母亲姓名")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "是否已故：", answer: "否")
            let tmp11 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况：", answer: "未婚")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "出生日期：", answer: "1990年8月18日")
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生城市：", answer: "国内 吉林省/吉林市")
            
            let tmp4 = YHPreviewQuestionAndAnswerModel(question: "职业：", answer: "在职")
            let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业名称：", answer: "设计师")
            let tmp6 = YHPreviewQuestionAndAnswerModel(question: "现居住国家/地区：", answer: "国内 吉林省/吉林市")
            let tmp7 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证：", answer: "国内 吉林省/吉林市")
            let tmp8 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码：", answer: "p102987（1）")
            
            let arr = [tmp0,tmp1,tmp11,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "母亲信息-健在", cellData0: arr)
            arrDataForParents.append(model1)
        }
        
        
        arrData = arrDataForParents
    }
    
    //配偶 数据
    func installDataForSpouse() {
        do {
            //随行信息-否
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "是否随行至香港：", answer: "否")
            let arr = [tmp0]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "随行信息-否", cellData0: arr)
            arrDataForSpouse.append(model1)
        }
        
        do {
            //配偶信息-否
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "配偶姓名：", answer: "配偶姓名")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "曾用名：", answer: "曾用名：")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏：", answer: "婚前姓氏：")
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生日期：", answer: "否")
            let tmp4 = YHPreviewQuestionAndAnswerModel(question: "出生城市：", answer: "否")
            let tmp5 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证：", answer: "否")
            let tmp6 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码：", answer: "否")
            let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "配偶信息-否", cellData0: arr)
            arrDataForSpouse.append(model1)
        }
        
        
        
        do {
            //随行信息 - 是
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "是否随行至香港：", answer: "否")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "国家/国籍：", answer: "中国-China")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "港澳通行证：", answer: "未办理")
            let arr = [tmp0,tmp1,tmp2]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "随行信息-否", cellData0: arr)
            arrDataForSpouse.append(model1)
        }
        
        
        do {
            //基本信息
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "配偶姓名：", answer: "DavidHuang")
            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 tmp8 = YHPreviewQuestionAndAnswerModel(question: "学位证：", answer: "学位证：")
            let tmp9 = YHPreviewQuestionAndAnswerModel(question: "学位证颁发地区：", answer: "职业名称")
            let tmp10 = YHPreviewQuestionAndAnswerModel(question: "是否和主申请人同住：", answer: "职业名称")
            let tmp11 = YHPreviewQuestionAndAnswerModel(question: "现居住地址：", answer: "职业名称")
            let tmp12 = YHPreviewQuestionAndAnswerModel(question: "是否在海外居住满1年及以上：", answer: "职业名称")
            let tmp13 = YHPreviewQuestionAndAnswerModel(question: "目前是否在港：", answer: "职业名称")
            
            let tmp14 = YHPreviewQuestionAndAnswerModel(question: "获准逗留至：", answer: "职业名称")
            let tmp15 = YHPreviewQuestionAndAnswerModel(question: "在港身份：", answer: "职业名称")
            let tmp16 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证：", answer: "职业名称")
            let tmp17 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码：", answer: "职业名称")
            
            let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,tmp12,tmp13,tmp14,tmp15,tmp16,tmp17]
            let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "基本信息", cellData0: arr)
            arrDataForSpouse.append(model2)
        }
        
        
        do {
            //证件信息
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "中国身份证号码：", answer: "2203381990287633390")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "签发地：", answer: "北京市分局")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "签发日期：", answer: "2018-07-17")
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "届满日期：", answer: "2028-07-31")
            let model0 = YHPersonInfoCellModel1(cellTitle: "中国身份证", cellData: [tmp0,tmp1,tmp2,tmp3])
            
            
            let tmp4 = YHPreviewQuestionAndAnswerModel(question: "旅行社证件号码：", answer: "c2345639")
            let tmp5 = YHPreviewQuestionAndAnswerModel(question: "签发地：", answer: "北京市分局")
            let tmp6 = YHPreviewQuestionAndAnswerModel(question: "签发日期：", answer: "2018-07-17")
            let tmp7 = YHPreviewQuestionAndAnswerModel(question: "届满日期：", answer: "2028-07-31")
            let model1 = YHPersonInfoCellModel1(cellTitle: "港澳通行证", cellData: [tmp4,tmp5,tmp6,tmp7])
            
            
            let tmp8 = YHPreviewQuestionAndAnswerModel(question: "证件类别：", answer: "护照")
            let tmp9 = YHPreviewQuestionAndAnswerModel(question: "证件号码：", answer: "p2345639")
            let tmp10 = YHPreviewQuestionAndAnswerModel(question: "签发地：", answer: "北京市分局")
            let tmp11 = YHPreviewQuestionAndAnswerModel(question: "签发日期：", answer: "2028-07-31")
            let tmp12 = YHPreviewQuestionAndAnswerModel(question: "届满日期：", answer: "2028-07-31")
            let model2 = YHPersonInfoCellModel1(cellTitle: "护照及其他旅行证件", cellData: [tmp8,tmp9,tmp10,tmp11,tmp12])
            
            let arr = [model0,model1,model2]
            let model3 = YHPreviewInfoSessionModel(cellType: .idCardInfoType, cellTitle: "证件信息", cellData1: arr)
            arrDataForSpouse.append(model3)
        }
        
        
        do {
            //证件照片
            let model1 = YHPersonInfoCellModel2(cellTitle: "中国身份证",frontUrl: "", backUrl: "", idType: 1)
            let model2 = YHPersonInfoCellModel2(cellTitle: "港澳通行证",frontUrl: "", backUrl: "", idType: 2)
            
            let arr = [model1,model2]
            let model4 = YHPreviewInfoSessionModel(cellType: .idPictureType, cellTitle: "证件照片", cellData2: arr)
            arrDataForSpouse.append(model4)
        }
        
        arrData = arrDataForSpouse
    }
    
    //子女 数据
    func installDataForChildren() {
        
        do {
            //随行信息-否
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "该子女是否随行至香港：", answer: "否")
            let arr = [tmp0]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "随行信息-否", cellData0: arr)
            arrDataForChildren.append(model1)
        }
        
        do {
            //子女信息-否
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "子女姓名：", answer: "子女姓名")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "曾用名：", answer: "曾用名：")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏：", answer: "婚前姓氏：")
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "性别：", answer: "性别")
            let tmp4 = YHPreviewQuestionAndAnswerModel(question: "出生日期：", answer: "否")
            let tmp5 = YHPreviewQuestionAndAnswerModel(question: "出生城市：", answer: "否")
            let tmp6 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况：", answer: "否")
            let tmp7 = YHPreviewQuestionAndAnswerModel(question: "职业名称：", answer: "否")
            let tmp8 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证：", answer: "否")
            let tmp9 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码：", answer: "否")
            let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "子女信息-否", cellData0: arr)
            arrDataForChildren.append(model1)
        }
        
        do {
            //随行信息 - 是
            let tmp00 = YHPreviewQuestionAndAnswerModel(question: "主申请人或现配偶是否拥有孩子护养权：", answer: "否")
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "是否随行至香港：", answer: "否")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "国家/国籍：", answer: "中国-China")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "港澳通行证：", answer: "未办理")
            let arr = [tmp00,tmp0,tmp1,tmp2]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "随行信息-是", cellData0: arr)
            arrDataForChildren.append(model1)
        }
        
        do {
            //基本信息
            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 tmp44 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况：", answer: "婚姻状况")
            let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业：", answer: "职业")
            let tmp6 = YHPreviewQuestionAndAnswerModel(question: "职业名称：", answer: "职业名称")
            let tmp7 = YHPreviewQuestionAndAnswerModel(question: "是否拥有学位：", answer: "是否拥有学位")
            let tmp8 = YHPreviewQuestionAndAnswerModel(question: "学位证：", answer: "学位证：")
            let tmp9 = YHPreviewQuestionAndAnswerModel(question: "学位证颁发地区：", answer: "职业名称")
            let tmp10 = YHPreviewQuestionAndAnswerModel(question: "是否和主申请人同住：", answer: "职业名称")
            let tmp11 = YHPreviewQuestionAndAnswerModel(question: "现居住地址：", answer: "职业名称")
            let tmp12 = YHPreviewQuestionAndAnswerModel(question: "是否在海外居住满1年及以上：", answer: "职业名称")
            let tmp122 = YHPreviewQuestionAndAnswerModel(question: "是否为前次婚姻的子女：", answer: "是否为前次婚姻的子女")
            let tmp13 = YHPreviewQuestionAndAnswerModel(question: "目前是否在港：", answer: "职业名称")
            let tmp14 = YHPreviewQuestionAndAnswerModel(question: "获准逗留至：", answer: "职业名称")
            let tmp15 = YHPreviewQuestionAndAnswerModel(question: "在港身份：", answer: "职业名称")
            let tmp16 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证：", answer: "职业名称")
            let tmp17 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码：", answer: "p102987（1）")
            
            let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp44,tmp5,tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,tmp12,tmp122,tmp13,tmp14,tmp15,tmp16,tmp17]
            let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "基本信息", cellData0: arr)
            arrDataForChildren.append(model2)
        }
        
        
        do {
            //证件信息
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "中国身份证号码：", answer: "2203381990287633390")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "签发地：", answer: "北京市分局")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "签发日期：", answer: "2018-07-17")
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "届满日期：", answer: "2028-07-31")
            let model0 = YHPersonInfoCellModel1(cellTitle: "中国身份证", cellData: [tmp0,tmp1,tmp2,tmp3])
            
            
            let tmp4 = YHPreviewQuestionAndAnswerModel(question: "旅行社证件号码：", answer: "c2345639")
            let tmp5 = YHPreviewQuestionAndAnswerModel(question: "签发地：", answer: "北京市分局")
            let tmp6 = YHPreviewQuestionAndAnswerModel(question: "签发日期：", answer: "2018-07-17")
            let tmp7 = YHPreviewQuestionAndAnswerModel(question: "届满日期：", answer: "2028-07-31")
            let model1 = YHPersonInfoCellModel1(cellTitle: "港澳通行证", cellData: [tmp4,tmp5,tmp6,tmp7])
            
            
            let tmp8 = YHPreviewQuestionAndAnswerModel(question: "证件类别：", answer: "护照")
            let tmp9 = YHPreviewQuestionAndAnswerModel(question: "证件号码：", answer: "p2345639")
            let tmp10 = YHPreviewQuestionAndAnswerModel(question: "签发地：", answer: "北京市分局")
            let tmp11 = YHPreviewQuestionAndAnswerModel(question: "签发日期：", answer: "2028-07-31")
            let tmp12 = YHPreviewQuestionAndAnswerModel(question: "届满日期：", answer: "2028-07-31")
            let model2 = YHPersonInfoCellModel1(cellTitle: "护照及其他旅行证件", cellData: [tmp8,tmp9,tmp10,tmp11,tmp12])
            
            let arr = [model0,model1,model2]
            let model3 = YHPreviewInfoSessionModel(cellType: .idCardInfoType, cellTitle: "证件信息", cellData1: arr)
            arrDataForChildren.append(model3)
        }
        
        do {
            //证件照片
            let model1 = YHPersonInfoCellModel2(cellTitle: "中国身份证",frontUrl: "", backUrl: "", idType: 1)
            let model2 = YHPersonInfoCellModel2(cellTitle: "港澳通行证",frontUrl: "", backUrl: "", idType: 2)
            
            let arr = [model1,model2]
            let model4 = YHPreviewInfoSessionModel(cellType: .idPictureType, cellTitle: "证件照片", cellData2: arr)
            arrDataForChildren.append(model4)
        }
        arrData = arrDataForChildren
    }
    
    //兄弟姐妹 数据
    func installDataForBrother() {
        do {
            //兄弟姐妹信息
            let tmp0 = YHPreviewQuestionAndAnswerModel(question: "姓名：", answer: "姓名")
            let tmp1 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况：", answer: "未婚")
            let tmp2 = YHPreviewQuestionAndAnswerModel(question: "出生日期：", answer: "1990年8月18日")
            let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生城市：", answer: "国内 吉林省/吉林市")
            
            let tmp4 = YHPreviewQuestionAndAnswerModel(question: "职业：", answer: "在职")
            let tmp5 = YHPreviewQuestionAndAnswerModel(question: "职业名称：", answer: "设计师")
            let tmp6 = YHPreviewQuestionAndAnswerModel(question: "现居住国家/地区：", answer: "国内 吉林省/吉林市")
            let tmp7 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证：", answer: "国内 吉林省/吉林市")
            let tmp8 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码：", answer: "p102987（1）")
            
            let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8]
            let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "兄弟姐妹信息", cellData0: arr)
            arrDataForBrother.append(model1)
        }
        arrData = arrDataForBrother
    }
}



// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHPreviewFamilyMemberViewController {
    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
    }
}

