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

基本资料填写

parent 7b9d2c43
...@@ -77,6 +77,10 @@ ...@@ -77,6 +77,10 @@
A514E5DC2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */; }; A514E5DC2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */; };
A5167B272B692CF20084C08F /* YHPersonInfoIdentificationCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5167B262B692CF20084C08F /* YHPersonInfoIdentificationCardView.swift */; }; A5167B272B692CF20084C08F /* YHPersonInfoIdentificationCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5167B262B692CF20084C08F /* YHPersonInfoIdentificationCardView.swift */; };
A5167B332B6A3A2D0084C08F /* YHPersonInfoBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5167B322B6A3A2D0084C08F /* YHPersonInfoBaseViewController.swift */; }; A5167B332B6A3A2D0084C08F /* YHPersonInfoBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5167B322B6A3A2D0084C08F /* YHPersonInfoBaseViewController.swift */; };
A5234E282B6E2EED00A33433 /* YHBasicInfoFillViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5234E272B6E2EED00A33433 /* YHBasicInfoFillViewController.swift */; };
A5234E2A2B6E349600A33433 /* YHBasicInfoFillBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5234E292B6E349600A33433 /* YHBasicInfoFillBottomView.swift */; };
A5234E2C2B6E3BA400A33433 /* YHBasicInfoFillCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5234E2B2B6E3BA400A33433 /* YHBasicInfoFillCell.swift */; };
A5234E2E2B6E43EA00A33433 /* YHBasicInfoFillView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5234E2D2B6E43EA00A33433 /* YHBasicInfoFillView.swift */; };
A53026902B4E6F2700F35102 /* YHHomeCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */; }; A53026902B4E6F2700F35102 /* YHHomeCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */; };
A5551FFE2B4C26CE00510980 /* YHBaseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */; }; A5551FFE2B4C26CE00510980 /* YHBaseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5551FFD2B4C26CE00510980 /* YHBaseViewModel.swift */; };
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573ED12B317BFF00D98EC0 /* AppDelegate.swift */; }; A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573ED12B317BFF00D98EC0 /* AppDelegate.swift */; };
...@@ -293,6 +297,10 @@ ...@@ -293,6 +297,10 @@
A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterSecondViewController.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>"; }; A5167B262B692CF20084C08F /* YHPersonInfoIdentificationCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPersonInfoIdentificationCardView.swift; sourceTree = "<group>"; };
A5167B322B6A3A2D0084C08F /* YHPersonInfoBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPersonInfoBaseViewController.swift; sourceTree = "<group>"; }; A5167B322B6A3A2D0084C08F /* YHPersonInfoBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPersonInfoBaseViewController.swift; sourceTree = "<group>"; };
A5234E272B6E2EED00A33433 /* YHBasicInfoFillViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBasicInfoFillViewController.swift; sourceTree = "<group>"; };
A5234E292B6E349600A33433 /* YHBasicInfoFillBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBasicInfoFillBottomView.swift; sourceTree = "<group>"; };
A5234E2B2B6E3BA400A33433 /* YHBasicInfoFillCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBasicInfoFillCell.swift; sourceTree = "<group>"; };
A5234E2D2B6E43EA00A33433 /* YHBasicInfoFillView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBasicInfoFillView.swift; sourceTree = "<group>"; };
A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeCustomCell.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>"; }; 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; }; A5573ECE2B317BFF00D98EC0 /* galaxy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = galaxy.app; sourceTree = BUILT_PRODUCTS_DIR; };
...@@ -806,6 +814,9 @@ ...@@ -806,6 +814,9 @@
A58556BD2B6BD85A003746B2 /* V */ = { A58556BD2B6BD85A003746B2 /* V */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A5234E292B6E349600A33433 /* YHBasicInfoFillBottomView.swift */,
A5234E2D2B6E43EA00A33433 /* YHBasicInfoFillView.swift */,
A5234E2B2B6E3BA400A33433 /* YHBasicInfoFillCell.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -813,6 +824,7 @@ ...@@ -813,6 +824,7 @@
A58556BE2B6BD85E003746B2 /* C */ = { A58556BE2B6BD85E003746B2 /* C */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A5234E272B6E2EED00A33433 /* YHBasicInfoFillViewController.swift */,
); );
path = C; path = C;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1358,6 +1370,7 @@ ...@@ -1358,6 +1370,7 @@
A5ACE9332B4564F7002C94D2 /* NetBaseModel.swift in Sources */, A5ACE9332B4564F7002C94D2 /* NetBaseModel.swift in Sources */,
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */, 049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */,
A5C5B3002B55623800A7C5D1 /* YHMainContentBaseViewController.swift in Sources */, A5C5B3002B55623800A7C5D1 /* YHMainContentBaseViewController.swift in Sources */,
A5234E2C2B6E3BA400A33433 /* YHBasicInfoFillCell.swift in Sources */,
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */, A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */,
A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */, A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */,
A5FD63DF2B6639AD00D1D9DA /* YHScoreDataModel.swift in Sources */, A5FD63DF2B6639AD00D1D9DA /* YHScoreDataModel.swift in Sources */,
...@@ -1462,6 +1475,7 @@ ...@@ -1462,6 +1475,7 @@
A5FD63FA2B68D95700D1D9DA /* YHPersonInfoIdentityCardModel.swift in Sources */, A5FD63FA2B68D95700D1D9DA /* YHPersonInfoIdentityCardModel.swift in Sources */,
A56D2D612B62020C009C83A8 /* YHContractMainItemStatusCell.swift in Sources */, A56D2D612B62020C009C83A8 /* YHContractMainItemStatusCell.swift in Sources */,
0468D43A2B579EAC00CFB916 /* YHLoginViewModel.swift in Sources */, 0468D43A2B579EAC00CFB916 /* YHLoginViewModel.swift in Sources */,
A5234E282B6E2EED00A33433 /* YHBasicInfoFillViewController.swift in Sources */,
0468D4492B6258A900CFB916 /* YHItemView.swift in Sources */, 0468D4492B6258A900CFB916 /* YHItemView.swift in Sources */,
041B528F2B5E620E007EBCEB /* YHFormItemInputTextCell.swift in Sources */, 041B528F2B5E620E007EBCEB /* YHFormItemInputTextCell.swift in Sources */,
A5FD63C72B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift in Sources */, A5FD63C72B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift in Sources */,
...@@ -1490,12 +1504,14 @@ ...@@ -1490,12 +1504,14 @@
A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */, A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */,
A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */, A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */,
042FBBC92B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift in Sources */, 042FBBC92B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift in Sources */,
A5234E2E2B6E43EA00A33433 /* YHBasicInfoFillView.swift in Sources */,
A5FD63C12B62616D00D1D9DA /* YHInformationPerfectModel.swift in Sources */, A5FD63C12B62616D00D1D9DA /* YHInformationPerfectModel.swift in Sources */,
A5C5B3292B57CCBE00A7C5D1 /* YHDavidCell4.swift in Sources */, A5C5B3292B57CCBE00A7C5D1 /* YHDavidCell4.swift in Sources */,
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */, 049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */,
A5ACE9582B4564F7002C94D2 /* YHNoDataTipView.swift in Sources */, A5ACE9582B4564F7002C94D2 /* YHNoDataTipView.swift in Sources */,
042FBBBB2B62806D00F9DE23 /* YHCertificateViewController.swift in Sources */, 042FBBBB2B62806D00F9DE23 /* YHCertificateViewController.swift in Sources */,
042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */, 042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */,
A5234E2A2B6E349600A33433 /* YHBasicInfoFillBottomView.swift in Sources */,
04A7BC912B6B7B89000E8D47 /* YHTwoOptionAlertView.swift in Sources */, 04A7BC912B6B7B89000E8D47 /* YHTwoOptionAlertView.swift in Sources */,
0468D4792B68A08600CFB916 /* YHAddressViewController.swift in Sources */, 0468D4792B68A08600CFB916 /* YHAddressViewController.swift in Sources */,
A5ACE9562B4564F7002C94D2 /* YHBouncesContentView.swift in Sources */, A5ACE9562B4564F7002C94D2 /* YHBouncesContentView.swift in Sources */,
......
...@@ -315,11 +315,27 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource ...@@ -315,11 +315,27 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
tableView.deselectRow(at: indexPath, animated: true) tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 \(indexPath.section)section --- \(indexPath.row)row") printLog("点击了 \(indexPath.section)section --- \(indexPath.row)row")
let model = serviceCenterMainReqVM.arrInfoFillStep[indexPath.row] let model = serviceCenterMainReqVM.arrInfoFillStep[indexPath.row]
if (indexPath.row + 1 > serviceCenterMainReqVM.myInfoFillStep) {
let message = "请先完成" + model.name + "填写"
YHHUD.flash(message: message) // if (serviceCenterMainReqVM.myInfoFillStep < 7) {
} else { // //未完成
navigationController?.pushViewController(YHMainApplicantInformationViewController()) //
} //
// if (indexPath.row + 1 > serviceCenterMainReqVM.myInfoFillStep) {
// let message = "请先完成" + model.name + "填写"
// YHHUD.flash(message: message)
// }
// else {
// navigationController?.pushViewController(YHMainApplicantInformationViewController())
// }
//
// } else {
// //已完成
//
// } //for test hl
let vc = YHBasicInfoFillViewController()
vc.orderId = orderId
navigationController?.pushViewController(vc)
} }
} }
//
// YHBasicInfoFillViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/2/3.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import GKNavigationBarSwift
/*
基本资料信息填写
*/
class YHBasicInfoFillViewController: YHBaseViewController {
var orderId : Int?
private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style:.grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.register(YHBasicInfoFillCell.self,forCellReuseIdentifier: YHBasicInfoFillCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
//1.0
initView()
//2.0
loadData()
}
}
// MARK: - private methods
extension YHBasicInfoFillViewController {
private func initView() {
gk_backStyle = .black
gk_navTitle = "基本资料信息填写"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1
let bottomView = YHBasicInfoFillBottomView()
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(YHBasicInfoFillBottomView.viewH)
}
bottomView.block = { tag in
if tag == 0 {
//点击了保存按钮
printLog("点击了保存按钮")
} else {
//点击了提交按钮
printLog("点击了提交按钮")
}
}
homeTableView.delegate = self
homeTableView.dataSource = self
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 15)
make.bottom.equalTo(bottomView.snp.top)
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
}
}
private func loadData() {
guard let orderId = orderId else { return}
let param = ["order_id":orderId]
// serviceCenterMainReqVM.getMyScoreDetail(params: param) { success, error in
// if success == true {
//
// } else {
// YHHUD.flash(message: error?.errorMsg ?? "发生错误,请重试")
// }
// self.homeTableView.reloadData()
// }
}
}
// MARK: - delegates
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHBasicInfoFillViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHBasicInfoFillCell.self)
// cell.selectionStyle = .none
// cell.optionData = self.serviceCenterMainReqVM.localScoreData?[indexPath.row + 1]
return cell
}
}
//
// YHBasicInfoFillBottomView.swift
// galaxy
//
// Created by davidhuangA on 2024/2/3.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHBasicInfoFillBottomView: UIView {
static let viewH : CGFloat = 98.0
override init(frame: CGRect) {
super.init(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: YHBasicInfoFillBottomView.viewH))
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
typealias Block = (Int) -> ()
var block: Block?
var saveButton: UIButton!
var nextButton: UIButton!
}
private extension YHBasicInfoFillBottomView {
func setupUI() {
backgroundColor = .white
saveButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.contentBkgColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("保存", for: .normal)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.addTarget(self, action: #selector(save), for: .touchUpInside)
return button
}()
addSubview(saveButton)
saveButton.snp.makeConstraints { make in
make.left.equalTo(kMargin)
make.top.equalTo(10)
make.height.equalTo(44)
make.width.equalTo(86)
}
nextButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("提交", for: .normal)
button.setTitleColor(.white, for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.clipsToBounds = true
button.addTarget(self, action: #selector(submit), for: .touchUpInside)
return button
}()
addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.right.equalTo(-kMargin)
make.top.equalTo(10)
make.height.equalTo(44)
make.left.equalTo(saveButton.snp.right).offset(10)
}
nextButton.layoutIfNeeded()
nextButton.backgroundGradient()
}
@objc func save() {
block?(0)
}
@objc func submit() {
block?(1)
}
}
//
// YHBasicInfoFillCell.swift
// galaxy
//
// Created by davidhuangA on 2024/2/3.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHBasicInfoFillCell: UITableViewCell {
static let cellReuseIdentifier = "YHBasicInfoFillCell"
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
updateUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
extension YHBasicInfoFillCell {
func updateUI() {
// for item in contentView.subviews {
// item.removeFromSuperview()
// }
//主申请人
let holdView1 = UIView()
holdView1.backgroundColor = .white
// holdView1.backgroundColor = .red //for test hjl
holdView1.layer.cornerRadius = kCornerRadius6
holdView1.clipsToBounds = true
contentView.addSubview(holdView1)
holdView1.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
do {
let sessionView = YHPersonInfoSessionView()
sessionView.updateTitle(title: "主申请人")
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)
}
let view0 = YHBasicInfoFillView()
holdView1.addSubview(view0)
view0.snp.makeConstraints { make in
make.top.equalTo(sessionView.snp.bottom)
make.right.equalToSuperview().offset(-18)
make.left.equalToSuperview().offset(18)
make.bottom.equalToSuperview()
}
// view0.backgroundColor = .red //for test hjl
view0.block = {
self.contentView.layoutIfNeeded()
}
// let view1 = YHBasicInfoFillView()
// holdView1.addSubview(view1)
// view1.snp.makeConstraints { make in
// make.top.equalTo(view0.snp.bottom)
// make.right.equalToSuperview().offset(-18)
// make.left.equalToSuperview().offset(18)
// make.bottom.equalToSuperview()
// }
// view1.backgroundColor = .purple //for test hjl
// view1.block = {
// self.contentView.layoutIfNeeded()
// }
}
}
}
//
// YHBasicInfoFillView.swift
// galaxy
//
// Created by davidhuangA on 2024/2/3.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHBasicInfoFillView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
typealias Block = () -> ()
var block: Block?
private let btnWidth = 70.0
private let btnHeight = 32.0
private let btnTitleSelectColor = UIColor.brandMainColor
private let btnTitleDefaultColor = UIColor.mainTextColor
private let btnBgDefaultColor = UIColor.contentBkgColor
private let btnBgSelectColor = UIColor.brandMainColor.withAlphaComponent(0.08)
private let answerBaseTag = 9527
private lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14)
label.lineBreakMode = .byCharWrapping
return label
}()
private lazy var answer1Btn: UIButton = {
let btn = UIButton()
btn.setTitle("否", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.layer.borderColor = UIColor.clear.cgColor
btn.tag = answerBaseTag
btn.addTarget(self, action: #selector(didClickResponseBtn(btn:)), for: .touchUpInside)
return btn
}()
private lazy var answer2Btn: UIButton = {
let btn = UIButton()
btn.setTitle("是", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.layer.borderColor = UIColor.clear.cgColor
btn.tag = answerBaseTag+1
btn.addTarget(self, action: #selector(didClickResponseBtn(btn:)), for: .touchUpInside)
return btn
}()
private lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0)
return view
}()
private lazy var additionHoldView : UIView = {
let view = UIView()
view.backgroundColor = UIColor.contentBkgColor
view.layer.cornerRadius = kCornerRadius6
view.clipsToBounds = true
return view
}()
var title:String? {
didSet {
if let question = title {
let str = "*"+question
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor.mainTextColor
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
titleLabel.attributedText = questionAttrStr
}
}
}
}
private extension YHBasicInfoFillView {
func setupUI() {
backgroundColor = .clear
title = "1、是否曾在香港或其他地方因任何罪行或违法行为被定罪?"
addSubview(titleLabel)
addSubview(answer2Btn)
addSubview(answer1Btn)
titleLabel.snp.makeConstraints { make in
make.top.equalTo(kMargin)
make.left.right.equalToSuperview()
}
answer1Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.left.equalTo(titleLabel.snp.left)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
answer2Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.left.equalTo(answer1Btn.snp.right).offset(12)
make.top.equalTo(answer1Btn.snp.top)
}
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.top.equalTo(answer1Btn.snp.bottom).offset(12)
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
// make.bottom.equalToSuperview()
}
bottomLine.isHidden = true
addSubview(additionHoldView)
additionHoldView.snp.makeConstraints { make in
make.top.equalTo(answer1Btn.snp.bottom).offset(12)
make.left.right.equalToSuperview()
make.height.equalTo(78)
make.bottom.equalToSuperview().offset(-18)
}
additionHoldView.isHidden = false
answer1Btn.isSelected = true
updateAnswerButton(answer1Btn, true)//for test hjl
}
@objc func didClickResponseBtn(btn: UIButton) {
printLog("点击了按钮哈 \(btn.tag)")
btn.isSelected = true
updateAnswerButton(btn, true)
if btn == answer1Btn {
answer2Btn.isSelected = false
updateAnswerButton(answer2Btn, false)
additionHoldView.isHidden = true
bottomLine.isHidden = false
bottomLine.snp.makeConstraints { make in
make.top.equalTo(answer1Btn.snp.bottom).offset(12)
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
make.bottom.equalToSuperview()
}
} else {
answer1Btn.isSelected = false
updateAnswerButton(answer1Btn, false)
additionHoldView.isHidden = false
bottomLine.isHidden = true
additionHoldView.snp.makeConstraints { make in
make.top.equalTo(answer1Btn.snp.bottom).offset(12)
make.left.right.equalToSuperview()
make.height.equalTo(78)
make.bottom.equalToSuperview().offset(-18)
}
}
layoutIfNeeded()
block?()
}
// 更新答案按钮选中状态
private func updateAnswerButton(_ btn:UIButton, _ isSelect:Bool) {
btn.layer.borderColor = (isSelect ? btnTitleSelectColor : .clear).cgColor
btn.setTitleColor((isSelect ? btnTitleSelectColor : btnTitleDefaultColor), for: .normal)
btn.backgroundColor = (isSelect ? btnBgSelectColor : btnBgDefaultColor)
}
}
...@@ -77,6 +77,7 @@ extension YHPersonInfoCommonCell { ...@@ -77,6 +77,7 @@ extension YHPersonInfoCommonCell {
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)
} }
if arrData.count == 1 { if arrData.count == 1 {
...@@ -129,6 +130,7 @@ extension YHPersonInfoCommonCell { ...@@ -129,6 +130,7 @@ extension YHPersonInfoCommonCell {
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)
} }
var tmp : UIView = sessionView var tmp : UIView = sessionView
...@@ -221,6 +223,7 @@ extension YHPersonInfoCommonCell { ...@@ -221,6 +223,7 @@ extension YHPersonInfoCommonCell {
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)
} }
var tmp : UIView = sessionView var tmp : UIView = sessionView
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
import UIKit import UIKit
class YHPersonInfoSessionView: UIView { class YHPersonInfoSessionView: UIView {
static let viewH : CGFloat = 52
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
setupUI() setupUI()
...@@ -23,8 +24,8 @@ class YHPersonInfoSessionView: UIView { ...@@ -23,8 +24,8 @@ class YHPersonInfoSessionView: UIView {
let lable0 = UILabel(text: "--") let lable0 = UILabel(text: "--")
lable0.textColor = UIColor.mainTextColor lable0.textColor = UIColor.mainTextColor
lable0.font = UIFont.PFSC_M(ofSize: 17) lable0.font = UIFont.PFSC_M(ofSize: 17)
lable0.numberOfLines = 0 // lable0.numberOfLines = 0
lable0.lineBreakMode = .byWordWrapping // lable0.lineBreakMode = .byWordWrapping
return lable0 return lable0
}() }()
...@@ -44,9 +45,10 @@ class YHPersonInfoSessionView: UIView { ...@@ -44,9 +45,10 @@ class YHPersonInfoSessionView: UIView {
addSubview(nameLable) addSubview(nameLable)
nameLable.snp.makeConstraints { make in nameLable.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(kMargin) make.top.equalToSuperview()
make.bottom.equalTo(bottomLine.snp.top).offset(-kMargin) make.bottom.equalTo(bottomLine.snp.top)
} }
// nameLable.backgroundColor = .yellow//for test hjl
} }
} }
......
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