Commit 369465a5 authored by Steven杜宇's avatar Steven杜宇

// 方案

parent 1f2fba82
......@@ -112,6 +112,8 @@
042B20D62CEB239400655093 /* YHIHKIdentityPlanCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042B20D52CEB239400655093 /* YHIHKIdentityPlanCell.swift */; };
042B20D82CEB325900655093 /* YHImproveSchemeTemplateListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042B20D72CEB325900655093 /* YHImproveSchemeTemplateListView.swift */; };
042B20DA2CEB337100655093 /* YHImproveSchemeTemplateListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042B20D92CEB337100655093 /* YHImproveSchemeTemplateListCell.swift */; };
042B20DC2CEB69CB00655093 /* YHSchemeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042B20DB2CEB69CB00655093 /* YHSchemeModel.swift */; };
042B20DF2CEB6A8F00655093 /* YHSchemeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042B20DE2CEB6A8F00655093 /* YHSchemeViewModel.swift */; };
0430E63B2C6DA106000511E2 /* CGFloat+Extention.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E63A2C6DA106000511E2 /* CGFloat+Extention.swift */; };
0430E6422C72E120000511E2 /* YHAddAdoptersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6412C72E120000511E2 /* YHAddAdoptersViewController.swift */; };
0430E6442C72E6A1000511E2 /* YHAdopterMainTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6432C72E6A1000511E2 /* YHAdopterMainTableViewCell.swift */; };
......@@ -1126,6 +1128,8 @@
042B20D52CEB239400655093 /* YHIHKIdentityPlanCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIHKIdentityPlanCell.swift; sourceTree = "<group>"; };
042B20D72CEB325900655093 /* YHImproveSchemeTemplateListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHImproveSchemeTemplateListView.swift; sourceTree = "<group>"; };
042B20D92CEB337100655093 /* YHImproveSchemeTemplateListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHImproveSchemeTemplateListCell.swift; sourceTree = "<group>"; };
042B20DB2CEB69CB00655093 /* YHSchemeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeModel.swift; sourceTree = "<group>"; };
042B20DE2CEB6A8F00655093 /* YHSchemeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeViewModel.swift; sourceTree = "<group>"; };
0430E63A2C6DA106000511E2 /* CGFloat+Extention.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CGFloat+Extention.swift"; sourceTree = "<group>"; };
0430E6412C72E120000511E2 /* YHAddAdoptersViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAddAdoptersViewController.swift; sourceTree = "<group>"; };
0430E6432C72E6A1000511E2 /* YHAdopterMainTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterMainTableViewCell.swift; sourceTree = "<group>"; };
......@@ -2346,6 +2350,14 @@
path = Model;
sourceTree = "<group>";
};
042B20DD2CEB6A7500655093 /* VM */ = {
isa = PBXGroup;
children = (
042B20DE2CEB6A8F00655093 /* YHSchemeViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
};
0430E63C2C72DB48000511E2 /* AddAdopters(2新增受养人) */ = {
isa = PBXGroup;
children = (
......@@ -3635,6 +3647,7 @@
047F3DDD2CE7216D001B2A6D /* MyNewScheme(我的方案) */ = {
isa = PBXGroup;
children = (
042B20DD2CEB6A7500655093 /* VM */,
047F3DE02CE724FF001B2A6D /* C */,
047F3DDF2CE724FA001B2A6D /* V */,
047F3DDE2CE724F4001B2A6D /* M */,
......@@ -3645,6 +3658,7 @@
047F3DDE2CE724F4001B2A6D /* M */ = {
isa = PBXGroup;
children = (
042B20DB2CEB69CB00655093 /* YHSchemeModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -5748,6 +5762,7 @@
04F4A5282CB8D4270026D469 /* YHResignAppointScheduleListViewController.swift in Sources */,
A598E9E22C7CB32D00F84739 /* YHTravelDocsPreparationListModel.swift in Sources */,
A598E9D72C7C9EF300F84739 /* YHTravelDocsPreparationListViewController.swift in Sources */,
042B20DC2CEB69CB00655093 /* YHSchemeModel.swift in Sources */,
A520124F2BABCE05008655EA /* YHFileListContentView.swift in Sources */,
04CA2BFF2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift in Sources */,
04CE1AE12C2AD91F001CB80A /* YHActivityDetailItemView.swift in Sources */,
......@@ -5933,6 +5948,7 @@
049AC4C62BC3E55300F857F4 /* YHServiceSectionView.swift in Sources */,
04256E152C75BD2700A37BA4 /* YHPayMembersCell.swift in Sources */,
0408C3632BEC7C6900DB1E25 /* YHVideoPlayerControlView.swift in Sources */,
042B20DF2CEB6A8F00655093 /* YHSchemeViewModel.swift in Sources */,
044F394C2CB806D0007CA277 /* YHVisaRenewalPayMethodUrlCell.swift in Sources */,
A567E5B12BD7643D00D5D5A0 /* YHHomeCollectionViewCell.swift in Sources */,
A582B2432BB95E20009D098C /* YHHKPlanCell.swift in Sources */,
......
......@@ -74,7 +74,7 @@ class YHServiceOrderListView: YHBaseViewController {
} else if type == 4 { // 方案
//我的方案
let vc = YHMineSchemeViewController()
let vc = YHMyNewSchemeViewController()
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 5 {
......
......@@ -10,7 +10,11 @@ import UIKit
class YHImproveSchemeViewController: YHBaseViewController {
var items:[String] = ["", "", ""]
var orderId: Int = 0
let viewModel = YHSchemeViewModel()
var items:[YHImproveDetailModel] = []
var isPass: Bool = false
lazy var bgImgView: UIImageView = {
let view = UIImageView(image: UIImage(named: "my_scheme_improve_list_bg"))
......@@ -116,7 +120,7 @@ class YHImproveSchemeViewController: YHBaseViewController {
btn.setTitle("重新选择提升目标", for: .normal)
btn.setTitleColor(.white, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
// btn.addTarget(self, action: #selector(didSaveBtnClicked), for: .touchUpInside)
btn.addTarget(self, action: #selector(didRightBtnClicked), for: .touchUpInside)
btn.layer.cornerRadius = kCornerRadius3
return btn
}()
......@@ -129,11 +133,18 @@ class YHImproveSchemeViewController: YHBaseViewController {
btn.setTitle("修改信息", for: .normal)
btn.setTitleColor(.brandMainColor, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
// btn.addTarget(self, action: #selector(didSaveBtnClicked), for: .touchUpInside)
btn.addTarget(self, action: #selector(didLeftBtnClicked), for: .touchUpInside)
btn.layer.cornerRadius = kCornerRadius3
return btn
}()
@objc func didLeftBtnClicked() {
self.modifyInfo()
}
@objc func didRightBtnClicked() {
self.navigationController?.popViewController(animated: true)
}
override func viewDidLoad() {
......@@ -153,13 +164,43 @@ class YHImproveSchemeViewController: YHBaseViewController {
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
}
bottomView.isHidden = isPass
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(64+k_Height_safeAreaInsetsBottom())
make.height.equalTo(isPass ? 0.0 : 64+k_Height_safeAreaInsetsBottom())
}
view.bringSubviewToFront(gk_navigationBar)
tableView.reloadData()
}
@objc open func backItemClick(_ sender: Any) {
self.navigationController?.popToRootViewController(animated: true)
}
func requestData() {
viewModel.getImproveDetail(orderId: orderId) {
[weak self] success, error in
guard let self = self else { return }
items.removeAll()
items.append(contentsOf: viewModel.improveDetailModel.comprehensive_evaluation)
tableView.reloadData()
greetLabel.text = "尊敬的\(viewModel.improveDetailModel.username)\(viewModel.improveDetailModel.sex)"
}
}
func modifyInfo() {
YHHUD.show(.progress(message: "修改中..."))
viewModel.modifyInfo(orderId: orderId) {
[weak self] success, error in
guard let self = self else { return }
if success {
let vc = YHInformationPerfectListVC()
vc.orderId = orderId
navigationController?.pushViewController(vc)
}
YHHUD.flash(message: error?.errorMsg ?? "修改失败")
}
}
}
......@@ -171,23 +212,19 @@ extension YHImproveSchemeViewController : UITableViewDelegate, UITableViewDataSo
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
return 2
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if 0 <= indexPath.row && indexPath.row < items.count {
let item = items[indexPath.row]
if indexPath.row == items.count-1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHIHKIdentityPlanCell.cellReuseIdentifier, for: indexPath) as! YHIHKIdentityPlanCell
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHImproveTargetListCell.cellReuseIdentifier, for: indexPath) as! YHImproveTargetListCell
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHIHKIdentityPlanCell.cellReuseIdentifier, for: indexPath) as! YHIHKIdentityPlanCell
return cell
}
let defaultCell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
return defaultCell
let cell = tableView.dequeueReusableCell(withIdentifier: YHImproveTargetListCell.cellReuseIdentifier, for: indexPath) as! YHImproveTargetListCell
cell.arr = self.items
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
......@@ -212,7 +249,7 @@ extension YHImproveSchemeViewController : UITableViewDelegate, UITableViewDataSo
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 12.0
return 0.1
}
}
......
//
// YHSchemeModel.swift
// galaxy
//
// Created by Dufet on 2024/11/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHSchemeModel: NSObject {
}
class YHComprehensiveEevaluationModel: SmartCodable {
var standard_name: String = ""
var standard_key: String = ""
var is_pass: Bool = false
var is_select: Bool = false
required init() {
}
}
class YHMySchemeDetailModel: SmartCodable {
var comprehensive_evaluation: [YHComprehensiveEevaluationModel] = []
var comprehensive_evaluation_selected: [String] = []
var industry_positioning: Int = 0
var plan_skip_status: Bool = false
var supplement_skip_status: Bool = false
var username: String = ""
var sex: String = ""
required init() {
}
}
class YHImproveDetailModel: SmartCodable {
var hk_require: String = ""
var improve_content: String = ""
var sort_num: Int = -1
required init() {
}
}
class YHSchemeTemplatesModel: SmartCodable {
var name: String = ""
var url: String = ""
required init() {
}
}
class YHImproveSchemeDetailModel: SmartCodable {
var comprehensive_evaluation: [YHImproveDetailModel] = []
var templates: [YHSchemeTemplatesModel] = []
var username: String = ""
var sex: String = ""
required init() {
}
}
......@@ -13,6 +13,12 @@ class YHComprehensiveEvaluationCell: UITableViewCell {
static let cellReuseIdentifier = "YHComprehensiveEvaluationCell"
var isPass: Bool = false {
didSet {
tipsLabel.attributed.text = isPass ? passText : unPassText
}
}
lazy var markImgV: UIImageView = {
let v = UIImageView(image: UIImage(named: "my_scheme_mark"))
return v
......@@ -37,18 +43,18 @@ class YHComprehensiveEvaluationCell: UITableViewCell {
lazy var tipsLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.attributed.text = unsatisfiedText
label.attributed.text = unPassText
return label
}()
lazy var satisfiedText: ASAttributedString = {
lazy var passText: 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 unsatisfiedText: ASAttributedString = {
lazy var unPassText: 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))
......
......@@ -13,6 +13,8 @@ class YHDocumentListCell: UITableViewCell {
static let cellReuseIdentifier = "YHDocumentListCell"
var rightBtnClick:(()->())?
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
......@@ -59,10 +61,14 @@ class YHDocumentListCell: UITableViewCell {
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.YH_clickEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 20, right: 20)
// button.addTarget(self, action: #selector(goNext), for: .touchUpInside)
button.addTarget(self, action: #selector(didRightBtnClicked), for: .touchUpInside)
return button
}()
@objc func didRightBtnClicked() {
rightBtnClick?()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
......
......@@ -12,16 +12,7 @@ class YHHKRequiredItemListCell: UITableViewCell {
static let cellReuseIdentifier = "YHHKRequiredItemListCell"
var arr: [String] = ["申请人是否50岁或以下",
"申请人是否持有由合资格大学颁授的硕士或博士学位",
"申请人所持有由合资格大学颁授的硕士或博士学位是否与「STEM」学科有关,即「科学」、「科技」、「工程」或「数学」",
"申请人是否具备两种语言的良好书写及口语能力",
"申请人是否具备良好的英文书写及口语能力",
"申请人是否拥有不少于五年相当于学位程度或专平的工作经验",
"申请人是否拥有不少于三年相当于学位程度或专家水平在跨国公司或知名企业的工作经验,例如上市公司或位列《福布斯》全球企业2000 强、《财富》世界500 强和胡润中国 500 强的企业",
"申请人是否拥有不少于三年相当于学位程度或专家水平在特定领域/行业的工作经验,包括「创新及科技」、「金融」及「国际贸易」(当中包括跨境海运及空运,以及供应链管理)",]
var requireArr: [String] = [] {
var passArr: [YHComprehensiveEevaluationModel] = [] {
didSet {
listView.removeSubviews()
listView.addSubview(topView)
......@@ -31,9 +22,9 @@ class YHHKRequiredItemListCell: UITableViewCell {
}
var lastItemView: YHHKRequiredItemView? = nil
for (index, text) in requireArr.enumerated() {
for (index, model) in passArr.enumerated() {
let itemView = YHHKRequiredItemView(frame: .zero)
itemView.text = text
itemView.text = model.standard_name
itemView.backgroundColor = index%2 == 0 ? .white : .init(hex: 0xFBF7F3)
listView.addSubview(itemView)
itemView.snp.makeConstraints { make in
......@@ -44,7 +35,7 @@ class YHHKRequiredItemListCell: UITableViewCell {
} else {
make.top.equalTo(topView.snp.bottom)
}
if index == requireArr.count-1 {
if index == passArr.count-1 {
make.bottom.equalToSuperview()
}
}
......@@ -147,7 +138,5 @@ class YHHKRequiredItemListCell: UITableViewCell {
make.left.right.top.equalToSuperview()
make.height.equalTo(42)
}
requireArr = arr
}
}
......@@ -62,7 +62,6 @@ class YHImproveHKView: UIView {
label.numberOfLines = 0
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = .mainTextColor
label.text = "港府要求:申请人是否具备良好的英文书写及口语能力申请人是否具备良好的英文书写及口语能力申请人是否具备良好的英文书写及口语能力"
return label
}()
......@@ -92,7 +91,6 @@ class YHImproveHKView: UIView {
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 13)
label.textColor = .init(hex: 0x6D788A)
label.text = "如您拥有某业务实体接近某50%的股权主体,且该业务实体在紧接申请前一年,全年盈利达港币500万元或以上(或等值外币),或您通过转股或其他方式孵化实现,即可满足申请条件"
return label
}()
......
......@@ -22,12 +22,12 @@ class YHImproveItem {
class YHImproveRequireItemView: UIView {
var item: YHImproveItem = YHImproveItem(title: "", isSelect: false) {
var item: YHComprehensiveEevaluationModel = YHComprehensiveEevaluationModel() {
didSet {
let a: ASAttributedString = .init(string:"港府要求:" , .font(UIFont.PFSC_M(ofSize: 14)), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init(string: item.title , .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init(string: item.standard_name , .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
titleLabel.attributed.text = a + b
isSelect = item.isSelect
isSelect = item.is_select
}
}
......@@ -89,8 +89,8 @@ class YHImproveRequireItemView: UIView {
}
@objc func tap() {
item.isSelect = !item.isSelect
isSelect = item.isSelect
item.is_select = !item.is_select
isSelect = item.is_select
}
}
......@@ -13,6 +13,8 @@ class YHImproveSchemeCell: UITableViewCell {
static let cellReuseIdentifier = "YHImproveSchemeCell"
var rightBtnClick:(()->())?
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
......@@ -57,10 +59,14 @@ class YHImproveSchemeCell: UITableViewCell {
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.YH_clickEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 20, right: 20)
// button.addTarget(self, action: #selector(goNext), for: .touchUpInside)
button.addTarget(self, action: #selector(didRightBtnClicked), for: .touchUpInside)
return button
}()
@objc func didRightBtnClicked() {
rightBtnClick?()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
......
......@@ -13,24 +13,18 @@ class YHImproveTargetCell: UITableViewCell {
static let cellReuseIdentifier = "YHImproveTargetCell"
var arr:[YHImproveItem] = {
let a = YHImproveItem(title: "申请人拥有不少于两年相当于学位程度或专家水平的国际工作经验", isSelect: false)
let b = YHImproveItem(title: "申请人现时是否拥有一家业务实体,而该业务实体在紧接申请前一年,全年盈利达港币500万元或以上(或等值外币", isSelect: false)
let c = YHImproveItem(title: "申请人是否具备良好的英文书写及口语能力", isSelect: false)
let d = YHImproveItem(title: "申请人是否拥有不少于五年相当于学位程度或专业水平的工作经验", isSelect: false)
return [a, b, c, d]
}()
var requireArr:[YHImproveItem] = [] {
var submitClick:(()->())?
var unpassArr: [YHComprehensiveEevaluationModel] = [] {
didSet {
updateRequireArrUI()
}
}
func updateRequireArrUI() {
listView.removeSubviews()
var lastView: YHImproveRequireItemView? = nil
for (index, item) in requireArr.enumerated() {
for (index, item) in unpassArr.enumerated() {
let view = YHImproveRequireItemView(frame: .zero)
view.item = item
listView.addSubview(view)
......@@ -41,7 +35,7 @@ class YHImproveTargetCell: UITableViewCell {
} else {
make.top.equalTo(0)
}
if index == requireArr.count-1 {
if index == unpassArr.count-1 {
make.bottom.equalTo(0)
}
}
......@@ -114,8 +108,13 @@ class YHImproveTargetCell: UITableViewCell {
btn.titleLabel?.font = .PFSC_M(ofSize: 16)
btn.layer.cornerRadius = 3
btn.setTitle("提交,获取详细方案", for: .normal)
btn.addTarget(self, action: #selector(didBottomBtnClicked), for: .touchUpInside)
return btn
}()
@objc func didBottomBtnClicked() {
submitClick?()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
......@@ -185,7 +184,5 @@ class YHImproveTargetCell: UITableViewCell {
make.bottom.equalTo(-24)
make.height.equalTo(46)
}
requireArr = arr
}
}
......@@ -12,6 +12,35 @@ class YHImproveTargetListCell: UITableViewCell {
static let cellReuseIdentifier = "YHImproveTargetListCell"
var arr: [YHImproveDetailModel] = [] {
didSet {
listView.removeSubviews()
var lastView: YHImproveHKView? = nil
for (i, item) in arr.enumerated() {
let itemView = YHImproveHKView(frame: .zero)
itemView.titleLabel.text = "港府要求:\(item.hk_require)"
itemView.tipsLabel.text = item.improve_content
itemView.numLabel.text = "\(i+1)"
itemView.showTemplateBtn = i%2 == 0
listView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
if let lastView = lastView {
make.top.equalTo(lastView.snp.bottom).offset(16)
} else {
make.top.equalTo(0)
}
if i == arr.count-1 {
make.bottom.equalTo(0)
}
}
lastView = itemView
}
}
}
lazy var whiteContentView: UIView = {
let v = UIView()
v.backgroundColor = .white
......@@ -103,32 +132,6 @@ class YHImproveTargetListCell: UITableViewCell {
make.bottom.equalTo(-16)
make.top.equalTo(lineView.snp.bottom).offset(20)
}
listView.removeSubviews()
let arr = ["港府要求:申请人是否具备良好的英文书写及口语能力",
"港府要求:申请人现时是否拥有一家业务实体,而该业务实体在紧接申请前一年,全年盈利达港币500万元或以上(或等值外币)"]
var lastView: YHImproveHKView? = nil
for (i, text) in arr.enumerated() {
let itemView = YHImproveHKView(frame: .zero)
itemView.titleLabel.text = text
itemView.numLabel.text = "\(i)"
itemView.showTemplateBtn = i%2 == 0
listView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
if let lastView = lastView {
make.top.equalTo(lastView.snp.bottom).offset(16)
} else {
make.top.equalTo(0)
}
if i == arr.count-1 {
make.bottom.equalTo(0)
}
}
lastView = itemView
}
}
}
......@@ -13,6 +13,8 @@ class YHMaterialListCell: UITableViewCell {
static let cellReuseIdentifier = "YHMaterialListCell"
var rightBtnClick:(()->())?
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
......@@ -68,10 +70,14 @@ class YHMaterialListCell: UITableViewCell {
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.YH_clickEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 20, right: 20)
// button.addTarget(self, action: #selector(goNext), for: .touchUpInside)
button.addTarget(self, action: #selector(didRightBtnClicked), for: .touchUpInside)
return button
}()
@objc func didRightBtnClicked() {
rightBtnClick?()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
......
......@@ -12,6 +12,8 @@ class YHModifySchemeInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHModifySchemeInfoCell"
var modifyBlock: (()->())?
lazy var bottomBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .white
......@@ -21,9 +23,14 @@ class YHModifySchemeInfoCell: UITableViewCell {
btn.titleLabel?.font = .PFSC_M(ofSize: 16)
btn.layer.cornerRadius = 3
btn.setTitle("修改信息", for: .normal)
btn.addTarget(self, action: #selector(didBottomBtnClicked), for: .touchUpInside)
return btn
}()
@objc func didBottomBtnClicked() {
modifyBlock?()
}
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
......
//
// YHSchemeViewModel.swift
// galaxy
//
// Created by Dufet on 2024/11/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSchemeViewModel {
var schemeModel = YHMySchemeDetailModel()
var improveDetailModel = YHImproveSchemeDetailModel()
//我的方案
func getMySchemeData(orderId: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Assessment.applyPlanNewApi
let params: [String : Any] = ["order_id" : orderId]
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHMySchemeDetailModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,err)
return
}
self.schemeModel = resultModel
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
// 提交方案
func postSelectImproveTargets(orderId: Int, targets:[String], callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Assessment.submitTargetsApi
let params: [String : Any] = ["order_id" : orderId,
"standard_key" : targets]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false, err)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func modifyInfo(orderId: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Assessment.modifyInfoApi
let params: [String : Any] = ["order_id" : orderId]
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false, err)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func getImproveDetail(orderId: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Assessment.improveDetailApi
let params: [String : Any] = ["order_id" : orderId]
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHImproveSchemeDetailModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,err)
return
}
self.improveDetailModel = resultModel
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
}
......@@ -474,7 +474,7 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
}
} else if msg.redirectPage == YHRedirectPage.myPlan.rawValue { // 我的方案
let vc = YHMineSchemeViewController()
let vc = YHMyNewSchemeViewController()
navigationController?.pushViewController(vc)
} else if msg.redirectPage == YHRedirectPage.myDocument.rawValue { // 我的文书
......
......@@ -376,6 +376,10 @@ class YHAllApiName {
struct Assessment {
//方案计划
static let applyPlanApi = "infoflow/assessment/apply_plan"
static let applyPlanNewApi = "infoflow/assessment/apply_plan"
static let submitTargetsApi = "infoflow/assessment/save_apply_plan_target"
static let modifyInfoApi = "infoflow/assessment/save_apply_plan_target"
static let improveDetailApi = "infoflow/assessment/improve_plan_detail"
}
// 消息
......
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