Commit 632ca7b1 authored by Alex朱枝文's avatar Alex朱枝文

续签文书管理详情页

parent 4a309832
......@@ -555,6 +555,11 @@
04F0ABF42C364F9400518C30 /* my.json in Resources */ = {isa = PBXBuildFile; fileRef = 04F0ABF12C364F9400518C30 /* my.json */; };
04F0ABF52C364F9400518C30 /* community.json in Resources */ = {isa = PBXBuildFile; fileRef = 04F0ABF22C364F9400518C30 /* community.json */; };
04F0ABF72C364F9D00518C30 /* service.json in Resources */ = {isa = PBXBuildFile; fileRef = 04F0ABF62C364F9D00518C30 /* service.json */; };
04F243292C942A5500DF2C74 /* YHResignDocumentDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F243282C942A5500DF2C74 /* YHResignDocumentDetailViewController.swift */; };
04F2432B2C942B5100DF2C74 /* YHResignDocumentTipsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F2432A2C942B5100DF2C74 /* YHResignDocumentTipsCell.swift */; };
04F2432D2C94645000DF2C74 /* YHResignDocumentStatusCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F2432C2C94645000DF2C74 /* YHResignDocumentStatusCell.swift */; };
04F2432F2C94704200DF2C74 /* YHPaddedLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F2432E2C94704200DF2C74 /* YHPaddedLabel.swift */; };
04F243312C953A3A00DF2C74 /* YHResignDocumentType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F243302C953A3A00DF2C74 /* YHResignDocumentType.swift */; };
04F316442C3568F000024164 /* YHAboutGalaxyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F316432C3568F000024164 /* YHAboutGalaxyViewController.swift */; };
04F4B76B2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F4B76A2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift */; };
04F5F86A2C1A95BB004A463C /* YHOtherServiceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F5F8692C1A95BB004A463C /* YHOtherServiceViewController.swift */; };
......@@ -1362,6 +1367,11 @@
04F0ABF12C364F9400518C30 /* my.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = my.json; sourceTree = "<group>"; };
04F0ABF22C364F9400518C30 /* community.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = community.json; sourceTree = "<group>"; };
04F0ABF62C364F9D00518C30 /* service.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = service.json; sourceTree = "<group>"; };
04F243282C942A5500DF2C74 /* YHResignDocumentDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentDetailViewController.swift; sourceTree = "<group>"; };
04F2432A2C942B5100DF2C74 /* YHResignDocumentTipsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentTipsCell.swift; sourceTree = "<group>"; };
04F2432C2C94645000DF2C74 /* YHResignDocumentStatusCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentStatusCell.swift; sourceTree = "<group>"; };
04F2432E2C94704200DF2C74 /* YHPaddedLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPaddedLabel.swift; sourceTree = "<group>"; };
04F243302C953A3A00DF2C74 /* YHResignDocumentType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentType.swift; sourceTree = "<group>"; };
04F316432C3568F000024164 /* YHAboutGalaxyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutGalaxyViewController.swift; sourceTree = "<group>"; };
04F4B76A2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateTemplateSheetView.swift; sourceTree = "<group>"; };
04F5F8692C1A95BB004A463C /* YHOtherServiceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOtherServiceViewController.swift; sourceTree = "<group>"; };
......@@ -1713,6 +1723,7 @@
isa = PBXGroup;
children = (
041892232C91BCF100B9FB94 /* YHResignRoundCellType.swift */,
04F243302C953A3A00DF2C74 /* YHResignDocumentType.swift */,
041892292C91CB2500B9FB94 /* YHResignDocumentStatus.swift */,
);
path = M;
......@@ -3280,6 +3291,8 @@
isa = PBXGroup;
children = (
041892202C91BBAA00B9FB94 /* YHResignDocumentCell.swift */,
04F2432A2C942B5100DF2C74 /* YHResignDocumentTipsCell.swift */,
04F2432C2C94645000DF2C74 /* YHResignDocumentStatusCell.swift */,
041892252C91BDF500B9FB94 /* YHResignDocumentHeaderCell.swift */,
041892272C91BE3300B9FB94 /* YHResignDocumentContentCell.swift */,
);
......@@ -3290,6 +3303,7 @@
isa = PBXGroup;
children = (
04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */,
04F243282C942A5500DF2C74 /* YHResignDocumentDetailViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -4121,6 +4135,7 @@
04AAA8DB2BF5E5A200FE9FD5 /* YHEmptyDataView.swift */,
A59B43CE2C4B5AD100B28379 /* YHShareViewOnTablebarView.swift */,
0418921E2C91BAAC00B9FB94 /* YHBaseDynamicCornerRadiusView.swift */,
04F2432E2C94704200DF2C74 /* YHPaddedLabel.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -4690,6 +4705,7 @@
045EEE7B2B9F171A0022A143 /* YHPersonInfoCellModel2.swift in Sources */,
A53B61122BB128AF0010B573 /* YHFileListItemsView2.swift in Sources */,
04358E042C77322700811928 /* YHHaveGrabbedNumberListCell.swift in Sources */,
04F243312C953A3A00DF2C74 /* YHResignDocumentType.swift in Sources */,
0430E6922C7EF08B000511E2 /* YHAdopterOtherCardTableViewCell.swift in Sources */,
044D0BF62C2154CA00C5CF5E /* YHAllowUseMyInfoViewController.swift in Sources */,
0485DFE12C6A0B6200B50293 /* YHPrincipleApprovedResultVC.swift in Sources */,
......@@ -4837,6 +4853,7 @@
048B2A4D2BC7DAE800A93BF0 /* YHMyLikeViewModel.swift in Sources */,
04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */,
045EEECD2B9F171A0022A143 /* YHScoreDataModel.swift in Sources */,
04F2432F2C94704200DF2C74 /* YHPaddedLabel.swift in Sources */,
A5ACE9342B4564F7002C94D2 /* YHAllApiName.swift in Sources */,
04AF82D62C25542D0028CE2A /* YHInterestTopicLayout.swift in Sources */,
045EEE902B9F171A0022A143 /* YHPreviewInfoNameAndSubNameItemsView.swift in Sources */,
......@@ -5006,6 +5023,7 @@
044D0BF82C21572B00C5CF5E /* YHAllowSettingTableViewCell.swift in Sources */,
A5ACE9482B4564F7002C94D2 /* YHHUDWariningView.swift in Sources */,
045EEF0F2B9F171A0022A143 /* YHSelectCountryViewModel.swift in Sources */,
04F2432B2C942B5100DF2C74 /* YHResignDocumentTipsCell.swift in Sources */,
045EEEB52B9F171A0022A143 /* YHWorkIntroductionItemView.swift in Sources */,
A567E59F2BD7643D00D5D5A0 /* YHStartPageViewController.swift in Sources */,
045EEF202B9F171A0022A143 /* YHCardExampleView.swift in Sources */,
......@@ -5106,6 +5124,7 @@
0430E67A2C757F13000511E2 /* YHAdoptedChinaTravelViewController.swift in Sources */,
A592BFEF2B9AB720004C04A9 /* YHWholeScreenTipsView.swift in Sources */,
045EEEF42B9F171A0022A143 /* YHSpouseBasicInfoVC.swift in Sources */,
04F243292C942A5500DF2C74 /* YHResignDocumentDetailViewController.swift in Sources */,
A5FD63C32B63438A00D1D9DA /* YHContactMainItemStatusModel.swift in Sources */,
045EEEEA2B9F171A0022A143 /* YHFamilyInitialInfo.swift in Sources */,
04256E232C76D22400A37BA4 /* YHAppointItem.swift in Sources */,
......@@ -5133,6 +5152,7 @@
045EEEFE2B9F171A0022A143 /* YHFormItemInputTextCell.swift in Sources */,
0419A0A42C49184300A5FCFA /* YHInvitationNumberItemView.swift in Sources */,
045EEEDD2B9F171A0022A143 /* YHCollegeNameCell.swift in Sources */,
04F2432D2C94645000DF2C74 /* YHResignDocumentStatusCell.swift in Sources */,
04256DFA2C742A1500A37BA4 /* YHFamilyGroupModel.swift in Sources */,
045EEF162B9F171A0022A143 /* YHMainApplicantInformationViewController.swift in Sources */,
0449EEF32C903A4100A397FD /* YHMaterialListModel.swift in Sources */,
......
//
// YHPaddedLabel.swift
// galaxy
//
// Created by alexzzw on 2024/9/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPaddedLabel: UILabel {
var padding: UIEdgeInsets
init(padding: UIEdgeInsets) {
self.padding = padding
super.init(frame: .zero)
}
required init?(coder: NSCoder) {
self.padding = UIEdgeInsets(top: 0, left: 4, bottom: 0, right: 4)
super.init(coder: coder)
}
override func drawText(in rect: CGRect) {
let insetRect = rect.inset(by: padding)
super.drawText(in: insetRect)
}
override var intrinsicContentSize: CGSize {
let size = super.intrinsicContentSize
return CGSize(width: size.width + padding.left + padding.right,
height: size.height + padding.top + padding.bottom)
}
}
//
// YHResignDocumentDetailViewController.swift
// galaxy
//
// Created by alexzzw on 2024/9/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignDocumentDetailViewController: YHBaseViewController {
private var editEvent: (() -> Void)?
private var submitEvent: (() -> Void)?
private var signatureConfirmationEvent: (() -> Void)?
private var previewEvent: (() -> Void)?
private var infoConfirmationEvent: (() -> Void)?
enum RowType {
case tips(_ title: String, _ detail: NSAttributedString)
case content(_ title: String, _ fileName: String, _ status: YHResignDocumentStatus, _ config: YHResignDocumentStatusCell.ButtonsConfig)
}
private var datas: [[RowType]] {
let normalText = "请主申请人完成电子签字请您尽快核对信息,如信息有误,可进行在线编辑如信息无误,"
let attText = "请您在右下角的位置完成电子签字"
let attStr = NSMutableAttributedString(string: normalText + attText)
attStr.setAttributes([.foregroundColor: UIColor.brandMainColor], range: NSRange(location: normalText.count, length: attText.count))
let config = getStatusButtonsConfig(docType: docType, status: status)
let firstSetcion: [RowType] = [.tips("​填写指引", attStr)]
let secondSetcion: [RowType] = [.content("文书稿件", "雇主的推荐信(仅签字)深圳华为科技有限公司.doc", .awaitingSignature, config)]
return [firstSetcion, secondSetcion]
}
private var docType: YHResignDocumentType
private var status: YHResignDocumentStatus = .awaitingSignature
init(_ docType: YHResignDocumentType, _ status: YHResignDocumentStatus) {
self.docType = docType
self.status = status
super.init(nibName: nil, bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private lazy var tableView: UITableView = {
let view = UITableView(frame:.zero, style:.grouped)
view.estimatedSectionHeaderHeight = 16.0
view.estimatedSectionFooterHeight = 0.01
view.sectionHeaderHeight = 16.0
view.sectionFooterHeight = 0.01
view.contentInsetAdjustmentBehavior = .never
view.showsVerticalScrollIndicator = false
view.separatorStyle = .none
view.delegate = self
view.dataSource = self
view.backgroundColor = .clear
view.tableFooterView = UITableViewHeaderFooterView()
view.rowHeight = UITableView.automaticDimension
view.register(YHResignDocumentTipsCell.self, forCellReuseIdentifier: YHResignDocumentTipsCell.cellReuseIdentifier)
view.register(YHResignDocumentStatusCell.self, forCellReuseIdentifier: YHResignDocumentStatusCell.cellReuseIdentifier)
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
editEvent = {
print("###editEvent")
}
submitEvent = {
print("###submitEvent")
}
signatureConfirmationEvent = {
print("###signatureConfirmationEvent")
}
previewEvent = {
print("###previewEvent")
}
infoConfirmationEvent = {
print("###infoConfirmationEvent")
}
tableView.reloadData()
}
}
extension YHResignDocumentDetailViewController {
private func setupUI() {
gk_navTitle = docType.title
gk_navBarAlpha = 1.0
gk_navBackgroundColor = .white
view.backgroundColor = UIColor.contentBkgColor
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview()
}
}
}
extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
datas.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard datas.count > section else {
return 0
}
return datas[section].count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard datas.count > indexPath.section else {
return UITableViewCell()
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return UITableViewCell()
}
let item = sectionArr[indexPath.row]
switch item {
case let .tips(title, detail):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHResignDocumentTipsCell.cellReuseIdentifier) as? YHResignDocumentTipsCell {
cell.setupCellInfo(title: title, detail: detail)
return cell
}
case let .content(title, fileName, status, config):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHResignDocumentStatusCell.cellReuseIdentifier) as? YHResignDocumentStatusCell {
cell.setupCellInfo(title: title, fileName: fileName, status: status, buttonsConfig: config)
return cell
}
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
}
extension YHResignDocumentDetailViewController {
private func getStatusButtonsConfig(docType: YHResignDocumentType, status: YHResignDocumentStatus) -> YHResignDocumentStatusCell.ButtonsConfig {
var config = YHResignDocumentStatusCell.ButtonsConfig()
/*
private var editEvent: (() -> Void)?
private var submitEvent: (() -> Void)?
private var signatureConfirmationEvent: (() -> Void)?
private var previewEvent: (() -> Void)?
private var infoConfirmationEvent: (() -> Void)?
*/
var actions: [(() -> Void)] = []
switch docType {
case .powerOfAttorney, .settlementPlan, .explanatoryStatement:
switch status {
case .pendingConfirmation, .awaitingSignature:
config.names = ["在线编辑", "提交", "签字确认"]
if let editEvent = editEvent {
actions.append(editEvent)
}
if let submitEvent = submitEvent {
actions.append(submitEvent)
}
if let signatureConfirmationEvent = signatureConfirmationEvent {
actions.append(signatureConfirmationEvent)
}
config.actions = actions
config.style = .three
case .finalizing, .underReview, .completed:
if let previewEvent = previewEvent {
actions.append(previewEvent)
}
config.names = ["查看"]
config.actions = actions
config.style = .one
}
case .qmasDoc:
switch status {
case .pendingConfirmation:
if let infoConfirmationEvent = infoConfirmationEvent {
actions.append(infoConfirmationEvent)
}
config.names = ["信息确认"]
config.actions = actions
config.style = .one
case .finalizing, .underReview, .completed:
if let previewEvent = previewEvent {
actions.append(previewEvent)
}
config.names = ["查看"]
config.actions = actions
config.style = .one
case .awaitingSignature:
if let infoConfirmationEvent = infoConfirmationEvent {
actions.append(infoConfirmationEvent)
}
if let signatureConfirmationEvent = signatureConfirmationEvent {
actions.append(signatureConfirmationEvent)
}
config.names = ["信息确认", "签字确认"]
config.actions = actions
config.style = .two
}
}
return config
}
}
......@@ -35,9 +35,6 @@ class YHResignDocumentManagementVC: YHBaseViewController {
view.dataSource = self
view.backgroundColor = .clear
view.rowHeight = 52
// if #available(iOS 15.0, *) {
// view.sectionHeaderTopPadding = 0
// }
view.tableFooterView = UITableViewHeaderFooterView()
view.register(YHResignDocumentHeaderCell.self, forCellReuseIdentifier: YHResignDocumentHeaderCell.cellReuseIdentifier)
view.register(YHResignDocumentContentCell.self, forCellReuseIdentifier: YHResignDocumentContentCell.cellReuseIdentifier)
......@@ -63,8 +60,6 @@ extension YHResignDocumentManagementVC {
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview()
// make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
// make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
}
}
}
......@@ -117,6 +112,25 @@ extension YHResignDocumentManagementVC: UITableViewDelegate, UITableViewDataSour
return UITableViewCell()
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard datas.count > indexPath.section else {
return
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return
}
let item = sectionArr[indexPath.row]
switch item {
case .header:
return
case let .content(title, status):
let controller = YHResignDocumentDetailViewController(.explanatoryStatement, status)
navigationController?.pushViewController(controller)
}
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
......
//
// YHResignDocumentType.swift
// galaxy
//
// Created by alexzzw on 2024/9/14.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
enum YHResignDocumentType {
case powerOfAttorney
case settlementPlan
case explanatoryStatement
// qualityMigrantAdmissionScheme
case qmasDoc
var title: String {
switch self {
case .powerOfAttorney:
return "代理委托书"
case .settlementPlan:
return "定居计划"
case .explanatoryStatement:
return "解释说明"
case .qmasDoc:
return "QMAS文件"
}
}
}
//
// YHResignDocumentTipsCell.swift
// galaxy
//
// Created by alexzzw on 2024/9/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignDocumentTipsCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHResignDocumentTipsCell"
private lazy var bgView: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "document_prompt_bg_small")
view.contentMode = .scaleAspectFill
return view
}()
private lazy var tipIconView: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "service_step_tips")
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize:13)
label.textColor = .brandMainColor
label.text = "填写指引"
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor50
label.font = .PFSC_R(ofSize:12)
label.numberOfLines = 0
return label
}()
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")
}
func setupCellInfo(title: String?, detail: NSAttributedString?) {
infoTitleLabel.text = title
infoDetailLabel.attributedText = detail
}
}
extension YHResignDocumentTipsCell {
private func setupUI() {
updateCellCorner(.single)
subContainerView.addSubview(bgView)
subContainerView.addSubview(tipIconView)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.sendSubviewToBack(bgView)
bgView.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
bgView.setContentHuggingPriority(.defaultLow, for: .vertical)
bgView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
tipIconView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.top.equalToSuperview().offset(18)
make.width.height.equalTo(14)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalTo(tipIconView.snp.right).offset(8)
make.centerY.equalTo(tipIconView)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalTo(tipIconView.snp.bottom).offset(8)
make.left.equalTo(tipIconView.snp.left)
make.right.lessThanOrEqualToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-16)
}
}
}
......@@ -75,6 +75,7 @@ extension UIColor {
//提示 color
static let tipsColor : UIColor = UIColor(hexString: "#2F7EF6")!
static let tipsColor8: UIColor = UIColor(hexString: "#2F7EF6", transparency: 0.08)!
//页面背景
static let pageBkgColor : UIColor = UIColor(hexString: "#F8F8F8")!
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "document_prompt_bg_small@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "document_prompt_bg_small@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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