Commit b125f518 authored by David黄金龙's avatar David黄金龙

主申请人信息 预览逻辑

parent 1403d482
......@@ -156,6 +156,7 @@
A5234E372B70802400A33433 /* YHBasicInfoCellModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5234E362B70802300A33433 /* YHBasicInfoCellModel.swift */; };
A5234E3E2B7235F000A33433 /* YHOtherInfoFillViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5234E3D2B7235F000A33433 /* YHOtherInfoFillViewController.swift */; };
A53026902B4E6F2700F35102 /* YHHomeCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */; };
A554A5002B95FB9100EA5973 /* YHMainInfoPreviewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A554A4FF2B95FB9100EA5973 /* YHMainInfoPreviewModel.swift */; };
A5551FFE2B4C26CE00510980 /* YHBaseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */; };
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573ED12B317BFF00D98EC0 /* AppDelegate.swift */; };
A5573EDB2B317C0000D98EC0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5573EDA2B317C0000D98EC0 /* Assets.xcassets */; };
......@@ -460,6 +461,7 @@
A5234E362B70802300A33433 /* YHBasicInfoCellModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBasicInfoCellModel.swift; sourceTree = "<group>"; };
A5234E3D2B7235F000A33433 /* YHOtherInfoFillViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOtherInfoFillViewController.swift; sourceTree = "<group>"; };
A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeCustomCell.swift; sourceTree = "<group>"; };
A554A4FF2B95FB9100EA5973 /* YHMainInfoPreviewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMainInfoPreviewModel.swift; sourceTree = "<group>"; };
A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewModel.swift; sourceTree = "<group>"; };
A5573ECE2B317BFF00D98EC0 /* galaxy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = galaxy.app; sourceTree = BUILT_PRODUCTS_DIR; };
A5573ED12B317BFF00D98EC0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
......@@ -1047,6 +1049,7 @@
A5FD63F92B68D95700D1D9DA /* YHPersonInfoIdentityCardModel.swift */,
A5191F612B89E748001069F7 /* YHPreviewQuestionAndAnswerModel.swift */,
A5B4A5842B9455F7003EFF8F /* YHPreviewForOtherInfoModel.swift */,
A554A4FF2B95FB9100EA5973 /* YHMainInfoPreviewModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -1812,6 +1815,7 @@
0413A6D82B8C76290006D154 /* YHCertificateUploadVC.swift in Sources */,
A5ACE93A2B4564F7002C94D2 /* NSAttributedString+Extension.swift in Sources */,
04E86E662B86EB6F00A35F4B /* YHLoginManager.swift in Sources */,
A554A5002B95FB9100EA5973 /* YHMainInfoPreviewModel.swift in Sources */,
042F888B2B8477C6008B60BD /* YHEducationInfo.swift in Sources */,
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */,
042FBBBF2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift in Sources */,
......
......@@ -1218,10 +1218,12 @@ class YHAddress: SmartCodable {
class YHChildStepchildClass: SmartCodable {
var has: String = ""
var info: String = ""
var number: String = ""
enum CodingKeys: String, CodingKey {
case has = "has"
case info = "info"
case number = "number"
}
required init() {
......
......@@ -50,10 +50,6 @@ class YHScoreDetailViewController: YHBaseViewController {
//2.0
loadData()
//3.保存orderId 提供给后续UI使用
UserDefaults.standard.set(orderId, forKey: "orderIdForPreview")
UserDefaults.standard.synchronize()
}
}
......
//
// YHMainInfoPreviewModel.swift
// galaxy
//
// Created by davidhuangA on 2024/3/4.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHMainInfoPreviewModel: SmartCodable {
var username: String = ""
var used_name: String = ""
var username_pinyin : String = ""
var sex : String = ""
var birthday: String = ""
var birth_place: String = ""
var mobile: String = ""
var email: String = ""
var married: String = ""
var nationality: String = ""
var live_address: String = ""
var surname: String = ""
var birth_place_details : String = ""
var live_address_detail : String = ""
var is_handled: Int = 0
var is_live_oversea_year: Int = 0
var hk_id : YHChildStepchildClass?
var certificates:YHCertificatesPreviewModel?
required init() {
}
}
class YHCertificatesPreviewModel: SmartCodable {
var cnIdentityCard: YHCNIdentityCardPreviewModel = YHCNIdentityCardPreviewModel()
var passport: YHCNIdentityCardPreviewModel = YHCNIdentityCardPreviewModel()
var hkMacaoPass: YHCNIdentityCardPreviewModel = YHCNIdentityCardPreviewModel()
enum CodingKeys: String, CodingKey {
case cnIdentityCard = "cn_identity_card"
case passport = "passport"
case hkMacaoPass = "hk_macao_pass"
}
required init() {
}
}
class YHCNIdentityCardPreviewModel: SmartCodable {
static let longTime = "8888-01-01"
var id: Int = 0
var number: String = ""
var issueAt: String = ""
var issueDateStartAt: String = ""
var issueDateEndAt: String = ""
var imgFront: String = ""
var imgBack: String = ""
var passport_type: Int = -1
var type: String = ""
enum CodingKeys: String, CodingKey {
case id = "id"
case number = "number"
case issueAt = "issue_at"
case issueDateStartAt = "issue_date_start_at"
case issueDateEndAt = "issue_date_end_at"
case imgFront = "img_front"
case imgBack = "img_back"
case passport_type = "passport_type"
case type = "type"
}
required init() {
}
}
......@@ -19,7 +19,7 @@ class YHPreviewViewModel: YHBaseViewModel {
//主申请人信息 预览 - 未完成
var mainApplicationInfoPreviewModel : YHMainInformationModel?
var mainApplicationInfoPreviewModel : YHMainInfoPreviewModel?
var arrDataForMainApplicationInfo : [YHPreviewInfoSessionModel] = []
//其他信息 预览
......@@ -68,8 +68,8 @@ extension YHPreviewViewModel {
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let result = YHMainInformationModel.deserialize(from: dic as? Dictionary) else {
let dic = json.data as? [AnyHashable : Any]
guard let result = YHMainInfoPreviewModel.deserialize(dict: dic) else {
callBackBlock(false,nil)
return
}
......@@ -169,64 +169,165 @@ private extension YHPreviewViewModel {
do {
//基本信息
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "主申请人:", answer: model.username)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "曾用名:", answer: model.used_name)
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏:", answer: model.surname)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "曾用名:", answer: model.used_name.isEmpty ? "--" : model.used_name)
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏:", answer: model.surname.isEmpty ? "--" : model.surname)
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生日期:", answer: model.birthday)
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "出生城市:", answer: model.birth_place.area.description) //mainData.birth_place for test hjl todo
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "性别:", answer: model.sex.description)//mainData.birth_place for test hjl todo
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况:", answer: model.married.description)//for test hjl todo
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "出生城市:", answer: model.birth_place)
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "性别:", answer: model.sex)//for test hjl todo
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况:", answer: model.married)//for test hjl todo
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "手机号:", answer: model.mobile)
let tmp8 = YHPreviewQuestionAndAnswerModel(question: "邮箱:", answer: model.email)
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "现居住地址:", answer:model.live_address)
let tmp10 = YHPreviewQuestionAndAnswerModel(question: "详细地址:", answer: model.live_address_detail)
let tmp11 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "是")//model.hk_id.has //for test hjl todo
let tmp12 = YHPreviewQuestionAndAnswerModel(question: "香港身份证:", answer: "-")//model.hk_id.number //for test hjl todo
let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,tmp12]
let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "基本信息", cellData0: arr)
arrDataForMainApplicationInfo.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])
var arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9]
if model.live_address.contains("中国") == false {
let tmp10 = YHPreviewQuestionAndAnswerModel(question: "是否在海外居住满1年及以上:", answer: model.is_live_oversea_year == 1 ? "是" : "否")
arr.append(tmp10)
} else {
let tmp10 = YHPreviewQuestionAndAnswerModel(question: "详细地址:", answer: model.live_address_detail)
arr.append(tmp10)
}
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)
arrDataForMainApplicationInfo.append(model3)
if let card = model.hk_id,card.has.isEmpty == false {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "是")
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "香港身份证号码:", answer: card.number.isEmpty ? "--" : card.number)
arr.append(tmp5)
arr.append(tmp6)
} else {
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "是否办理过香港身份证:", answer: "否")
arr.append(tmp5)
}
let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "基本信息", cellData0: arr)
arrDataForMainApplicationInfo.append(model2)
}
do {
//证件照片
let model1 = YHPersonInfoCellModel2(cellTitle: "中国身份证",frontUrl: "", backUrl: "", idType: 1)
let model2 = YHPersonInfoCellModel2(cellTitle: "港澳通行证",frontUrl: "", backUrl: "", idType: 2)
if let model2 = model.certificates {
//1.跟随 证件信息
do {
//中国身份证
var str = model2.cnIdentityCard.number
if str.isEmpty {
str = "无"
}
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "中国身份证号码:", answer: str)
str = model2.cnIdentityCard.issueAt
if str.isEmpty {
str = "无"
}
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str)
str = model2.cnIdentityCard.issueAt
if str.isEmpty {
str = "无"
}
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
str = model2.cnIdentityCard.issueDateEndAt
if str.isEmpty {
str = "无"
} else {
if str == "8888-01-01" {
str = "至今"
}
}
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let model0 = YHPersonInfoCellModel1(cellTitle: "中国身份证", cellData: [tmp0,tmp1,tmp2,tmp3])
var arr = [model0]
//港澳通行证
if model.is_handled == 1 {
str = model2.hkMacaoPass.number
if str.isEmpty {
str = "无"
}
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "旅行社证件号码:", answer: str)
str = model2.hkMacaoPass.issueAt
if str.isEmpty {
str = "无"
}
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: str)
str = model2.hkMacaoPass.issueDateEndAt
if str.isEmpty {
str = "无"
}
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
str = model2.hkMacaoPass.issueDateStartAt
if str.isEmpty {
str = "无"
} else {
if str == "8888-01-01" {
str = "至今"
}
}
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let model1 = YHPersonInfoCellModel1(cellTitle: "港澳通行证", cellData: [tmp4,tmp5,tmp6,tmp7])
arr.append(model1)
}
if model.nationality != "中国-China" {
//护照及其他旅行证件
var str = String(model2.passport.passport_type)//for test hjl todo
let tmp8 = YHPreviewQuestionAndAnswerModel(question: "证件类别:", answer: str)
str = model2.passport.number
if str.isEmpty {
str = "--"
}
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "证件号码:", answer: str)
str = model2.passport.issueAt
if str.isEmpty {
str = "无"
}
let tmp10 = YHPreviewQuestionAndAnswerModel(question: "签发地:", answer: "北京市分局")
str = model2.passport.issueDateStartAt
if str.isEmpty {
str = "无"
}
let tmp11 = YHPreviewQuestionAndAnswerModel(question: "签发日期:", answer: str)
str = model2.passport.issueDateEndAt
if str.isEmpty {
str = "无"
} else {
if str == "8888-01-01" {
str = "至今"
}
}
let tmp12 = YHPreviewQuestionAndAnswerModel(question: "届满日期:", answer: str)
let model2 = YHPersonInfoCellModel1(cellTitle: "护照及其他旅行证件", cellData: [tmp8,tmp9,tmp10,tmp11,tmp12])
arr.append(model2)
}
let model3 = YHPreviewInfoSessionModel(cellType: .idCardInfoType, cellTitle: "证件信息", cellData1: arr)
arrDataForMainApplicationInfo.append(model3)
}
let arr = [model1,model2]
let model4 = YHPreviewInfoSessionModel(cellType: .idPictureType, cellTitle: "证件照片", cellData2: arr)
arrDataForMainApplicationInfo.append(model4)
//2.跟随 证件照
do {
//证件照片
let front = model2.cnIdentityCard.imgFront
let back = model2.cnIdentityCard.imgBack
let model1 = YHPersonInfoCellModel2(cellTitle: "中国身份证",frontUrl: front, backUrl: back, idType: 1)
var arr = [model1]
if model.is_handled == 1 {
let front = model2.hkMacaoPass.imgFront
let back = model2.hkMacaoPass.imgBack
let model2 = YHPersonInfoCellModel2(cellTitle: "港澳通行证",frontUrl: front, backUrl: back, idType: 2)
arr.append(model2)
}
let model4 = YHPreviewInfoSessionModel(cellType: .idPictureType, cellTitle: "证件照片", cellData2: arr)
arrDataForMainApplicationInfo.append(model4)
}
}
}
......@@ -426,9 +527,6 @@ private extension YHPreviewViewModel {
private extension YHPreviewViewModel {
func installDataForFamilyInfo() {
//父母
installDataForParents()
......@@ -443,8 +541,6 @@ private extension YHPreviewViewModel {
installDataForBrother()
}
//父母 数据
func installDataForParents() {
do {
......@@ -586,7 +682,6 @@ private extension YHPreviewViewModel {
arrDataForFamilyInfo = arrDataForParents
}
private func installDataForSpouseOp(model : YHFamilyMember) {
var arrTemp : [YHPreviewInfoSessionModel] = []
......@@ -887,9 +982,7 @@ private extension YHPreviewViewModel {
installDataForSpouseOp(model: model)
}
private func installDataForChildOp(model : YHFamilyMember,childIndex : Int) {
var arrTemp : [YHPreviewInfoSessionModel] = []
do {
if model.follow != 1 {
......@@ -1208,8 +1301,6 @@ private extension YHPreviewViewModel {
}
}
//兄弟姐妹 数据
func installDataForBrother() {
......
......@@ -95,7 +95,7 @@ class YHNetRequest: NSObject {
requestHeader.add(name:"sign",value:sign)
requestHeader.add(name: "token", value: YHLoginManager.shared.userModel?.token ?? "-")
// testToken(&requestHeader) //for test hjl 使用测试token
testToken(&requestHeader) //for test hjl 使用测试token
headers = requestHeader
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment