Commit b47e4c7b authored by pete谢兆麟's avatar pete谢兆麟

提示修改

parent 6cfa63cc
...@@ -116,8 +116,11 @@ class YHMyDocumentsDetailViewController: YHBaseViewController { ...@@ -116,8 +116,11 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
} else { } else {
YHHUD.flash(message: error?.errorMsg ?? "") YHHUD.flash(message: error?.errorMsg ?? "")
} }
self.checkSign()
}) })
}
func checkSign() {
viewModel?.requestSignCallBack("\(self.viewModel.mainModel?.writing_document.doc_sign.id ?? 0)", callBackBlock: {[weak self] success, error in viewModel?.requestSignCallBack("\(self.viewModel.mainModel?.writing_document.doc_sign.id ?? 0)", callBackBlock: {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.isSign = success self.isSign = success
...@@ -407,26 +410,22 @@ extension YHMyDocumentsDetailViewController: UITableViewDelegate, UITableViewDat ...@@ -407,26 +410,22 @@ extension YHMyDocumentsDetailViewController: UITableViewDelegate, UITableViewDat
cell.block = {[weak self] type in cell.block = {[weak self] type in
guard let self = self else { return } guard let self = self else { return }
if type == .edit { if type == .edit {
if self.viewModel.mainModel?.prospectus.id != 0 { YHHUD.show(.progress(message: ""))
// 跳转赴港计划书编辑页面 self.viewModel.requestDocumentsTemporaryUrl("\(id)", callBackBlock: {[weak self] success, error in
} else { YHHUD.hide()
YHHUD.show(.progress(message: "")) guard let self = self else { return }
self.viewModel.requestDocumentsTemporaryUrl("\(id)", callBackBlock: {[weak self] success, error in if success {
YHHUD.hide() self.viewModel.requestDocumentRecord("\(id)", 2) { success, error in
guard let self = self else { return }
if success {
self.viewModel.requestDocumentRecord("\(id)", 2) { success, error in
}
guard let url = URL(string: self.viewModel?.urlModel?.url) else { return }
let tmpVC = SFSafariViewController(url: url)
tmpVC.dismissButtonStyle = .close
tmpVC.delegate = self
self.navigationController?.pushViewController(tmpVC)
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
} }
}) guard let url = URL(string: self.viewModel?.urlModel?.url) else { return }
} let tmpVC = SFSafariViewController(url: url)
tmpVC.dismissButtonStyle = .close
tmpVC.delegate = self
self.navigationController?.pushViewController(tmpVC)
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
}
})
} }
if type == .submit { if type == .submit {
...@@ -434,32 +433,29 @@ extension YHMyDocumentsDetailViewController: UITableViewDelegate, UITableViewDat ...@@ -434,32 +433,29 @@ extension YHMyDocumentsDetailViewController: UITableViewDelegate, UITableViewDat
} }
if type == .look { if type == .look {
if self.viewModel.mainModel?.prospectus.id != 0 { YHHUD.show(.progress(message: ""))
// 跳转赴港计划书查看页面 self.viewModel.requestDocumentsTemporaryUrl("\(id)", callBackBlock: {[weak self] success, error in
} else { YHHUD.hide()
YHHUD.show(.progress(message: "")) guard let self = self else { return }
self.viewModel.requestDocumentsTemporaryUrl("\(id)", callBackBlock: {[weak self] success, error in if success {
YHHUD.hide() self.viewModel.requestDocumentRecord("\(id)", 1) { success, error in
guard let self = self else { return }
if success {
self.viewModel.requestDocumentRecord("\(id)", 1) { success, error in
}
guard let url = URL(string: self.viewModel?.urlModel?.url) else { return }
let tmpVC = SFSafariViewController(url: url)
tmpVC.dismissButtonStyle = .close
tmpVC.delegate = self
self.navigationController?.pushViewController(tmpVC)
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
} }
}) guard let url = URL(string: self.viewModel?.urlModel?.url) else { return }
} let tmpVC = SFSafariViewController(url: url)
tmpVC.dismissButtonStyle = .close
tmpVC.delegate = self
self.navigationController?.pushViewController(tmpVC)
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
}
})
} }
} }
return cell return cell
} else { } else {
if indexPath.row == 0 { if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHDocumentPromptTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHDocumentPromptTableViewCell.self)
cell.type = self.viewModel.mainModel?.writing_document.doc_sign.doc_type ?? 0
cell.backgroundColor = .clear cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear cell.contentView.backgroundColor = .clear
return cell return cell
...@@ -467,6 +463,9 @@ extension YHMyDocumentsDetailViewController: UITableViewDelegate, UITableViewDat ...@@ -467,6 +463,9 @@ extension YHMyDocumentsDetailViewController: UITableViewDelegate, UITableViewDat
let cell = tableView.dequeueReusableCell(withClass: YHDocumentToActionTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHDocumentToActionTableViewCell.self)
cell.dataSource = self.viewModel.mainModel cell.dataSource = self.viewModel.mainModel
cell.isSign = self.isSign cell.isSign = self.isSign
if self.type == 5 {
cell.isSign = true
}
cell.backgroundColor = .clear cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear cell.contentView.backgroundColor = .clear
cell.block = { [weak self] type in cell.block = { [weak self] type in
......
...@@ -216,7 +216,7 @@ class YHDocumentMessageTableViewCell: UITableViewCell { ...@@ -216,7 +216,7 @@ class YHDocumentMessageTableViewCell: UITableViewCell {
let status = dataSource.writing_document.status let status = dataSource.writing_document.status
if status == 1 { if status == 1 {
statusTxt = "不展示" statusTxt = " 不展示 "
color = UIColor.brandMainColor color = UIColor.brandMainColor
lookButton.isHidden = true lookButton.isHidden = true
} else if status == 2 { } else if status == 2 {
......
...@@ -14,10 +14,9 @@ class YHDocumentPromptTableViewCell: UITableViewCell { ...@@ -14,10 +14,9 @@ class YHDocumentPromptTableViewCell: UITableViewCell {
var promptImageView: UIImageView! var promptImageView: UIImageView!
var titleLabel: UILabel! var titleLabel: UILabel!
var subTitleLabel: UILabel! var subTitleLabel: UILabel!
var type: Int = 0 {
var dataSource: YHMyDocumentDetailModel? {
didSet { didSet {
updateAllViews() updatePrompt()
} }
} }
...@@ -104,10 +103,22 @@ class YHDocumentPromptTableViewCell: UITableViewCell { ...@@ -104,10 +103,22 @@ class YHDocumentPromptTableViewCell: UITableViewCell {
} }
func updateAllViews() { func updatePrompt() {
guard let dataSource = dataSource else { return } // 1-代理委托书,2-受养人声明,3-工作经验补充表,4-声明书,5-人才清单声明书,6-个人陈述书,7-推荐信,8-组织架构图
// titleLabel.text = dataSource.doc_name
// subTitleLabel.text = "\(dataSource.doc_type)" if type == 7 || type == 8 {
let a: ASAttributedString = .init("您可以", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.subTextColor2))
let aa: ASAttributedString = .init("转发给需签署的人签字,若需要盖章,则先确认文书是否已签完,然后下载打印去盖章,扫描签章件上传", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.brandMainColor))
subTitleLabel.attributed.text = a + aa
} else if type == 2 {
let a: ASAttributedString = .init("您可以", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.subTextColor2))
let aa: ASAttributedString = .init("先下载原件,然后打印去签字/盖章,最后扫描签字/盖章件上传", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.brandMainColor))
subTitleLabel.attributed.text = a + aa
} else {
let a: ASAttributedString = .init("您可以", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.subTextColor2))
let aa: ASAttributedString = .init("直接电子签署文书,或上传已签章件", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.brandMainColor))
subTitleLabel.attributed.text = a + aa
}
} }
} }
......
...@@ -99,8 +99,11 @@ class YHMySignatureDetailViewController: YHBaseViewController { ...@@ -99,8 +99,11 @@ class YHMySignatureDetailViewController: YHBaseViewController {
} else { } else {
YHHUD.flash(message: error?.errorMsg ?? "") YHHUD.flash(message: error?.errorMsg ?? "")
} }
self.checkSign()
}) })
}
func checkSign() {
viewModel?.requestSignCallBack("\(self.id)", callBackBlock: {[weak self] success, error in viewModel?.requestSignCallBack("\(self.id)", callBackBlock: {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.isSign = success self.isSign = success
...@@ -354,6 +357,7 @@ extension YHMySignatureDetailViewController: UITableViewDelegate, UITableViewDat ...@@ -354,6 +357,7 @@ extension YHMySignatureDetailViewController: UITableViewDelegate, UITableViewDat
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 { if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHDocumentPromptTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHDocumentPromptTableViewCell.self)
cell.type = self.viewModel.mainModel?.doc_type ?? 0
cell.backgroundColor = .clear cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear cell.contentView.backgroundColor = .clear
return cell return cell
...@@ -361,6 +365,9 @@ extension YHMySignatureDetailViewController: UITableViewDelegate, UITableViewDat ...@@ -361,6 +365,9 @@ extension YHMySignatureDetailViewController: UITableViewDelegate, UITableViewDat
let cell = tableView.dequeueReusableCell(withClass: YHSignatureToActionTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHSignatureToActionTableViewCell.self)
cell.dataSource = self.viewModel.mainModel cell.dataSource = self.viewModel.mainModel
cell.isSign = self.isSign cell.isSign = self.isSign
if self.type == 5 {
cell.isSign = true
}
cell.backgroundColor = .clear cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear cell.contentView.backgroundColor = .clear
cell.block = { [weak self] type in cell.block = { [weak self] type in
......
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