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

修改 个人信息预览

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