Commit 8bbb69de authored by pete谢兆麟's avatar pete谢兆麟

我的文书详情UI

parent 3f9212f3
...@@ -242,6 +242,10 @@ ...@@ -242,6 +242,10 @@
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */; }; 04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */; };
04E86E0D2B70D51D00A35F4B /* YHWebViewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */; }; 04E86E0D2B70D51D00A35F4B /* YHWebViewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */; };
04E86E662B86EB6F00A35F4B /* YHLoginManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E652B86EB6F00A35F4B /* YHLoginManager.swift */; }; 04E86E662B86EB6F00A35F4B /* YHLoginManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E652B86EB6F00A35F4B /* YHLoginManager.swift */; };
04EA23082BB50753009DA928 /* YHDocumentMessageTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04EA23072BB50753009DA928 /* YHDocumentMessageTableViewCell.swift */; };
04EA230A2BB5172F009DA928 /* YHDocumentPromptTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04EA23092BB5172F009DA928 /* YHDocumentPromptTableViewCell.swift */; };
04EA230C2BB5199D009DA928 /* YHDocumentToActionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04EA230B2BB5199D009DA928 /* YHDocumentToActionTableViewCell.swift */; };
04EA230E2BB538E9009DA928 /* YHDocumentUploadTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04EA230D2BB538E9009DA928 /* YHDocumentUploadTableViewCell.swift */; };
04F4B76B2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F4B76A2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift */; }; 04F4B76B2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F4B76A2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; }; 6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; }; A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; };
...@@ -629,6 +633,10 @@ ...@@ -629,6 +633,10 @@
04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; }; 04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; };
04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWebViewViewController.swift; sourceTree = "<group>"; }; 04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWebViewViewController.swift; sourceTree = "<group>"; };
04E86E652B86EB6F00A35F4B /* YHLoginManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginManager.swift; sourceTree = "<group>"; }; 04E86E652B86EB6F00A35F4B /* YHLoginManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginManager.swift; sourceTree = "<group>"; };
04EA23072BB50753009DA928 /* YHDocumentMessageTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDocumentMessageTableViewCell.swift; sourceTree = "<group>"; };
04EA23092BB5172F009DA928 /* YHDocumentPromptTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDocumentPromptTableViewCell.swift; sourceTree = "<group>"; };
04EA230B2BB5199D009DA928 /* YHDocumentToActionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDocumentToActionTableViewCell.swift; sourceTree = "<group>"; };
04EA230D2BB538E9009DA928 /* YHDocumentUploadTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDocumentUploadTableViewCell.swift; sourceTree = "<group>"; };
04F4B76A2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateTemplateSheetView.swift; sourceTree = "<group>"; }; 04F4B76A2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateTemplateSheetView.swift; sourceTree = "<group>"; };
19B28612265782F9DC1BE0B0 /* Pods-galaxy.testenv.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.testenv.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.testenv.xcconfig"; sourceTree = "<group>"; }; 19B28612265782F9DC1BE0B0 /* Pods-galaxy.testenv.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.testenv.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.testenv.xcconfig"; sourceTree = "<group>"; };
58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; }; 58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; };
...@@ -1032,6 +1040,7 @@ ...@@ -1032,6 +1040,7 @@
045EEDF82B9F171A0022A143 /* MyDocuments(我的文书) */ = { 045EEDF82B9F171A0022A143 /* MyDocuments(我的文书) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04EA23062BB50719009DA928 /* View */,
04A7BD0D2BA41C7600BD35A2 /* ViewModel */, 04A7BD0D2BA41C7600BD35A2 /* ViewModel */,
04A7BD0C2BA41C6E00BD35A2 /* Model */, 04A7BD0C2BA41C6E00BD35A2 /* Model */,
045EEDF92B9F171A0022A143 /* C */, 045EEDF92B9F171A0022A143 /* C */,
...@@ -1549,6 +1558,17 @@ ...@@ -1549,6 +1558,17 @@
path = Server; path = Server;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
04EA23062BB50719009DA928 /* View */ = {
isa = PBXGroup;
children = (
04EA23072BB50753009DA928 /* YHDocumentMessageTableViewCell.swift */,
04EA23092BB5172F009DA928 /* YHDocumentPromptTableViewCell.swift */,
04EA230B2BB5199D009DA928 /* YHDocumentToActionTableViewCell.swift */,
04EA230D2BB538E9009DA928 /* YHDocumentUploadTableViewCell.swift */,
);
path = View;
sourceTree = "<group>";
};
4758815B24BAF3CAA24EC6A8 /* Pods */ = { 4758815B24BAF3CAA24EC6A8 /* Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -2448,6 +2468,7 @@ ...@@ -2448,6 +2468,7 @@
045EEEB52B9F171A0022A143 /* YHWorkIntroductionItemView.swift in Sources */, 045EEEB52B9F171A0022A143 /* YHWorkIntroductionItemView.swift in Sources */,
045EEF202B9F171A0022A143 /* YHCardExampleView.swift in Sources */, 045EEF202B9F171A0022A143 /* YHCardExampleView.swift in Sources */,
04A6715E2B9FFCA700C1FB91 /* YHCertificateNameCell.swift in Sources */, 04A6715E2B9FFCA700C1FB91 /* YHCertificateNameCell.swift in Sources */,
04EA23082BB50753009DA928 /* YHDocumentMessageTableViewCell.swift in Sources */,
045EEE8E2B9F171A0022A143 /* YHPreviewInfoWorkSummaryView.swift in Sources */, 045EEE8E2B9F171A0022A143 /* YHPreviewInfoWorkSummaryView.swift in Sources */,
045EEECE2B9F171A0022A143 /* YHScoreDetailViewController.swift in Sources */, 045EEECE2B9F171A0022A143 /* YHScoreDetailViewController.swift in Sources */,
A5C5B3252B57C74900A7C5D1 /* YHDavidCell3.swift in Sources */, A5C5B3252B57C74900A7C5D1 /* YHDavidCell3.swift in Sources */,
...@@ -2492,6 +2513,7 @@ ...@@ -2492,6 +2513,7 @@
A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */, A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */,
045EEEA52B9F171A0022A143 /* YHImageViewController.swift in Sources */, 045EEEA52B9F171A0022A143 /* YHImageViewController.swift in Sources */,
045EEEF32B9F171A0022A143 /* YHFamilyMemberInfoListVC.swift in Sources */, 045EEEF32B9F171A0022A143 /* YHFamilyMemberInfoListVC.swift in Sources */,
04EA230C2BB5199D009DA928 /* YHDocumentToActionTableViewCell.swift in Sources */,
A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */, A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */,
A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */, A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */,
045EEEFE2B9F171A0022A143 /* YHFormItemInputTextCell.swift in Sources */, 045EEEFE2B9F171A0022A143 /* YHFormItemInputTextCell.swift in Sources */,
...@@ -2508,6 +2530,7 @@ ...@@ -2508,6 +2530,7 @@
045EEEE12B9F171A0022A143 /* YHMySignatureListViewModel.swift in Sources */, 045EEEE12B9F171A0022A143 /* YHMySignatureListViewModel.swift in Sources */,
04A7BD152BA4361700BD35A2 /* YHMyDocumentDetailModel.swift in Sources */, 04A7BD152BA4361700BD35A2 /* YHMyDocumentDetailModel.swift in Sources */,
045EEEA02B9F171A0022A143 /* YHWorkItemListModel.swift in Sources */, 045EEEA02B9F171A0022A143 /* YHWorkItemListModel.swift in Sources */,
04EA230E2BB538E9009DA928 /* YHDocumentUploadTableViewCell.swift in Sources */,
045EEEAD2B9F171A0022A143 /* YHWorkExperienceListTableViewCell.swift in Sources */, 045EEEAD2B9F171A0022A143 /* YHWorkExperienceListTableViewCell.swift in Sources */,
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */, 049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */,
047619E92BA9867100F45358 /* YHCountryHotView.swift in Sources */, 047619E92BA9867100F45358 /* YHCountryHotView.swift in Sources */,
...@@ -2555,6 +2578,7 @@ ...@@ -2555,6 +2578,7 @@
A5C5B3272B57C8D500A7C5D1 /* YHDavidCell2.swift in Sources */, A5C5B3272B57C8D500A7C5D1 /* YHDavidCell2.swift in Sources */,
045EEEB72B9F171A0022A143 /* YHWorkItemAddView.swift in Sources */, 045EEEB72B9F171A0022A143 /* YHWorkItemAddView.swift in Sources */,
A5ACE9372B4564F7002C94D2 /* YHBaseUrlManager.swift in Sources */, A5ACE9372B4564F7002C94D2 /* YHBaseUrlManager.swift in Sources */,
04EA230A2BB5172F009DA928 /* YHDocumentPromptTableViewCell.swift in Sources */,
045EEF092B9F171A0022A143 /* YHBasicInfoFillModel.swift in Sources */, 045EEF092B9F171A0022A143 /* YHBasicInfoFillModel.swift in Sources */,
A5ACE9352B4564F7002C94D2 /* YHNetRequest.swift in Sources */, A5ACE9352B4564F7002C94D2 /* YHNetRequest.swift in Sources */,
A5FD63CB2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift in Sources */, A5FD63CB2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift in Sources */,
......
...@@ -50,7 +50,6 @@ class YHFilePreviewTool: NSObject { ...@@ -50,7 +50,6 @@ class YHFilePreviewTool: NSObject {
} }
func openXLSXFile(at fileURL: URL, fileName: String?) { func openXLSXFile(at fileURL: URL, fileName: String?) {
let controller = UIDocumentInteractionController(url: fileURL) let controller = UIDocumentInteractionController(url: fileURL)
// 设置标题显示 // 设置标题显示
if let fileName = fileName, !fileName.isEmpty { if let fileName = fileName, !fileName.isEmpty {
......
//
// YHDocumentPromptTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/3/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHDocumentPromptTableViewCell: UITableViewCell {
var centerView: UIImageView!
var promptImageView: UIImageView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var dataSource: YHMyDocumentDetailModel? {
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIImageView()
view.image = UIImage(named: "document_prompt_bg")
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(8)
make.bottom.equalTo(-8)
}
promptImageView = {
let view = UIImageView()
view.image = UIImage(named: "document_prompt_icon")
return view
}()
centerView.addSubview(promptImageView)
promptImageView.snp.makeConstraints { make in
make.width.height.equalTo(14)
make.left.equalTo(16)
make.top.equalTo(16)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 12)
label.textColor = UIColor.brandMainColor
label.text = "温馨提示:"
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(38)
make.top.equalTo(16)
make.height.equalTo(17)
}
subTitleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.labelTextColor2
label.numberOfLines = 0
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))
label.attributed.text = a + aa
return label
}()
centerView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(15)
make.right.equalTo(-15)
make.top.equalTo(38.5)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
// titleLabel.text = dataSource.doc_name
// subTitleLabel.text = "\(dataSource.doc_type)"
}
}
//
// YHDocumentToActionTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/3/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHDocumentToActionTableViewCell: UITableViewCell {
typealias Block = (YHMyFileMethodType) -> ()
var block: Block?
var centerView: UIView!
var titleLabel: UILabel!
var topLineView: UIView!
var bottomView: UIView!
var bottomLeftLineView: UIView!
var bottomRightLineView: UIView!
var fileImageView: UIImageView!
var fileNameLabel: UILabel!
var editButton: UIButton!
var submitButton: UIButton!
var lookButton: UIButton!
var dataSource: YHMyDocumentWritingDocumentDocSignModel? {
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
let width = (KScreenWidth - 32)/3.0
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(8)
make.bottom.equalTo(-8)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "电子签"
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(24)
}
topLineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(topLineView)
topLineView.snp.makeConstraints { make in
make.right.equalTo(-18)
make.left.equalTo(18)
make.height.equalTo(1)
make.top.equalTo(52)
}
bottomView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.right.left.equalToSuperview()
make.height.equalTo(1)
make.top.equalTo(123)
}
bottomLeftLineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(bottomLeftLineView)
bottomLeftLineView.snp.makeConstraints { make in
make.left.equalTo(width)
make.width.equalTo(1)
make.bottom.equalTo(-17.5)
make.height.equalTo(16)
}
bottomRightLineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(bottomRightLineView)
bottomRightLineView.snp.makeConstraints { make in
make.left.equalTo(width * 2)
make.width.equalTo(1)
make.bottom.equalTo(-17.5)
make.height.equalTo(16)
}
editButton = {
let button = UIButton(type: .custom)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
button.setTitle("签署", for: .normal)
button.addTarget(self, action: #selector(editButtonClick), for: .touchUpInside)
return button
}()
centerView.addSubview(editButton)
editButton.snp.makeConstraints { make in
make.left.bottom.equalToSuperview()
make.top.equalTo(bottomView.snp.bottom)
make.width.equalTo(width)
}
submitButton = {
let button = UIButton(type: .custom)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
button.setTitle("查看", for: .normal)
button.addTarget(self, action: #selector(submitButtonClick), for: .touchUpInside)
return button
}()
centerView.addSubview(submitButton)
submitButton.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.top.equalTo(bottomView.snp.bottom)
make.left.equalTo(width)
make.width.equalTo(width)
}
lookButton = {
let button = UIButton(type: .custom)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
button.setTitle("下载", for: .normal)
button.addTarget(self, action: #selector(lookButtonClick), for: .touchUpInside)
return button
}()
centerView.addSubview(lookButton)
lookButton.snp.makeConstraints { make in
make.right.bottom.equalToSuperview()
make.top.equalTo(bottomView.snp.bottom)
make.width.equalTo(width)
}
fileImageView = {
let view = UIImageView()
view.image = UIImage(named: "")
return view
}()
centerView.addSubview(fileImageView)
fileImageView.snp.makeConstraints { make in
make.left.equalTo(24)
make.centerY.equalToSuperview()
make.width.height.equalTo(31)
}
fileNameLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.numberOfLines = 0
label.text = "雇主的推荐信(仅签字)华为科技有限公司.doc"
return label
}()
centerView.addSubview(fileNameLabel)
fileNameLabel.snp.makeConstraints { make in
make.right.equalTo(-18)
make.left.equalTo(67)
make.height.equalTo(40)
make.centerY.equalToSuperview()
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
// titleLabel.text = dataSource.doc_name
// subTitleLabel.text = "\(dataSource.doc_type)"
}
@objc func editButtonClick() {
if let block = block {
block(.sign)
}
}
@objc func lookButtonClick() {
if let block = block {
block(.look)
}
}
@objc func submitButtonClick() {
if let block = block {
block(.downLoad)
}
}
}
//
// YHDocumentUploadTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/3/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHDocumentUploadTableViewCell: UITableViewCell {
typealias Block = (YHMyFileMethodType, Int) -> ()
var block: Block?
var centerView: UIView!
var titleLabel: UILabel!
var topLineView: UIView!
var fileImageView: UIImageView!
var fileNameLabel: UILabel!
var promptLabel: UILabel!
var bottomView: YHWorkItemAddView!
var dataSource: YHMyDocumentWritingDocumentDocSignModel? {
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
let width = (KScreenWidth - 32)/3.0
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(8)
make.bottom.equalTo(-8)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "上传已签章件"
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(24)
}
topLineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(topLineView)
topLineView.snp.makeConstraints { make in
make.right.equalTo(-18)
make.left.equalTo(18)
make.height.equalTo(1)
make.top.equalTo(52)
}
fileImageView = {
let view = UIImageView()
view.image = UIImage(named: "")
return view
}()
centerView.addSubview(fileImageView)
fileImageView.snp.makeConstraints { make in
make.left.equalTo(24)
make.centerY.equalToSuperview()
make.width.height.equalTo(31)
}
fileNameLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.numberOfLines = 0
label.text = "雇主的推荐信(仅签字)华为科技有限公司.doc"
return label
}()
centerView.addSubview(fileNameLabel)
fileNameLabel.snp.makeConstraints { make in
make.right.equalTo(-18)
make.left.equalTo(67)
make.height.equalTo(40)
make.centerY.equalToSuperview()
}
promptLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.labelTextColor2
label.numberOfLines = 0
label.text = "注意:1.支持PDF、JPEG、JPG、PNG、BMP、TIFF文件格式,文件大小不限制;2.上传成功后会自动更新文件名;3.最多上传10张图片或文件,若有问题可联系文案"
return label
}()
centerView.addSubview(promptLabel)
promptLabel.snp.makeConstraints { make in
make.right.equalTo(-16)
make.left.equalTo(16)
make.height.equalTo(60)
make.bottom.equalTo(-16)
}
bottomView = {
let view = YHWorkItemAddView()
view.addBtn.setTitle("上传已签章件".local, for: .normal)
view.clickBlock = {[weak self] in
guard let self = self else { return }
if let block = self.block {
block(.upload, 0)
}
}
return view
}()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.bottom.equalTo(-92)
make.left.equalTo(18)
make.right.equalTo(-18)
make.height.equalTo(45)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
// titleLabel.text = dataSource.doc_name
// subTitleLabel.text = "\(dataSource.doc_type)"
}
}
...@@ -11,6 +11,9 @@ import UIKit ...@@ -11,6 +11,9 @@ import UIKit
class YHMyDocumentsDetailViewModel: YHBaseViewModel { class YHMyDocumentsDetailViewModel: YHBaseViewModel {
var mainModel: YHMyDocumentDetailModel? var mainModel: YHMyDocumentDetailModel?
var urlModel: YHMyDocumentsUrlModel? var urlModel: YHMyDocumentsUrlModel?
var pageUrl: String?
var personalUrl: String?
override init() { override init() {
super.init() super.init()
} }
...@@ -61,4 +64,135 @@ class YHMyDocumentsDetailViewModel: YHBaseViewModel { ...@@ -61,4 +64,135 @@ class YHMyDocumentsDetailViewModel: YHBaseViewModel {
callBackBlock(false, err) callBackBlock(false, err)
} }
} }
func requestDocumentSubmit(_ supplementId: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["supplement_id": supplementId]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Documents.submit
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
// authority 1-读 2-写
func requestDocumentRecord(_ supplementId: String, _ authority: Int, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["supplement_id": supplementId,
"authority": authority]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Documents.record
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func requestSignaturePageURL(_ id: String, callBackBlock:@escaping (_ success: Bool?, _ error: YHErrorModel?)->()) {
// let params: [String : Any] = ["order_id": orderId]
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.pageUrl
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
// let dic = json.data
// guard let result = YHMySignatureURLModel.deserialize(from: dic as? Dictionary) else {
// callBackBlock(false,nil)
// return
// }
self.pageUrl = json.data as? String
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func requestSignaturePersonalURL(callBackBlock:@escaping (_ success: Bool?, _ error: YHErrorModel?)->()) {
// let params: [String : Any] = ["order_id": orderId]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.personalUrl
let _ = YHNetRequest.postRequest(url: strUrl) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let result = YHMySignatureURLModel.deserialize(from: dic as? Dictionary) else {
callBackBlock(false,nil)
return
}
self.personalUrl = result.url
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func requestSignatureLook(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.look
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let result = YHMySignatureURLModel.deserialize(from: dic as? Dictionary) else {
callBackBlock(false,nil)
return
}
self.pageUrl = result.url
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func requestSignatureDownload(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.download
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let result = YHMySignatureURLModel.deserialize(from: dic as? Dictionary) else {
callBackBlock(false,nil)
return
}
self.pageUrl = result.url
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
} }
...@@ -176,6 +176,16 @@ extension YHMySignatureDetailViewController: UITableViewDelegate, UITableViewDat ...@@ -176,6 +176,16 @@ extension YHMySignatureDetailViewController: UITableViewDelegate, UITableViewDat
printLog("下载") printLog("下载")
case .look: case .look:
printLog("查看") printLog("查看")
case .edit:
break
case .submit:
break
case .upload:
break
case .delete:
break
case .reUpload:
break
} }
} }
cell.backgroundColor = .clear cell.backgroundColor = .clear
......
...@@ -12,6 +12,11 @@ enum YHMyFileMethodType: Int { ...@@ -12,6 +12,11 @@ enum YHMyFileMethodType: Int {
case sign = 0 // 签署 case sign = 0 // 签署
case downLoad = 1 // 下载 case downLoad = 1 // 下载
case look = 2 // 查看 case look = 2 // 查看
case edit = 3 // 编辑
case submit = 4 // 提交
case upload = 5 // 上传
case delete = 6 // 删除
case reUpload = 7 // 重传
} }
class YHMyFileMethodTableViewCell: UITableViewCell { class YHMyFileMethodTableViewCell: UITableViewCell {
......
...@@ -105,4 +105,50 @@ class YHMySignatureDetailViewModel: YHBaseViewModel { ...@@ -105,4 +105,50 @@ class YHMySignatureDetailViewModel: YHBaseViewModel {
callBackBlock(false, err) callBackBlock(false, err)
} }
} }
func requestSignatureLook(_ id: String, callBackBlock:@escaping (_ success: Bool?, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.look
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let result = YHMySignatureURLModel.deserialize(from: dic as? Dictionary) else {
callBackBlock(false,nil)
return
}
self.pageUrl = result.url
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func requestSignatureDownload(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.download
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let result = YHMySignatureURLModel.deserialize(from: dic as? Dictionary) else {
callBackBlock(false,nil)
return
}
self.pageUrl = result.url
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
} }
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "document_prompt_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "document_prompt_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "document_prompt_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "document_prompt_icon@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