Commit 2b181917 authored by Steven杜宇's avatar Steven杜宇

// 方案

parent e73b0a71
...@@ -30,6 +30,10 @@ class YHSchemeItem { ...@@ -30,6 +30,10 @@ class YHSchemeItem {
class YHMyNewSchemeViewController: YHBaseViewController { class YHMyNewSchemeViewController: YHBaseViewController {
var orderId: Int = 0 var orderId: Int = 0
// 通过的至少要求数量
let passMinCount: Int = 6
var tipsType = YHSchemeTipsType.none
var items: [[YHSchemeItem]] = [] var items: [[YHSchemeItem]] = []
var passArr: [YHComprehensiveEevaluationModel] = [] var passArr: [YHComprehensiveEevaluationModel] = []
var unpassArr: [YHComprehensiveEevaluationModel] = [] var unpassArr: [YHComprehensiveEevaluationModel] = []
...@@ -252,40 +256,60 @@ class YHMyNewSchemeViewController: YHBaseViewController { ...@@ -252,40 +256,60 @@ class YHMyNewSchemeViewController: YHBaseViewController {
} }
} }
isPass = passArr.count >= 6 items.removeAll()
// 至少满足6项才通过
isPass = passArr.count >= passMinCount
var arr1 = [YHSchemeItem]()
if passArr.count == 0 { // 一项都不满足 不通过
tipsType = .neverPass
let item1 = YHSchemeItem(type: .evaluate)
let item2 = YHSchemeItem(type: .modifyInfo)
arr1 = [item1, item2]
} else if 1 <= passArr.count, passArr.count < passMinCount { // 不满足至少通过数 不通过
tipsType = .partPass
let item1 = YHSchemeItem(type: .evaluate)
let item2 = YHSchemeItem(type: .hkRequireList)
let item3 = YHSchemeItem(type: .modifyInfo)
arr1 = [item1, item2, item3]
} else if passArr.count >= passMinCount { // 满足至少通过数
tipsType = .pass
if isPass {
let item1 = YHSchemeItem(type: .evaluate) let item1 = YHSchemeItem(type: .evaluate)
arr1.append(item1)
let item2 = YHSchemeItem(type: .hkRequireList) let item2 = YHSchemeItem(type: .hkRequireList)
arr1.append(item2)
let item3 = YHSchemeItem(type: .industryLocation) let item3 = YHSchemeItem(type: .industryLocation)
arr1.append(item3)
let item4 = YHSchemeItem(type: .materialList) let item4 = YHSchemeItem(type: .materialList)
arr1.append(item4)
let item5 = YHSchemeItem(type: .documentList) let item5 = YHSchemeItem(type: .documentList)
let item6 = YHSchemeItem(type: .improveScheme) arr1.append(item5)
var arr1: [YHSchemeItem]
if passArr.count > 0 { if passArr.count < self.viewModel.schemeModel.comprehensive_evaluation.count { // 不是全满足则显示提升方案
arr1 = [item1, item2, item3, item4, item5, item6] let item6 = YHSchemeItem(type: .improveScheme)
} else { arr1.append(item6)
arr1 = [item1, item3, item4, item5, item6] }
} }
items.append(arr1) items.append(arr1)
} else { if !isPass {
let item01 = YHSchemeItem(type: .evaluate)
let item02 = YHSchemeItem(type: .hkRequireList)
let item03 = YHSchemeItem(type: .modifyInfo)
var arr1: [YHSchemeItem] = []
if passArr.count > 0 {
arr1 = [item01, item02, item03]
} else {
arr1 = [item01, item03]
}
let item11 = YHSchemeItem(type: .improveTarget) let item11 = YHSchemeItem(type: .improveTarget)
let arr2: [YHSchemeItem] = [item11] let arr2: [YHSchemeItem] = [item11]
items.append(contentsOf: [arr1, arr2]) items.append(arr2)
} }
self.tableView.reloadData() self.tableView.reloadData()
} }
...@@ -379,7 +403,7 @@ extension YHMyNewSchemeViewController : UITableViewDelegate, UITableViewDataSour ...@@ -379,7 +403,7 @@ extension YHMyNewSchemeViewController : UITableViewDelegate, UITableViewDataSour
if item.type == .evaluate { if item.type == .evaluate {
let cell = tableView.dequeueReusableCell(withIdentifier: YHComprehensiveEvaluationCell.cellReuseIdentifier, for: indexPath) as! YHComprehensiveEvaluationCell let cell = tableView.dequeueReusableCell(withIdentifier: YHComprehensiveEvaluationCell.cellReuseIdentifier, for: indexPath) as! YHComprehensiveEvaluationCell
cell.isPass = isPass cell.tipsType = self.tipsType
targetCell = cell targetCell = cell
} }
......
...@@ -9,13 +9,28 @@ ...@@ -9,13 +9,28 @@
import UIKit import UIKit
import AttributedString import AttributedString
enum YHSchemeTipsType: Int {
case none = 0
case neverPass = 1 // 要求一项都不满足
case pass = 2 // 要求满足了6项以上 通过
case partPass = 3 // 要求未满足6项 不通过
}
class YHComprehensiveEvaluationCell: UITableViewCell { class YHComprehensiveEvaluationCell: UITableViewCell {
static let cellReuseIdentifier = "YHComprehensiveEvaluationCell" static let cellReuseIdentifier = "YHComprehensiveEvaluationCell"
var isPass: Bool = false { var tipsType: YHSchemeTipsType = .none {
didSet { didSet {
tipsLabel.attributed.text = isPass ? passText : unPassText if tipsType == .neverPass {
tipsLabel.attributed.text = neverPassText
} else if tipsType == .partPass {
tipsLabel.attributed.text = partPassText
} else if tipsType == .pass {
tipsLabel.attributed.text = passText
}
} }
} }
...@@ -43,10 +58,11 @@ class YHComprehensiveEvaluationCell: UITableViewCell { ...@@ -43,10 +58,11 @@ class YHComprehensiveEvaluationCell: UITableViewCell {
lazy var tipsLabel: UILabel = { lazy var tipsLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.numberOfLines = 0 label.numberOfLines = 0
label.attributed.text = unPassText label.attributed.text = neverPassText
return label return label
}() }()
lazy var passText: ASAttributedString = { lazy var passText: ASAttributedString = {
let aa: ASAttributedString = .init("经初步评估,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor)) let aa: ASAttributedString = .init("经初步评估,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init("您符合【优秀人才入境计划-综合计分制】甄选条件", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.init(hex: 0xD48638))) let bb: ASAttributedString = .init("您符合【优秀人才入境计划-综合计分制】甄选条件", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.init(hex: 0xD48638)))
...@@ -54,13 +70,20 @@ class YHComprehensiveEvaluationCell: UITableViewCell { ...@@ -54,13 +70,20 @@ class YHComprehensiveEvaluationCell: UITableViewCell {
return aa+bb+cc return aa+bb+cc
}() }()
lazy var unPassText: ASAttributedString = { lazy var partPassText: ASAttributedString = {
let aa: ASAttributedString = .init("经初步评估,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor)) let aa: ASAttributedString = .init("经初步评估,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init("您目前已符合【优秀人才入境计划 - 综合计分制】的部分重要甄选条件", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.init(hex: 0xD48638))) let bb: ASAttributedString = .init("您目前已符合【优秀人才入境计划 - 综合计分制】的部分重要甄选条件", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.init(hex: 0xD48638)))
let cc: ASAttributedString = .init(",在如下方面具备优势,足以证明您的优秀之处!考虑到优才计划的的多维度要求,以及您目前已经具备的良好基础,如果您能进一步去孵化其他条件,后续的申请将会更具竞争力", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor)) let cc: ASAttributedString = .init(",在如下方面具备优势,足以证明您的优秀之处!考虑到优才计划的的多维度要求,以及您目前已经具备的良好基础,如果您能进一步去孵化其他条件,后续的申请将会更具竞争力", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
return aa+bb+cc return aa+bb+cc
}() }()
lazy var neverPassText: ASAttributedString = {
let aa: ASAttributedString = .init("经初步评估,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init("您目前不符合【优秀人才入境计划-综合计分制】甄选条件", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.init(hex: 0xD48638)))
let cc: ASAttributedString = .init(",考虑到优才计划的的多维度要求,我们建议您进一步孵化以下条件,后续的申请将会更具竞争力", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
return aa+bb+cc
}()
lazy var bgView: UIView = { lazy var bgView: UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = .clear view.backgroundColor = .clear
......
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