Commit 00dc4cad authored by Steven杜宇's avatar Steven杜宇

// 原则批逻辑

parent 250f8732
...@@ -309,6 +309,8 @@ ...@@ -309,6 +309,8 @@
048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */; }; 048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */; };
0485DFD42C649A2500B50293 /* YHPrincipleUploadModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */; }; 0485DFD42C649A2500B50293 /* YHPrincipleUploadModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */; };
0485DFD62C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0485DFD52C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift */; }; 0485DFD62C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0485DFD52C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift */; };
0485DFD82C66036600B50293 /* YHPrincipleFileRenameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0485DFD72C66036600B50293 /* YHPrincipleFileRenameView.swift */; };
0485DFDA2C660EFA00B50293 /* YHPrincipleRequestModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0485DFD92C660EFA00B50293 /* YHPrincipleRequestModel.swift */; };
048787D12BCE61B20036E221 /* YHServiceNoOrderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */; }; 048787D12BCE61B20036E221 /* YHServiceNoOrderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */; };
048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */; }; 048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */; };
048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */; }; 048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */; };
...@@ -959,6 +961,8 @@ ...@@ -959,6 +961,8 @@
048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchBar.swift; sourceTree = "<group>"; }; 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchBar.swift; sourceTree = "<group>"; };
0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleUploadModel.swift; sourceTree = "<group>"; }; 0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleUploadModel.swift; sourceTree = "<group>"; };
0485DFD52C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleApprovedWaitSubmitVC.swift; sourceTree = "<group>"; }; 0485DFD52C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleApprovedWaitSubmitVC.swift; sourceTree = "<group>"; };
0485DFD72C66036600B50293 /* YHPrincipleFileRenameView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleFileRenameView.swift; sourceTree = "<group>"; };
0485DFD92C660EFA00B50293 /* YHPrincipleRequestModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleRequestModel.swift; sourceTree = "<group>"; };
048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceNoOrderView.swift; sourceTree = "<group>"; }; 048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceNoOrderView.swift; sourceTree = "<group>"; };
048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderListViewController.swift; sourceTree = "<group>"; }; 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderListViewController.swift; sourceTree = "<group>"; };
048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderProgressTableViewCell.swift; sourceTree = "<group>"; }; 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderProgressTableViewCell.swift; sourceTree = "<group>"; };
...@@ -2221,6 +2225,7 @@ ...@@ -2221,6 +2225,7 @@
04B360F02C635A33001EB053 /* YHPrincipleWaitResultModel.swift */, 04B360F02C635A33001EB053 /* YHPrincipleWaitResultModel.swift */,
04B360F62C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift */, 04B360F62C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift */,
0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */, 0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */,
0485DFD92C660EFA00B50293 /* YHPrincipleRequestModel.swift */,
); );
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2235,6 +2240,7 @@ ...@@ -2235,6 +2240,7 @@
04B360EE2C620975001EB053 /* YHPrincipleUploadStatusCell.swift */, 04B360EE2C620975001EB053 /* YHPrincipleUploadStatusCell.swift */,
04B360EC2C61F157001EB053 /* YHPrincipleEnvelopeCell.swift */, 04B360EC2C61F157001EB053 /* YHPrincipleEnvelopeCell.swift */,
04B360EA2C60E88C001EB053 /* YHPrincipleCongratulationAlertView.swift */, 04B360EA2C60E88C001EB053 /* YHPrincipleCongratulationAlertView.swift */,
0485DFD72C66036600B50293 /* YHPrincipleFileRenameView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3915,6 +3921,7 @@ ...@@ -3915,6 +3921,7 @@
A5EF21332BA6E030005027E6 /* YHFileListViewController.swift in Sources */, A5EF21332BA6E030005027E6 /* YHFileListViewController.swift in Sources */,
045EEF1E2B9F171A0022A143 /* YHBottomNextView.swift in Sources */, 045EEF1E2B9F171A0022A143 /* YHBottomNextView.swift in Sources */,
A567E59E2BD7643D00D5D5A0 /* YHHomePageViewController.swift in Sources */, A567E59E2BD7643D00D5D5A0 /* YHHomePageViewController.swift in Sources */,
0485DFD82C66036600B50293 /* YHPrincipleFileRenameView.swift in Sources */,
045EEEBA2B9F171A0022A143 /* YHWorkResponsibilitiesTableViewCell.swift in Sources */, 045EEEBA2B9F171A0022A143 /* YHWorkResponsibilitiesTableViewCell.swift in Sources */,
047AA3ED2C4A70F6009C4554 /* YHHeadView.swift in Sources */, 047AA3ED2C4A70F6009C4554 /* YHHeadView.swift in Sources */,
04AD317F2C295C0300DF5655 /* YHChangeHeadModel.swift in Sources */, 04AD317F2C295C0300DF5655 /* YHChangeHeadModel.swift in Sources */,
...@@ -4006,6 +4013,7 @@ ...@@ -4006,6 +4013,7 @@
A5EE41EF2C21387C005BBA5D /* YHAiRadarAreaView.swift in Sources */, A5EE41EF2C21387C005BBA5D /* YHAiRadarAreaView.swift in Sources */,
045EEEE22B9F171A0022A143 /* YHMySignatureDetailViewModel.swift in Sources */, 045EEEE22B9F171A0022A143 /* YHMySignatureDetailViewModel.swift in Sources */,
045EEE7D2B9F171A0022A143 /* YHWorkExpDataModel.swift in Sources */, 045EEE7D2B9F171A0022A143 /* YHWorkExpDataModel.swift in Sources */,
0485DFDA2C660EFA00B50293 /* YHPrincipleRequestModel.swift in Sources */,
045EEE832B9F171A0022A143 /* YHMainInfoPreviewModel.swift in Sources */, 045EEE832B9F171A0022A143 /* YHMainInfoPreviewModel.swift in Sources */,
045EEEAB2B9F171A0022A143 /* YHImageClipperViewController.swift in Sources */, 045EEEAB2B9F171A0022A143 /* YHImageClipperViewController.swift in Sources */,
044414032BC39B8D00784A14 /* YHServerTableHeadView.swift in Sources */, 044414032BC39B8D00784A14 /* YHServerTableHeadView.swift in Sources */,
......
...@@ -175,14 +175,57 @@ extension YHPrincipleUploadListVC { ...@@ -175,14 +175,57 @@ extension YHPrincipleUploadListVC {
@objc func didUploadBtnClicked() { @objc func didUploadBtnClicked() {
var files:[YHPrincipleRequestModel] = []
// 赴港居留同意书
let agreementModel = self.viewModel.uploadDetailModel.file_data.agreement
let agree = YHPrincipleRequestModel()
agree.id = agreementModel.id
agree.check_status = agreementModel.check_status
agree.file_url = agreementModel.content_url
files.append(agree)
// 申请人意见访问
let opinionModel = self.viewModel.uploadDetailModel.file_data.opinion
let opinion = YHPrincipleRequestModel()
opinion.id = opinionModel.id
opinion.check_status = opinionModel.check_status
opinion.file_url = opinionModel.content_url
files.append(opinion)
// 其他证明条件
let otherModel = self.viewModel.uploadDetailModel.file_data.other
let other = YHPrincipleRequestModel()
other.id = otherModel.id
other.check_status = otherModel.check_status
other.file_url = otherModel.content_url
files.append(other)
YHHUD.show(.progress(message:"上传中"))
viewModel.uploadPrincipleFiles(files) { success, error in
YHHUD.hide()
if success {
YHHUD.flash(message: "上传成功")
self.requestData()
return
}
var errMsg = error?.errorMsg ?? "上传失败"
YHHUD.flash(message: errMsg)
}
} }
func showFileOperationAlertView(_ model: YHPrincipleContentUrlModel, itemModel:YHPrincipleAgreementModel) { func showFileOperationAlertView(_ index: Int, itemModel:YHPrincipleAgreementModel) {
if index < 0 || index > itemModel.content_url.count {
return
}
var arr = [YHCertificateEditItem(type:.rename, title:"重命名"), let model = itemModel.content_url[index]
YHCertificateEditItem(type:.preview, title:"预览"), let arr = [YHCertificateEditItem(type:.rename, title:"重命名"),
YHCertificateEditItem(type:.delete, title:"删除"), YHCertificateEditItem(type:.preview, title:"预览"),
YHCertificateEditItem(type:.cancel, title:"取消")] YHCertificateEditItem(type:.delete, title:"删除"),
YHCertificateEditItem(type:.cancel, title:"取消")]
YHCertificateEditSheetView.sheetView(items:arr) { YHCertificateEditSheetView.sheetView(items:arr) {
[weak self] editType in [weak self] editType in
...@@ -192,12 +235,18 @@ extension YHPrincipleUploadListVC { ...@@ -192,12 +235,18 @@ extension YHPrincipleUploadListVC {
if editType == .rename { // 重命名 if editType == .rename { // 重命名
IQKeyboardManager.shared.enable = false IQKeyboardManager.shared.enable = false
// var name = contentItem.getFileNameWithoutSuffix() var name = model.getFileNameWithoutSuffix()
// if name.count > 30 { if name.count > 30 {
// name = name[safe: ..<30]! name = name[safe: ..<30]!
// } }
// renameInputView.textField.text = name let view = YHPrincipleFileRenameView.renameView(name: name)
// renameInputView.textField.becomeFirstResponder() view.confirmBlock = {
[weak self] text in
guard let self = self else { return }
model.name = text + "." + model.getFileSuffixName()
self.tableView.reloadData()
}
view.show()
} else if editType == .delete { // 删除 } else if editType == .delete { // 删除
...@@ -281,9 +330,9 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -281,9 +330,9 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
} }
// 文件操作 // 文件操作
cell.fileEditBlock = { cell.fileEditBlock = {
[weak self] fileModel in [weak self] fileModel, index in
guard let self = self else { return } guard let self = self else { return }
self.showFileOperationAlertView(fileModel, itemModel: model) self.showFileOperationAlertView(index, itemModel: model)
} }
return cell return cell
} }
......
//
// YHPrincipleRequestModel.swift
// galaxy
//
// Created by edy on 2024/8/9.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHPrincipleRequestModel: SmartCodable {
var id: Int = 0
var check_status: Int = 0
var file_url:[YHPrincipleContentUrlModel] = []
required init() {
}
}
...@@ -79,6 +79,21 @@ class YHPrincipleContentUrlModel: SmartCodable { ...@@ -79,6 +79,21 @@ class YHPrincipleContentUrlModel: SmartCodable {
return "" return ""
} }
// 获取文件名(不包含后缀) eg:123.pdf -> 123
func getFileNameWithoutSuffix()->String {
if name.isEmpty {
return name
}
if !name.contains(".") {
return name
}
if !name.pathExtension.isEmpty {
let fileName = (name as NSString).deletingPathExtension
return fileName
}
return ""
}
required init() { required init() {
} }
......
//
// YHPrincipleFileRenameView.swift
// galaxy
//
// Created by edy on 2024/8/9.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import IQKeyboardManagerSwift
class YHPrincipleFileRenameView: UIView {
var confirmBlock: ((String) -> ())?
var name: String = "" {
didSet {
self.renameInputView.textField.text = name
}
}
static func renameView(name:String) -> YHPrincipleFileRenameView {
let view = YHPrincipleFileRenameView(frame: UIScreen.main.bounds)
view.name = name
return view
}
func show() {
addKeyBoardNotify()
UIApplication.shared.yhKeyWindow()?.addSubview(self)
renameInputView.textField.becomeFirstResponder()
}
func dismiss() {
removeNotify()
self.removeFromSuperview()
}
var renameInputView: YHFileRenameInputView = {
let view = YHFileRenameInputView.inputView(defalutText: "请输入名称")
return view
}()
// 底层蒙版
lazy var blackMaskView: UIView = {
let view = UIView()
view.backgroundColor = .alertMaskColor
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
deinit {
self.removeNotify()
}
func createUI() {
self.addSubview(blackMaskView)
self.addSubview(renameInputView)
renameInputView.editBlock = {
[weak self] text in
guard let self = self else { return }
if let text = text {
confirmBlock?(text)
}
self.dismiss()
}
renameInputView.dismissBlock = {
self.dismiss()
}
blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
renameInputView.snp.makeConstraints { make in
make.left.right.equalTo(self)
make.height.equalTo(YHFileRenameInputView.height)
make.bottom.equalToSuperview().offset(YHFileRenameInputView.height)
}
}
func addKeyBoardNotify() {
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
}
func removeNotify() {
NotificationCenter.default.removeObserver(self)
}
@objc func handleKeyboardNotification(_ notification: Notification) {
if notification.userInfo != nil {
guard let keyboardFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as AnyObject).cgRectValue else {return }
let isKeyboardShow = notification.name == UIResponder.keyboardWillShowNotification
let bottomMargin = (isKeyboardShow ? -keyboardFrame.height : YHFileRenameInputView.height)
if !isKeyboardShow {
IQKeyboardManager.shared.enable = true
}
self.renameInputView.snp.updateConstraints { make in
make.bottom.equalToSuperview().offset(bottomMargin)
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
}
...@@ -30,7 +30,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -30,7 +30,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
var itemModel:YHPrincipleAgreementModel? var itemModel:YHPrincipleAgreementModel?
var items: [YHPrincipleContentUrlModel] = [] var items: [YHPrincipleContentUrlModel] = []
var expandClick:((Bool)->())? var expandClick:((Bool)->())?
var fileEditBlock:((YHPrincipleContentUrlModel) -> ())? var fileEditBlock:((YHPrincipleContentUrlModel, Int) -> ())?
// var status: YHPrincipleUploadStatus = .preUpload // var status: YHPrincipleUploadStatus = .preUpload
let viewModel = YHPrincleViewModel() let viewModel = YHPrincleViewModel()
...@@ -173,7 +173,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -173,7 +173,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
itemModel = model itemModel = model
items.removeAll() items.removeAll()
items.append(contentsOf: model.content_url) items.append(contentsOf: model.content_url)
contentView.removeSubviews() contentView.removeSubviews()
self.dotLineLayer.removeFromSuperlayer() self.dotLineLayer.removeFromSuperlayer()
...@@ -186,6 +186,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -186,6 +186,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
whiteView.addSubview(tableView) whiteView.addSubview(tableView)
whiteView.addSubview(uploadBtn) whiteView.addSubview(uploadBtn)
whiteView.addSubview(redTipsLabel) whiteView.addSubview(redTipsLabel)
tableView.reloadData()
// 标题 // 标题
var titleStr: ASAttributedString = .init("\(self.getTitle(type: model.customType))", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor)) var titleStr: ASAttributedString = .init("\(self.getTitle(type: model.customType))", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
...@@ -281,7 +282,6 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -281,7 +282,6 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
} }
make.height.equalTo(listHeight) make.height.equalTo(listHeight)
} }
tableView.reloadData()
uploadBtn.snp.remakeConstraints { make in uploadBtn.snp.remakeConstraints { make in
make.left.equalTo(16) make.left.equalTo(16)
...@@ -430,8 +430,8 @@ extension YHPrincipleUploadStatusCell: UITableViewDataSource, UITableViewDelegat ...@@ -430,8 +430,8 @@ extension YHPrincipleUploadStatusCell: UITableViewDataSource, UITableViewDelegat
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadFileCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadFileCell let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadFileCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadFileCell
if 0 <= indexPath.row, indexPath.row < items.count { if 0 <= indexPath.section, indexPath.section < items.count {
let model: YHPrincipleContentUrlModel = items[indexPath.row] let model: YHPrincipleContentUrlModel = items[indexPath.section]
cell.updateModel(model) cell.updateModel(model)
if let itemModel = self.itemModel { if let itemModel = self.itemModel {
cell.isShowEditBtn = (itemModel.check_status == YHPrincipleUploadStatus.preUpload.rawValue || cell.isShowEditBtn = (itemModel.check_status == YHPrincipleUploadStatus.preUpload.rawValue ||
...@@ -442,7 +442,7 @@ extension YHPrincipleUploadStatusCell: UITableViewDataSource, UITableViewDelegat ...@@ -442,7 +442,7 @@ extension YHPrincipleUploadStatusCell: UITableViewDataSource, UITableViewDelegat
cell.editBlock = { cell.editBlock = {
[weak self] model in [weak self] model in
guard let self = self else { return } guard let self = self else { return }
self.fileEditBlock?(model) self.fileEditBlock?(model, indexPath.section)
} }
} }
return cell return cell
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
import UIKit import UIKit
import SmartCodable
class YHPrincleViewModel: YHBaseViewModel { class YHPrincleViewModel: YHBaseViewModel {
...@@ -132,6 +133,29 @@ class YHPrincleViewModel: YHBaseViewModel { ...@@ -132,6 +133,29 @@ class YHPrincleViewModel: YHBaseViewModel {
} }
} }
func uploadPrincipleFiles(_ files: [YHPrincipleRequestModel], callback:((_ success: Bool, _ error:YHErrorModel?)->())?) {
guard let arr = files.toArray() else { return }
let params: [String : Any] = ["file_list" : arr]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Principle.uploadFiles
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
printLog("model 是 ==> \(json)")
if json.code == 200 {
callback?(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback?(false, err)
}
} failBlock: { err in
callback?(false, err)
}
}
func getEnvelopModel() -> YHPrincipleEnvelopeModel { func getEnvelopModel() -> YHPrincipleEnvelopeModel {
let model = YHPrincipleEnvelopeModel() let model = YHPrincipleEnvelopeModel()
model.name = "黄金龙" model.name = "黄金龙"
......
...@@ -20,6 +20,8 @@ class YHFileRenameInputView: UIView { ...@@ -20,6 +20,8 @@ class YHFileRenameInputView: UIView {
static let height = 217.0 static let height = 217.0
var maxWordsCount = 30 var maxWordsCount = 30
var editBlock:((String?)->Void)? var editBlock:((String?)->Void)?
var dismissBlock:(()->())?
lazy var blackMaskView: UIView = { lazy var blackMaskView: UIView = {
let view = UIView(frame:UIScreen.main.bounds) let view = UIView(frame:UIScreen.main.bounds)
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5) view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
...@@ -189,6 +191,7 @@ extension YHFileRenameInputView { ...@@ -189,6 +191,7 @@ extension YHFileRenameInputView {
@objc func dismiss() { @objc func dismiss() {
self.textField.resignFirstResponder() self.textField.resignFirstResponder()
UIApplication.shared.yhKeyWindow()?.endEditing(true) UIApplication.shared.yhKeyWindow()?.endEditing(true)
self.dismissBlock?()
} }
@objc func didWhiteContentViewTap() { @objc func didWhiteContentViewTap() {
...@@ -208,7 +211,6 @@ extension YHFileRenameInputView { ...@@ -208,7 +211,6 @@ extension YHFileRenameInputView {
editBlock(textField.text) editBlock(textField.text)
} }
dismiss() dismiss()
} }
} }
......
...@@ -386,6 +386,8 @@ class YHAllApiName { ...@@ -386,6 +386,8 @@ class YHAllApiName {
static let getUploadDetail = "super-app/order/approval/uploadInfo" static let getUploadDetail = "super-app/order/approval/uploadInfo"
// 原则批已获批 是否发送邮件 // 原则批已获批 是否发送邮件
static let getIsSendMail = "super-app/order/customer/service/interview/is-send-email" static let getIsSendMail = "super-app/order/customer/service/interview/is-send-email"
// 原则批上传文件
static let uploadFiles = "super-app/order/approval/upload/save"
} }
} }
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