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

// 原则批

parent dc44ac71
......@@ -11,7 +11,7 @@ import AttributedString
class YHPrincipleCongratulationVC: YHBaseViewController {
lazy var congratulationLabel: UILabel = {
lazy var titleLabel: UILabel = {
var label = UILabel()
label.numberOfLines = 0
let a: ASAttributedString = .init("祝贺您", .font(UIFont.PFSC_M(ofSize: 24)),.foreground(UIColor.init(hex: 0xF07300)))
......@@ -33,9 +33,9 @@ class YHPrincipleCongratulationVC: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "原则批"
view.addSubview(congratulationLabel)
view.addSubview(titleLabel)
view.addSubview(detailLabel)
congratulationLabel.snp.makeConstraints { make in
titleLabel.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar+24)
make.left.equalTo(24)
make.right.equalTo(-24)
......@@ -43,7 +43,7 @@ class YHPrincipleCongratulationVC: YHBaseViewController {
}
detailLabel.snp.makeConstraints { make in
make.top.equalTo(congratulationLabel.snp.bottom).offset(12)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.left.equalTo(24)
make.right.equalTo(-24)
}
......
......@@ -7,11 +7,12 @@
//
import UIKit
import AttributedString
class YHPrincipleWaitResultViewController: YHBaseViewController {
var orderId: Int = 0
var status: Int = 0
var status: Int = 11
var items: [YHPrincipleWaitResultModel] = []
let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = {
......@@ -71,10 +72,8 @@ extension YHPrincipleWaitResultViewController {
let params: [String : Any] = ["order_id" : orderId,
"search_type" : 1]
viewModel.getPrincipleWaitReviewResult(params: params) { success, error in
if let waitResultModel = self.viewModel.waitResultModel {
self.items.removeAll()
let waitResultModel = self.viewModel.waitResultModel
if waitResultModel.resultImageList.count > 0 {
// 实时入境处身份申请进度
let model1 = waitResultModel.copy()
......@@ -103,7 +102,6 @@ extension YHPrincipleWaitResultViewController {
self.tableView.reloadData()
}
}
}
}
extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewDataSource {
......@@ -165,11 +163,60 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 24.0
return UITableView.automaticDimension
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
return 0.01
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
var titleLabel = UILabel()
titleLabel.numberOfLines = 0
let title: ASAttributedString = .init("您好,\(self.viewModel.waitResultModel.applicant.userName)先生!", .font(UIFont.PFSC_M(ofSize: 24)),.foreground(UIColor.mainTextColor))
titleLabel.attributed.text = title
view.addSubview(titleLabel)
let tipsLabel = UILabel()
tipsLabel.numberOfLines = 0
tipsLabel.font = UIFont.PFSC_R(ofSize: 14)
tipsLabel.textColor = .mainTextColor(alpha: 0.7)
tipsLabel.text = "您的【优秀人才入境计划】赴港居留申请资料已经递交港府。"
view.addSubview(tipsLabel)
let detailLabel = UILabel()
detailLabel.numberOfLines = 0
detailLabel.attributed.text = self.getDescOfStatus(self.status)
view.addSubview(detailLabel)
titleLabel.snp.makeConstraints { make in
make.top.equalTo(12)
make.left.equalTo(20)
make.right.equalTo(-20)
make.height.equalTo(34)
}
tipsLabel.snp.makeConstraints { make in
// 待补件
let isWaitSupply = self.status == 12
let topMargin = isWaitSupply ? 12.0 : 0.0
make.top.equalTo(titleLabel.snp.bottom).offset(topMargin)
make.left.equalTo(20)
make.right.equalTo(-20)
if !isWaitSupply {
make.height.equalTo(0)
}
}
detailLabel.snp.makeConstraints { make in
make.top.equalTo(tipsLabel.snp.bottom).offset(12)
make.left.equalTo(20)
make.right.equalTo(-20)
make.bottom.equalTo(-36)
}
return view
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
......@@ -177,9 +224,36 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
func getDescOfStatus(_ status: Int) -> ASAttributedString {
return UIView()
// 11 等待原则批结果
// 12 正在进行原则批补件
// 13 原则批已获批
// 14 未获批准~
if status == 11 { // 等待原则批结果
let str1: ASAttributedString = .init("您的【优秀人才入境计划】赴港居留申请资料已经递交港府,且入境事务处已经认收受理!港府审核周期预计在12个月内,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
let str2: ASAttributedString = .init("我们将实时为您查询身份申请进度", .font(UIFont.PFSC_B(ofSize: 14)),.foreground(UIColor.brandMainColor))
var str3: ASAttributedString = .init(",请您耐心等待!", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
if self.viewModel.waitResultModel.resultImageList.count > 0 {
str3 = .init(",详见下方截图:", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
}
return str1 + str2 + str3
} else if status == 12 { // 待补件
let str1: ASAttributedString = .init("受港府邮件通知,需要您补充资料才能继续后续流程。", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
let str2: ASAttributedString = .init("请联系为您服务的生活管家,为您提供更多详情!", .font(UIFont.PFSC_B(ofSize: 14)),.foreground(UIColor.brandMainColor))
return str1 + str2
} else if status == 14 { // 未获批准~
let str1: ASAttributedString = .init("您【与家人】申请的【优秀人才入境计划】", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
let str2: ASAttributedString = .init("未获批准", .font(UIFont.PFSC_B(ofSize: 14)),.foreground(UIColor.brandMainColor))
var str3: ASAttributedString = .init("。具体详情以及后续处理方式,请您联系专属服务您的生活管家进行详细沟通", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
return str1 + str2 + str3
}
let defaultStr: ASAttributedString = .init("")
return defaultStr
}
}
......@@ -40,6 +40,7 @@ class YHPrincipleEnvelopeCell: UITableViewCell {
let btn = UIButton()
btn.setImage(UIImage(named: "custom_service_expand_0"), for: .normal)
btn.addTarget(self, action: #selector(didExpandBtnClicked), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 0, left: 40, bottom: 20, right: 40)
return btn
}()
......
......@@ -40,6 +40,7 @@ class YHPrinciplePhotoListCell: UITableViewCell {
let btn = UIButton()
btn.setImage(UIImage(named: "custom_service_expand_0"), for: .normal)
btn.addTarget(self, action: #selector(didExpandBtnClicked), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 0, left: 40, bottom: 20, right: 40)
return btn
}()
......
......@@ -126,6 +126,7 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
let btn = UIButton()
btn.setImage(UIImage(named: "custom_service_expand_0"), for: .normal)
btn.addTarget(self, action: #selector(didExpandBtnClicked), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 0, left: 40, bottom: 20, right: 40)
return btn
}()
......
......@@ -10,7 +10,7 @@ import UIKit
class YHPrincleViewModel: NSObject {
var waitResultModel: YHPrincipleWaitResultModel?
var waitResultModel = YHPrincipleWaitResultModel()
func getPrincipleWaitReviewResult(params:[String : Any], callback:((_ success: Bool,_ error:YHErrorModel?)->())?) {
......
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