Commit 3b051ab7 authored by Steven杜宇's avatar Steven杜宇

// 家庭信息确认

parent db99e379
......@@ -41,6 +41,9 @@
04213B332C4A084600797900 /* YHHomeInfoClassifyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04213B322C4A084600797900 /* YHHomeInfoClassifyModel.swift */; };
04213B352C4F85A900797900 /* YHHomeLifeCategoryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04213B342C4F85A900797900 /* YHHomeLifeCategoryModel.swift */; };
04213B372C4F87C600797900 /* YHHomeLifeCategoryDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04213B362C4F87C600797900 /* YHHomeLifeCategoryDetailModel.swift */; };
04256DD02C7041C700A37BA4 /* YHInfoItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DCF2C7041C700A37BA4 /* YHInfoItemView.swift */; };
04256DD22C704A3000A37BA4 /* YHIFamilyInfoListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DD12C704A3000A37BA4 /* YHIFamilyInfoListCell.swift */; };
04256DD42C70538400A37BA4 /* YHFamilyInfoUpdateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DD32C70538400A37BA4 /* YHFamilyInfoUpdateViewController.swift */; };
0425E63D2BA9345200A5E763 /* YHSchemeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */; };
0425E6402BA9357D00A5E763 /* YHScemeItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63F2BA9357D00A5E763 /* YHScemeItemModel.swift */; };
0425E6422BA95B1B00A5E763 /* YHSchemeTableFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E6412BA95B1B00A5E763 /* YHSchemeTableFooterView.swift */; };
......@@ -699,6 +702,9 @@
04213B322C4A084600797900 /* YHHomeInfoClassifyModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeInfoClassifyModel.swift; sourceTree = "<group>"; };
04213B342C4F85A900797900 /* YHHomeLifeCategoryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeLifeCategoryModel.swift; sourceTree = "<group>"; };
04213B362C4F87C600797900 /* YHHomeLifeCategoryDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeLifeCategoryDetailModel.swift; sourceTree = "<group>"; };
04256DCF2C7041C700A37BA4 /* YHInfoItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInfoItemView.swift; sourceTree = "<group>"; };
04256DD12C704A3000A37BA4 /* YHIFamilyInfoListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIFamilyInfoListCell.swift; sourceTree = "<group>"; };
04256DD32C70538400A37BA4 /* YHFamilyInfoUpdateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyInfoUpdateViewController.swift; sourceTree = "<group>"; };
0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableViewCell.swift; sourceTree = "<group>"; };
0425E63F2BA9357D00A5E763 /* YHScemeItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScemeItemModel.swift; sourceTree = "<group>"; };
0425E6412BA95B1B00A5E763 /* YHSchemeTableFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableFooterView.swift; sourceTree = "<group>"; };
......@@ -2247,6 +2253,8 @@
049D62C42C6F272800E811A1 /* YHRiskWarningCell.swift */,
049D62C62C6F2F4F00E811A1 /* YHApproverInfoVerifyCell.swift */,
04506F542C6F57E600738EA1 /* YHFamilyMemberInfoCell.swift */,
04256DD12C704A3000A37BA4 /* YHIFamilyInfoListCell.swift */,
04256DCF2C7041C700A37BA4 /* YHInfoItemView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -2262,6 +2270,7 @@
isa = PBXGroup;
children = (
049D62C12C6F258700E811A1 /* YHFamilyInfoConfirmViewController.swift */,
04256DD32C70538400A37BA4 /* YHFamilyInfoUpdateViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -3781,6 +3790,7 @@
0419A0A02C48FC7D00A5FCFA /* YHInvitationWithGiftsSecondTableViewCell.swift in Sources */,
045EEEC72B9F171A0022A143 /* YHOtherYesOrNoItemView.swift in Sources */,
A5FF0F3E2C32F2590069852B /* YHActivityDetailCell2.swift in Sources */,
04256DD42C70538400A37BA4 /* YHFamilyInfoUpdateViewController.swift in Sources */,
04FD85702C21646200BEF9C5 /* YHMyInterestTopicCell.swift in Sources */,
04A7BD172BA43A0F00BD35A2 /* YHMyDocumentsDetailViewModel.swift in Sources */,
045EEEB32B9F171A0022A143 /* YHWorkFileSyncTableViewCell.swift in Sources */,
......@@ -3982,6 +3992,7 @@
A5FF0F3C2C32F2460069852B /* YHActivityDetailCell1.swift in Sources */,
045EEF232B9F171A0022A143 /* YHItemView.swift in Sources */,
04754A952B96FF3D00F8ADCA /* UITextField+Extension.swift in Sources */,
04256DD02C7041C700A37BA4 /* YHInfoItemView.swift in Sources */,
A5ACE9312B4564F7002C94D2 /* YHPersonalCenterCell.swift in Sources */,
045EEE9A2B9F171A0022A143 /* YHWorkIntroductionViewModel.swift in Sources */,
044D0C1C2C22C30B00C5CF5E /* YHEditSchoolViewController.swift in Sources */,
......@@ -4083,6 +4094,7 @@
048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */,
047AA3F82C5CC7B0009C4554 /* YHShareStepView.swift in Sources */,
04AD31792C23FFC700DF5655 /* YHInterestModel.swift in Sources */,
04256DD22C704A3000A37BA4 /* YHIFamilyInfoListCell.swift in Sources */,
A596CADF2C6B9B3D00F85797 /* YHHomeAlertViewManager.swift in Sources */,
04EA23082BB50753009DA928 /* YHDocumentMessageTableViewCell.swift in Sources */,
045EEE8E2B9F171A0022A143 /* YHPreviewInfoWorkSummaryView.swift in Sources */,
......
......@@ -15,7 +15,7 @@ class YHFamilyInfoConfirmViewController: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 16.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.estimatedSectionFooterHeight = 0.01
tableView.contentInsetAdjustmentBehavior = .never
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
......@@ -52,7 +52,7 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHRiskWarningCell.cellReuseIdentifier, for: indexPath)
// let cell = tableView.dequeueReusableCell(withIdentifier: YHRiskWarningCell.cellReuseIdentifier, for: indexPath)
if 0 <= indexPath.section && indexPath.section < items.count {
if indexPath.section == 0 {
......@@ -82,20 +82,18 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
return 0.01
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
view.backgroundColor = .blue
return view
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
view.backgroundColor = .yellow
return view
}
}
//
// YHFamilyInfoUpdateViewController.swift
// galaxy
//
// Created by edy on 2024/8/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
enum YHFamilyMemberRelationType: Int {
case none = 0
case mainApplicant = 1
case spouse = 2
case child = 3
}
class YHFamilyInfoUpdateViewController: YHBaseViewController {
var relation:YHFamilyMemberRelationType = .mainApplicant
var items: [[YHFamilyInfoItem]] = []
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 16.0
tableView.estimatedSectionFooterHeight = 0.01
tableView.contentInsetAdjustmentBehavior = .never
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = UIColor(hex: 0xF8F9FB)
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHIFamilyInfoListCell.self, forCellReuseIdentifier: YHIFamilyInfoListCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
self.gk_navTitle = "家庭信息确认"
self.view.backgroundColor = .white
self.view.addSubview(self.tableView)
self.tableView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar+16)
}
self.getData()
}
func getData() {
var isEditMode = false
var isShowPreviousInfo = false
// arr1 信息核实
var arr1 = [YHFamilyInfoItem]()
if self.relation == .mainApplicant {
let mainApplicantNameInfo = YHFamilyInfoItem(id: .mainApplicantName,
action: .edit,
isMust: true,
title: "主申请人姓名",
detail: "张全蛋",
previousTitle: "原主申人姓名",
previousDetail: "张晓丹",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(mainApplicantNameInfo)
} else if self.relation == .spouse {
let spouseNameInfo = YHFamilyInfoItem(id: .spouseName,
action: .edit,
isMust: true,
title: "配偶姓名",
detail: "李斯",
previousTitle: "原配偶姓名",
previousDetail: "张晓丹",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(spouseNameInfo)
} else if self.relation == .child {
let childNameInfo = YHFamilyInfoItem(id: .childName,
action: .edit,
isMust: true,
title: "子女姓名",
detail: "张晓蛋",
previousTitle: "原子女姓名",
previousDetail: "张晓丹",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(childNameInfo)
}
let firstNameInfo = YHFamilyInfoItem(id: .firstName,
action: .edit,
isMust: true,
title: "姓(拼音)",
detail: "ZH",
previousTitle: "原姓(拼音)",
previousDetail: "ZHANG",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(firstNameInfo)
let lastNameInfo = YHFamilyInfoItem(id: .lastName,
action: .edit,
isMust: true,
title: "名(拼音)",
detail: "ZHANGZ",
previousTitle: "原名(拼音)",
previousDetail: "ZHANG",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(lastNameInfo)
if self.relation != .child { // 子女无婚姻状况一栏
let marriageInfo = YHFamilyInfoItem(id: .marriage,
action: .select,
isMust: true,
title: "婚姻状况",
detail: "已婚",
previousTitle: "原婚姻状况",
previousDetail: "未婚",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(marriageInfo)
}
let birthNationInfo = YHFamilyInfoItem(id: .birthNation,
action: .choice,
isMust: true,
title: "出生国家/地区",
detail: "国内",
previousTitle: "原出生国家/地区",
previousDetail: "国内",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(birthNationInfo)
let birthPlaceInfo = YHFamilyInfoItem(id: .birthPlace,
action: .edit,
isMust: true,
title: "出生地",
detail: "上海市市辖区",
previousTitle: "原出生地",
previousDetail: "上海市市辖区",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(birthPlaceInfo)
let declareNationInfo = YHFamilyInfoItem(id: .declareNation,
action: .edit,
isMust: true,
title: "申报国籍",
detail: "中国-CHINA",
previousTitle: "原申报国籍",
previousDetail: "中国-CHINA",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(declareNationInfo)
let occupationInfo = YHFamilyInfoItem(id: .occupation,
action: .edit,
isMust: true,
title: "职业",
detail: "总监",
previousTitle: "原职业",
previousDetail: "总监",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(occupationInfo)
let hongkongIdInfo = YHFamilyInfoItem(id: .hongKongId,
action: .edit,
isMust: true,
title: "香港身份证号",
detail: "3231235123512",
previousTitle: "原香港身份证号",
previousDetail: "1235235346523452",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr1.append(hongkongIdInfo)
// arr2 递交证件信息
var arr2 = [YHFamilyInfoItem]()
let travelCerInfo = YHFamilyInfoItem(id: .travelCertificateType,
action: .select,
isMust: true,
title: "申报旅行证件",
detail: "港澳通行证",
previousTitle: "原申报旅行证件",
previousDetail: "港澳通行证",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr2.append(travelCerInfo)
let cerIdInfo = YHFamilyInfoItem(id: .travelCertificateId,
action: .edit,
isMust: true,
title: "证件号",
detail: "2351235234523542",
previousTitle: "原证件号",
previousDetail: "2351235234523542",
isEditMode: isEditMode,
isShowPreviousInfo: isShowPreviousInfo)
arr2.append(cerIdInfo)
items.append(contentsOf: [arr1, arr2])
self.tableView.reloadData()
}
}
extension YHFamilyInfoUpdateViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHIFamilyInfoListCell.cellReuseIdentifier, for: indexPath) as! YHIFamilyInfoListCell
if indexPath.row == 0 {
// 标题
var title: ASAttributedString = .init("信息核实", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
cell.titleLabel.attributed.text = title
} else {
let title: ASAttributedString = .init("递交证件信息", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
let subtitle: ASAttributedString = .init("(如需更换,请联系您的生活管家)", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor(alpha: 0.5)))
cell.titleLabel.attributed.text = title + subtitle
}
if 0 <= indexPath.row && indexPath.row < items.count {
let arr = items[indexPath.row]
cell.updateItems(arr)
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 0.01
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
return view
}
}
......@@ -88,7 +88,7 @@ class YHApproverInfoVerifyCell: UITableViewCell {
tableView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.height.equalTo(memberRowHeight * Double(items.count))
make.height.equalTo(memberRowHeight * Double(items.count) + 4.0)
make.left.right.bottom.equalToSuperview()
}
tableView.reloadData()
......@@ -132,13 +132,11 @@ extension YHApproverInfoVerifyCell: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
view.backgroundColor = .red
return view
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
view.backgroundColor = .green
return view
}
}
......@@ -51,7 +51,7 @@ class YHFamilyMemberInfoCell: UITableViewCell {
}()
lazy var arrowImgView: UIImageView = {
let view = UIImageView(image: UIImage(named: "family_info_arrow"))
let view = UIImageView(image: UIImage(named: "family_info_status_arrow"))
return view
}()
......
//
// YHIFamilyInfoListCell.swift
// galaxy
//
// Created by edy on 2024/8/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
enum YHFamilyInfoType: Int {
case none = 0
case mainApplicantName = 1
case firstName = 2
case lastName = 3
case marriage = 4
case birthNation = 5
case birthPlace = 6
case declareNation = 7
case occupation = 8
case hongKongId = 9
case travelCertificateType = 10
case travelCertificateId = 11
case childName = 12
case spouseName = 13
}
enum YHFamilyInfoActionType: Int {
case none = 0
case edit = 1 // 输入框编辑
case select = 2 // 弹出弹窗选择
case choice = 3 // 按钮多项选择
}
class YHFamilyInfoItem {
var id: YHFamilyInfoType = .none
var action:YHFamilyInfoActionType = .none
var isMust: Bool = false
var title: String = ""
var detail: String = ""
var previousTitle: String = ""
var previousDetail: String = ""
var isEditMode: Bool = false
var isShowPreviousInfo: Bool = false
init(id: YHFamilyInfoType, action: YHFamilyInfoActionType, isMust: Bool, title: String, detail: String, previousTitle: String, previousDetail: String, isEditMode: Bool, isShowPreviousInfo: Bool) {
self.id = id
self.action = action
self.isMust = isMust
self.title = title
self.detail = detail
self.previousTitle = previousTitle
self.previousDetail = previousDetail
self.isEditMode = isEditMode
self.isShowPreviousInfo = isShowPreviousInfo
}
}
class YHIFamilyInfoListCell: UITableViewCell {
static let cellReuseIdentifier = "YHIFamilyInfoListCell"
lazy var whiteView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
return label
}()
lazy var modifyBtn: UIButton = {
let btn = UIButton()
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.titleLabel?.textColor = .brandMainColor
btn.setTitle("修改", for: .normal)
return btn
}()
lazy var itemsContentView: UIView = {
let view = UIView()
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
self.backgroundColor = .clear
self.contentView.backgroundColor = .clear
contentView.addSubview(whiteView)
whiteView.addSubview(titleLabel)
whiteView.addSubview(modifyBtn)
whiteView.addSubview(itemsContentView)
whiteView.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-16)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(18)
make.left.equalTo(18)
make.right.equalTo(-18)
}
modifyBtn.snp.makeConstraints { make in
make.top.equalTo(18)
make.right.equalTo(-18)
make.size.equalTo(CGSize(width: 28, height: 20))
}
itemsContentView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.left.equalTo(18)
make.right.equalTo(-18)
make.bottom.equalTo(0)
}
}
func updateItems(_ items:[YHFamilyInfoItem]) {
itemsContentView.removeSubviews()
var lastItemView:YHInfoItemView? = nil
for (index, item) in items.enumerated() {
let itemView = YHInfoItemView(frame: .zero)
itemsContentView.addSubview(itemView)
itemView.updateItem(item)
itemView.snp.makeConstraints { make in
make.left.right.equalTo(0)
if let lastView = lastItemView {
make.top.equalTo(lastView.snp.bottom)
} else {
make.top.equalTo(itemsContentView.snp.top)
}
if index == items.count-1 {
make.bottom.equalTo(itemsContentView.snp.bottom)
}
}
lastItemView = itemView
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
//
// YHInfoItemView.swift
// galaxy
//
// Created by edy on 2024/8/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHInfoItemView: UIView {
var rightBtnWidth = 28.0
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
lazy var detailLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_M(ofSize: 14)
label.text = "张全蛋"
label.textColor = UIColor.mainTextColor
return label
}()
lazy var rightBtn: UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named: "family_info_del"), for: .normal)
return btn
}()
lazy var previousContentView: UIView = {
let view = UIView()
view.layer.cornerRadius = kCornerRadius6
view.backgroundColor = UIColor(hex: 0xF8F9FB)
view.clipsToBounds = true
return view
}()
lazy var previousTitleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.text = "原主申人姓名"
label.textColor = UIColor.mainTextColor(alpha: 0.3)
return label
}()
lazy var previousDetailLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_M(ofSize: 12)
label.text = "张全蛋"
label.textColor = UIColor.mainTextColor(alpha: 0.3)
return label
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(lineView)
self.addSubview(titleLabel)
self.addSubview(detailLabel)
self.addSubview(rightBtn)
self.addSubview(previousContentView)
previousContentView.addSubview(previousTitleLabel)
previousContentView.addSubview(previousDetailLabel)
lineView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(0.5)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(0)
make.height.equalTo(20)
make.width.equalTo(122)
}
detailLabel.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(titleLabel.snp.right)
make.right.equalTo(-18.0-rightBtnWidth-18.0)
}
rightBtn.snp.makeConstraints { make in
make.top.equalTo(16)
make.width.height.equalTo(22)
make.right.equalTo(0)
}
previousContentView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(-16)
make.top.equalTo(detailLabel.snp.bottom).offset(16)
}
previousTitleLabel.snp.makeConstraints { make in
make.left.equalTo(12)
make.top.equalTo(12)
make.width.equalTo(110)
}
previousDetailLabel.snp.makeConstraints { make in
make.left.equalTo(previousTitleLabel.snp.right).offset(0)
make.top.equalTo(12)
make.right.equalTo(-18)
make.bottom.equalTo(-12)
}
}
func updateItem(_ item: YHFamilyInfoItem) {
// 标题
var title: ASAttributedString = .init("\(item.title)", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
// 是否必填
if item.isMust {
let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.failColor))
title = mustTag + title
}
titleLabel.attributed.text = title
detailLabel.text = item.detail
rightBtn.isHidden = !item.isEditMode
previousTitleLabel.text = item.previousTitle
previousDetailLabel.text = item.previousDetail
previousContentView.isHidden = !item.isShowPreviousInfo
detailLabel.snp.updateConstraints { make in
make.right.equalTo(item.isEditMode ? -18.0-rightBtnWidth-18.0 : 0)
}
previousContentView.snp.remakeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(item.isShowPreviousInfo ? -16 : 0)
if !item.isShowPreviousInfo {
make.height.equalTo(0)
}
make.top.equalTo(detailLabel.snp.bottom).offset(16)
}
}
}
......@@ -338,7 +338,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
}
if true {
let vc = YHFamilyInfoConfirmViewController()
let vc = YHFamilyInfoUpdateViewController()
self.navigationController?.pushViewController(vc)
return
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "箭头中@2x.png",
"filename" : "Group 2848@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "箭头中@3x.png",
"filename" : "Group 2848@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2848@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2848@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "箭头中@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "箭头中@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