Commit f22e08ef authored by Alex朱枝文's avatar Alex朱枝文

续签文书优化UI走查bug修复

parent c92ab43e
......@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
040450CF2CC8A0F400D1CFE5 /* YHResignDocumentMultiLineTipsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040450CE2CC8A0F400D1CFE5 /* YHResignDocumentMultiLineTipsCell.swift */; };
0408C3632BEC7C6900DB1E25 /* YHVideoPlayerControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0408C3622BEC7C6900DB1E25 /* YHVideoPlayerControlView.swift */; };
0409BEEB2C5B41D4003FCFD7 /* YHPrincipleProfileListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0409BEEA2C5B41D4003FCFD7 /* YHPrincipleProfileListCell.swift */; };
041390692C1081FA0098CB8A /* YHFileListEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041390682C1081FA0098CB8A /* YHFileListEmptyView.swift */; };
......@@ -970,6 +971,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
040450CE2CC8A0F400D1CFE5 /* YHResignDocumentMultiLineTipsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentMultiLineTipsCell.swift; sourceTree = "<group>"; };
0408C3622BEC7C6900DB1E25 /* YHVideoPlayerControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVideoPlayerControlView.swift; sourceTree = "<group>"; };
0409BEEA2C5B41D4003FCFD7 /* YHPrincipleProfileListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleProfileListCell.swift; sourceTree = "<group>"; };
041390682C1081FA0098CB8A /* YHFileListEmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFileListEmptyView.swift; sourceTree = "<group>"; };
......@@ -3826,6 +3828,7 @@
children = (
041892202C91BBAA00B9FB94 /* YHResignDocumentCell.swift */,
04F2432A2C942B5100DF2C74 /* YHResignDocumentTipsCell.swift */,
040450CE2CC8A0F400D1CFE5 /* YHResignDocumentMultiLineTipsCell.swift */,
04F2432C2C94645000DF2C74 /* YHResignDocumentStatusCell.swift */,
044F391F2CB50A5F007CA277 /* YHResignDocumentUploadHeaderCell.swift */,
044F39212CB50B34007CA277 /* YHResignDocumentUploadFileCell.swift */,
......@@ -5540,6 +5543,7 @@
A567E5972BD7643D00D5D5A0 /* YHHomeModel.swift in Sources */,
04AF82D82C291E960028CE2A /* YHMatchUserViewModel.swift in Sources */,
0468D4362B57752F00CFB916 /* YHUserModel.swift in Sources */,
040450CF2CC8A0F400D1CFE5 /* YHResignDocumentMultiLineTipsCell.swift in Sources */,
A567E5982BD7643D00D5D5A0 /* YHHKEventModel.swift in Sources */,
045EEE992B9F171A0022A143 /* YHPreviewInfoHoldView.swift in Sources */,
045EEE7E2B9F171A0022A143 /* YHPersonInfoCellModel1.swift in Sources */,
......
......@@ -76,4 +76,13 @@ extension YHFilePreviewTool: UIDocumentInteractionControllerDelegate {
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
return targetVC ?? UIViewController.current ?? UIViewController()
}
func documentInteractionControllerDidEndPreview(_ controller: UIDocumentInteractionController) {
documentController = nil
}
func documentInteractionControllerWillBeginPreview(_ controller: UIDocumentInteractionController) {
let navi = targetVC?.navigationController
navi?.gk_navItemRightSpace = kMargin
}
}
......@@ -21,7 +21,7 @@ class YHResignDocumentDetailViewController: YHBaseViewController {
private var downloadEvent: (() -> Void)?
enum RowType {
case tips(_ title: String, _ detail: ASAttributedString)
case tips(_ title: String, _ details: [ASAttributedString])
case content(_ title: String, _ fileName: String, _ status: YHResignDocumentStatus, _ config: YHResignDocumentStatusCell.ButtonsConfig)
case uploadHeader(_ title: String)
case uploadFile(_ title: String, _ url: String, _ editTypes: [YHCertificateEditType])
......@@ -71,7 +71,7 @@ class YHResignDocumentDetailViewController: YHBaseViewController {
view.backgroundColor = .clear
view.tableFooterView = UITableViewHeaderFooterView()
view.rowHeight = UITableView.automaticDimension
view.register(YHResignDocumentTipsCell.self, forCellReuseIdentifier: YHResignDocumentTipsCell.cellReuseIdentifier)
view.register(YHResignDocumentMultiLineTipsCell.self, forCellReuseIdentifier: YHResignDocumentMultiLineTipsCell.cellReuseIdentifier)
view.register(YHResignDocumentStatusCell.self, forCellReuseIdentifier: YHResignDocumentStatusCell.cellReuseIdentifier)
view.register(YHResignDocumentUploadHeaderCell.self, forCellReuseIdentifier: YHResignDocumentUploadHeaderCell.cellReuseIdentifier)
......@@ -286,9 +286,9 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView
let item = sectionArr[indexPath.row]
switch item {
case let .tips(title, detail):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHResignDocumentTipsCell.cellReuseIdentifier) as? YHResignDocumentTipsCell {
cell.setupCellASAttributedInfo(title: title, detail: detail)
case let .tips(title, details):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHResignDocumentMultiLineTipsCell.cellReuseIdentifier) as? YHResignDocumentMultiLineTipsCell {
cell.setupCellInfo(title: title, details: details)
return cell
}
case let .content(title, fileName, status, config):
......@@ -415,7 +415,7 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView
return
}
let item = sectionArr[indexPath.row]
if case let .uploadFile(title, urlStr, editTypes) = item {
if case let .uploadFile(title, urlStr, _) = item {
previewUploadedFiles(urlStr, title: title)
}
}
......@@ -909,37 +909,35 @@ private extension YHCertificateEditType {
private extension YHResignDocumentType {
func attributedTips() -> ASAttributedString {
let dotStr: ASAttributedString = "\(.image(UIImage(named: "tip_list_index_dot") ?? UIImage(), .custom(.center, size: .init(width: 3, height: 3))))"
let spaceStr: ASAttributedString = "\(.image(UIImage(), .custom(.center, size: .init(width: 8, height: 3))))"
let indentStr = dotStr + spaceStr
func attributedTips() -> [ASAttributedString] {
let downloadStr: ASAttributedString = .init(string: "您也可以下载文件后完成信息确认,并上传已签署件", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
// .add(attributes: .paragraph(.lineSpacing(4), .firstLineHeadIndent(0), .headIndent(11)))
switch self {
case .powerOfAttorney:
let firstLine: ASAttributedString = .init(string: "请您尽快核对信息,如信息有误,可进行在线编辑\n", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let firstLine: ASAttributedString = .init(string: "请您尽快核对信息,如信息有误,可进行在线编辑", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let secondLineL: ASAttributedString = .init(string: "如信息无误,请主申请人在", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let secondLineR: ASAttributedString = .init(string: "右下角的位置完成电子签字\n", .font(UIFont.PFSC_B(ofSize: 12)), .foreground(UIColor.brandMainColor))
let secondLineR: ASAttributedString = .init(string: "右下角的位置完成电子签字", .font(UIFont.PFSC_B(ofSize: 12)), .foreground(UIColor.brandMainColor))
let secondLine = (secondLineL + secondLineR)
return (indentStr + firstLine + indentStr + secondLine + indentStr + downloadStr).add(attributes: .paragraph(.lineSpacing(8), .firstLineHeadIndent(0), .headIndent(11)))
return [firstLine, secondLine, downloadStr]
case .qmasDoc:
let firstLine: ASAttributedString = .init(string: "需填写完整邮箱、电话号码(内地电话号码或香港电话号码)、日期(填写当下日期即可)\n", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let firstLine: ASAttributedString = .init(string: "需填写完整邮箱、电话号码(内地电话号码或香港电话号码)、日期(填写当下日期即可)", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let secondLine: ASAttributedString = .init(string: "请主申请人勾选信息并完成电子签字\n", .font(UIFont.PFSC_B(ofSize: 12)), .foreground(UIColor.brandMainColor))
return (indentStr + firstLine + indentStr + secondLine + indentStr + downloadStr).add(attributes: .paragraph(.lineSpacing(8), .firstLineHeadIndent(0), .headIndent(11)))
let secondLine: ASAttributedString = .init(string: "请主申请人勾选信息并完成电子签字", .font(UIFont.PFSC_B(ofSize: 12)), .foreground(UIColor.brandMainColor))
return [firstLine, secondLine, downloadStr]
case .settlementPlan:
let firstLine: ASAttributedString = .init(string: "如需调整和补充内容,请在文档中进行编辑\n", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let secondLine: ASAttributedString = .init(string: "编辑完成后,点击“完成编辑,提交”\n", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let third: ASAttributedString = .init(string: "我们将根据您的修改调整文书\n", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let firstLine: ASAttributedString = .init(string: "如需调整和补充内容,请在文档中进行编辑", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let secondLine: ASAttributedString = .init(string: "编辑完成后,点击“完成编辑,提交”", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let third: ASAttributedString = .init(string: "我们将根据您的修改调整文书", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let fourth1: ASAttributedString = .init(string: "如您对《定居计划书》无其他补充建议,", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let fourth2: ASAttributedString = .init(string: "请您在文书尾部进行电子签字\n", .font(UIFont.PFSC_B(ofSize: 12)), .foreground(UIColor.brandMainColor))
return (indentStr + firstLine + indentStr + secondLine + indentStr + third + indentStr + fourth1 + fourth2 + indentStr + downloadStr).add(attributes: .paragraph(.lineSpacing(8), .firstLineHeadIndent(0), .headIndent(11)))
let fourth2: ASAttributedString = .init(string: "请您在文书尾部进行电子签字", .font(UIFont.PFSC_B(ofSize: 12)), .foreground(UIColor.brandMainColor))
return [firstLine, secondLine, third, fourth1 + fourth2, downloadStr]
case .explanatoryStatement:
let firstLine: ASAttributedString = .init(string: "如需调整和补充内容,请在文档中进行编辑\n", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let secondLine: ASAttributedString = .init(string: "编辑完成后,点击“完成编辑,提交”\n", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let third: ASAttributedString = .init(string: "我们将根据您的修改调整文书\n", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let firstLine: ASAttributedString = .init(string: "如需调整和补充内容,请在文档中进行编辑", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let secondLine: ASAttributedString = .init(string: "编辑完成后,点击“完成编辑,提交”", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let third: ASAttributedString = .init(string: "我们将根据您的修改调整文书", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let fourth1: ASAttributedString = .init(string: "如您对《解释说明书》无其他补充建议,", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let fourth2: ASAttributedString = .init(string: "请您在文书尾部进行电子签字\n", .font(UIFont.PFSC_B(ofSize: 12)), .foreground(UIColor.brandMainColor))
return (indentStr + firstLine + indentStr + secondLine + indentStr + third + indentStr + fourth1 + fourth2 + indentStr + downloadStr).add(attributes: .paragraph(.lineSpacing(8), .firstLineHeadIndent(0), .headIndent(11)))
let fourth2: ASAttributedString = .init(string: "请您在文书尾部进行电子签字", .font(UIFont.PFSC_B(ofSize: 12)), .foreground(UIColor.brandMainColor))
return [firstLine, secondLine, third, fourth1 + fourth2, downloadStr]
}
}
}
//
// YHResignDocumentMultiLineTipsCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHResignDocumentMultiLineTipsCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHResignDocumentMultiLineTipsCell"
private let dotWidth: CGFloat = 3
private var detailLabels: [UILabel] = []
private var dotImageViews: [UIImageView] = []
private lazy var dotImage: UIImage = {
let image = UIImage(named: "tip_list_index_dot") ?? UIImage()
return image
}()
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
}()
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?, details: [ASAttributedString]) {
infoTitleLabel.text = title
detailLabels.forEach {
$0.removeFromSuperview()
}
dotImageViews.forEach {
$0.removeFromSuperview()
}
detailLabels.removeAll()
dotImageViews.removeAll()
let count = details.count
details.enumerated().forEach { [weak self] index, detail in
guard let self = self else {
return
}
let dotImageView = self.getDotImageView()
let label = self.getDetailLabel(detail)
self.dotImageViews.append(dotImageView)
self.detailLabels.append(label)
self.subContainerView.addSubview(dotImageView)
self.subContainerView.addSubview(label)
label.snp.makeConstraints { make in
if index == 0 {
make.top.equalTo(self.infoTitleLabel.snp.bottom).offset(10)
} else {
make.top.equalTo(self.detailLabels[index - 1].snp.bottom).offset(8)
}
make.left.equalTo(dotImageView.snp.right).offset(8)
make.right.lessThanOrEqualToSuperview().offset(-16)
if index == count - 1 {
make.bottom.equalToSuperview().offset(-16)
}
}
dotImageView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.top.equalTo(label.snp.top).offset(7)
make.width.height.equalTo(self.dotWidth)
}
}
}
}
extension YHResignDocumentMultiLineTipsCell {
private func setupUI() {
updateCellCorner(.single)
subContainerView.addSubview(bgView)
subContainerView.addSubview(tipIconView)
subContainerView.addSubview(infoTitleLabel)
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)
make.bottom.lessThanOrEqualToSuperview().offset(-16).priority(.low)
}
}
private func getDetailLabel(_ detail: ASAttributedString) -> UILabel {
let label = UILabel()
label.textColor = .mainTextColor70
label.font = .PFSC_R(ofSize: 12)
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
label.attributed.text = detail
return label
}
private func getDotImageView() -> UIImageView {
let imageView = UIImageView()
imageView.image = dotImage
return imageView
}
}
......@@ -426,6 +426,7 @@ extension YHResignDocumentStatusCell {
infoStatusLabel.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.right).offset(4)
make.height.equalTo(18)
make.centerY.equalTo(infoTitleLabel)
}
......
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