Commit 1d081e8b authored by David黄金龙's avatar David黄金龙

其他信息输入

parent bcf2ce35
...@@ -123,6 +123,8 @@ ...@@ -123,6 +123,8 @@
A58556C02B6C82AF003746B2 /* YHScoreResultBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58556BF2B6C82AF003746B2 /* YHScoreResultBaseModel.swift */; }; A58556C02B6C82AF003746B2 /* YHScoreResultBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58556BF2B6C82AF003746B2 /* YHScoreResultBaseModel.swift */; };
A58556C22B6C8412003746B2 /* YHScoreResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58556C12B6C8412003746B2 /* YHScoreResultModel.swift */; }; A58556C22B6C8412003746B2 /* YHScoreResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58556C12B6C8412003746B2 /* YHScoreResultModel.swift */; };
A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A58951C42B398D1000225C19 /* Launch Screen.storyboard */; }; A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A58951C42B398D1000225C19 /* Launch Screen.storyboard */; };
A596C3882B8441D20067BBB8 /* YHOtherYesOrNoItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596C3872B8441D20067BBB8 /* YHOtherYesOrNoItemView.swift */; };
A596C38A2B8448000067BBB8 /* YHOtherTextViewItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596C3892B8448000067BBB8 /* YHOtherTextViewItemView.swift */; };
A5ACE9272B4564F7002C94D2 /* YHLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */; }; A5ACE9272B4564F7002C94D2 /* YHLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */; };
A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE8DE2B4564F7002C94D2 /* YHSmsCodeView.swift */; }; A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE8DE2B4564F7002C94D2 /* YHSmsCodeView.swift */; };
A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE8E02B4564F7002C94D2 /* YHSmsCodeInputView.swift */; }; A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE8E02B4564F7002C94D2 /* YHSmsCodeInputView.swift */; };
...@@ -375,6 +377,8 @@ ...@@ -375,6 +377,8 @@
A58556BF2B6C82AF003746B2 /* YHScoreResultBaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultBaseModel.swift; sourceTree = "<group>"; }; A58556BF2B6C82AF003746B2 /* YHScoreResultBaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultBaseModel.swift; sourceTree = "<group>"; };
A58556C12B6C8412003746B2 /* YHScoreResultModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultModel.swift; sourceTree = "<group>"; }; A58556C12B6C8412003746B2 /* YHScoreResultModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultModel.swift; sourceTree = "<group>"; };
A58951C42B398D1000225C19 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; }; A58951C42B398D1000225C19 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
A596C3872B8441D20067BBB8 /* YHOtherYesOrNoItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOtherYesOrNoItemView.swift; sourceTree = "<group>"; };
A596C3892B8448000067BBB8 /* YHOtherTextViewItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOtherTextViewItemView.swift; sourceTree = "<group>"; };
A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHLoginViewController.swift; sourceTree = "<group>"; }; A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHLoginViewController.swift; sourceTree = "<group>"; };
A5ACE8DE2B4564F7002C94D2 /* YHSmsCodeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHSmsCodeView.swift; sourceTree = "<group>"; }; A5ACE8DE2B4564F7002C94D2 /* YHSmsCodeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHSmsCodeView.swift; sourceTree = "<group>"; };
A5ACE8E02B4564F7002C94D2 /* YHSmsCodeInputView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHSmsCodeInputView.swift; sourceTree = "<group>"; }; A5ACE8E02B4564F7002C94D2 /* YHSmsCodeInputView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHSmsCodeInputView.swift; sourceTree = "<group>"; };
...@@ -940,6 +944,8 @@ ...@@ -940,6 +944,8 @@
A50AB8A02B82F99C00C227DE /* YHOtherInfoSessionView.swift */, A50AB8A02B82F99C00C227DE /* YHOtherInfoSessionView.swift */,
A50AB8A22B830ACE00C227DE /* YHOtherResidenceFillView.swift */, A50AB8A22B830ACE00C227DE /* YHOtherResidenceFillView.swift */,
A50AB8A42B831FF300C227DE /* YHOtherSelecteItemView.swift */, A50AB8A42B831FF300C227DE /* YHOtherSelecteItemView.swift */,
A596C3872B8441D20067BBB8 /* YHOtherYesOrNoItemView.swift */,
A596C3892B8448000067BBB8 /* YHOtherTextViewItemView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1663,6 +1669,7 @@ ...@@ -1663,6 +1669,7 @@
04E86E322B81EA1000A35F4B /* YHWorkItemAddView.swift in Sources */, 04E86E322B81EA1000A35F4B /* YHWorkItemAddView.swift in Sources */,
A5C5B2FB2B5535DF00A7C5D1 /* YHHomeBannerView.swift in Sources */, A5C5B2FB2B5535DF00A7C5D1 /* YHHomeBannerView.swift in Sources */,
A5F78C822B68F39600EEA170 /* YHPersonInfoCommonCell.swift in Sources */, A5F78C822B68F39600EEA170 /* YHPersonInfoCommonCell.swift in Sources */,
A596C3882B8441D20067BBB8 /* YHOtherYesOrNoItemView.swift in Sources */,
A5ACE94B2B4564F7002C94D2 /* YHHUDRotatingImageView.swift in Sources */, A5ACE94B2B4564F7002C94D2 /* YHHUDRotatingImageView.swift in Sources */,
041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */, 041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */,
04E86E0F2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift in Sources */, 04E86E0F2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift in Sources */,
...@@ -1691,6 +1698,7 @@ ...@@ -1691,6 +1698,7 @@
A5234E352B707F6B00A33433 /* YHBasicInfoSessionModel.swift in Sources */, A5234E352B707F6B00A33433 /* YHBasicInfoSessionModel.swift in Sources */,
A5234E312B6F9C5E00A33433 /* YHBasicInfoFillViewModel.swift in Sources */, A5234E312B6F9C5E00A33433 /* YHBasicInfoFillViewModel.swift in Sources */,
0468D4862B6A41F300CFB916 /* YHMainInformationModel.swift in Sources */, 0468D4862B6A41F300CFB916 /* YHMainInformationModel.swift in Sources */,
A596C38A2B8448000067BBB8 /* YHOtherTextViewItemView.swift in Sources */,
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */, 0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */,
A5FD63EA2B67D95100D1D9DA /* YHFamilyMemberViewController.swift in Sources */, A5FD63EA2B67D95100D1D9DA /* YHFamilyMemberViewController.swift in Sources */,
04E86E2F2B81EA1000A35F4B /* YHWorkExperienceListViewController.swift in Sources */, 04E86E2F2B81EA1000A35F4B /* YHWorkExperienceListViewController.swift in Sources */,
......
...@@ -225,12 +225,12 @@ extension YHOtherInfoFillCell { ...@@ -225,12 +225,12 @@ extension YHOtherInfoFillCell {
} }
//3.语言水平 //3.专业技能行业
let holdView3 = createHoldView() let holdView3 = createHoldView()
contentView.addSubview(holdView3) contentView.addSubview(holdView3)
holdView3.snp.makeConstraints { make in holdView3.snp.makeConstraints { make in
make.top.equalTo(holdView2.snp.bottom).offset(18) make.top.equalTo(holdView2.snp.bottom).offset(18)
make.left.right.bottom.equalToSuperview() make.left.right.equalToSuperview()
} }
do { do {
...@@ -258,6 +258,100 @@ extension YHOtherInfoFillCell { ...@@ -258,6 +258,100 @@ extension YHOtherInfoFillCell {
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
} }
} }
//4.辅助资料
let holdView4 = createHoldView()
contentView.addSubview(holdView4)
holdView4.snp.makeConstraints { make in
make.top.equalTo(holdView3.snp.bottom).offset(18)
make.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-18)
}
do {
let sessionView = YHOtherInfoSessionView(frame: .zero)
sessionView.type = 2
sessionView.updateTitle(title: "辅助资料")
holdView4.addSubview(sessionView)
sessionView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(YHOtherInfoSessionView.viewH)
}
//1、您是否有行业内的专业资格证书?
let fzView1 = YHOtherYesOrNoItemView(frame: .zero)
holdView4.addSubview(fzView1)
fzView1.snp.makeConstraints { make in
make.top.equalTo(sessionView.snp.bottom)
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
}
// 2、您是否在期刊或杂志上发表过论文、文章、书籍等(与工作、资质有关的)?
let fzView2 = YHOtherYesOrNoItemView(frame: .zero)
holdView4.addSubview(fzView2)
fzView2.snp.makeConstraints { make in
make.top.equalTo(fzView1.snp.bottom)
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
}
// 3、您是否有大学奖学金证明、专利证书、获奖证书(工作单位颁发的可以)?
let fzView3 = YHOtherYesOrNoItemView(frame: .zero)
holdView4.addSubview(fzView3)
fzView3.snp.makeConstraints { make in
make.top.equalTo(fzView2.snp.bottom)
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
}
// 4、您是否被媒体采访过,专访您的文章被发表在杂志上或网络上?
let fzView4 = YHOtherYesOrNoItemView(frame: .zero)
holdView4.addSubview(fzView4)
fzView4.snp.makeConstraints { make in
make.top.equalTo(fzView3.snp.bottom)
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
}
//5、专业奖项
let fzView5 = YHOtherTextViewItemView(frame: .zero)
holdView4.addSubview(fzView5)
fzView5.snp.makeConstraints { make in
make.top.equalTo(fzView4.snp.bottom)
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(YHOtherTextViewItemView.viewH)
}
//6、学业奖项
let fzView6 = YHOtherTextViewItemView(frame: .zero)
holdView4.addSubview(fzView6)
fzView6.snp.makeConstraints { make in
make.top.equalTo(fzView5.snp.bottom)
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(YHOtherTextViewItemView.viewH)
}
//7、其他奖励
let fzView7 = YHOtherTextViewItemView(frame: .zero)
holdView4.addSubview(fzView7)
fzView7.snp.makeConstraints { make in
make.top.equalTo(fzView6.snp.bottom)
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(YHOtherTextViewItemView.viewH)
make.bottom.equalToSuperview()
}
}
} }
......
//
// YHOtherTextViewItemView.swift
// galaxy
//
// Created by davidhuangA on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHOtherTextViewItemView: UIView, UITextViewDelegate {
static let viewH : CGFloat = 172.0
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 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
label.text = "5、专业奖项"
return label
}()
private lazy var tipsLabel: UILabel = {
let label = UILabel()
label.textColor = .placeHolderColor
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14)
label.lineBreakMode = .byCharWrapping
label.text = "5、专业奖项"
return label
}()
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 model : YHBasicInfoCellModel? {
didSet {
updateUI()
}
}
private var myTextView : UITextView!
private let kTipsString : String = "如选择“是”,请详细说明"
}
private extension YHOtherTextViewItemView {
func setupUI() {
backgroundColor = .clear
// title = "1、是否曾在香港或其他地方因任何罪行或违法行为被定罪?"
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.top.equalTo(kMargin)
make.left.right.equalToSuperview()
make.height.equalTo(20)
}
addSubview(additionHoldView)
additionHoldView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(kMargin)
make.left.right.equalToSuperview()
make.height.equalTo(104)
}
let textView : UITextView = UITextView()
textView.backgroundColor = .clear
textView.font = UIFont.PFSC_R(ofSize: 14)
additionHoldView.addSubview(textView)
textView.snp.makeConstraints { make in
make.edges.equalTo(0)
}
myTextView = textView
myTextView.delegate = self
myTextView.contentInset = UIEdgeInsets(top: 12, left: 12, bottom: 12, right: 12)
additionHoldView.addSubview(tipsLabel)
tipsLabel.snp.makeConstraints { make in
make.top.equalTo(20)
make.left.equalTo(16)
make.right.equalTo(-12)
}
tipsLabel.text = kTipsString
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
make.bottom.equalToSuperview()
}
}
private func updateUI() {
guard let model = model else { return }
}
}
extension YHOtherTextViewItemView : UITextFieldDelegate {
internal func textViewDidChange(_ textView: UITextView) {
if textView.text == "" {
tipsLabel.isHidden = false
} else {
tipsLabel.isHidden = true
}
}
}
//
// YHOtherYesOrNoItemView.swift
// galaxy
//
// Created by davidhuangA on 2024/2/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHOtherYesOrNoItemView: UIView, UITextViewDelegate {
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
}()
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.failColor, range: starRange)
titleLabel.attributedText = questionAttrStr
}
}
}
var model : YHBasicInfoCellModel? {
didSet {
updateUI()
}
}
private var lastSelectedBtn : UIButton?
}
private extension YHOtherYesOrNoItemView {
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()
}
}
@objc func didClickResponseBtn(btn: UIButton) {
printLog("点击了按钮哈 \(btn.tag)")
if lastSelectedBtn == btn {
printLog("连续点击了同一个按钮......")
return
}
lastSelectedBtn = btn
btn.isSelected = true
updateAnswerButton(btn, true)
if btn == answer1Btn {
answer2Btn.isSelected = false
updateAnswerButton(answer2Btn, false)
model?.answer = "N"
} else {
answer1Btn.isSelected = false
updateAnswerButton(answer1Btn, false)
// bottomLine.snp.removeConstraints()
}
// 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)
}
private func updateUI() {
guard let model = model else { return }
title = model.question
if model.answer == "Y" {
didClickResponseBtn(btn: answer2Btn)
} else {
if model.answer == "N" {
didClickResponseBtn(btn: answer1Btn)
}
}
}
}
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