Commit 6d256090 authored by David黄金龙's avatar David黄金龙

展示 字段

parent e4446e21
......@@ -109,7 +109,9 @@ extension YHOtherInfoFillCell {
lastTargetView = residenceView
} else {
let sessionView = YHOtherInfoSessionView(frame: .zero)
let title = "居住信息" + String(index + 1)
let addationIndex = dataModel.residences.count > 1 ? String(index + 1) : ""
let title = "居住信息" + addationIndex
sessionView.updateTitle(title: title)
sessionView.type = 1
sessionView.tag = index
......
......@@ -9,32 +9,6 @@
import UIKit
import AttributedString
enum YHOtherPickerViewType: Int {
// 按自然顺序递增
case none = 0
// 语言能力
case language
// 专业技能行业
case professionalSkill
// 用人单位性质
case nature
// 工作证明文件
case certificate
// 行政架构层级
case structure
// 职位水平类别
case level
// 高管证明文件
case prove
// 证件类别
case idType
// 性别
case sex
// 婚姻状况
case marry
}
struct YHOtherPickerViewItemData {
let title : String
let subTitle : String
......
......@@ -131,6 +131,8 @@ extension YHPreviewViewModel {
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
arrDataForMainApplicationInfo.removeAll()
if json.code == 200 {
let dic = json.data as? [AnyHashable : Any]
guard let result = YHMainInfoPreviewModel.deserialize(dict: dic) else {
......@@ -141,12 +143,10 @@ extension YHPreviewViewModel {
installDataForMainApplicationInfo()
callBackBlock(true, nil)
} else {
installDataForMainApplicationInfo() //for test hjl
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
self.installDataForMainApplicationInfo()//for test hjl
callBackBlock(false,err)
}
}
......@@ -240,10 +240,14 @@ private extension YHPreviewViewModel {
title = model.international_work_experience == 0 ? "否" : "是"
let tmp11 = YHPreviewQuestionAndAnswerModel(question: "相关工作是否属国际工作经验:", answer:title)
let tmp12 = YHPreviewQuestionAndAnswerModel(question: "企业人数规模:", answer:String(model.company_member_total))
let tmp13 = YHPreviewQuestionAndAnswerModel(question: "行政架构层级:", answer:String(model.administrative_level))
let tempppp = YHConstantArrayData.getShowNameBy(indexStr: String(model.administrative_level), type: .structure)
let tmp13 = YHPreviewQuestionAndAnswerModel(question: "行政架构层级:", answer:tempppp)
let tmp14 = YHPreviewQuestionAndAnswerModel(question: "下属管理人数:", answer:String(model.company_manage_total))
let tmp15 = YHPreviewQuestionAndAnswerModel(question: "公司营业额/港元(近一年):", answer:String(model.turnover))
let tmp16 = YHPreviewQuestionAndAnswerModel(question: "职业水平类别:", answer:String(model.professional_level))
let tempppp0 = YHConstantArrayData.getShowNameBy(indexStr: String(model.administrative_level), type: .level)
let tmp16 = YHPreviewQuestionAndAnswerModel(question: "职业水平类别:", answer:tempppp0)
arr1.append(contentsOf: [tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,tmp12,tmp13,tmp14,tmp15,tmp16])
}
......@@ -271,7 +275,9 @@ private extension YHPreviewViewModel {
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "项目业绩/亮点", answer:item.project_highlights)
let arrT : [YHPreviewQuestionAndAnswerModel] = [tmp1,tmp2,tmp3]
let dataModelTemp = YHWorkExpDataModel(title: "项目介绍" + String(index + 1), data: arrT)
let addationIndex = list.count > 1 ? String(index + 1) : ""
let dataModelTemp = YHWorkExpDataModel(title: "项目介绍" + addationIndex, data: arrT)
arr3.append(dataModelTemp)
}
}
......@@ -293,8 +299,8 @@ private extension YHPreviewViewModel {
let dataModel4 = YHWorkExpDataModel(title: "", data: arr4)
let mmmm = YHPreviewInfoSessionModel(cellType: .workExp, cellTitle: "主申请人工作经历" + String(index + 1), cellData4: [dataModel1,dataModel2,dataModel3,dataModel4])
let addationIndex = list.count > 1 ? String(index + 1) : ""
let mmmm = YHPreviewInfoSessionModel(cellType: .workExp, cellTitle: "主申请人工作经历" + addationIndex, cellData4: [dataModel1,dataModel2,dataModel3,dataModel4])
arrDataForWorkExpInfo.append(mmmm)
}
}
......@@ -305,8 +311,8 @@ private extension YHPreviewViewModel {
arrDataForAcademicInfo.removeAll()
guard let model0 = academicInfoPreviewModel else { return}
do {
if let arr = model0.edu_list {
for(index,model) in arr.enumerated() {
if let arr0 = model0.edu_list {
for(index,model) in arr0.enumerated() {
//主申请人学历
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "学校全称:", answer:model.college)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "授课形式:", answer:model.type)
......@@ -334,7 +340,7 @@ private extension YHPreviewViewModel {
let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7]
let addationIndex = arr.count > 1 ? String(index + 1) : ""
let addationIndex = arr0.count > 1 ? String(index + 1) : ""
let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "主申请人学历" + addationIndex, cellData0: arr)
arrDataForAcademicInfo.append(model2)
}
......@@ -408,10 +414,10 @@ private extension YHPreviewViewModel {
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生日期:", answer: model.birthday)
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "出生城市:", answer: model.birth_place)
var msg = YHConstantArrayData.getSexNameBy(index: Int(model.sex) ?? 0)
var msg = YHConstantArrayData.getShowNameBy(indexStr: model.sex, type: .sex)
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "性别:", answer: msg)
msg = YHConstantArrayData.getMarryNameBy(index: Int(model.married) ?? 0)
msg = YHConstantArrayData.getShowNameBy(indexStr: model.married, type: .marry)
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "婚姻状况:", answer: msg)
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "手机号:", answer: model.mobile)
......@@ -512,7 +518,7 @@ private extension YHPreviewViewModel {
if model.nationality != "中国-China" {
//护照及其他旅行证件
var str = YHConstantArrayData.getIdTypeBy(index:model2.passport.passport_type)
var str = YHConstantArrayData.getShowNameBy(indexStr: String(model2.passport.passport_type), type: .idType)
let tmp8 = YHPreviewQuestionAndAnswerModel(question: "证件类别:", answer: str)
str = model2.passport.number
......@@ -677,7 +683,10 @@ private extension YHPreviewViewModel {
//居住信息
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "开始时间:", answer: item.start_time)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "结束时间:", answer: item.end_time)
let title = "国家" + String(index + 1) + ":" + item.country
let addationIndex = arr1.count > 1 ? String(index + 1) : ""
let title = "国家" + addationIndex + ":" + item.country
let model0 = YHPersonInfoCellModel1(cellTitle: title, cellData: [tmp0,tmp1])
arr.append(model0)
......@@ -1011,7 +1020,9 @@ private extension YHPreviewViewModel {
var arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7]
if model.hasDegree == "1" {
for(index,item) in model.hasDegreeJson.enumerated() {
let title = "学位证" + String(index + 1) + ":"
let addationIndex = model.hasDegreeJson.count > 1 ? String(index + 1) : ""
let title = "学位证" + addationIndex + ":"
let tmp8 = YHPreviewQuestionAndAnswerModel(question: title, answer: item.degree)
arr.append(tmp8)
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "学位证颁发地区:", answer: item.address)
......@@ -1151,7 +1162,7 @@ private extension YHPreviewViewModel {
if model.nationality != "中国-China" {
//护照及其他旅行证件
var str = String(model.certificates.passport.passPortType)//for test hjl todo
var str = YHConstantArrayData.getShowNameBy(indexStr: String(model.certificates.passport.passPortType), type: .idType)
let tmp8 = YHPreviewQuestionAndAnswerModel(question: "证件类别:", answer: str)
str = model.certificates.passport.number
......@@ -1239,7 +1250,8 @@ private extension YHPreviewViewModel {
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "配偶姓名:", answer: model.subsetName)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "曾用名:", answer: model.usedName.isEmpty ? "--" : model.usedName)
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏:", answer: model.surname.isEmpty ? "--" : model.surname)
let tmp22 = YHPreviewQuestionAndAnswerModel(question: "性别:", answer: String(model.sex))//for test hjl todo
let sexStr = YHConstantArrayData.getShowNameBy(indexStr: String(model.sex), type: .sex)
let tmp22 = YHPreviewQuestionAndAnswerModel(question: "性别:", answer: sexStr)
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生日期:", answer: model.birthday)
var city = ""
if model.birthPlaceAboard == 0 {
......@@ -1291,11 +1303,13 @@ private extension YHPreviewViewModel {
do {
//配偶信息
//子女信息
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "子女姓名:", answer: model.subsetName)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "曾用名:", answer: model.usedName)
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "婚前姓氏:", answer: model.surname)
let tmp22 = YHPreviewQuestionAndAnswerModel(question: "性别:", answer: String(model.sex)) //for test hjl todo
let sexStr = YHConstantArrayData.getShowNameBy(indexStr: String(model.sex), type: .sex)
let tmp22 = YHPreviewQuestionAndAnswerModel(question: "性别:", answer: sexStr)
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "出生日期:", answer: model.birthday)
var city = ""
if model.birthPlaceAboard == 0 {
......@@ -1326,7 +1340,9 @@ private extension YHPreviewViewModel {
if model.hasDegree == "1" {
for(index,item) in model.hasDegreeJson.enumerated() {
let title = "学位证" + String(index + 1) + ":"
let addationIndex = model.hasDegreeJson.count > 1 ? String(index + 1) : ""
let title = "学位证" + addationIndex + ":"
let tmp8 = YHPreviewQuestionAndAnswerModel(question: title, answer: item.degree)
arr.append(tmp8)
let tmp9 = YHPreviewQuestionAndAnswerModel(question: "学位证颁发地区:", answer: item.address)
......
......@@ -8,6 +8,32 @@
import UIKit
enum YHOtherPickerViewType: Int {
// 按自然顺序递增
case none = 0
// 语言能力
case language
// 专业技能行业
case professionalSkill
// 用人单位性质
case nature
// 工作证明文件
case certificate
// 行政架构层级
case structure
// 职位水平类别
case level
// 高管证明文件
case prove
// 证件类别
case idType
// 性别
case sex
// 婚姻状况
case marry
}
class YHConstantArrayData {
static let arrLanguage : [[String : String]] = [
[
......@@ -287,16 +313,14 @@ class YHConstantArrayData {
"id": "10"
]
]
static func getIdTypeBy(index : Int) -> String {
for item in YHConstantArrayData.arrIdType {
if let target = item["id"],index == Int(target) {
return item["title"] ?? "未知"
}
}
return "未知"
}
// static func getIdTypeBy(index : Int) -> String {
// for item in YHConstantArrayData.arrIdType {
// if let target = item["id"],index == Int(target) {
// return item["title"] ?? "未知"
// }
// }
// return "未知"
// }
static let arrSex : [[String : String]] = [
["title": "男",
"id": "1"
......@@ -305,14 +329,7 @@ class YHConstantArrayData {
"id": "2"
]
]
static func getSexNameBy(index : Int) -> String {
for item in YHConstantArrayData.arrSex {
if let target = item["id"],index == Int(target) {
return item["title"] ?? "未知"
}
}
return "未知"
}
static let arrMarry : [[String : String]] = [
["title": "已婚",
......@@ -332,9 +349,29 @@ class YHConstantArrayData {
]
]
static func getMarryNameBy(index : Int) -> String {
for item in YHConstantArrayData.arrMarry {
if let target = item["id"],index == Int(target) {
//通过 id 获取 title
static func getShowNameBy(indexStr:String,type : YHOtherPickerViewType) -> String {
if indexStr.isEmpty {
return "未知"
}
var arrData : [[String : String]] = [[:]]
switch type {
case .marry:
arrData = YHConstantArrayData.arrMarry
case .sex:
arrData = YHConstantArrayData.arrSex
case .idType:
arrData = YHConstantArrayData.arrIdType
case .structure:
arrData = YHConstantArrayData.arrStructure
case .level:
arrData = YHConstantArrayData.arrLevel
default:
arrData = [[:]]
}
for item in arrData {
if let target = item["id"],indexStr == target {
return item["title"] ?? "未知"
}
}
......
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