Commit b04f0b7a authored by Steven杜宇's avatar Steven杜宇

Merge branch 'develop' into duyu

parents 8248b4b0 4e4d1a30
...@@ -220,6 +220,7 @@ ...@@ -220,6 +220,7 @@
A5C5B32D2B57D66000A7C5D1 /* YHBbxCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C5B32C2B57D66000A7C5D1 /* YHBbxCollectionViewCell.swift */; }; A5C5B32D2B57D66000A7C5D1 /* YHBbxCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C5B32C2B57D66000A7C5D1 /* YHBbxCollectionViewCell.swift */; };
A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */; }; A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */; };
A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */; }; A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */; };
A5F685F22B86D2E3006F4BF9 /* YHOtherPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F685F12B86D2E3006F4BF9 /* YHOtherPickerView.swift */; };
A5F78C822B68F39600EEA170 /* YHPersonInfoCommonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F78C812B68F39600EEA170 /* YHPersonInfoCommonCell.swift */; }; A5F78C822B68F39600EEA170 /* YHPersonInfoCommonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F78C812B68F39600EEA170 /* YHPersonInfoCommonCell.swift */; };
A5FD63BD2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63BC2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift */; }; A5FD63BD2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63BC2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift */; };
A5FD63BF2B6250BC00D1D9DA /* YHInformationPerfectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63BE2B6250BC00D1D9DA /* YHInformationPerfectCell.swift */; }; A5FD63BF2B6250BC00D1D9DA /* YHInformationPerfectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63BE2B6250BC00D1D9DA /* YHInformationPerfectCell.swift */; };
...@@ -501,6 +502,7 @@ ...@@ -501,6 +502,7 @@
A5C5B32C2B57D66000A7C5D1 /* YHBbxCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBbxCollectionViewCell.swift; sourceTree = "<group>"; }; A5C5B32C2B57D66000A7C5D1 /* YHBbxCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBbxCollectionViewCell.swift; sourceTree = "<group>"; };
A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeModel.swift; sourceTree = "<group>"; }; A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeModel.swift; sourceTree = "<group>"; };
A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomePageViewModel.swift; sourceTree = "<group>"; }; A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomePageViewModel.swift; sourceTree = "<group>"; };
A5F685F12B86D2E3006F4BF9 /* YHOtherPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOtherPickerView.swift; sourceTree = "<group>"; };
A5F78C812B68F39600EEA170 /* YHPersonInfoCommonCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPersonInfoCommonCell.swift; sourceTree = "<group>"; }; A5F78C812B68F39600EEA170 /* YHPersonInfoCommonCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPersonInfoCommonCell.swift; sourceTree = "<group>"; };
A5FD63BC2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationPerfectListVC.swift; sourceTree = "<group>"; }; A5FD63BC2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationPerfectListVC.swift; sourceTree = "<group>"; };
A5FD63BE2B6250BC00D1D9DA /* YHInformationPerfectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationPerfectCell.swift; sourceTree = "<group>"; }; A5FD63BE2B6250BC00D1D9DA /* YHInformationPerfectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationPerfectCell.swift; sourceTree = "<group>"; };
...@@ -682,7 +684,7 @@ ...@@ -682,7 +684,7 @@
path = VM; path = VM;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
0468D43D2B61F68100CFB916 /* MainApplicantInformation */ = { 0468D43D2B61F68100CFB916 /* MainApplicantInformation(主申请人信息) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04E86E3F2B8357EC00A35F4B /* M */, 04E86E3F2B8357EC00A35F4B /* M */,
...@@ -690,7 +692,7 @@ ...@@ -690,7 +692,7 @@
0468D4402B61F6C400CFB916 /* V */, 0468D4402B61F6C400CFB916 /* V */,
0468D43E2B61F6B100CFB916 /* C */, 0468D43E2B61F6B100CFB916 /* C */,
); );
path = MainApplicantInformation; path = "MainApplicantInformation(主申请人信息)";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
0468D43E2B61F6B100CFB916 /* C */ = { 0468D43E2B61F6B100CFB916 /* C */ = {
...@@ -1152,6 +1154,7 @@ ...@@ -1152,6 +1154,7 @@
A596C39C2B84D9100067BBB8 /* YHOtherYesOrNoItemView.swift */, A596C39C2B84D9100067BBB8 /* YHOtherYesOrNoItemView.swift */,
A596C39D2B84D9100067BBB8 /* YHOtherSelecteItemView.swift */, A596C39D2B84D9100067BBB8 /* YHOtherSelecteItemView.swift */,
A596C39E2B84D9100067BBB8 /* YHOtherInfoSessionView.swift */, A596C39E2B84D9100067BBB8 /* YHOtherInfoSessionView.swift */,
A5F685F12B86D2E3006F4BF9 /* YHOtherPickerView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1491,7 +1494,7 @@ ...@@ -1491,7 +1494,7 @@
A58556BB2B6BD81C003746B2 /* BaseInformation(基本资料) */, A58556BB2B6BD81C003746B2 /* BaseInformation(基本资料) */,
A5167B2D2B6A23D10084C08F /* PersonInfoList(个人信息表) */, A5167B2D2B6A23D10084C08F /* PersonInfoList(个人信息表) */,
A5167B292B6A174B0084C08F /* MyScore(我的评分) */, A5167B292B6A174B0084C08F /* MyScore(我的评分) */,
0468D43D2B61F68100CFB916 /* MainApplicantInformation */, 0468D43D2B61F68100CFB916 /* MainApplicantInformation(主申请人信息) */,
041B52882B5E13EB007EBCEB /* FamilyMember(家庭成员信息表) */, 041B52882B5E13EB007EBCEB /* FamilyMember(家庭成员信息表) */,
); );
path = "ServiceProcess(流程)"; path = "ServiceProcess(流程)";
...@@ -1715,6 +1718,7 @@ ...@@ -1715,6 +1718,7 @@
A5C5B3002B55623800A7C5D1 /* YHMainContentBaseViewController.swift in Sources */, A5C5B3002B55623800A7C5D1 /* YHMainContentBaseViewController.swift in Sources */,
A5234E2C2B6E3BA400A33433 /* YHBasicInfoFillCell.swift in Sources */, A5234E2C2B6E3BA400A33433 /* YHBasicInfoFillCell.swift in Sources */,
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */, A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */,
A5F685F22B86D2E3006F4BF9 /* YHOtherPickerView.swift in Sources */,
A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */, A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */,
A5FD63DF2B6639AD00D1D9DA /* YHScoreDataModel.swift in Sources */, A5FD63DF2B6639AD00D1D9DA /* YHScoreDataModel.swift in Sources */,
A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */, A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */,
......
...@@ -104,7 +104,7 @@ class YHFormPickerView: UIView { ...@@ -104,7 +104,7 @@ class YHFormPickerView: UIView {
lazy var titleLabel: UILabel = { lazy var titleLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.textColor = UIColor(hexString:"#222222") label.textColor = UIColor.mainTextColor
label.textAlignment = .center label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize: 16) label.font = UIFont.PFSC_R(ofSize: 16)
label.text = "请选择" label.text = "请选择"
...@@ -382,6 +382,10 @@ class YHFormPickerView: UIView { ...@@ -382,6 +382,10 @@ class YHFormPickerView: UIView {
return "职业" return "职业"
case .professionCertificate: case .professionCertificate:
return "选择证书名称" return "选择证书名称"
case .language:
return "选择语言能力"
case .professionalSkill:
return "选择专业技能行业"
} }
} }
} }
...@@ -425,7 +429,7 @@ extension YHFormPickerView: UIPickerViewDelegate, UIPickerViewDataSource { ...@@ -425,7 +429,7 @@ extension YHFormPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView { func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
let label = UILabel() let label = UILabel()
label.textColor = UIColor(hexString:"#222222") label.textColor = UIColor.mainTextColor
label.textAlignment = .center label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize: 14) label.font = UIFont.PFSC_R(ofSize: 14)
label.text = "" label.text = ""
...@@ -619,7 +623,10 @@ extension YHFormPickerView { ...@@ -619,7 +623,10 @@ extension YHFormPickerView {
} else if title.contains("英国皇家特许会计师") { } else if title.contains("英国皇家特许会计师") {
return .professionCertificate(.ACA) return .professionCertificate(.ACA)
} }
case .language:
return .none
case .professionalSkill:
return .none
} }
return .none return .none
} }
......
...@@ -33,7 +33,10 @@ enum YHFormPickerViewType: Int { ...@@ -33,7 +33,10 @@ enum YHFormPickerViewType: Int {
case degreeLocation case degreeLocation
// 专业证书 // 专业证书
case professionCertificate case professionCertificate
// 语言能力
case language
// 专业技能行业
case professionalSkill
} }
enum YHPickerViewMarriageType: Int { enum YHPickerViewMarriageType: Int {
...@@ -337,8 +340,6 @@ enum YHFormPickerViewSubType { ...@@ -337,8 +340,6 @@ enum YHFormPickerViewSubType {
return "CIMA(管理会计师考试)" return "CIMA(管理会计师考试)"
case .professionCertificate(.ACA): case .professionCertificate(.ACA):
return "The Associate Chartered Accountant(英国皇家特许会计师)" return "The Associate Chartered Accountant(英国皇家特许会计师)"
return ""
} }
} }
...@@ -477,7 +478,6 @@ enum YHFormPickerViewSubType { ...@@ -477,7 +478,6 @@ enum YHFormPickerViewSubType {
return 12 return 12
case .professionCertificate(.ACA): case .professionCertificate(.ACA):
return 13 return 13
return -1
} }
} }
......
...@@ -78,7 +78,7 @@ class YHFormItemExpireDateCell: UITableViewCell { ...@@ -78,7 +78,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
private lazy var detailLabel: UILabel = { private lazy var detailLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.textColor = UIColor(hexString: "#222222") label.textColor = UIColor.mainTextColor
label.textAlignment = .left label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize: 14) label.font = UIFont.PFSC_R(ofSize: 14)
return label return label
......
...@@ -88,7 +88,7 @@ class YHSaveAndSubmitView: UIView { ...@@ -88,7 +88,7 @@ class YHSaveAndSubmitView: UIView {
let btn = UIButton() let btn = UIButton()
btn.setTitle("保存", for: .normal) btn.setTitle("保存", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14) btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hexString:"#222222"), for: .normal) btn.setTitleColor(UIColor.mainTextColor, for: .normal)
btn.backgroundColor = UIColor(hexString:"#F8F9FB") btn.backgroundColor = UIColor(hexString:"#F8F9FB")
btn.layer.cornerRadius = 8.0 btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSaveBtn), for: .touchUpInside) btn.addTarget(self, action: #selector(didClickSaveBtn), for: .touchUpInside)
......
...@@ -170,7 +170,7 @@ extension YHSelectCountryViewController: UICollectionViewDelegate, UICollectionV ...@@ -170,7 +170,7 @@ extension YHSelectCountryViewController: UICollectionViewDelegate, UICollectionV
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let string = hotDataSource[indexPath.row] let string = hotDataSource[indexPath.row]
let size = (string as NSString).size(withAttributes: [NSAttributedString.Key.font : kFont(size: 13)]) let size = (string as NSString).size(withAttributes: [NSAttributedString.Key.font : UIFont.PFSC_R(ofSize: 13)])
return CGSize(width: size.width + 25, height: 32) // 这里可以根据需求设置不同的尺寸 return CGSize(width: size.width + 25, height: 32) // 这里可以根据需求设置不同的尺寸
} }
...@@ -199,7 +199,7 @@ class YHCountryCollectionViewCell: UICollectionViewCell { ...@@ -199,7 +199,7 @@ class YHCountryCollectionViewCell: UICollectionViewCell {
label = { label = {
let view = UILabel() let view = UILabel()
view.textAlignment = .center view.textAlignment = .center
view.font = kFont(size: 13) view.font = UIFont.PFSC_R(ofSize: 13)
view.textColor = UIColor(hex: 0x222222) view.textColor = UIColor(hex: 0x222222)
view.backgroundColor = UIColor(hex: 0xf8f9fb) view.backgroundColor = UIColor(hex: 0xf8f9fb)
view.layer.masksToBounds = true view.layer.masksToBounds = true
...@@ -240,7 +240,7 @@ class YHCountryTableViewCell: UITableViewCell { ...@@ -240,7 +240,7 @@ class YHCountryTableViewCell: UITableViewCell {
func setupUI() { func setupUI() {
titleLabel = { titleLabel = {
let label = UILabel() let label = UILabel()
label.font = kFont(size: 13) label.font = UIFont.PFSC_R(ofSize: 13)
label.textColor = UIColor(hex:0x222222) label.textColor = UIColor(hex:0x222222)
return label return label
}() }()
......
...@@ -69,10 +69,10 @@ class YHStepView: UIScrollView { ...@@ -69,10 +69,10 @@ class YHStepView: UIScrollView {
} }
let label = UILabel() let label = UILabel()
label.text = array[i] label.text = array[i]
label.font = kFont(size: 13) label.font = UIFont.PFSC_R(ofSize: 13)
label.textAlignment = .center label.textAlignment = .center
label.tag = 2000 + i label.tag = 2000 + i
label.textColor = UIColor.init(hex: 0x222222) label.textColor = UIColor.mainTextColor
addSubview(label) addSubview(label)
label.snp.makeConstraints { make in label.snp.makeConstraints { make in
make.centerX.equalTo(button.snp.centerX) make.centerX.equalTo(button.snp.centerX)
...@@ -100,13 +100,13 @@ class YHStepView: UIScrollView { ...@@ -100,13 +100,13 @@ class YHStepView: UIScrollView {
if currentIndex == i { if currentIndex == i {
button.setBackgroundImage(UIImage(named: "service_step_now"), for: .normal) button.setBackgroundImage(UIImage(named: "service_step_now"), for: .normal)
label.textColor = UIColor.init(hex: 0x4388ff) label.textColor = UIColor.brandMainColor
} else if i < currentIndex { } else if i < currentIndex {
button.setBackgroundImage(UIImage(named: "service_step_success"), for: .normal) button.setBackgroundImage(UIImage(named: "service_step_success"), for: .normal)
label.textColor = UIColor.init(hex: 0x222222) label.textColor = UIColor.mainTextColor
} else { } else {
button.setBackgroundImage(UIImage(named: "service_step_fail"), for: .normal) button.setBackgroundImage(UIImage(named: "service_step_fail"), for: .normal)
label.textColor = UIColor.init(hex: 0xc0c0c0) label.textColor = UIColor.placeHolderColor
} }
} }
} }
...@@ -125,13 +125,16 @@ class YHStepView: UIScrollView { ...@@ -125,13 +125,16 @@ class YHStepView: UIScrollView {
} }
if currentIndex == i { if currentIndex == i {
button?.setBackgroundImage(UIImage(named: "service_step_now"), for: .normal) button?.setBackgroundImage(UIImage(named: "service_step_now"), for: .normal)
lable?.textColor = UIColor.init(hex: 0x4388ff) lable?.textColor = UIColor.brandMainColor
lable?.font = UIFont.PFSC_M(ofSize: 13)
} else if i < currentIndex { } else if i < currentIndex {
button?.setBackgroundImage(UIImage(named: "service_step_success"), for: .normal) button?.setBackgroundImage(UIImage(named: "service_step_success"), for: .normal)
lable?.textColor = UIColor.init(hex: 0x222222) lable?.textColor = UIColor.mainTextColor
lable?.font = UIFont.PFSC_R(ofSize: 13)
} else { } else {
button?.setBackgroundImage(UIImage(named: "service_step_fail"), for: .normal) button?.setBackgroundImage(UIImage(named: "service_step_fail"), for: .normal)
lable?.textColor = UIColor.init(hex: 0xc0c0c0) lable?.textColor = UIColor.placeHolderColor
lable?.font = UIFont.PFSC_R(ofSize: 13)
} }
} }
} }
......
...@@ -63,6 +63,8 @@ class YHOtherInfoFillCell: UITableViewCell { ...@@ -63,6 +63,8 @@ class YHOtherInfoFillCell: UITableViewCell {
}() }()
let languageView = YHOtherSelecteItemView()
let skillView = YHOtherSelecteItemView()
} }
extension YHOtherInfoFillCell { extension YHOtherInfoFillCell {
...@@ -213,7 +215,7 @@ extension YHOtherInfoFillCell { ...@@ -213,7 +215,7 @@ extension YHOtherInfoFillCell {
} }
let view = YHOtherSelecteItemView() let view = languageView
view.updateKeyName(name: "您的语言水平与下列哪一项符合", keyValue:dataModel.language_detail?.levelDes ?? "") view.updateKeyName(name: "您的语言水平与下列哪一项符合", keyValue:dataModel.language_detail?.levelDes ?? "")
view.type = 2 view.type = 2
holdView2.addSubview(view) holdView2.addSubview(view)
...@@ -225,6 +227,10 @@ extension YHOtherInfoFillCell { ...@@ -225,6 +227,10 @@ extension YHOtherInfoFillCell {
make.height.equalTo(YHOtherSelecteItemView.getViewHBy(type: 2)) make.height.equalTo(YHOtherSelecteItemView.getViewHBy(type: 2))
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
} }
let tap = UITapGestureRecognizer(target: self, action: #selector(tapViewItem))
view.addGestureRecognizer(tap)
} }
...@@ -248,7 +254,7 @@ extension YHOtherInfoFillCell { ...@@ -248,7 +254,7 @@ extension YHOtherInfoFillCell {
} }
let view = YHOtherSelecteItemView() let view = skillView
view.updateKeyName(name: "最能代表你的专业技能的行业", keyValue: dataModel.profession?.optionDes ?? "") view.updateKeyName(name: "最能代表你的专业技能的行业", keyValue: dataModel.profession?.optionDes ?? "")
view.type = 2 view.type = 2
holdView3.addSubview(view) holdView3.addSubview(view)
...@@ -260,6 +266,11 @@ extension YHOtherInfoFillCell { ...@@ -260,6 +266,11 @@ extension YHOtherInfoFillCell {
make.height.equalTo(YHOtherSelecteItemView.getViewHBy(type: 2)) make.height.equalTo(YHOtherSelecteItemView.getViewHBy(type: 2))
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
} }
let tap = UITapGestureRecognizer(target: self, action: #selector(tapViewItem2))
skillView.addGestureRecognizer(tap)
} }
...@@ -392,3 +403,22 @@ extension YHOtherInfoFillCell { ...@@ -392,3 +403,22 @@ extension YHOtherInfoFillCell {
return holdView1 return holdView1
} }
} }
extension YHOtherInfoFillCell {
@objc func tapViewItem(_ gestureRecognizer: UIPanGestureRecognizer) {
YHOtherPickerView.show(type: .language) { item in
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 ?? "")
}
}
@objc func tapViewItem2(_ gestureRecognizer: UIPanGestureRecognizer) {
YHOtherPickerView.show(type: .professionalSkill) { item in
print(item)
self.dataModel?.profession?.option = Int(item.index) ?? 0
self.dataModel?.profession?.optionDes = item.title
self.skillView.updateKeyName(name: "最能代表你的专业技能的行业", keyValue:self.dataModel?.profession?.optionDes ?? "")
}
}
}
//
// YHOtherPickerView.swift
// galaxy
//
// Created by davidhuangA on 2024/2/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
//
// YHFormPickerView.swift
// galaxy
//
// Created by edy on 2024/1/29.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
// 【 用法 Usage】
/*
// (1) 直接传type
YHFormPickerView.show(type: .certificate, selectType: .certificate(.otherStatelessTravelPassport)) { selectType in
// 选择类型的标题
print(selectType.title)
}
// (2) 直接传字符串值
YHFormPickerView.show(type: .certificate, selectTitle: "公务通行证") { selectType in
// 选择类型的标题
print(selectType.title)
}
*/
//class YHOtherPickerView {
//
// let type: YHFormPickerViewSubType
// lazy var title = {
// return type.title
// }()
//
// init(type: YHFormPickerViewSubType) {
// self.type = type
// }
//}
struct YHOtherPickerViewItemData {
let title : String
let subTitle : String
let index : String
}
class YHOtherPickerView: UIView {
private var type : YHFormPickerViewType = .none
var arrData : [YHOtherPickerViewItemData] = []
private var selectType:YHFormPickerViewSubType?
// private var selectTitle:String? {
// didSet {
// let type:YHFormPickerViewSubType = getSubType(selectTitle)
// selectType = type
// }
// }
private var selectBlock:((YHOtherPickerViewItemData)->Void)? //回调
private var userSelectedItem : YHOtherPickerViewItemData? //用户选择的item
var title: String? {
didSet {
titleLabel.text = title
}
}
lazy var pickerView:UIPickerView = {
let view = UIPickerView()
view.dataSource = self
view.delegate = self
return view
}()
lazy var blackMaskView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismiss))
view.addGestureRecognizer(tap)
return view
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
lazy var topView:UIView = {
let view = UIView()
view.addSubview(titleLabel)
view.addSubview(cancelBtn)
view.addSubview(confirmBtn)
titleLabel.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
cancelBtn.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview()
make.width.equalTo(60)
}
confirmBtn.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.width.equalTo(60)
}
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize: 16)
label.text = "请选择"
return label
}()
lazy var cancelBtn: UIButton = {
let btn = UIButton()
btn.setTitle("取消".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0x222222), for: .normal)
btn.addTarget(self, action: #selector(didClickCancelButton), for: .touchUpInside)
return btn
}()
lazy var confirmBtn: UIButton = {
let btn = UIButton()
btn.setTitle("确定".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0x4487F9), for: .normal)
btn.addTarget(self, action: #selector(didClickConfirmButton), for: .touchUpInside)
return btn
}()
init(type: YHFormPickerViewType) {
super.init(frame: UIScreen.main.bounds)
self.createUI()
self.type = type
initDataSource()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func show() {
// showSelectType(&selectType)
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
static func show(type:YHFormPickerViewType, selectType:YHFormPickerViewSubType? = nil, callBack: @escaping ((YHOtherPickerViewItemData)->Void)) {
let picker = YHOtherPickerView(type: type)
// picker.selectType = selectType
picker.selectBlock = callBack
picker.show()
}
@objc func dismiss() {
self.removeFromSuperview()
}
func createUI() {
self.addSubview(blackMaskView)
self.addSubview(whiteContentView)
whiteContentView.addSubview(topView)
whiteContentView.addSubview(pickerView)
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
let path = UIBezierPath(roundedRect:bounds,byRoundingCorners: corner,cornerRadii:CGSizeMake(16.0, 16.0));
let layer = CAShapeLayer();
layer.frame = whiteContentView.bounds;
layer.path = path.cgPath;
whiteContentView.layer.mask = layer;
if let title = title {
titleLabel.text = title
} else {
titleLabel.text = getTitle(type: type)
}
blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
whiteContentView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalToSuperview().offset(KScreenHeight*2/3.0)
}
topView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(52)
}
pickerView.snp.makeConstraints { make in
make.top.equalTo(topView.snp.bottom)
make.left.right.bottom.equalToSuperview()
}
}
@objc func didClickCancelButton() {
dismiss()
}
@objc func didClickConfirmButton() {
if let item = userSelectedItem {
selectBlock?(item)
}
dismiss()
}
func showSelectType(_ selectType: inout YHFormPickerViewSubType?) {
// 处理从外部传入的选中第几行的参数
// 是否找到选中行数据
// var selectIndex:Int = -1
// if let selectType = selectType, let arr = dataDict[type], !arr.isEmpty {
// for (index, item) in arr.enumerated() {
// if selectType.index == item.type.index {
// selectIndex = index
// break
// }
// }
// }
//
// if selectIndex != -1 { // 找到了选择行
// pickerView.selectRow(selectIndex, inComponent: 0, animated: true)
// } else { // 未找到选中行数据则滚动至第一行
// if dataDict[type]?.isEmpty == true { return }
// if let arr = dataDict[type], !arr.isEmpty {
// let item = arr[0]
// selectType = item.type
// pickerView.selectRow(0, inComponent: 0, animated: true)
// }
// }
}
func getTitle(type: YHFormPickerViewType)-> String {
switch type {
case .language:
return "选择语言能力"
case .professionalSkill:
return "选择专业技能行业"
default:
return "请选择"
}
}
}
extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return arrData.count
}
// func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
// if 0 <= row && row < arrData.count {
// let item :YHOtherPickerViewItemData = arrData[row]
// return item.title
// }
// return ""
// }
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
if 0 <= row && row < arrData.count {
let item :YHOtherPickerViewItemData = arrData[row]
print(item)
userSelectedItem = item
}
}
func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
return 70
}
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 14)
label.numberOfLines = 0
if 0 <= row && row < arrData.count {
let item :YHOtherPickerViewItemData = arrData[row]
if item.subTitle.count > 0 {
let a: ASAttributedString = .init(NSAttributedString(string: (item.title + "\n")), .font(UIFont.PFSC_M(ofSize: 14)),.foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init(NSAttributedString(string: item.subTitle), .font(UIFont.PFSC_R(ofSize: 11)),.foreground(UIColor.labelTextColor2))
label.attributed.text = a + b
} else {
let a: ASAttributedString = .init(NSAttributedString(string: item.title), .font(UIFont.PFSC_M(ofSize: 14)),.foreground(UIColor.mainTextColor))
label.attributed.text = a
}
}
// 选中背景色
if #available(iOS 14.0, *), pickerView.subviews.count > 1 {
pickerView.subviews[1].backgroundColor = UIColor(hex: 0x4487F9, alpha: 0.06)
}
return label
}
}
extension YHOtherPickerView {
func initDataSource() {
//根据type 构建对应的数据源
switch type {
case .language:
let arr = YHOtherInfoFillViewModel.arrLanguage
arrData.removeAll()
arr.forEach { item in
let model = YHOtherPickerViewItemData(title: item["title"] ?? "-", subTitle: item["dec"] ?? "-", index: item["id"] ?? "-")
arrData.append(model)
}
title = getTitle(type: type)
return
case .professionalSkill:
let arr = YHOtherInfoFillViewModel.arrSkill
arrData.removeAll()
arr.forEach { item in
let model = YHOtherPickerViewItemData(title: item["title"] ?? "-", subTitle: item["dec"] ?? "-", index: item["value"] ?? "-")
arrData.append(model)
}
title = getTitle(type: type)
return
default:
return
}
}
}
...@@ -11,7 +11,7 @@ import UIKit ...@@ -11,7 +11,7 @@ import UIKit
class YHOtherInfoFillViewModel: YHBaseViewModel { class YHOtherInfoFillViewModel: YHBaseViewModel {
var otherInfoFillData : YHOtherInfoFillModel? var otherInfoFillData : YHOtherInfoFillModel?
var arrLanguage : [[String : String]] = [ static let arrLanguage : [[String : String]] = [
["id":"1", ["id":"1",
"title": "中文及英文", "title": "中文及英文",
"dec": "国外大学(英语国家)毕业,英文授课,获得学位证。(如为中外联合办学,在中国上课的,不算)", "dec": "国外大学(英语国家)毕业,英文授课,获得学位证。(如为中外联合办学,在中国上课的,不算)",
...@@ -39,7 +39,7 @@ class YHOtherInfoFillViewModel: YHBaseViewModel { ...@@ -39,7 +39,7 @@ class YHOtherInfoFillViewModel: YHBaseViewModel {
] ]
var arrSkill : [[String : String]] = [ static let arrSkill : [[String : String]] = [
[ [
"title": "学术研究及教育", "title": "学术研究及教育",
"dec": "幼儿教育、高等教育、学术研究", "dec": "幼儿教育、高等教育、学术研究",
...@@ -204,7 +204,7 @@ extension YHOtherInfoFillViewModel { ...@@ -204,7 +204,7 @@ extension YHOtherInfoFillViewModel {
if let language = self.otherInfoFillData?.language_detail { if let language = self.otherInfoFillData?.language_detail {
if language.level > 0 { if language.level > 0 {
let target = String(language.level) let target = String(language.level)
for(_,item) in arrLanguage.enumerated() { for(_,item) in YHOtherInfoFillViewModel.arrLanguage.enumerated() {
if target == item["id"] { if target == item["id"] {
language.levelDes = item["title"] ?? "" language.levelDes = item["title"] ?? ""
...@@ -219,7 +219,7 @@ extension YHOtherInfoFillViewModel { ...@@ -219,7 +219,7 @@ extension YHOtherInfoFillViewModel {
if let profession = self.otherInfoFillData?.profession { if let profession = self.otherInfoFillData?.profession {
if profession.option > 0 { if profession.option > 0 {
let target = String(profession.option) let target = String(profession.option)
for(_,item) in arrSkill.enumerated() { for(_,item) in YHOtherInfoFillViewModel.arrSkill.enumerated() {
if target == item["value"] { if target == item["value"] {
profession.optionDes = item["title"] ?? "" profession.optionDes = item["title"] ?? ""
......
...@@ -55,7 +55,7 @@ class YHWorkActionView: UIView { ...@@ -55,7 +55,7 @@ class YHWorkActionView: UIView {
exampleButton = { exampleButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.titleLabel?.font = kFont(size: 13) button.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
button.contentHorizontalAlignment = .center button.contentHorizontalAlignment = .center
button.setTitle("参考示例", for: .normal) button.setTitle("参考示例", for: .normal)
button.setTitleColor( UIColor(hex:0x2f7ef6), for: .normal) button.setTitleColor( UIColor(hex:0x2f7ef6), for: .normal)
......
...@@ -72,7 +72,7 @@ class YHWorkExampleTypeView: UIView { ...@@ -72,7 +72,7 @@ class YHWorkExampleTypeView: UIView {
button.setTitle(dataSource[i], for: .normal) button.setTitle(dataSource[i], for: .normal)
button.setTitleColor(UIColor(hex: 0x222222), for: .normal) button.setTitleColor(UIColor(hex: 0x222222), for: .normal)
button.setBackgroundColor(color: UIColor(hex: 0xf8f9fb), forState: .normal) button.setBackgroundColor(color: UIColor(hex: 0xf8f9fb), forState: .normal)
button.titleLabel?.font = kFont(size: 13) button.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
button.layer.cornerRadius = 16 button.layer.cornerRadius = 16
button.tag = 3000 + i button.tag = 3000 + i
button.addTarget(self, action: #selector(exampleClick(sender:)), for: .touchUpInside) button.addTarget(self, action: #selector(exampleClick(sender:)), for: .touchUpInside)
......
...@@ -109,7 +109,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell { ...@@ -109,7 +109,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell {
button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .selected) button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .selected)
button.setTitleColor(UIColor(hex: 0x222222), for: .normal) button.setTitleColor(UIColor(hex: 0x222222), for: .normal)
button.setTitle("是", for: .normal) button.setTitle("是", for: .normal)
button.titleLabel?.font = kFont(size: 13) button.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
button.layer.cornerRadius = 16 button.layer.cornerRadius = 16
button.layer.borderWidth = 1 button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor button.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
...@@ -131,7 +131,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell { ...@@ -131,7 +131,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell {
button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .selected) button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .selected)
button.setTitleColor(UIColor(hex: 0x222222), for: .normal) button.setTitleColor(UIColor(hex: 0x222222), for: .normal)
button.setTitle("否", for: .normal) button.setTitle("否", for: .normal)
button.titleLabel?.font = kFont(size: 13) button.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
button.layer.cornerRadius = 16 button.layer.cornerRadius = 16
button.addTarget(self, action: #selector(leftClick), for: .touchUpInside) button.addTarget(self, action: #selector(leftClick), for: .touchUpInside)
return button return button
......
...@@ -78,7 +78,7 @@ class YHCodeSueecssViewController: YHBaseViewController { ...@@ -78,7 +78,7 @@ class YHCodeSueecssViewController: YHBaseViewController {
loginSubTitleLabel = { loginSubTitleLabel = {
let label = UILabel() let label = UILabel()
label.text = "已发送至 \(phoneNumber ?? "")" label.text = "已发送至 \(phoneNumber ?? "")"
label.font = kFont(size: 13) label.font = UIFont.PFSC_R(ofSize: 13)
label.textColor = UIColor(hex:0xc0c0c0) label.textColor = UIColor(hex:0xc0c0c0)
return label return label
}() }()
......
...@@ -96,7 +96,7 @@ class YHPhoneLoginViewController: YHBaseViewController { ...@@ -96,7 +96,7 @@ class YHPhoneLoginViewController: YHBaseViewController {
loginSubTitleLabel = { loginSubTitleLabel = {
let label = UILabel() let label = UILabel()
label.text = "手机号首次登录自动注册" label.text = "手机号首次登录自动注册"
label.font = kFont(size: 13) label.font = UIFont.PFSC_R(ofSize: 13)
label.textColor = UIColor(hex:0xc0c0c0) label.textColor = UIColor(hex:0xc0c0c0)
return label return label
}() }()
......
...@@ -50,7 +50,7 @@ class YHAboutUsViewController: YHBaseViewController { ...@@ -50,7 +50,7 @@ class YHAboutUsViewController: YHBaseViewController {
lazy var aboutLabel = { lazy var aboutLabel = {
var label = UILabel() var label = UILabel()
label.text = "关于银河".local label.text = "关于银河".local
label.textColor = UIColor(hexString:"#222222") label.textColor = UIColor.mainTextColor
label.textAlignment = NSTextAlignment.left label.textAlignment = NSTextAlignment.left
label.font = UIFont.systemFont(ofSize: 20) label.font = UIFont.systemFont(ofSize: 20)
return label return label
...@@ -69,7 +69,7 @@ class YHAboutUsViewController: YHBaseViewController { ...@@ -69,7 +69,7 @@ class YHAboutUsViewController: YHBaseViewController {
lazy var advantageLabel = { lazy var advantageLabel = {
var label = UILabel() var label = UILabel()
label.text = "四大优势" label.text = "四大优势"
label.textColor = UIColor(hexString:"#222222") label.textColor = UIColor.mainTextColor
label.textAlignment = .center label.textAlignment = .center
label.font = UIFont.systemFont(ofSize: 15) label.font = UIFont.systemFont(ofSize: 15)
return label return label
......
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