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

修改 个人信息预览

parent f7c7059f
This diff is collapsed.
...@@ -59,14 +59,14 @@ extension YHBasicInfoFillCell { ...@@ -59,14 +59,14 @@ extension YHBasicInfoFillCell {
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
} }
let sessionView = YHPersonInfoSessionView() let sessionView = YHPreviewInfoTitleView()
sessionView.updateTitle(title: dataModel.sessionTitle) sessionView.updateTitle(title: dataModel.sessionTitle)
holdView1.addSubview(sessionView) holdView1.addSubview(sessionView)
sessionView.snp.makeConstraints { make in sessionView.snp.makeConstraints { make in
make.top.equalToSuperview() make.top.equalToSuperview()
make.right.equalToSuperview().offset(-18) make.right.equalToSuperview().offset(-18)
make.left.equalToSuperview().offset(18) make.left.equalToSuperview().offset(18)
make.height.equalTo(YHPersonInfoSessionView.viewH) make.height.equalTo(YHPreviewInfoTitleView.viewH)
} }
......
...@@ -12,7 +12,7 @@ import JXSegmentedView ...@@ -12,7 +12,7 @@ import JXSegmentedView
*主申请人信息 *主申请人信息
*/ */
class YHMainApplicantInfoViewController: YHPersonInfoBaseViewController { class YHMainApplicantInfoViewController: YHPersonInfoBaseViewController {
var arrData : [YHPersonInfoCellModel] = [] var arrData : [YHPreviewInfoSessionModel] = []
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
setupUI() setupUI()
...@@ -25,62 +25,62 @@ private extension YHMainApplicantInfoViewController { ...@@ -25,62 +25,62 @@ private extension YHMainApplicantInfoViewController {
func installData() { func installData() {
do { do {
//国家信息 //国家信息
let tmp0 = YHPersonInfoBaseModel(name: "国家/国籍:", description: "中国-China") let tmp0 = YHPreviewInfoBaseModel(name: "国家/国籍:", description: "中国-China")
let tmp1 = YHPersonInfoBaseModel(name: "港澳通行证:", description: "未办理") let tmp1 = YHPreviewInfoBaseModel(name: "港澳通行证:", description: "未办理")
let arr = [tmp0,tmp1] let arr = [tmp0,tmp1]
let model1 = YHPersonInfoCellModel(cellType: 0, cellTitle: "国籍信息", cellData0: arr) let model1 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "国籍信息", cellData0: arr)
arrData.append(model1) arrData.append(model1)
} }
do { do {
//基本信息 //基本信息
let tmp0 = YHPersonInfoBaseModel(name: "主申请人:", description: "DavidHuang") let tmp0 = YHPreviewInfoBaseModel(name: "主申请人:", description: "DavidHuang")
let tmp1 = YHPersonInfoBaseModel(name: "曾用名:", description: "--") let tmp1 = YHPreviewInfoBaseModel(name: "曾用名:", description: "--")
let tmp2 = YHPersonInfoBaseModel(name: "婚前姓氏:", description: "--") let tmp2 = YHPreviewInfoBaseModel(name: "婚前姓氏:", description: "--")
let tmp3 = YHPersonInfoBaseModel(name: "出生日期:", description: "1990年8月18日") let tmp3 = YHPreviewInfoBaseModel(name: "出生日期:", description: "1990年8月18日")
let tmp4 = YHPersonInfoBaseModel(name: "出生城市:", description: "国内 吉林省/吉林市") let tmp4 = YHPreviewInfoBaseModel(name: "出生城市:", description: "国内 吉林省/吉林市")
let tmp5 = YHPersonInfoBaseModel(name: "性别:", description: "男") let tmp5 = YHPreviewInfoBaseModel(name: "性别:", description: "男")
let tmp6 = YHPersonInfoBaseModel(name: "婚姻状况:", description: "已婚") let tmp6 = YHPreviewInfoBaseModel(name: "婚姻状况:", description: "已婚")
let tmp7 = YHPersonInfoBaseModel(name: "手机号:", description: "13572984488") let tmp7 = YHPreviewInfoBaseModel(name: "手机号:", description: "13572984488")
let tmp8 = YHPersonInfoBaseModel(name: "邮箱:", description: "13572984488@nn.com") let tmp8 = YHPreviewInfoBaseModel(name: "邮箱:", description: "13572984488@nn.com")
let tmp9 = YHPersonInfoBaseModel(name: "现居住地址:", description: "现居住地址:现居住地址:现居住地址:现居住地址:现居住地址:现居住地址:") let tmp9 = YHPreviewInfoBaseModel(name: "现居住地址:", description: "现居住地址:现居住地址:现居住地址:现居住地址:现居住地址:现居住地址:")
let tmp10 = YHPersonInfoBaseModel(name: "详细地址:", description: "锐度公园世家北区10-1-701锐度公园世家北区10-1-701") let tmp10 = YHPreviewInfoBaseModel(name: "详细地址:", description: "锐度公园世家北区10-1-701锐度公园世家北区10-1-701")
let tmp11 = YHPersonInfoBaseModel(name: "是否办理过香港身份证:", description: "是") let tmp11 = YHPreviewInfoBaseModel(name: "是否办理过香港身份证:", description: "是")
let tmp12 = YHPersonInfoBaseModel(name: "香港身份证:", description: "否") let tmp12 = YHPreviewInfoBaseModel(name: "香港身份证:", description: "否")
let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,tmp12] let arr = [tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,tmp12]
let model2 = YHPersonInfoCellModel(cellType: 0, cellTitle: "基本信息", cellData0: arr) let model2 = YHPreviewInfoSessionModel(cellType: .countryInfoType, cellTitle: "基本信息", cellData0: arr)
arrData.append(model2) arrData.append(model2)
} }
do { do {
//证件信息 //证件信息
let tmp0 = YHPersonInfoBaseModel(name: "中国身份证号码:", description: "2203381990287633390") let tmp0 = YHPreviewInfoBaseModel(name: "中国身份证号码:", description: "2203381990287633390")
let tmp1 = YHPersonInfoBaseModel(name: "签发地:", description: "北京市分局") let tmp1 = YHPreviewInfoBaseModel(name: "签发地:", description: "北京市分局")
let tmp2 = YHPersonInfoBaseModel(name: "签发日期:", description: "2018-07-17") let tmp2 = YHPreviewInfoBaseModel(name: "签发日期:", description: "2018-07-17")
let tmp3 = YHPersonInfoBaseModel(name: "届满日期:", description: "2028-07-31") let tmp3 = YHPreviewInfoBaseModel(name: "届满日期:", description: "2028-07-31")
let model0 = YHPersonInfoCellModel1(cellTitle: "中国身份证", cellData: [tmp0,tmp1,tmp2,tmp3]) let model0 = YHPersonInfoCellModel1(cellTitle: "中国身份证", cellData: [tmp0,tmp1,tmp2,tmp3])
let tmp4 = YHPersonInfoBaseModel(name: "旅行社证件号码:", description: "c2345639") let tmp4 = YHPreviewInfoBaseModel(name: "旅行社证件号码:", description: "c2345639")
let tmp5 = YHPersonInfoBaseModel(name: "签发地:", description: "北京市分局") let tmp5 = YHPreviewInfoBaseModel(name: "签发地:", description: "北京市分局")
let tmp6 = YHPersonInfoBaseModel(name: "签发日期:", description: "2018-07-17") let tmp6 = YHPreviewInfoBaseModel(name: "签发日期:", description: "2018-07-17")
let tmp7 = YHPersonInfoBaseModel(name: "届满日期:", description: "2028-07-31") let tmp7 = YHPreviewInfoBaseModel(name: "届满日期:", description: "2028-07-31")
let model1 = YHPersonInfoCellModel1(cellTitle: "港澳通行证", cellData: [tmp4,tmp5,tmp6,tmp7]) let model1 = YHPersonInfoCellModel1(cellTitle: "港澳通行证", cellData: [tmp4,tmp5,tmp6,tmp7])
let tmp8 = YHPersonInfoBaseModel(name: "证件类别:", description: "护照") let tmp8 = YHPreviewInfoBaseModel(name: "证件类别:", description: "护照")
let tmp9 = YHPersonInfoBaseModel(name: "证件号码:", description: "p2345639") let tmp9 = YHPreviewInfoBaseModel(name: "证件号码:", description: "p2345639")
let tmp10 = YHPersonInfoBaseModel(name: "签发地:", description: "北京市分局") let tmp10 = YHPreviewInfoBaseModel(name: "签发地:", description: "北京市分局")
let tmp11 = YHPersonInfoBaseModel(name: "签发日期:", description: "2028-07-31") let tmp11 = YHPreviewInfoBaseModel(name: "签发日期:", description: "2028-07-31")
let tmp12 = YHPersonInfoBaseModel(name: "届满日期:", description: "2028-07-31") let tmp12 = YHPreviewInfoBaseModel(name: "届满日期:", description: "2028-07-31")
let model2 = YHPersonInfoCellModel1(cellTitle: "护照及其他旅行证件", cellData: [tmp8,tmp9,tmp10,tmp11,tmp12]) let model2 = YHPersonInfoCellModel1(cellTitle: "护照及其他旅行证件", cellData: [tmp8,tmp9,tmp10,tmp11,tmp12])
let arr = [model0,model1,model2] let arr = [model0,model1,model2]
let model3 = YHPersonInfoCellModel(cellType: 1, cellTitle: "证件信息", cellData1: arr) let model3 = YHPreviewInfoSessionModel(cellType: .idCardInfoType, cellTitle: "证件信息", cellData1: arr)
arrData.append(model3) arrData.append(model3)
} }
...@@ -91,7 +91,7 @@ private extension YHMainApplicantInfoViewController { ...@@ -91,7 +91,7 @@ private extension YHMainApplicantInfoViewController {
let model2 = YHPersonInfoCellModel2(cellTitle: "港澳通行证",frontUrl: "", backUrl: "", idType: 2) let model2 = YHPersonInfoCellModel2(cellTitle: "港澳通行证",frontUrl: "", backUrl: "", idType: 2)
let arr = [model1,model2] let arr = [model1,model2]
let model4 = YHPersonInfoCellModel(cellType: 2, cellTitle: "证件照片", cellData2: arr) let model4 = YHPreviewInfoSessionModel(cellType: .idPictureType, cellTitle: "证件照片", cellData2: arr)
arrData.append(model4) arrData.append(model4)
} }
} }
...@@ -99,7 +99,7 @@ private extension YHMainApplicantInfoViewController { ...@@ -99,7 +99,7 @@ private extension YHMainApplicantInfoViewController {
func setupUI() { func setupUI() {
installData() installData()
self.homeTableView.register(YHPersonInfoCommonCell.self,forCellReuseIdentifier: YHPersonInfoCommonCell.cellReuseIdentifier) self.homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier)
self.homeTableView.reloadData() self.homeTableView.reloadData()
} }
} }
...@@ -113,7 +113,7 @@ extension YHMainApplicantInfoViewController { ...@@ -113,7 +113,7 @@ extension YHMainApplicantInfoViewController {
} }
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHPersonInfoCommonCell.self) let cell = tableView.dequeueReusableCell(withClass: YHPreviewInfoCell.self)
cell.selectionStyle = .none cell.selectionStyle = .none
cell.model = arrData[indexPath.row] cell.model = arrData[indexPath.row]
return cell return cell
......
...@@ -11,5 +11,5 @@ import SmartCodable ...@@ -11,5 +11,5 @@ import SmartCodable
struct YHPersonInfoCellModel1: SmartCodable { struct YHPersonInfoCellModel1: SmartCodable {
var cellTitle : String = "" var cellTitle : String = ""
var cellData : [YHPersonInfoBaseModel] = [] var cellData : [YHPreviewInfoBaseModel] = []
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import UIKit import UIKit
import SmartCodable import SmartCodable
struct YHPersonInfoBaseModel: SmartCodable { struct YHPreviewInfoBaseModel: SmartCodable {
var name : String = "" var name : String = ""
var description : String = "" var description : String = ""
} }
...@@ -9,10 +9,18 @@ ...@@ -9,10 +9,18 @@
import UIKit import UIKit
import SmartCodable import SmartCodable
struct YHPersonInfoCellModel: SmartCodable { enum YHPreviewInfoSessionModelType: Int {
var cellType : Int = 0 // 0-国籍信息 类型 1-证件信息 类型 2-证件照片 类型 case countryInfoType = 0 //0-国籍信息 类型
case idCardInfoType = 1 //1-证件信息 类型
case idPictureType = 2 //2-证件照片 类型
}
struct YHPreviewInfoSessionModel {
var cellType : YHPreviewInfoSessionModelType = .countryInfoType
var cellTitle : String = "" var cellTitle : String = ""
var cellData0 : [YHPersonInfoBaseModel]? = nil var cellData0 : [YHPreviewInfoBaseModel]? = nil
var cellData1 : [YHPersonInfoCellModel1]? = nil var cellData1 : [YHPersonInfoCellModel1]? = nil
var cellData2 : [YHPersonInfoCellModel2]? = nil var cellData2 : [YHPersonInfoCellModel2]? = nil
} }
// //
// YHPersonInfoCommonCell.swift // YHPreviewInfoCommonCell.swift
// galaxy // galaxy
// //
// Created by davidhuangA on 2024/1/30. // Created by davidhuangA on 2024/1/30.
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
import UIKit import UIKit
class YHPersonInfoCommonCell: UITableViewCell { class YHPreviewInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHPersonInfoCommonCell" static let cellReuseIdentifier = "YHPreviewInfoCell"
var model : YHPersonInfoCellModel? { var model : YHPreviewInfoSessionModel? {
didSet{ didSet{
updateUI() updateUI()
} }
...@@ -30,34 +30,18 @@ class YHPersonInfoCommonCell: UITableViewCell { ...@@ -30,34 +30,18 @@ class YHPersonInfoCommonCell: UITableViewCell {
} }
private lazy var holdView : YHPersonInfoSessionHoldView = { private lazy var holdView : YHPreviewInfoHoldView = {
let contryInfoView = YHPersonInfoSessionHoldView() let contryInfoView = YHPreviewInfoHoldView()
return contryInfoView return contryInfoView
}() }()
override func layoutSubviews() {
super.layoutSubviews()
if holdView.superview != nil {
holdView.snp.makeConstraints { make in
make.top.equalTo(14)
make.left.bottom.equalToSuperview()
make.right.equalToSuperview().offset(-16)
}
}
}
} }
extension YHPersonInfoCommonCell { extension YHPreviewInfoCell {
func updateUI() { func updateUI() {
for item in holdView.subviews {
item.removeFromSuperview()
}
holdView.removeFromSuperview()
contentView.removeSubviews()
backgroundColor = .clear backgroundColor = .clear
contentView.backgroundColor = .clear contentView.backgroundColor = .clear
contentView.addSubview(holdView) contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in holdView.snp.makeConstraints { make in
make.top.equalTo(14) make.top.equalTo(14)
...@@ -65,24 +49,24 @@ extension YHPersonInfoCommonCell { ...@@ -65,24 +49,24 @@ extension YHPersonInfoCommonCell {
make.width.equalTo(contentView.snp.width) make.width.equalTo(contentView.snp.width)
} }
if model?.cellType == 0 { if model?.cellType == .countryInfoType {
guard let model = model else { return } guard let model = model else { return }
guard let arrData = model.cellData0,arrData.count > 0 else { return } guard let arrData = model.cellData0,arrData.count > 0 else { return }
let sessionView = YHPersonInfoSessionView() let sessionView = YHPreviewInfoTitleView()
sessionView.updateTitle(title: model.cellTitle) sessionView.updateTitle(title: model.cellTitle)
holdView.addSubview(sessionView) holdView.addSubview(sessionView)
sessionView.snp.makeConstraints { make in sessionView.snp.makeConstraints { make in
make.top.equalToSuperview() make.top.equalToSuperview()
make.right.equalToSuperview().offset(-18) make.right.equalToSuperview().offset(-18)
make.left.equalToSuperview().offset(18) make.left.equalToSuperview().offset(18)
make.height.equalTo(YHPersonInfoSessionView.viewH) make.height.equalTo(YHPreviewInfoTitleView.viewH)
} }
if arrData.count == 1 { if arrData.count == 1 {
let item = arrData[0] let item = arrData[0]
let cellView = YHPersonInfoCellView() let cellView = YHPreviewInfoNameAndSubNameView()
cellView.update(title: item.name, subtitle: item.description) cellView.update(title: item.name, subtitle: item.description)
holdView.addSubview(cellView) holdView.addSubview(cellView)
cellView.snp.makeConstraints { make in cellView.snp.makeConstraints { make in
...@@ -94,7 +78,7 @@ extension YHPersonInfoCommonCell { ...@@ -94,7 +78,7 @@ extension YHPersonInfoCommonCell {
} else { } else {
var tmp : UIView = sessionView var tmp : UIView = sessionView
for(index,item) in arrData.enumerated() { for(index,item) in arrData.enumerated() {
let cellView = YHPersonInfoCellView() let cellView = YHPreviewInfoNameAndSubNameView()
cellView.update(title: item.name, subtitle: item.description) cellView.update(title: item.name, subtitle: item.description)
holdView.addSubview(cellView) holdView.addSubview(cellView)
...@@ -117,20 +101,20 @@ extension YHPersonInfoCommonCell { ...@@ -117,20 +101,20 @@ extension YHPersonInfoCommonCell {
} }
} }
} }
else if model?.cellType == 1 { else if model?.cellType == .idCardInfoType {
guard let model = model else { return } guard let model = model else { return }
guard let arrData = model.cellData1,arrData.count > 0 else { return } guard let arrData = model.cellData1,arrData.count > 0 else { return }
let sessionView = YHPersonInfoSessionView() let sessionView = YHPreviewInfoTitleView()
sessionView.updateTitle(title: model.cellTitle) sessionView.updateTitle(title: model.cellTitle)
holdView.addSubview(sessionView) holdView.addSubview(sessionView)
sessionView.snp.makeConstraints { make in sessionView.snp.makeConstraints { make in
make.top.equalToSuperview() make.top.equalToSuperview()
make.right.equalToSuperview().offset(-18) make.right.equalToSuperview().offset(-18)
make.left.equalToSuperview().offset(18) make.left.equalToSuperview().offset(18)
make.height.equalTo(YHPersonInfoSessionView.viewH) make.height.equalTo(YHPreviewInfoTitleView.viewH)
} }
var tmp : UIView = sessionView var tmp : UIView = sessionView
...@@ -153,7 +137,7 @@ extension YHPersonInfoCommonCell { ...@@ -153,7 +137,7 @@ extension YHPersonInfoCommonCell {
let arrData0 = item0.cellData let arrData0 = item0.cellData
if arrData0.count > 0 { if arrData0.count > 0 {
for(index,item) in arrData0.enumerated() { for(index,item) in arrData0.enumerated() {
let cellView = YHPersonInfoCellView() let cellView = YHPreviewInfoNameAndSubNameView()
cellView.update(title: item.name, subtitle: item.description) cellView.update(title: item.name, subtitle: item.description)
holdView.addSubview(cellView) holdView.addSubview(cellView)
...@@ -211,19 +195,19 @@ extension YHPersonInfoCommonCell { ...@@ -211,19 +195,19 @@ extension YHPersonInfoCommonCell {
} }
} }
} }
else if model?.cellType == 2 { else if model?.cellType == .idPictureType {
guard let model = model else { return } guard let model = model else { return }
guard let arrData = model.cellData2,arrData.count > 0 else { return } guard let arrData = model.cellData2,arrData.count > 0 else { return }
let sessionView = YHPersonInfoSessionView() let sessionView = YHPreviewInfoTitleView()
sessionView.updateTitle(title: model.cellTitle) sessionView.updateTitle(title: model.cellTitle)
holdView.addSubview(sessionView) holdView.addSubview(sessionView)
sessionView.snp.makeConstraints { make in sessionView.snp.makeConstraints { make in
make.top.equalToSuperview() make.top.equalToSuperview()
make.right.equalToSuperview().offset(-18) make.right.equalToSuperview().offset(-18)
make.left.equalToSuperview().offset(18) make.left.equalToSuperview().offset(18)
make.height.equalTo(YHPersonInfoSessionView.viewH) make.height.equalTo(YHPreviewInfoTitleView.viewH)
} }
var tmp : UIView = sessionView var tmp : UIView = sessionView
...@@ -252,5 +236,9 @@ extension YHPersonInfoCommonCell { ...@@ -252,5 +236,9 @@ extension YHPersonInfoCommonCell {
tmp = view tmp = view
} }
} }
else {
}
} }
} }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class YHPersonInfoSessionHoldView: UIView { class YHPreviewInfoHoldView: UIView {
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
backgroundColor = .white backgroundColor = .white
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
import UIKit import UIKit
class YHPersonInfoCellView: UIView { class YHPreviewInfoNameAndSubNameView: UIView {
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
setupUI() setupUI()
...@@ -60,7 +60,7 @@ class YHPersonInfoCellView: UIView { ...@@ -60,7 +60,7 @@ class YHPersonInfoCellView: UIView {
} }
} }
extension YHPersonInfoCellView { extension YHPreviewInfoNameAndSubNameView {
func update(title : String,subtitle : String) { func update(title : String,subtitle : String) {
nameLable.text = title nameLable.text = title
subtitleLable.text = subtitle subtitleLable.text = subtitle
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class YHPersonInfoSessionView: UIView { class YHPreviewInfoTitleView: UIView {
static let viewH : CGFloat = 52 static let viewH : CGFloat = 52
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
...@@ -49,7 +49,7 @@ class YHPersonInfoSessionView: UIView { ...@@ -49,7 +49,7 @@ class YHPersonInfoSessionView: UIView {
} }
} }
extension YHPersonInfoSessionView { extension YHPreviewInfoTitleView {
func updateTitle(title : String) { func updateTitle(title : String) {
nameLable.text = title nameLable.text = title
} }
......
...@@ -39,7 +39,7 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD ...@@ -39,7 +39,7 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
// 加载网页的进度条 // 加载网页的进度条
progBar = UIProgressView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 30)) progBar = UIProgressView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 30))
progBar.progress = 0.0 progBar.progress = 0.0
progBar.tintColor = UIColor.red progBar.tintColor = UIColor.brandMainColor
webview.addSubview(progBar) webview.addSubview(progBar)
// 监听网页加载的进度 // 监听网页加载的进度
webview.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil) webview.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil)
......
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