Commit 2f8ad61f authored by David黄金龙's avatar David黄金龙

添加 主申请人信息 展示

parent 5e494916
......@@ -68,6 +68,7 @@
A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; };
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; };
A514E5DC2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */; };
A5167B272B692CF20084C08F /* YHPersonInfoIdentificationCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5167B262B692CF20084C08F /* YHPersonInfoIdentificationCardView.swift */; };
A53026902B4E6F2700F35102 /* YHHomeCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */; };
A5551FFE2B4C26CE00510980 /* YHBaseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */; };
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573ED12B317BFF00D98EC0 /* AppDelegate.swift */; };
......@@ -273,6 +274,7 @@
A51044172B493675006B60BB /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
A51044192B495DD0006B60BB /* UIView+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = "<group>"; };
A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterSecondViewController.swift; sourceTree = "<group>"; };
A5167B262B692CF20084C08F /* YHPersonInfoIdentificationCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPersonInfoIdentificationCardView.swift; sourceTree = "<group>"; };
A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeCustomCell.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; };
......@@ -1057,6 +1059,7 @@
A5FD63EE2B68902400D1D9DA /* YHPersonInfoCellView.swift */,
A5FD63F02B68963200D1D9DA /* YHPersonInfoSessionHoldView.swift */,
A5F78C812B68F39600EEA170 /* YHPersonInfoCommonCell.swift */,
A5167B262B692CF20084C08F /* YHPersonInfoIdentificationCardView.swift */,
);
path = "个人信息表";
sourceTree = "<group>";
......@@ -1346,6 +1349,7 @@
A5ACE9472B4564F7002C94D2 /* YHHUD.swift in Sources */,
A5ACE9412B4564F7002C94D2 /* Dictionary+Extension.swift in Sources */,
A5C5B3102B57677300A7C5D1 /* YHGestureTableView.swift in Sources */,
A5167B272B692CF20084C08F /* YHPersonInfoIdentificationCardView.swift in Sources */,
A5ACE9312B4564F7002C94D2 /* YHPersonalCenterCell.swift in Sources */,
A5ACE9532B4564F7002C94D2 /* YHBaseViewController.swift in Sources */,
042FBBC32B63DA4C00F9DE23 /* YHParentInfoVC.swift in Sources */,
......
......@@ -56,8 +56,8 @@ private extension YHMainApplicantInfoViewController {
let tmp0 = YHPersonInfoBaseModel(name: "国家/国籍:", description: "中国-China")
let tmp1 = YHPersonInfoBaseModel(name: "港澳通行证:", description: "未办理")
let arr = [tmp0,tmp1]
let model = YHPersonInfoCellModel(cellType: 0, cellTitle: "国籍信息", cellData0: arr)
arrData.append(model)
let model1 = YHPersonInfoCellModel(cellType: 0, cellTitle: "国籍信息", cellData0: arr)
arrData.append(model1)
}
do {
......@@ -111,6 +111,17 @@ private extension YHMainApplicantInfoViewController {
let model3 = YHPersonInfoCellModel(cellType: 1, cellTitle: "证件信息", cellData1: arr)
arrData.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 = YHPersonInfoCellModel(cellType: 2, cellTitle: "证件照片", cellData2: arr)
arrData.append(model4)
}
}
func setupUI() {
......
......@@ -10,7 +10,20 @@ import UIKit
import SmartCodable
struct YHPersonInfoCellModel2: SmartCodable {
var cellTitle : String = ""
var frontUrl : String = "" //正面url
var backUrl : String = "" //反面url
//1- 中国身份证 2-港澳通行证
var idType: Int = 1 {
didSet {
if idType == 1 {
cellTitle = "中国身份证"
} else if idType == 2 {
cellTitle = "港澳通行证"
}
}
}
}
......@@ -103,7 +103,8 @@ extension YHPersonInfoCommonCell {
tmp = cellView
}
}
} else if model?.cellType == 1 {
}
else if model?.cellType == 1 {
guard let model = model else { return }
guard let arrData = model.cellData1,arrData.count > 0 else { return }
......@@ -124,7 +125,6 @@ extension YHPersonInfoCommonCell {
lable.text = item0.cellTitle
lable.textColor = UIColor(hex: 0x222222)
lable.font = UIFont.PingFangScM(ofSize: 14)
// lable.backgroundColor = .red //for test hjl
holdView.addSubview(lable)
lable.snp.makeConstraints { make in
make.top.equalTo(tmp.snp.bottom).offset(18)
......@@ -149,13 +149,10 @@ extension YHPersonInfoCommonCell {
make.top.equalTo(tmp.snp.bottom).offset(10) //for test hjl
make.right.equalToSuperview().offset(-18)
make.left.equalToSuperview().offset(18)
// make.bottom.equalToSuperview().offset(-21)
}
} else if index == arrData0.count - 1 {
//最后一个
if index0 == arrData.count - 1 {
//最后一个cell
......@@ -170,13 +167,11 @@ extension YHPersonInfoCommonCell {
make.top.equalTo(tmp.snp.bottom)
make.right.equalToSuperview().offset(-18)
make.left.equalToSuperview().offset(18)
// make.bottom.equalToSuperview().offset(-21)
}
let bottomLine = UIView()
bottomLine.backgroundColor = UIColor(hex: 0xF0F0F0)
// bottomLine.backgroundColor = .blue//for test hjl
holdView.addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.top.equalTo(cellView.snp.bottom).offset(28)
......@@ -202,5 +197,46 @@ extension YHPersonInfoCommonCell {
}
}
}
else if model?.cellType == 2 {
guard let model = model else { return }
guard let arrData = model.cellData2,arrData.count > 0 else { return }
let sessionView = YHPersonInfoSessionView()
sessionView.updateTitle(title: model.cellTitle)
holdView.addSubview(sessionView)
sessionView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.right.equalToSuperview().offset(-18)
make.left.equalToSuperview().offset(18)
}
var tmp : UIView = sessionView
for (index0,item0) in arrData.enumerated() {
let view = YHPersonInfoIdentificationCardView()
view.dataModel = item0
holdView.addSubview(view)
if index0 == arrData.count - 1 {
view.snp.makeConstraints { make in
make.top.equalTo(tmp.snp.bottom)
make.right.equalToSuperview()
make.left.equalToSuperview()
make.bottom.equalToSuperview()
view.bottomLine.isHidden = true
}
} else {
view.snp.makeConstraints { make in
make.top.equalTo(tmp.snp.bottom)
make.right.equalToSuperview()
make.left.equalToSuperview()
}
view.bottomLine.isHidden = false
}
tmp = view
}
}
}
}
//
// YHPersonInfoIdentificationCardView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPersonInfoIdentificationCardView: UIView {
var dataModel : YHPersonInfoCellModel2? {
didSet {
updateUI()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private lazy var titleLable : UILabel = {
let lable = UILabel()
lable.textColor = UIColor(hex: 0x222222)
lable.font = UIFont.PingFangScM(ofSize: 14)
return lable
}()
private lazy var frontImagV : UIImageView = {
let lable = UIImageView()
lable.image = UIImage(named: "person_info_id_front")
lable.contentMode = .scaleAspectFit
lable.layer.cornerRadius = 6
lable.clipsToBounds = true
return lable
}()
private lazy var backImagV : UIImageView = {
let lable = UIImageView()
lable.image = UIImage(named: "person_info_id_back")
lable.contentMode = .scaleAspectFit
lable.layer.cornerRadius = 6
lable.clipsToBounds = true
return lable
}()
private lazy var subtitleFrontLable : UILabel = {
let lable = UILabel()
lable.textColor = UIColor(hex: 0x888F98)
lable.font = UIFont.PingFangScR(ofSize: 14)
lable.text = "身份证头像面"
lable.textAlignment = .center
return lable
}()
private lazy var subtitleBackLable : UILabel = {
let lable = UILabel()
lable.textColor = UIColor(hex: 0x888F98)
lable.font = UIFont.PingFangScR(ofSize: 14)
lable.text = "身份证国徽面"
lable.textAlignment = .center
return lable
}()
lazy var bottomLine : UIView = {
let lable = UIView()
lable.backgroundColor = UIColor(hex: 0xF0F0F0)
return lable
}()
}
extension YHPersonInfoIdentificationCardView {
func setupUI() {
addSubview(titleLable)
titleLable.snp.makeConstraints { make in
make.top.equalTo(18)
make.left.equalTo(18)
make.right.equalTo(-18)
make.height.equalTo(17)
}
addSubview(subtitleFrontLable)
subtitleFrontLable.snp.makeConstraints { make in
make.top.equalTo(titleLable.snp.bottom).offset(20)
make.height.equalTo(17)
make.left.equalTo(16)
make.right.equalTo(self.snp.centerX).offset(-4)
}
addSubview(frontImagV)
frontImagV.snp.makeConstraints { make in
make.top.equalTo(subtitleFrontLable.snp.bottom).offset(13)
make.height.equalTo(95)
make.left.equalTo(subtitleFrontLable.snp.left)
make.right.equalTo(subtitleFrontLable.snp.right)
}
addSubview(subtitleBackLable)
subtitleBackLable.snp.makeConstraints { make in
make.top.equalTo(titleLable.snp.bottom).offset(20)
make.height.equalTo(17)
make.right.equalTo(-18)
make.left.equalTo(self.snp.centerX).offset(4)
}
addSubview(backImagV)
backImagV.snp.makeConstraints { make in
make.top.equalTo(subtitleBackLable.snp.bottom).offset(13)
make.height.equalTo(95)
make.left.equalTo(subtitleBackLable.snp.left)
make.right.equalTo(subtitleBackLable.snp.right)
}
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.top.equalTo(backImagV.snp.bottom).offset(15)
make.height.equalTo(0.5)
make.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
}
}
extension YHPersonInfoIdentificationCardView {
func updateUI() {
guard let dataModel = dataModel else { return }
titleLable.text = dataModel.cellTitle
subtitleFrontLable.text = dataModel.idType == 1 ? "身份证头像面" : "港澳通行证正面"
subtitleBackLable.text = dataModel.idType == 1 ? "身份证国徽面" : "港澳通行证反面"
}
}
{
"images" : [
{
"filename" : "截屏2023-03-21 16.03 1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "截屏2023-03-21 16.03 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "截屏2023-03-21 16.03 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "截屏2023-03-21 16.11 1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "截屏2023-03-21 16.11 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "截屏2023-03-21 16.11 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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