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

续签文书管理tips调整

parent 9c3c3890
......@@ -8,6 +8,7 @@
import UIKit
import SafariServices
import AttributedString
class YHResignDocumentDetailViewController: YHBaseViewController {
......@@ -18,7 +19,7 @@ class YHResignDocumentDetailViewController: YHBaseViewController {
private var infoConfirmationEvent: (() -> Void)?
enum RowType {
case tips(_ title: String, _ detail: NSAttributedString)
case tips(_ title: String, _ detail: ASAttributedString)
case content(_ title: String, _ fileName: String, _ status: YHResignDocumentStatus, _ config: YHResignDocumentStatusCell.ButtonsConfig)
}
......@@ -106,7 +107,7 @@ extension YHResignDocumentDetailViewController {
var firstSetcion: [RowType] = []
var secondSetcion: [RowType] = []
if let docType = YHResignDocumentType(rawValue: documentModel.docType), let status = YHResignDocumentStatus.getStatus(documentModel.docStatus) {
firstSetcion.append(.tips("​填写指引", docType.attributeInfo()))
firstSetcion.append(.tips("​填写指引", docType.attributedTips()))
let config = self.getStatusButtonsConfig(docType: docType, status: status, model: documentModel)
secondSetcion = [.content("文书稿件", self.name, status, config)]
datas.removeAll()
......@@ -143,7 +144,7 @@ extension YHResignDocumentDetailViewController: UITableViewDelegate, UITableView
switch item {
case let .tips(title, detail):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHResignDocumentTipsCell.cellReuseIdentifier) as? YHResignDocumentTipsCell {
cell.setupCellInfo(title: title, detail: detail)
cell.setupCellASAttributedInfo(title: title, detail: detail)
return cell
}
case let .content(title, fileName, status, config):
......@@ -174,10 +175,10 @@ extension YHResignDocumentDetailViewController {
}
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getResginDocumentUrl(docId: model.docId, isEditable: true) { [weak self] model, error in
YHHUD.hide()
guard let self = self else {
return
}
YHHUD.hide()
if let urlString = model?.url, let url = URL(string: urlString) {
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
......@@ -192,6 +193,12 @@ extension YHResignDocumentDetailViewController {
}
submitEvent = { [weak self] in
guard let self = self else {
return
}
// 产品说增加二次弹窗确认
YHCommonAlertView.show("确认提交?", "", "取消", "确认", fullGuestureEnable: false) {
} callBack: { [weak self] in
guard let self = self else {
return
}
......@@ -206,6 +213,8 @@ extension YHResignDocumentDetailViewController {
YHHUD.flash(message: errorMsg)
}
}
}
printLog("###submitEvent")
}
......@@ -219,7 +228,6 @@ extension YHResignDocumentDetailViewController {
guard let self = self else {
return
}
YHHUD.hide()
guard let signatureModel = signatureModel else {
if let error = error {
printLog("###续期文书签字: \(error.errorMsg)")
......@@ -243,10 +251,10 @@ extension YHResignDocumentDetailViewController {
}
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.previewResginDocument(docId: model.docId) { [weak self] model, error in
YHHUD.hide()
guard let self = self else {
return
}
YHHUD.hide()
if let urlString = model?.url, let url = URL(string: urlString) {
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
......@@ -352,32 +360,39 @@ extension YHResignDocumentDetailViewController {
}
private extension YHResignDocumentType {
func attributeInfo() -> NSAttributedString {
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
switch self {
case .powerOfAttorney:
let normalText = "请主申请人完成电子签字请您尽快核对信息,如信息有误,可进行在线编辑如信息无误,"
let attText = "请您在右下角的位置完成电子签字"
let attStr = NSMutableAttributedString(string: normalText + attText)
attStr.setAttributes([.foregroundColor: UIColor.brandMainColor], range: NSRange(location: normalText.count, length: attText.count))
return attStr
let firstLine: ASAttributedString = .init(string: "请您尽快核对信息,如信息有误,可进行在线编辑\n", .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: "右下角的位置完成电子签字", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.brandMainColor))
let secondLine = (secondLineL + secondLineR)
return (indentStr + firstLine + indentStr + secondLine).add(attributes: .paragraph(.lineSpacing(8), .firstLineHeadIndent(0), .headIndent(11)))
case .qmasDoc:
let normalText = "请主申请人勾选信息并完成电子签字此文件需在申请续签时提交给港府请您尽快进行对应问题的勾选,填写完整邮箱、电话号码(内地电话号码或香港电话号码)、日期(填写当下日期即可)"
let attText = "申请人姓名需要进行电子签字"
let attStr = NSMutableAttributedString(string: normalText + attText)
attStr.setAttributes([.foregroundColor: UIColor.brandMainColor], range: NSRange(location: normalText.count, length: attText.count))
return attStr
let firstLine1: ASAttributedString = .init(string: "需填写完整邮箱、电话号码", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor))
let firstLine2: ASAttributedString = .init(string: "(内地电话号码或香港电话号码)", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor50))
let firstLine3: ASAttributedString = .init(string: "、日期", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor))
let firstLine4: ASAttributedString = .init(string: "(填写当下日期即可)\n", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor50))
let secondLine: ASAttributedString = .init(string: "请主申请人勾选信息并完成电子签字", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.brandMainColor))
return (indentStr + firstLine1 + firstLine2 + firstLine3 + firstLine4 + indentStr + secondLine).add(attributes: .paragraph(.lineSpacing(8), .firstLineHeadIndent(0), .headIndent(11)))
case .settlementPlan:
let normalText = "请主申请人完成电子签字请您审阅赴港定居计划文书内容,如需调整和补充内容,请在线上进行编辑,我们将根据您的修改及反馈对文书进行调整如您对《定居计划书》无其他补充建议,"
let attText = "请您在文书尾部进行电子签字"
let attStr = NSMutableAttributedString(string: normalText + attText)
attStr.setAttributes([.foregroundColor: UIColor.brandMainColor], range: NSRange(location: normalText.count, length: attText.count))
return attStr
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 fourth1: ASAttributedString = .init(string: "如您对《定居计划书》无其他补充建议,", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let fourth2: ASAttributedString = .init(string: "请您在文书尾部进行电子签字", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.brandMainColor))
return (indentStr + firstLine + indentStr + secondLine + indentStr + third + indentStr + fourth1 + fourth2).add(attributes: .paragraph(.lineSpacing(8), .firstLineHeadIndent(0), .headIndent(11)))
case .explanatoryStatement:
let normalText = "请主申请人完成电子签字请您审阅文书中的相关解释说明,如需调整和补充,请在线上进行编辑,我们将根据您的修改及反馈对文书进行调整如您对《解释说明书》无其他补充建议,"
let attText = "请您在文书尾部进行电子签字"
let attStr = NSMutableAttributedString(string: normalText + attText)
attStr.setAttributes([.foregroundColor: UIColor.brandMainColor], range: NSRange(location: normalText.count, length: attText.count))
return attStr
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 fourth1: ASAttributedString = .init(string: "如您对《解释说明书》无其他补充建议,", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.mainTextColor70))
let fourth2: ASAttributedString = .init(string: "请您在文书尾部进行电子签字", .font(UIFont.PFSC_R(ofSize: 12)), .foreground(UIColor.brandMainColor))
return (indentStr + firstLine + indentStr + secondLine + indentStr + third + indentStr + fourth1 + fourth2).add(attributes: .paragraph(.lineSpacing(8), .firstLineHeadIndent(0), .headIndent(11)))
}
}
}
......@@ -19,7 +19,7 @@ enum YHResignDocumentType: Int {
case .powerOfAttorney:
return "代理委托书"
case .settlementPlan:
return "定居计划"
return "定居计划"
case .explanatoryStatement:
return "解释说明"
case .qmasDoc:
......
......@@ -7,6 +7,7 @@
//
import UIKit
import AttributedString
class YHResignDocumentTipsCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHResignDocumentTipsCell"
......@@ -54,6 +55,12 @@ class YHResignDocumentTipsCell: YHResignDocumentCell {
infoDetailLabel.textColor = detailColor
infoDetailLabel.attributedText = detail
}
func setupCellASAttributedInfo(title: String?, detail: ASAttributedString?, detailColor: UIColor = .mainTextColor50) {
infoTitleLabel.text = title
infoDetailLabel.textColor = detailColor
infoDetailLabel.attributed.text = detail
}
}
extension YHResignDocumentTipsCell {
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tip_list_index_dot@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tip_list_index_dot@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