Commit 2f3cc4ef authored by David黄金龙's avatar David黄金龙

我的积分 UI

parent 65941070
...@@ -145,6 +145,9 @@ ...@@ -145,6 +145,9 @@
A5FD63D62B65FCA400D1D9DA /* YHScoreTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D52B65FCA400D1D9DA /* YHScoreTitleView.swift */; }; A5FD63D62B65FCA400D1D9DA /* YHScoreTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D52B65FCA400D1D9DA /* YHScoreTitleView.swift */; };
A5FD63D82B6603A500D1D9DA /* YHScoreResultView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D72B6603A500D1D9DA /* YHScoreResultView.swift */; }; A5FD63D82B6603A500D1D9DA /* YHScoreResultView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D72B6603A500D1D9DA /* YHScoreResultView.swift */; };
A5FD63DA2B66060800D1D9DA /* YHScoreOptionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D92B66060800D1D9DA /* YHScoreOptionsView.swift */; }; A5FD63DA2B66060800D1D9DA /* YHScoreOptionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D92B66060800D1D9DA /* YHScoreOptionsView.swift */; };
A5FD63DC2B6628F600D1D9DA /* scoreOptionData.plist in Resources */ = {isa = PBXBuildFile; fileRef = A5FD63DB2B6628F600D1D9DA /* scoreOptionData.plist */; };
A5FD63DF2B6639AD00D1D9DA /* YHScoreDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63DE2B6639AD00D1D9DA /* YHScoreDataModel.swift */; };
A5FD63E12B66592300D1D9DA /* YHScoreItemCellForAge.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63E02B66592300D1D9DA /* YHScoreItemCellForAge.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
...@@ -322,6 +325,9 @@ ...@@ -322,6 +325,9 @@
A5FD63D52B65FCA400D1D9DA /* YHScoreTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreTitleView.swift; sourceTree = "<group>"; }; A5FD63D52B65FCA400D1D9DA /* YHScoreTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreTitleView.swift; sourceTree = "<group>"; };
A5FD63D72B6603A500D1D9DA /* YHScoreResultView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultView.swift; sourceTree = "<group>"; }; A5FD63D72B6603A500D1D9DA /* YHScoreResultView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultView.swift; sourceTree = "<group>"; };
A5FD63D92B66060800D1D9DA /* YHScoreOptionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreOptionsView.swift; sourceTree = "<group>"; }; A5FD63D92B66060800D1D9DA /* YHScoreOptionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreOptionsView.swift; sourceTree = "<group>"; };
A5FD63DB2B6628F600D1D9DA /* scoreOptionData.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = scoreOptionData.plist; sourceTree = "<group>"; };
A5FD63DE2B6639AD00D1D9DA /* YHScoreDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreDataModel.swift; sourceTree = "<group>"; };
A5FD63E02B66592300D1D9DA /* YHScoreItemCellForAge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreItemCellForAge.swift; sourceTree = "<group>"; };
B6BB01E4C5DB87B66F0ECE84 /* Pods-galaxy.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.release.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.release.xcconfig"; sourceTree = "<group>"; }; B6BB01E4C5DB87B66F0ECE84 /* Pods-galaxy.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.release.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -765,6 +771,7 @@ ...@@ -765,6 +771,7 @@
A5ACE9172B4564F7002C94D2 /* M */ = { A5ACE9172B4564F7002C94D2 /* M */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A5FD63DD2B66397C00D1D9DA /* 我的评分 */,
A5C382D02B5FAAB300C5E65C /* YHContactItemModel.swift */, A5C382D02B5FAAB300C5E65C /* YHContactItemModel.swift */,
A5FD63C02B62616D00D1D9DA /* YHInformationPerfectModel.swift */, A5FD63C02B62616D00D1D9DA /* YHInformationPerfectModel.swift */,
A5FD63C22B63438A00D1D9DA /* YHContactMainItemStatusModel.swift */, A5FD63C22B63438A00D1D9DA /* YHContactMainItemStatusModel.swift */,
...@@ -925,6 +932,16 @@ ...@@ -925,6 +932,16 @@
A5FD63D52B65FCA400D1D9DA /* YHScoreTitleView.swift */, A5FD63D52B65FCA400D1D9DA /* YHScoreTitleView.swift */,
A5FD63D72B6603A500D1D9DA /* YHScoreResultView.swift */, A5FD63D72B6603A500D1D9DA /* YHScoreResultView.swift */,
A5FD63D92B66060800D1D9DA /* YHScoreOptionsView.swift */, A5FD63D92B66060800D1D9DA /* YHScoreOptionsView.swift */,
A5FD63DB2B6628F600D1D9DA /* scoreOptionData.plist */,
A5FD63E02B66592300D1D9DA /* YHScoreItemCellForAge.swift */,
);
path = "我的评分";
sourceTree = "<group>";
};
A5FD63DD2B66397C00D1D9DA /* 我的评分 */ = {
isa = PBXGroup;
children = (
A5FD63DE2B6639AD00D1D9DA /* YHScoreDataModel.swift */,
); );
path = "我的评分"; path = "我的评分";
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1039,6 +1056,7 @@ ...@@ -1039,6 +1056,7 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
A5FD63DC2B6628F600D1D9DA /* scoreOptionData.plist in Resources */,
04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */, 04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */,
A5C5B2EE2B4F9B8800A7C5D1 /* Localizable.xcstrings in Resources */, A5C5B2EE2B4F9B8800A7C5D1 /* Localizable.xcstrings in Resources */,
A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */, A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */,
...@@ -1121,6 +1139,7 @@ ...@@ -1121,6 +1139,7 @@
A5C5B3002B55623800A7C5D1 /* ContentBaseViewController.swift in Sources */, A5C5B3002B55623800A7C5D1 /* ContentBaseViewController.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 */,
A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */, A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */,
A5FD63BD2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift in Sources */, A5FD63BD2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift in Sources */,
041B52932B5E6CBA007EBCEB /* YHFormItemTitleCell.swift in Sources */, 041B52932B5E6CBA007EBCEB /* YHFormItemTitleCell.swift in Sources */,
...@@ -1175,6 +1194,7 @@ ...@@ -1175,6 +1194,7 @@
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */, 0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */,
042FBBB92B627C0F00F9DE23 /* YHCertificateInfo.swift in Sources */, 042FBBB92B627C0F00F9DE23 /* YHCertificateInfo.swift in Sources */,
A5ACE93F2B4564F7002C94D2 /* UIViewController+Extension.swift in Sources */, A5ACE93F2B4564F7002C94D2 /* UIViewController+Extension.swift in Sources */,
A5FD63E12B66592300D1D9DA /* YHScoreItemCellForAge.swift in Sources */,
A5ACE9472B4564F7002C94D2 /* YHHUD.swift in Sources */, A5ACE9472B4564F7002C94D2 /* YHHUD.swift in Sources */,
A5ACE9412B4564F7002C94D2 /* Dictionary+Extension.swift in Sources */, A5ACE9412B4564F7002C94D2 /* Dictionary+Extension.swift in Sources */,
A5C5B3102B57677300A7C5D1 /* YHGestureTableView.swift in Sources */, A5C5B3102B57677300A7C5D1 /* YHGestureTableView.swift in Sources */,
......
...@@ -9,11 +9,14 @@ ...@@ -9,11 +9,14 @@
import UIKit import UIKit
import GKNavigationBarSwift import GKNavigationBarSwift
/* /*
我的评分 / 评分详情 我的评分 / 评分详情
*/ */
class YHScoreDetailViewController: YHBaseViewController { class YHScoreDetailViewController: YHBaseViewController {
private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
//头部背景图片 //头部背景图片
lazy var headBkgImagV: UIImageView = { lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView() let imagV = UIImageView()
...@@ -31,22 +34,30 @@ class YHScoreDetailViewController: YHBaseViewController { ...@@ -31,22 +34,30 @@ class YHScoreDetailViewController: YHBaseViewController {
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension tableView.rowHeight = UITableView.automaticDimension
tableView.register(YHScorePersonInfoCell.self,forCellReuseIdentifier: YHScorePersonInfoCell.cellReuseIdentifier) tableView.register(YHScorePersonInfoCell.self,forCellReuseIdentifier: YHScorePersonInfoCell.cellReuseIdentifier)
tableView.register(YHScoreItemCell.self,forCellReuseIdentifier: YHScoreItemCell.cellReuseIdentifier) tableView.register(YHScoreItemCell.self,forCellReuseIdentifier: YHScoreItemCell.cellReuseIdentifier)
// tableView.register(YHDavidCell1.self,forCellReuseIdentifier: YHDavidCell1.cellReuseIdentifier) tableView.register(YHScoreItemCellForAge.self,forCellReuseIdentifier: YHScoreItemCellForAge.cellReuseIdentifier)
// tableView.register(YHDavidCell3.self,forCellReuseIdentifier: YHDavidCell3.cellReuseIdentifier)
// tableView.register(YHDavidCell2.self,forCellReuseIdentifier: YHDavidCell2.cellReuseIdentifier)
// tableView.register(YHDavidCell4.self,forCellReuseIdentifier: YHDavidCell4.cellReuseIdentifier)
// tableView.register(YHDavidCell5.self,forCellReuseIdentifier: YHDavidCell5.cellReuseIdentifier) // tableView.register(YHDavidCell1.self,forCellReuseIdentifier: YHDavidCell1.cellReuseIdentifier)
// tableView.register(YHDavidCell3.self,forCellReuseIdentifier: YHDavidCell3.cellReuseIdentifier)
// tableView.register(YHDavidCell2.self,forCellReuseIdentifier: YHDavidCell2.cellReuseIdentifier)
// tableView.register(YHDavidCell4.self,forCellReuseIdentifier: YHDavidCell4.cellReuseIdentifier)
// tableView.register(YHDavidCell5.self,forCellReuseIdentifier: YHDavidCell5.cellReuseIdentifier)
return tableView return tableView
}() }()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
//0.0
serviceCenterMainReqVM.loadLocalScoreData()
//1.0 //1.0
initView() initView()
} }
} }
...@@ -69,7 +80,7 @@ extension YHScoreDetailViewController { ...@@ -69,7 +80,7 @@ extension YHScoreDetailViewController {
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
make.height.equalTo(326) make.height.equalTo(326)
} }
homeTableView.delegate = self homeTableView.delegate = self
homeTableView.dataSource = self homeTableView.dataSource = self
...@@ -81,7 +92,7 @@ extension YHScoreDetailViewController { ...@@ -81,7 +92,7 @@ extension YHScoreDetailViewController {
make.right.equalTo(-16) make.right.equalTo(-16)
} }
// homeTableView.backgroundColor = .purple //for test hjl // homeTableView.backgroundColor = .purple //for test hjl
} }
} }
...@@ -124,9 +135,14 @@ extension YHScoreDetailViewController : UITableViewDelegate,UITableViewDataSourc ...@@ -124,9 +135,14 @@ extension YHScoreDetailViewController : UITableViewDelegate,UITableViewDataSourc
if indexPath.row == 0 { if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHScorePersonInfoCell.self) let cell = tableView.dequeueReusableCell(withClass: YHScorePersonInfoCell.self)
return cell return cell
} else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHScoreItemCellForAge.self)
cell.optionData = self.serviceCenterMainReqVM.localScoreData?[indexPath.row]
return cell
} }
let cell = tableView.dequeueReusableCell(withClass: YHScoreItemCell.self) let cell = tableView.dequeueReusableCell(withClass: YHScoreItemCell.self)
cell.optionData = self.serviceCenterMainReqVM.localScoreData?[indexPath.row]
return cell return cell
} }
......
//
// YHScoreDataModel.swift
// galaxy
//
// Created by davidhuangA on 2024/1/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHScoreDataModel: SmartCodable {
var age_score : YHScoreSessionModel?
var language_score : YHScoreSessionModel?
var background_score : YHScoreSessionModel?
var work_experience_score : YHScoreSessionModel?
var education_score : YHScoreSessionModel?
var talent_list_score : YHScoreSessionModel?
required init() {
}
subscript(_ index : Int) -> YHScoreSessionModel? {
if index == 1 {
return age_score
} else if index == 2 {
return language_score
} else if index == 3 {
return background_score
} else if index == 4 {
return work_experience_score
} else if index == 5 {
return education_score
} else if index == 6 {
return talent_list_score
}
return nil
}
}
class YHScoreOptiosModel : SmartCodable {
var isSelected : Bool = false
var scoreName : String = ""
var scoreValue : String = ""
required init() {
}
}
class YHScoreSessionModel : SmartCodable {
var name : String = "" //"年龄得分"
var score : String = "" //(最高30分)
var options : [YHScoreOptiosModel] = []
required init() {
}
}
...@@ -113,6 +113,9 @@ class YHInformationFillTipsAlertView: UIView { ...@@ -113,6 +113,9 @@ class YHInformationFillTipsAlertView: UIView {
let lable00 = UILabel(text: "我确认我所提供的材料真实有效,并知悉其中内容。") let lable00 = UILabel(text: "我确认我所提供的材料真实有效,并知悉其中内容。")
lable00.font = kFont(size: 12) lable00.font = kFont(size: 12)
lable00.textColor = UIColor(red: 0.533, green: 0.561, blue: 0.596, alpha: 1) lable00.textColor = UIColor(red: 0.533, green: 0.561, blue: 0.596, alpha: 1)
let tap = UITapGestureRecognizer(target: self, action: #selector(onClickAgree))
lable00.isUserInteractionEnabled = true
lable00.addGestureRecognizer(tap)
bottomView.addSubview(lable00) bottomView.addSubview(lable00)
lable00.snp.makeConstraints { make in lable00.snp.makeConstraints { make in
......
...@@ -17,7 +17,11 @@ class YHScoreItemCell: UITableViewCell { ...@@ -17,7 +17,11 @@ class YHScoreItemCell: UITableViewCell {
//// updateUI() //// updateUI()
// } // }
// } // }
var optionData : YHScoreSessionModel? {
didSet {
updateUI()
}
}
private lazy var holdView : UIView = { private lazy var holdView : UIView = {
let view = UIView() let view = UIView()
...@@ -27,15 +31,6 @@ class YHScoreItemCell: UITableViewCell { ...@@ -27,15 +31,6 @@ class YHScoreItemCell: UITableViewCell {
return view return view
}() }()
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
// Initialization code // Initialization code
...@@ -56,6 +51,13 @@ class YHScoreItemCell: UITableViewCell { ...@@ -56,6 +51,13 @@ class YHScoreItemCell: UITableViewCell {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
var titleView : YHScoreTitleView!
private var scoreOptionsView1 : YHScoreOptionsView!
private var scoreOptionsView2 : YHScoreOptionsView!
private var scoreOptionsView3 : YHScoreOptionsView!
private var scoreOptionsView4 : YHScoreOptionsView!
} }
extension YHScoreItemCell { extension YHScoreItemCell {
...@@ -77,7 +79,7 @@ extension YHScoreItemCell { ...@@ -77,7 +79,7 @@ extension YHScoreItemCell {
make.top.left.right.equalToSuperview() make.top.left.right.equalToSuperview()
} }
let titleView = YHScoreTitleView() titleView = YHScoreTitleView()
holdView.addSubview(titleView) holdView.addSubview(titleView)
titleView.snp.makeConstraints { make in titleView.snp.makeConstraints { make in
make.top.equalToSuperview() make.top.equalToSuperview()
...@@ -96,7 +98,7 @@ extension YHScoreItemCell { ...@@ -96,7 +98,7 @@ extension YHScoreItemCell {
make.height.equalTo(YHScoreTitleView.viewH) make.height.equalTo(YHScoreTitleView.viewH)
} }
let scoreOptionsView1 = YHScoreOptionsView() scoreOptionsView1 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView1) holdView.addSubview(scoreOptionsView1)
scoreOptionsView1.snp.makeConstraints { make in scoreOptionsView1.snp.makeConstraints { make in
make.top.equalTo(resultView.snp.bottom) make.top.equalTo(resultView.snp.bottom)
...@@ -104,7 +106,7 @@ extension YHScoreItemCell { ...@@ -104,7 +106,7 @@ extension YHScoreItemCell {
make.right.equalTo(titleView.snp.right) make.right.equalTo(titleView.snp.right)
} }
let scoreOptionsView2 = YHScoreOptionsView() scoreOptionsView2 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView2) holdView.addSubview(scoreOptionsView2)
scoreOptionsView2.snp.makeConstraints { make in scoreOptionsView2.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView1.snp.bottom) make.top.equalTo(scoreOptionsView1.snp.bottom)
...@@ -112,7 +114,7 @@ extension YHScoreItemCell { ...@@ -112,7 +114,7 @@ extension YHScoreItemCell {
make.right.equalTo(titleView.snp.right) make.right.equalTo(titleView.snp.right)
} }
let scoreOptionsView3 = YHScoreOptionsView() scoreOptionsView3 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView3) holdView.addSubview(scoreOptionsView3)
scoreOptionsView3.snp.makeConstraints { make in scoreOptionsView3.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView2.snp.bottom) make.top.equalTo(scoreOptionsView2.snp.bottom)
...@@ -120,7 +122,7 @@ extension YHScoreItemCell { ...@@ -120,7 +122,7 @@ extension YHScoreItemCell {
make.right.equalTo(titleView.snp.right) make.right.equalTo(titleView.snp.right)
} }
let scoreOptionsView4 = YHScoreOptionsView() scoreOptionsView4 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView4) holdView.addSubview(scoreOptionsView4)
scoreOptionsView4.snp.makeConstraints { make in scoreOptionsView4.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView3.snp.bottom) make.top.equalTo(scoreOptionsView3.snp.bottom)
...@@ -130,4 +132,26 @@ extension YHScoreItemCell { ...@@ -130,4 +132,26 @@ extension YHScoreItemCell {
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
} }
} }
func updateUI() {
guard let arrData = optionData?.options else {
return
}
titleView.updateWith(optionData?.name, optionData?.score)
for (index,item) in arrData.enumerated() {
if index == 0 {
scoreOptionsView1.nameLable.text = item.scoreName
} else if index == 1 {
scoreOptionsView2.nameLable.text = item.scoreName
} else if index == 2 {
scoreOptionsView3.nameLable.text = item.scoreName
} else if index == 3 {
scoreOptionsView4.nameLable.text = item.scoreName
}
}
}
} }
//
// YHScoreItemCellForAge.swift
// galaxy
//
// Created by davidhuangA on 2024/1/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHScoreItemCellForAge: UITableViewCell {
static let cellReuseIdentifier = "YHScoreItemCellForAge"
var optionData : YHScoreSessionModel? {
didSet {
updateUI()
}
}
private lazy var holdView : UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
view.clipsToBounds = true
return view
}()
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
var titleView : YHScoreTitleView!
private var scoreOptionsView1 : YHScoreOptionsView!
private var scoreOptionsView2 : YHScoreOptionsView!
private var scoreOptionsView3 : YHScoreOptionsView!
private var scoreOptionsView4 : YHScoreOptionsView!
}
extension YHScoreItemCellForAge {
func setupUI() {
backgroundColor = .clear
contentView.backgroundColor = .clear
contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in
make.top.right.left.equalToSuperview()
make.bottom.equalToSuperview().offset(-14)
}
titleView = YHScoreTitleView()
holdView.addSubview(titleView)
titleView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.equalTo(18)
make.right.equalTo(-18)
make.height.equalTo(YHScoreTitleView.viewH)
}
let resultView = YHScoreResultView()
holdView.addSubview(resultView)
resultView.snp.makeConstraints { make in
make.top.equalTo(titleView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
make.height.equalTo(YHScoreTitleView.viewH)
}
scoreOptionsView1 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView1)
scoreOptionsView1.snp.makeConstraints { make in
make.top.equalTo(resultView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView2 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView2)
scoreOptionsView2.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView1.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView3 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView3)
scoreOptionsView3.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView2.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView4 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView4)
scoreOptionsView4.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView3.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
make.bottom.equalToSuperview()
}
}
func updateUI() {
guard let arrData = optionData?.options else {
return
}
titleView.updateWith(optionData?.name, optionData?.score)
for (index,item) in arrData.enumerated() {
if index == 0 {
scoreOptionsView1.nameLable.text = item.scoreName
} else if index == 1 {
scoreOptionsView2.nameLable.text = item.scoreName
} else if index == 2 {
scoreOptionsView3.nameLable.text = item.scoreName
} else if index == 3 {
scoreOptionsView4.nameLable.text = item.scoreName
}
}
}
}
...@@ -12,7 +12,6 @@ class YHScoreOptionsView: UIView { ...@@ -12,7 +12,6 @@ class YHScoreOptionsView: UIView {
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
setupUI() setupUI()
} }
...@@ -20,8 +19,8 @@ class YHScoreOptionsView: UIView { ...@@ -20,8 +19,8 @@ class YHScoreOptionsView: UIView {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
private lazy var nameLable : UILabel = { lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "(3)学士学位/由国家或国际认可或著名的专业团 队颁授,证明持有人具有极高水平的专业知识或专业技能的专业资格 ") let lable0 = UILabel()
lable0.textColor = UIColor(hex: 0x4E4E4E) lable0.textColor = UIColor(hex: 0x4E4E4E)
lable0.font = UIFont.PingFangScR(ofSize: 14) lable0.font = UIFont.PingFangScR(ofSize: 14)
lable0.numberOfLines = 0 lable0.numberOfLines = 0
......
...@@ -71,3 +71,10 @@ private extension YHScoreTitleView { ...@@ -71,3 +71,10 @@ private extension YHScoreTitleView {
} }
} }
} }
extension YHScoreTitleView {
func updateWith(_ name: String?,_ text : String?) {
nameLable.text = name ?? "-"
desLable.text = text ?? "-"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>age_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>30</string>
<key>scoreName</key>
<string>118-39</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>20</string>
<key>scoreName</key>
<string>240-44</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>15</string>
<key>scoreName</key>
<string>345-50</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>15</string>
<key>scoreName</key>
<string>450+</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>年龄得分</string>
<key>score</key>
<string>(最高30分)</string>
</dict>
<key>education_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>40</string>
<key>scoreName</key>
<string>1)博士学位/2个或以上硕士学位</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>20</string>
<key>scoreName</key>
<string>2)硕士学位/2个或以上学士学位</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>10</string>
<key>scoreName</key>
<string>3)学士学位/由国家或国际认可或著名的专业团队颁授,证明持有人具有极高水平的专业知识或专业技能的专业资格</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>30</string>
<key>scoreName</key>
<string>4)如学士或以上程度的学位是由国际认可的著名院校颁授,可额外获取分数</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>学历/专业资格</string>
<key>score</key>
<string>(最高70分)</string>
</dict>
<key>work_experience_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>0</string>
<key>scoreName</key>
<string>1)获得最低学位证以后,拥有不超过2年工作经验</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>5</string>
<key>scoreName</key>
<string>2)不少于2年相当于学位程度或专家水平的工作经验</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>15</string>
<key>scoreName</key>
<string>3)不少于5年相当于学位程度或专家水平的工作经验</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>30</string>
<key>scoreName</key>
<string>4)不少于5年相当于学位程度或专家水平的工作经验,当中最少2年担任高级职位</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>40</string>
<key>scoreName</key>
<string>5)不少于10年相当于学位程度或专家水平的工作经验,当中最少5年担任高级职位</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>15</string>
<key>scoreName</key>
<string>6)如拥有不少于2年相当于学位程度或专家水平及在你原居国家/地区以外地方的国际工作经验,可额外获取分数</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>20</string>
<key>scoreName</key>
<string>7)如拥有不少于3年相当于学位程度或专家水平的跨国公司或知名企业的工作经验,如上市公司或位列《福布斯》全球企业2000强、《财富》世界500強和胡润中国500强企业,可额外获取分数</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>工作经验</string>
<key>score</key>
<string>(最高75分)</string>
</dict>
<key>talent_list_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>30</string>
<key>scoreName</key>
<string>1)如符合人才清单内相关专业的规格,可额外获取分数</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>人才清单</string>
<key>score</key>
<string>(最高30分)</string>
</dict>
<key>language_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>20</string>
<key>scoreName</key>
<string>1)中文及英文 —— 国外大学(英语国家)毕业,英文授课,获得学位证。(如为中外联合办学,在中国上课的,不算)</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>20</string>
<key>scoreName</key>
<string>2)中文及英文 —— 有近两年的雅思或托福成绩单(雅思考试G类或A类总分达6分;托福笔试达550分,计算机达213分,网考达80)</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>15</string>
<key>scoreName</key>
<string>3)中文及另一种外语 —— 非英文的外语,如:法文、日文等(需提供相关证书) </string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>10</string>
<key>scoreName</key>
<string>4)仅中文</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>10</string>
<key>scoreName</key>
<string>5)仅英文</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>语言能力</string>
<key>score</key>
<string>(最高20分)</string>
</dict>
<key>background_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>5</string>
<key>scoreName</key>
<string>1)至少一名直系家庭(已婚配偶、父母、兄弟姊妹、子女)是现居于香港的香港永久性居民</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>5</string>
<key>scoreName</key>
<string>2)随行已婚配偶的学历相当于大学学位或以上的水平</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>10</string>
<key>scoreName</key>
<string>3)每名随行的18岁以下未婚及受养的子女得5分,最高得10</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>家庭背景</string>
<key>score</key>
<string>(最高20分)</string>
</dict>
</dict>
</plist>
...@@ -11,8 +11,12 @@ import SmartCodable ...@@ -11,8 +11,12 @@ import SmartCodable
class YHServiceCenterMainViewModel: YHBaseViewModel { class YHServiceCenterMainViewModel: YHBaseViewModel {
//合同列表 数据 //合同列表 数据
var arrContactList : [YHContactItemModel] = [] var arrContactList : [YHContactItemModel] = []
//评分相关的 本地数据
var localScoreData : YHScoreDataModel?
} }
//请求接口
extension YHServiceCenterMainViewModel { extension YHServiceCenterMainViewModel {
//请求合同项 //请求合同项
func getContactList(callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) { func getContactList(callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
...@@ -41,8 +45,32 @@ extension YHServiceCenterMainViewModel { ...@@ -41,8 +45,32 @@ extension YHServiceCenterMainViewModel {
} }
} }
//其他方法
extension YHServiceCenterMainViewModel {
//加载本地 plist数据
func loadLocalScoreData() {
if let path = Bundle.main.path(forResource: "scoreOptionData", ofType: "plist") {
if let plistData = FileManager.default.contents(atPath: path) {
do {
let listDictionary = try PropertyListSerialization.propertyList(from: plistData, options: [], format: nil) as! [String: Any]
guard let model = YHScoreDataModel.deserialize(dict: listDictionary) else {
localScoreData = nil
return
}
localScoreData = model
} catch {
localScoreData = nil
}
} else {
localScoreData = nil
}
} else {
localScoreData = nil
}
}
}
//合同数据结构
struct YHContactItemHoldModel : SmartCodable { struct YHContactItemHoldModel : SmartCodable {
var orders : [YHContactItemModel] = [] var orders : [YHContactItemModel] = []
} }
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