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

2项检测

parent caeaaaa5
......@@ -247,6 +247,7 @@
A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE95D2B4571BF002C94D2 /* YHHomeViewController.swift */; };
A5B4A5832B94555C003EFF8F /* YHPreviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B4A5822B94555C003EFF8F /* YHPreviewViewModel.swift */; };
A5B4A5852B9455F7003EFF8F /* YHPreviewForOtherInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B4A5842B9455F7003EFF8F /* YHPreviewForOtherInfoModel.swift */; };
A5C062E42B9EFE98001C5DF0 /* YHCustomTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C062E32B9EFE98001C5DF0 /* YHCustomTextView.swift */; };
A5C382CA2B5E1F4C00C5E65C /* YHLoginTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382C92B5E1F4C00C5E65C /* YHLoginTipsView.swift */; };
A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */; };
A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382CE2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift */; };
......@@ -578,6 +579,7 @@
A5ACE95D2B4571BF002C94D2 /* YHHomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeViewController.swift; sourceTree = "<group>"; };
A5B4A5822B94555C003EFF8F /* YHPreviewViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPreviewViewModel.swift; sourceTree = "<group>"; };
A5B4A5842B9455F7003EFF8F /* YHPreviewForOtherInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPreviewForOtherInfoModel.swift; sourceTree = "<group>"; };
A5C062E32B9EFE98001C5DF0 /* YHCustomTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCustomTextView.swift; sourceTree = "<group>"; };
A5C382C92B5E1F4C00C5E65C /* YHLoginTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginTipsView.swift; sourceTree = "<group>"; };
A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContractCell.swift; sourceTree = "<group>"; };
A5C382CE2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterMainViewModel.swift; sourceTree = "<group>"; };
......@@ -1400,6 +1402,7 @@
A596C39D2B84D9100067BBB8 /* YHOtherSelecteItemView.swift */,
A596C39E2B84D9100067BBB8 /* YHOtherInfoSessionView.swift */,
A5F685F12B86D2E3006F4BF9 /* YHOtherPickerView.swift */,
A5C062E32B9EFE98001C5DF0 /* YHCustomTextView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -1992,6 +1995,7 @@
A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */,
A5ACE9452B4564F7002C94D2 /* YHHUDContainerView.swift in Sources */,
0413A6D82B8C76290006D154 /* YHCertificateUploadVC.swift in Sources */,
A5C062E42B9EFE98001C5DF0 /* YHCustomTextView.swift in Sources */,
A5ACE93A2B4564F7002C94D2 /* NSAttributedString+Extension.swift in Sources */,
04E86E662B86EB6F00A35F4B /* YHLoginManager.swift in Sources */,
A554A5002B95FB9100EA5973 /* YHMainInfoPreviewModel.swift in Sources */,
......
......@@ -159,12 +159,28 @@ extension YHOtherInfoFillViewController {
if model.language_detail?.levelDes.isEmpty == true {
returnValue = false
return returnValue
} else {
if let language = model.language_detail,language.level == 4 {
if language.name.isEmpty || language.remark.isEmpty {
returnValue = false
return returnValue
}
}
}
//3.专业技能行业
if model.profession?.optionDes.isEmpty == true {
returnValue = false
return returnValue
} else {
if let language = model.profession,language.option == 15 {
if language.remark.isEmpty {
returnValue = false
return returnValue
}
}
}
//4.辅助资料
......
//
// YHCustomTextView.swift
// galaxy
//
// Created by davidhuangA on 2024/3/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCustomTextView: UIView, UITextViewDelegate {
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
typealias Block = (String) -> ()
var block: Block?
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 = "请输入中文之外的语种"
return label
}()
lazy var noTextTipsLable: UILabel = {
let label = UILabel()
label.textColor = .failColor
label.font = UIFont.PFSC_R(ofSize: 12)
label.text = "无数据时候的提示"
return label
}()
private lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = .clear//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 myTextView : UITextView!
var needCheckFlag : Bool = false {
didSet {
layoutMyUI()
}
}
override func layoutSubviews() {
super.layoutSubviews()
layoutMyUI()
}
}
private extension YHCustomTextView {
func setupUI() {
backgroundColor = .clear
addSubview(additionHoldView)
additionHoldView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.right.equalToSuperview()
make.height.equalTo(44)
}
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(14)
make.left.equalTo(16)
make.right.equalTo(-12)
}
addSubview(noTextTipsLable)
noTextTipsLable.snp.makeConstraints { make in
make.top.equalTo(additionHoldView.snp.bottom).offset(6)
make.left.right.equalToSuperview()
make.height.equalTo(20)
}
noTextTipsLable.isHidden = true
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
make.top.equalTo(noTextTipsLable.snp.bottom).offset(12)
make.bottom.equalToSuperview()
}
}
private func layoutMyUI() {
noTextTipsLable.snp.removeConstraints()
bottomLine.snp.removeConstraints()
if myTextView.text.isEmpty {
tipsLabel.isHidden = false
} else {
tipsLabel.isHidden = true
}
if needCheckFlag == true,myTextView.text.isEmpty {
noTextTipsLable.isHidden = false
noTextTipsLable.snp.remakeConstraints { make in
make.top.equalTo(additionHoldView.snp.bottom).offset(6)
make.left.right.equalToSuperview()
make.height.equalTo(20)
}
bottomLine.snp.remakeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
make.top.equalTo(noTextTipsLable.snp.bottom).offset(12)
make.bottom.equalToSuperview()
}
} else {
noTextTipsLable.isHidden = true
bottomLine.snp.remakeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
make.top.equalTo(additionHoldView.snp.bottom).offset(12)
make.bottom.equalToSuperview()
}
}
}
}
extension YHCustomTextView : UITextFieldDelegate {
internal func textViewDidChange(_ textView: UITextView) {
if textView.text == "" {
tipsLabel.isHidden = false
} else {
tipsLabel.isHidden = true
}
self.block?(textView.text)
}
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
if !text.isEmpty {
if textView.text.count > 999 {
return false
}
}
return true
}
}
extension YHCustomTextView {
func updateUI(title : String,value : String, type : YHOtherTextViewItemType = .unknowAwards) {
myTextView.text = value
if value.count > 0 {
tipsLabel.isHidden = true
} else {
tipsLabel.isHidden = false
}
layoutMyUI()
}
}
......@@ -175,8 +175,6 @@ extension YHOtherInfoFillCell {
lastTargetView = residenceView
}
//添加按钮
holdView1.addSubview(addBtn)
addBtn.layer.addSublayer(dotLineLayer)
......@@ -216,9 +214,15 @@ extension YHOtherInfoFillCell {
let view = languageView
view.updateKeyName(name: "您的语言水平与下列哪一项符合", keyValue:dataModel.language_detail?.levelDes ?? "")
view.updateKeyName(name: "您的语言水平与下列哪一项符合", keyValue:dataModel.language_detail?.levelDes ?? "",firstTxt: dataModel.language_detail?.name ?? "",secondTxt: dataModel.language_detail?.remark ?? "")
view.needCheckFlag = dataModel.needCheckFlag
view.type = 2
view.textBlock = {firstTxt,secondTxt in
self.dataModel?.language_detail?.name = firstTxt
self.dataModel?.language_detail?.remark = secondTxt
}
holdView2.addSubview(view)
view.snp.makeConstraints { make in
make.top.equalTo(sessionView.snp.bottom)
......@@ -256,9 +260,13 @@ extension YHOtherInfoFillCell {
let view = skillView
view.updateKeyName(name: "最能代表你的专业技能的行业", keyValue: dataModel.profession?.optionDes ?? "")
view.updateKeyName(name: "最能代表你的专业技能的行业", keyValue: dataModel.profession?.optionDes ?? "",firstTxt: dataModel.profession?.remark ?? "")
view.needCheckFlag = dataModel.needCheckFlag
view.type = 2
view.textBlock = { firstTxt,secondTxt in
self.dataModel?.profession?.remark = firstTxt
}
holdView3.addSubview(view)
view.snp.makeConstraints { make in
make.top.equalTo(sessionView.snp.bottom)
......@@ -415,6 +423,8 @@ extension YHOtherInfoFillCell {
self.dataModel?.language_detail?.level = Int(item.index) ?? 0
self.dataModel?.language_detail?.levelDes = item.title
self.languageView.updateKeyName(name: "您的语言水平与下列哪一项符合", keyValue:self.dataModel?.language_detail?.levelDes ?? "")
self.block?()
}
}
......@@ -424,6 +434,8 @@ extension YHOtherInfoFillCell {
self.dataModel?.profession?.option = Int(item.index) ?? 0
self.dataModel?.profession?.optionDes = item.title
self.skillView.updateKeyName(name: "最能代表你的专业技能的行业", keyValue:self.dataModel?.profession?.optionDes ?? "")
self.block?()
}
}
}
......@@ -40,6 +40,11 @@ class YHOtherSelecteItemView: UIView {
var block: ItemBlock?
typealias TextViewBlock = (_ firstTxt: String, _ secondTxt: String) -> ()
var textBlock: TextViewBlock?
lazy var longTimeButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "main_time_normal"), for: .normal)
......@@ -119,9 +124,10 @@ class YHOtherSelecteItemView: UIView {
return view
}()
let firstTextView : YHCustomTextView = YHCustomTextView()
let secondTextView : YHCustomTextView = YHCustomTextView()
private let rightIcon = UIImageView()
override func layoutSubviews() {
super.layoutSubviews()
......@@ -164,6 +170,17 @@ extension YHOtherSelecteItemView {
make.height.equalTo(32)
make.width.equalTo(43)
}
addSubview(firstTextView)
addSubview(secondTextView)
firstTextView.block = { text in
self.textBlock?(self.firstTextView.myTextView.text,self.secondTextView.myTextView.text)
}
secondTextView.block = { text in
self.textBlock?(self.firstTextView.myTextView.text,self.secondTextView.myTextView.text)
}
}
@objc func longTimeButtonClick() {
......@@ -179,7 +196,7 @@ extension YHOtherSelecteItemView {
}
extension YHOtherSelecteItemView {
func updateKeyName(name : String, keyValue : String) {
func updateKeyName(name : String, keyValue : String,firstTxt:String = "",secondTxt: String = "") {
if type == 1 {
noTextTipsLable.text = "请选择" + name
......@@ -189,21 +206,22 @@ extension YHOtherSelecteItemView {
title = name
textField.text = keyValue
firstTextView.myTextView.text = firstTxt
secondTextView.myTextView.text = secondTxt
secondTextView.layoutIfNeeded()
layoutMyUI()
}
func layoutMyUI() {
titleLabel.snp.removeConstraints()
subHoldView.snp.removeConstraints()
bottomLine.snp.removeConstraints()
noTextTipsLable.snp.removeConstraints()
if type == 1 {
if needCheckFlag == true {
titleLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(kMargin)
......@@ -346,6 +364,12 @@ extension YHOtherSelecteItemView {
make.left.equalToSuperview()
}
firstTextView.isHidden = true
secondTextView.isHidden = true
firstTextView.snp.removeConstraints()
secondTextView.snp.removeConstraints()
bottomLine.snp.removeConstraints()
if textField.isEmpty == true {
noTextTipsLable.isHidden = false
noTextTipsLable.snp.remakeConstraints { make in
......@@ -364,10 +388,50 @@ extension YHOtherSelecteItemView {
}
else {
noTextTipsLable.isHidden = true
var lastView : UIView = subHoldView
if let text = textField.text,text.contains("其他") {
firstTextView.noTextTipsLable.text = "请输入其他专业技能的行业"
firstTextView.tipsLabel.text = "请输入其他专业技能的行业"
firstTextView.isHidden = false
firstTextView.snp.remakeConstraints { make in
make.top.equalTo(lastView.snp.bottom).offset(kMargin)
make.left.right.equalToSuperview()
}
firstTextView.needCheckFlag = needCheckFlag
lastView = firstTextView
} else if let text = textField.text,text.contains("中文及另一种外语") {
firstTextView.isHidden = false
secondTextView.isHidden = false
firstTextView.noTextTipsLable.text = "请输入中文之外的语种"
firstTextView.tipsLabel.text = "请输入中文之外的语种"
firstTextView.snp.remakeConstraints { make in
make.top.equalTo(lastView.snp.bottom).offset(kMargin)
make.left.right.equalToSuperview()
}
secondTextView.noTextTipsLable.text = "请输入2年内获取的证书及分数"
secondTextView.tipsLabel.text = "请输入2年内获取的证书及分数"
secondTextView.snp.remakeConstraints { make in
make.top.equalTo(firstTextView.snp.bottom).offset(kMargin)
make.left.right.equalToSuperview()
}
firstTextView.needCheckFlag = needCheckFlag
secondTextView.needCheckFlag = needCheckFlag
lastView = secondTextView
} else {
}
bottomLine.snp.removeConstraints()
bottomLine.snp.remakeConstraints { make in
make.top.equalTo(subHoldView.snp.bottom).offset(kMargin)
make.bottom.left.right.equalToSuperview()
make.top.equalTo(lastView.snp.bottom).offset(kMargin)
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
make.bottom.equalToSuperview()
}
}
} else {
......@@ -386,10 +450,56 @@ extension YHOtherSelecteItemView {
make.left.equalToSuperview()
}
firstTextView.snp.removeConstraints()
secondTextView.snp.removeConstraints()
firstTextView.isHidden = true
secondTextView.isHidden = true
var lastView : UIView = subHoldView
if let text = textField.text,text.contains("其他") {
firstTextView.noTextTipsLable.text = "请输入其他专业技能的行业"
firstTextView.tipsLabel.text = "请输入其他专业技能的行业"
firstTextView.isHidden = false
firstTextView.snp.remakeConstraints { make in
make.top.equalTo(lastView.snp.bottom).offset(kMargin)
make.left.right.equalToSuperview()
}
firstTextView.needCheckFlag = needCheckFlag
lastView = firstTextView
} else if let text = textField.text,text.contains("中文及另一种外语") {
firstTextView.isHidden = false
secondTextView.isHidden = false
firstTextView.noTextTipsLable.text = "请输入中文之外的语种"
firstTextView.tipsLabel.text = "请输入中文之外的语种"
firstTextView.snp.remakeConstraints { make in
make.top.equalTo(lastView.snp.bottom).offset(kMargin)
make.left.right.equalToSuperview()
}
secondTextView.noTextTipsLable.text = "请输入2年内获取的证书及分数"
secondTextView.tipsLabel.text = "请输入2年内获取的证书及分数"
secondTextView.snp.remakeConstraints { make in
make.top.equalTo(firstTextView.snp.bottom).offset(kMargin)
make.left.right.equalToSuperview()
}
firstTextView.needCheckFlag = needCheckFlag
secondTextView.needCheckFlag = needCheckFlag
lastView = secondTextView
} else {
}
bottomLine.snp.removeConstraints()
bottomLine.snp.remakeConstraints { make in
make.top.equalTo(subHoldView.snp.bottom).offset(kMargin)
make.bottom.left.right.equalToSuperview()
make.top.equalTo(lastView.snp.bottom).offset(kMargin)
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
make.bottom.equalToSuperview()
}
}
} else {
......
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