Commit 19c299e0 authored by David黄金龙's avatar David黄金龙

其他信息 预览 展示

parent deaa5e7c
...@@ -222,6 +222,8 @@ ...@@ -222,6 +222,8 @@
A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE9252B4564F7002C94D2 /* YHBasicContentView.swift */; }; A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE9252B4564F7002C94D2 /* YHBasicContentView.swift */; };
A5ACE9582B4564F7002C94D2 /* YHNoDataTipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE9262B4564F7002C94D2 /* YHNoDataTipView.swift */; }; A5ACE9582B4564F7002C94D2 /* YHNoDataTipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE9262B4564F7002C94D2 /* YHNoDataTipView.swift */; };
A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE95D2B4571BF002C94D2 /* YHHomeViewController.swift */; }; A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE95D2B4571BF002C94D2 /* YHHomeViewController.swift */; };
A5B4A5832B94555C003EFF8F /* YHPreviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B4A5822B94555C003EFF8F /* YHPreviewViewModel.swift */; };
A5B4A5852B9455F7003EFF8F /* YHPreviewForOtherInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B4A5842B9455F7003EFF8F /* YHPreviewForOtherInfoModel.swift */; };
A5C382CA2B5E1F4C00C5E65C /* YHLoginTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382C92B5E1F4C00C5E65C /* YHLoginTipsView.swift */; }; A5C382CA2B5E1F4C00C5E65C /* YHLoginTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382C92B5E1F4C00C5E65C /* YHLoginTipsView.swift */; };
A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */; }; A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */; };
A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382CE2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift */; }; A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382CE2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift */; };
...@@ -528,6 +530,8 @@ ...@@ -528,6 +530,8 @@
A5ACE9252B4564F7002C94D2 /* YHBasicContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHBasicContentView.swift; sourceTree = "<group>"; }; A5ACE9252B4564F7002C94D2 /* YHBasicContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHBasicContentView.swift; sourceTree = "<group>"; };
A5ACE9262B4564F7002C94D2 /* YHNoDataTipView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHNoDataTipView.swift; sourceTree = "<group>"; }; A5ACE9262B4564F7002C94D2 /* YHNoDataTipView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHNoDataTipView.swift; sourceTree = "<group>"; };
A5ACE95D2B4571BF002C94D2 /* YHHomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeViewController.swift; sourceTree = "<group>"; }; A5ACE95D2B4571BF002C94D2 /* YHHomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeViewController.swift; sourceTree = "<group>"; };
A5B4A5822B94555C003EFF8F /* YHPreviewViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPreviewViewModel.swift; sourceTree = "<group>"; };
A5B4A5842B9455F7003EFF8F /* YHPreviewForOtherInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPreviewForOtherInfoModel.swift; sourceTree = "<group>"; };
A5C382C92B5E1F4C00C5E65C /* YHLoginTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginTipsView.swift; sourceTree = "<group>"; }; A5C382C92B5E1F4C00C5E65C /* YHLoginTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginTipsView.swift; sourceTree = "<group>"; };
A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContractCell.swift; sourceTree = "<group>"; }; A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContractCell.swift; sourceTree = "<group>"; };
A5C382CE2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterMainViewModel.swift; sourceTree = "<group>"; }; A5C382CE2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterMainViewModel.swift; sourceTree = "<group>"; };
...@@ -1026,6 +1030,7 @@ ...@@ -1026,6 +1030,7 @@
A5167B2D2B6A23D10084C08F /* PersonInfoList(个人信息预览) */ = { A5167B2D2B6A23D10084C08F /* PersonInfoList(个人信息预览) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A5B4A5812B945461003EFF8F /* VM */,
A5167B2E2B6A23F50084C08F /* M */, A5167B2E2B6A23F50084C08F /* M */,
A5167B2F2B6A23FC0084C08F /* V */, A5167B2F2B6A23FC0084C08F /* V */,
A5167B302B6A24010084C08F /* C */, A5167B302B6A24010084C08F /* C */,
...@@ -1041,6 +1046,7 @@ ...@@ -1041,6 +1046,7 @@
A5FD63FB2B68DA6600D1D9DA /* YHPersonInfoCellModel2.swift */, A5FD63FB2B68DA6600D1D9DA /* YHPersonInfoCellModel2.swift */,
A5FD63F92B68D95700D1D9DA /* YHPersonInfoIdentityCardModel.swift */, A5FD63F92B68D95700D1D9DA /* YHPersonInfoIdentityCardModel.swift */,
A5191F612B89E748001069F7 /* YHPreviewQuestionAndAnswerModel.swift */, A5191F612B89E748001069F7 /* YHPreviewQuestionAndAnswerModel.swift */,
A5B4A5842B9455F7003EFF8F /* YHPreviewForOtherInfoModel.swift */,
); );
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1541,6 +1547,14 @@ ...@@ -1541,6 +1547,14 @@
path = C; path = C;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
A5B4A5812B945461003EFF8F /* VM */ = {
isa = PBXGroup;
children = (
A5B4A5822B94555C003EFF8F /* YHPreviewViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
};
A5C382C82B5E101E00C5E65C /* ServiceProcess(流程) */ = { A5C382C82B5E101E00C5E65C /* ServiceProcess(流程) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -1946,6 +1960,7 @@ ...@@ -1946,6 +1960,7 @@
A596C3A02B84D9100067BBB8 /* YHOtherInfoFillCell.swift in Sources */, A596C3A02B84D9100067BBB8 /* YHOtherInfoFillCell.swift in Sources */,
A5ACE9382B4564F7002C94D2 /* UIApplication+Extension.swift in Sources */, A5ACE9382B4564F7002C94D2 /* UIApplication+Extension.swift in Sources */,
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */, 041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */,
A5B4A5832B94555C003EFF8F /* YHPreviewViewModel.swift in Sources */,
043955212B70955200955D49 /* YHFormPickerViewType.swift in Sources */, 043955212B70955200955D49 /* YHFormPickerViewType.swift in Sources */,
043955232B70BC2500955D49 /* YHChildInfoContainerVC.swift in Sources */, 043955232B70BC2500955D49 /* YHChildInfoContainerVC.swift in Sources */,
04E86E442B8357EC00A35F4B /* YHCountryMessage.swift in Sources */, 04E86E442B8357EC00A35F4B /* YHCountryMessage.swift in Sources */,
...@@ -1988,6 +2003,7 @@ ...@@ -1988,6 +2003,7 @@
A5191F602B89E6FA001069F7 /* YHPreviewInfoQuestionAndAnswerItemView.swift in Sources */, A5191F602B89E6FA001069F7 /* YHPreviewInfoQuestionAndAnswerItemView.swift in Sources */,
04B0239E2B92C27C00B83629 /* YHFamilyMemberViewModel.swift in Sources */, 04B0239E2B92C27C00B83629 /* YHFamilyMemberViewModel.swift in Sources */,
04E86E452B8357EC00A35F4B /* YHItemModel.swift in Sources */, 04E86E452B8357EC00A35F4B /* YHItemModel.swift in Sources */,
A5B4A5852B9455F7003EFF8F /* YHPreviewForOtherInfoModel.swift in Sources */,
A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */, A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */,
A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */, A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */,
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */, 04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */,
......
...@@ -50,6 +50,10 @@ class YHScoreDetailViewController: YHBaseViewController { ...@@ -50,6 +50,10 @@ class YHScoreDetailViewController: YHBaseViewController {
//2.0 //2.0
loadData() loadData()
//3.保存orderId 提供给后续UI使用
UserDefaults.standard.set(orderId, forKey: "orderIdForPreview")
UserDefaults.standard.synchronize()
} }
} }
......
...@@ -54,10 +54,7 @@ extension YHOtherInfoFillViewController { ...@@ -54,10 +54,7 @@ extension YHOtherInfoFillViewController {
bottomView.block = { tag in bottomView.block = { tag in
if tag == 0 { if tag == 0 {
//点击了保存按钮 //点击了保存按钮
// let arr = self.basicInfoVM.arrBasicInfoSessionDataForEdit
// printLog(arr)
printLog("点击了保存按钮") printLog("点击了保存按钮")
self.saveData() self.saveData()
} else { } else {
...@@ -234,4 +231,3 @@ extension YHOtherInfoFillViewController : UITableViewDelegate,UITableViewDataSou ...@@ -234,4 +231,3 @@ extension YHOtherInfoFillViewController : UITableViewDelegate,UITableViewDataSou
return cell return cell
} }
} }
...@@ -12,9 +12,10 @@ class YHOtherInfoFillViewModel: YHBaseViewModel { ...@@ -12,9 +12,10 @@ class YHOtherInfoFillViewModel: YHBaseViewModel {
var otherInfoFillData : YHOtherInfoFillModel? var otherInfoFillData : YHOtherInfoFillModel?
static let arrLanguage : [[String : String]] = [ static let arrLanguage : [[String : String]] = [
["id":"1", [
"title": "中文及英文", "id":"1",
"dec": "国外大学(英语国家)毕业,英文授课,获得学位证。(如为中外联合办学,在中国上课的,不算)", "title": "中文及英文",
"dec": "国外大学(英语国家)毕业,英文授课,获得学位证。(如为中外联合办学,在中国上课的,不算)",
], ],
[ [
"id": "2", "id": "2",
...@@ -134,68 +135,83 @@ class YHOtherInfoFillViewModel: YHBaseViewModel { ...@@ -134,68 +135,83 @@ class YHOtherInfoFillViewModel: YHBaseViewModel {
] ]
static let arrNature : [[String : String]] = [ static let arrNature : [[String : String]] = [
[ "title": "有限责任公司", [
"id": "有限责任公司" "title": "有限责任公司",
"id": "有限责任公司"
], ],
[ "title": "股份有限公司", [
"id": "股份有限公司" "title": "股份有限公司",
"id": "股份有限公司"
], ],
[ "title": "跨国有限责任公司", [
"id": "跨国有限责任公司" "title": "跨国有限责任公司",
"id": "跨国有限责任公司"
], ],
[ "title": "跨国股份有限公司", [
"id": "跨国股份有限公司" "title": "跨国股份有限公司",
"id": "跨国股份有限公司"
], ],
[ "title": "上市公司", [
"id": "上市公司" "title": "上市公司",
"id": "上市公司"
], ],
[ "title": "上市跨国公司", [
"id": "上市跨国公司" "title": "上市跨国公司",
"id": "上市跨国公司"
], ],
[ "title": "教育机构", [
"id": "教育机构" "title": "教育机构",
"id": "教育机构"
], ],
[ "title": "半公营企业", [
"id": "半公营企业" "title": "半公营企业",
"id": "半公营企业"
], ],
[ "title": "政府机构", [
"id": "政府机构" "title": "政府机构",
"id": "政府机构"
], ],
[ "title": "跨国合伙企业", [
"id": "跨国合伙企业" "title": "跨国合伙企业",
"id": "跨国合伙企业"
], ],
[ "title": "跨国个人独资企业", [
"id": "跨国个人独资企业" "title": "跨国个人独资企业",
"id": "跨国个人独资企业"
], ],
[ "title": "个人独资企业", [
"id": "个人独资企业" "title": "个人独资企业",
"id": "个人独资企业"
], ],
[ "title": "国家/政府间组织", [
"id": "国家/政府间组织" "title": "国家/政府间组织",
"id": "国家/政府间组织"
], ],
[ "title": "志愿/慈善/宗教团体", [
"id": "志愿/慈善/宗教团体" "title": "志愿/慈善/宗教团体",
"id": "志愿/慈善/宗教团体"
], ],
[ "title": "其他(请备注)", [
"id": "其他(请备注)" "title": "其他(请备注)",
"id": "其他(请备注)"
] ]
] ]
static let arrCertificate : [[String : String]] = [ static let arrCertificate : [[String : String]] = [
["id": "盖章并签字的推荐信 (证明效果最强)", ["id": "盖章并签字的推荐信 (证明效果最强)",
"title": "盖章并签字的推荐信 (证明效果最强)" "title": "盖章并签字的推荐信 (证明效果最强)"
], ],
["id": "签字的推荐信+盖章的工作证明", ["id": "签字的推荐信+盖章的工作证明",
"title": "签字的推荐信+盖章的工作证明" "title": "签字的推荐信+盖章的工作证明"
], ],
["id": "仅有签字的推荐信", ["id": "仅有签字的推荐信",
"title": "仅有签字的推荐信" "title": "仅有签字的推荐信"
], ],
["id": "仅有社保记录/劳动合同/工牌等", ["id": "仅有社保记录/劳动合同/工牌等",
"title": "仅有社保记录/劳动合同/工牌等" "title": "仅有社保记录/劳动合同/工牌等"
], ],
["id": "仅提供声明书解释", ["id": "仅提供声明书解释",
"title": "仅提供声明书解释" "title": "仅提供声明书解释"
], ],
["id": "仅有工作证明", ["id": "仅有工作证明",
"title": "仅有工作证明" "title": "仅有工作证明"
...@@ -204,100 +220,100 @@ class YHOtherInfoFillViewModel: YHBaseViewModel { ...@@ -204,100 +220,100 @@ class YHOtherInfoFillViewModel: YHBaseViewModel {
static let arrStructure : [[String : String]] = [ static let arrStructure : [[String : String]] = [
["title": "组织架构最顶级", ["title": "组织架构最顶级",
"id": "1" "id": "1"
], ],
["title": "组织架构第二层级", ["title": "组织架构第二层级",
"id": "2" "id": "2"
], ],
["title": "组织架构第三层级", ["title": "组织架构第三层级",
"id": "3" "id": "3"
], ],
["title": "组织架构第四层级", ["title": "组织架构第四层级",
"id": "4" "id": "4"
], ],
["title": "以上都不是", ["title": "以上都不是",
"id": "5" "id": "5"
] ]
] ]
static let arrLevel : [[String : String]] = [ static let arrLevel : [[String : String]] = [
["title": "高级经理人", ["title": "高级经理人",
"id": "1" "id": "1"
], ],
["title": "中级经理人", ["title": "中级经理人",
"id": "2" "id": "2"
], ],
["title": "初级经理人", ["title": "初级经理人",
"id": "3" "id": "3"
], ],
["title": "专业人士", ["title": "专业人士",
"id": "4" "id": "4"
], ],
["title": "半专业人士", ["title": "半专业人士",
"id": "5" "id": "5"
], ],
["title": "其他", ["title": "其他",
"id": "6" "id": "6"
] ]
] ]
static let arrProve : [[String : String]] = [ static let arrProve : [[String : String]] = [
["title": "盖章且签字的组织架构图和审计报告", ["title": "盖章且签字的组织架构图和审计报告",
"id": "盖章且签字的组织架构图和审计报告" "id": "盖章且签字的组织架构图和审计报告"
] ]
] ]
static let arrIdType : [[String : String]] = [ static let arrIdType : [[String : String]] = [
["title": "护照", ["title": "护照",
"id": "3" "id": "3"
], ],
["title": "外交护照", ["title": "外交护照",
"id": "4" "id": "4"
], ],
["title": "公务护照", ["title": "公务护照",
"id": "5" "id": "5"
], ],
["title": "中国发无国籍旅游证件", ["title": "中国发无国籍旅游证件",
"id": "6" "id": "6"
], ],
["title": "旅游通行证", ["title": "旅游通行证",
"id": "7" "id": "7"
], ],
["title": "联合国通行证", ["title": "联合国通行证",
"id": "8" "id": "8"
], ],
["title": "其他无国籍旅行证件", ["title": "其他无国籍旅行证件",
"id": "9" "id": "9"
], ],
["title": "其他", ["title": "其他",
"id": "10" "id": "10"
] ]
] ]
static let arrSex : [[String : String]] = [ static let arrSex : [[String : String]] = [
["title": "男", ["title": "男",
"id": "1" "id": "1"
], ],
["title": "女", ["title": "女",
"id": "2" "id": "2"
] ]
] ]
static let arrMarry : [[String : String]] = [ static let arrMarry : [[String : String]] = [
["title": "已婚", ["title": "已婚",
"id": "0" "id": "0"
], ],
["title": "未婚", ["title": "未婚",
"id": "1" "id": "1"
], ],
["title": "离婚", ["title": "离婚",
"id": "2" "id": "2"
], ],
["title": "分居", ["title": "分居",
"id": "3" "id": "3"
], ],
["title": "丧偶", ["title": "丧偶",
"id": "4" "id": "4"
] ]
] ]
} }
...@@ -306,31 +322,34 @@ extension YHOtherInfoFillViewModel { ...@@ -306,31 +322,34 @@ extension YHOtherInfoFillViewModel {
//获取其他资料信息 //获取其他资料信息
func getOtherInfo( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) { func getOtherInfo( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
// createOrgBasiceInfoData()
// callBackBlock(true,nil)//先返回数据 让界面展示相关的UI
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Order.otherInfoFillApi let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Order.otherInfoFillApi
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
printLog("model 是 ==> \(json)")
let dic = json.data
guard let resultModel = YHOtherInfoFillModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
callBackBlock(false,nil)
return
}
if resultModel.residences.isEmpty { if json.code == 200 {
resultModel.residences.append(Residence()) let dic = json.data
guard let resultModel = YHOtherInfoFillModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
callBackBlock(false,nil)
return
}
if resultModel.residences.isEmpty {
resultModel.residences.append(Residence())
}
self.otherInfoFillData = resultModel
handleData()
//根据返回值 组装 真实的数据
callBackBlock(true,nil)
} else {
let err : YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
callBackBlock(false,err)
} }
self.otherInfoFillData = resultModel
handleData()
//根据返回值 组装 真实的数据
callBackBlock(true,nil)
} failBlock: { err in } failBlock: { err in
callBackBlock(false,err) callBackBlock(false,err)
} }
......
...@@ -11,78 +11,41 @@ import UIKit ...@@ -11,78 +11,41 @@ import UIKit
*其他信息 预览 *其他信息 预览
*/ */
class YHPreviewOtherInformationViewController: YHPreviewBaseViewController { class YHPreviewOtherInformationViewController: YHPreviewBaseViewController {
var arrData : [YHPreviewInfoSessionModel] = [] // var arrData : [YHPreviewInfoSessionModel] = []
private let previewVM : YHPreviewViewModel = YHPreviewViewModel()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
setupUI() setupUI()
loadData()
} }
} }
private extension YHPreviewOtherInformationViewController { private extension YHPreviewOtherInformationViewController {
func installData() {
do {
//居住信息
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "开始时间:", answer: "1990年8月")
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "结束时间:", answer: "2013年7月")
let model0 = YHPersonInfoCellModel1(cellTitle: "国家1:中国", cellData: [tmp0,tmp1])
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "开始时间:", answer: "1990年8月")
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "结束时间:", answer: "2013年7月")
let model1 = YHPersonInfoCellModel1(cellTitle: "国家1:中国2", cellData: [tmp2,tmp3])
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "开始时间:", answer: "1990年8月")
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "结束时间:", answer: "2013年7月")
let model2 = YHPersonInfoCellModel1(cellTitle: "国家1:中国3", cellData: [tmp4,tmp5])
let arr = [model0,model1,model2]
let model3 = YHPreviewInfoSessionModel(cellType: .idCardInfoType, cellTitle: "居住信息", cellData1: arr)
arrData.append(model3)
}
do {
//语言能力
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "中文及英文", answer: "国外大学(英语国家)毕业,英文授课,获得学位证。(如为中外联合办学,在中国上课的,不算)")
let arr = [tmp0]
let model1 = YHPreviewInfoSessionModel(cellType: .questionAndAnswer, cellTitle: "语言能力", cellData0: arr)
arrData.append(model1)
}
do {
//专业技能行业
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "1、最能代表你的专业技能的行业是?(单选)", answer: "无",remark: "我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业我的自定义专业")
let arr = [tmp0]
let model1 = YHPreviewInfoSessionModel(cellType: .questionAndAnswer, cellTitle: "专业技能行业", cellData0: arr)
arrData.append(model1)
}
do {
//专业技能行业
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "1、您是否有行业内的专业资格证书?", answer: "否")
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "2、您是否在期刊或杂志上发表论文、文章、书籍等(与工作、资质有关的)?", answer: "是")
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "3、您是否有大学奖学金证明、专利证书、获奖证书(工作单位颁发的可以)?", answer: "是")
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "4、您是否被媒体采访过,专访您的文章被发表在杂志上或网络上?", answer: "是")
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "5、专业奖项:", answer: "这里是一片文案说明说明示例,这里是一片文案说明说明示例,这里是一片文案说明说明示例,这里是一片文案说明说明示例,这里是一片文案说明说明示例,这里是一片文案说明说明示例")
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "6、学业奖项:", answer: "--")
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "7、其他资料:", answer: "这里是一片文案说明说明示例,这里是一片文案说明说明示例,这里是一片文案说明说明示例,这里是一片文案说明说明示例,这里是一片文案说明说明示例,这里是一片文案说明。")
let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6]
let model1 = YHPreviewInfoSessionModel(cellType: .questionAndAnswer, cellTitle: "辅助资料", cellData0: arr)
arrData.append(model1)
}
}
func setupUI() { func setupUI() {
installData() // installData()
self.homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier) self.homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier)
self.homeTableView.reloadData() self.homeTableView.reloadData()
} }
private func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
previewVM.getPreviewForOtherInfo(params: ["order_id" : orderID]) { success, error in
if success == true {
} else {
}
self.homeTableView.reloadData()
}
} else {
printLog("error : orderID 为空")
}
}
} }
...@@ -90,13 +53,13 @@ private extension YHPreviewOtherInformationViewController { ...@@ -90,13 +53,13 @@ private extension YHPreviewOtherInformationViewController {
// MARK: - UITableViewDelegate 和 UITableViewDataSource // MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHPreviewOtherInformationViewController { extension YHPreviewOtherInformationViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return arrData.count return previewVM.arrDataForOtherInfo.count
} }
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHPreviewInfoCell.self) let cell = tableView.dequeueReusableCell(withClass: YHPreviewInfoCell.self)
cell.selectionStyle = .none cell.selectionStyle = .none
cell.model = arrData[indexPath.row] cell.model = previewVM.arrDataForOtherInfo[indexPath.row]
return cell return cell
} }
} }
//
// YHPreviewForOtherInfoModel.swift
// galaxy
//
// Created by davidhuangA on 2024/3/3.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
struct YHPreviewForOtherInfoModel: SmartCodable {
var list: [Residence]?
var language: LanguageDetail?
var profession: Profession?
var question: Question?
}
//
// YHPreviewViewModel.swift
// galaxy
//
// Created by davidhuangA on 2024/3/3.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPreviewViewModel: YHBaseViewModel {
//其他信息 预览
private var otherInfoPreviewModel : YHPreviewForOtherInfoModel?
var arrDataForOtherInfo : [YHPreviewInfoSessionModel] = []
//
}
extension YHPreviewViewModel {
//获取其他信息预览 数据
func getPreviewForOtherInfo( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Preview.PreviewOtherInfoApi
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let resultModel = YHPreviewForOtherInfoModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
callBackBlock(false,nil)
return
}
self.otherInfoPreviewModel = resultModel
installDataForOtherInfo()
//根据返回值 组装 真实的数据
callBackBlock(true,nil)
} else {
let err : YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
}
private extension YHPreviewViewModel {
func installDataForOtherInfo() {
guard let model = otherInfoPreviewModel else {
return
}
handleDataForOtherInfo()
do {
if let arr1 = model.list,arr1.isEmpty == false {
var arr : [YHPersonInfoCellModel1] = []
for (index,item) in arr1.enumerated() {
//居住信息
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "开始时间:", answer: item.start_time)
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "结束时间:", answer: item.end_time)
let title = "国家" + String(index + 1) + ":" + item.country
let model0 = YHPersonInfoCellModel1(cellTitle: title, cellData: [tmp0,tmp1])
arr.append(model0)
}
let model3 = YHPreviewInfoSessionModel(cellType: .idCardInfoType, cellTitle: "居住信息", cellData1: arr)
arrDataForOtherInfo.append(model3)
}
}
do {
//语言能力
if let model = otherInfoPreviewModel?.language {
let tmp0 = YHPreviewQuestionAndAnswerModel(question: model.levelDes, answer: model.remark)
let arr = [tmp0]
let model1 = YHPreviewInfoSessionModel(cellType: .questionAndAnswer, cellTitle: "语言能力", cellData0: arr)
arrDataForOtherInfo.append(model1)
}
}
do {
//专业技能行业
if let model = otherInfoPreviewModel?.profession {
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "1、最能代表你的专业技能的行业是?(单选)", answer: model.optionDes,remark: model.remark)
let arr = [tmp0]
let model1 = YHPreviewInfoSessionModel(cellType: .questionAndAnswer, cellTitle: "专业技能行业", cellData0: arr)
arrDataForOtherInfo.append(model1)
}
}
do {
//其他问题
if let model = otherInfoPreviewModel?.question {
let tmp0 = YHPreviewQuestionAndAnswerModel(question: "1、您是否有行业内的专业资格证书?", answer: model.professional_qualification == 1 ? "是" : "否")
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "2、您是否在期刊或杂志上发表论文、文章、书籍等(与工作、资质有关的)?", answer: model.paper == 1 ? "是" : "否")
let tmp2 = YHPreviewQuestionAndAnswerModel(question: "3、您是否有大学奖学金证明、专利证书、获奖证书(工作单位颁发的可以)?", answer: model.scholarship == 1 ? "是" : "否")
let tmp3 = YHPreviewQuestionAndAnswerModel(question: "4、您是否被媒体采访过,专访您的文章被发表在杂志上或网络上?", answer: model.media_interview == 1 ? "是" : "否")
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "5、专业奖项:", answer: model.professional_awards)
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "6、学业奖项:", answer: model.academic_awards)
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "7、其他资料:", answer: model.other_information)
let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6]
let model1 = YHPreviewInfoSessionModel(cellType: .questionAndAnswer, cellTitle: "辅助资料", cellData0: arr)
arrDataForOtherInfo.append(model1)
}
}
}
}
extension YHPreviewViewModel {
func handleDataForOtherInfo() {
if let language = otherInfoPreviewModel?.language {
if language.level > 0 {
let target = String(language.level)
for(_,item) in YHOtherInfoFillViewModel.arrLanguage.enumerated() {
if target == item["id"] {
language.levelDes = item["title"] ?? "--"
language.remark = item["dec"] ?? "--"
break
}
}
}
}
if let profession = otherInfoPreviewModel?.profession {
if profession.option > 0 {
let target = String(profession.option)
for(_,item) in YHOtherInfoFillViewModel.arrSkill.enumerated() {
if target == item["value"] {
profession.optionDes = item["title"] ?? "--"
break
}
}
}
}
}
}
...@@ -159,4 +159,10 @@ class YHAllApiName { ...@@ -159,4 +159,10 @@ class YHAllApiName {
struct User { struct User {
static let verifyCode = "user/verify-code" static let verifyCode = "user/verify-code"
} }
struct Preview {
static let PreviewOtherInfoApi = "infoflow/residence/preview"
}
} }
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