Commit 3bf96ded authored by Steven杜宇's avatar Steven杜宇

// 原则批

parent 2aa0baaa
...@@ -387,6 +387,17 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -387,6 +387,17 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
guard let self = self else { return } guard let self = self else { return }
self.showFileOperationAlertView(index, itemModel: model) self.showFileOperationAlertView(index, itemModel: model)
} }
cell.fileClickBlock = {
[weak self] fileModel, index in
guard let self = self else { return }
// 直接点击文件所在行进行预览
let fileUrl = !fileModel.url.isEmpty ? fileModel.url : fileModel.fileUrl
self.viewModel.getPublicImageUrl(fileUrl) { success, error in
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:model.name)
}
}
}
// 上传文件点击 // 上传文件点击
cell.uploadBtnClick = { cell.uploadBtnClick = {
[weak self] selectModel in [weak self] selectModel in
...@@ -456,7 +467,7 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -456,7 +467,7 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
let str1: ASAttributedString = .init("您【与家人】申请的【优秀人才入境计划】,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7))) let str1: ASAttributedString = .init("您【与家人】申请的【优秀人才入境计划】,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
let str2: ASAttributedString = .init("已获得港府的甄选名额", .font(UIFont.PFSC_B(ofSize: 14)),.foreground(UIColor.brandMainColor)) let str2: ASAttributedString = .init("已获得港府的甄选名额", .font(UIFont.PFSC_B(ofSize: 14)),.foreground(UIColor.brandMainColor))
let str3: ASAttributedString = .init(",请您于", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7))) let str3: ASAttributedString = .init(",请您于", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
let time: ASAttributedString = .init("\(self.viewModel.envelopModel.date)", .font(UIFont.PFSC_B(ofSize: 14)),.foreground(UIColor.brandMainColor)) let time: ASAttributedString = .init("\(self.viewModel.uploadDetailModel.date)", .font(UIFont.PFSC_B(ofSize: 14)),.foreground(UIColor.brandMainColor))
let str4: ASAttributedString = .init("前补充更多文件,即可等待获得港府的正式批准!", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7))) let str4: ASAttributedString = .init("前补充更多文件,即可等待获得港府的正式批准!", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
detailLabel.attributed.text = str1 + str2 + str3 + time + str4 detailLabel.attributed.text = str1 + str2 + str3 + time + str4
view.addSubview(detailLabel) view.addSubview(detailLabel)
......
...@@ -65,7 +65,6 @@ class YHPrinciplePhotoListCell: UITableViewCell { ...@@ -65,7 +65,6 @@ class YHPrinciplePhotoListCell: UITableViewCell {
label.font = UIFont.PFSC_M(ofSize: 13) label.font = UIFont.PFSC_M(ofSize: 13)
label.textColor = UIColor(hex: 0x121A26, alpha: 0.3) label.textColor = UIColor(hex: 0x121A26, alpha: 0.3)
label.numberOfLines = 0 label.numberOfLines = 0
label.text = "最新更新时间:2024-04-19 19:50:12\n已累计为您查询 4 次"
return label return label
}() }()
......
...@@ -20,7 +20,8 @@ class YHPrincipleUploadFileCell: UITableViewCell { ...@@ -20,7 +20,8 @@ class YHPrincipleUploadFileCell: UITableViewCell {
var timeLabel: UILabel! var timeLabel: UILabel!
var editBtn: UIButton! var editBtn: UIButton!
var editBlock: ((YHPrincipleContentUrlModel)->())? var editBlock: ((YHPrincipleContentUrlModel)->())?
var clickBlock:((YHPrincipleContentUrlModel) -> ())?
var isShowEditBtn: Bool = false { var isShowEditBtn: Bool = false {
didSet { didSet {
editBtn.isHidden = !isShowEditBtn editBtn.isHidden = !isShowEditBtn
...@@ -40,6 +41,10 @@ class YHPrincipleUploadFileCell: UITableViewCell { ...@@ -40,6 +41,10 @@ class YHPrincipleUploadFileCell: UITableViewCell {
editBlock?(fileModel) editBlock?(fileModel)
} }
@objc func didFileClicked() {
self.clickBlock?(fileModel)
}
func updateModel(_ model: YHPrincipleContentUrlModel) { func updateModel(_ model: YHPrincipleContentUrlModel) {
fileModel = model fileModel = model
...@@ -79,6 +84,9 @@ class YHPrincipleUploadFileCell: UITableViewCell { ...@@ -79,6 +84,9 @@ class YHPrincipleUploadFileCell: UITableViewCell {
func setupUI() { func setupUI() {
let tap = UITapGestureRecognizer(target: self, action: #selector(didFileClicked))
self.contentView.addGestureRecognizer(tap)
self.selectionStyle = .none self.selectionStyle = .none
iconImgV = UIImageView(image: UIImage(named: "my_cer_type_pdf")) iconImgV = UIImageView(image: UIImage(named: "my_cer_type_pdf"))
contentView.addSubview(iconImgV) contentView.addSubview(iconImgV)
......
...@@ -31,6 +31,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -31,6 +31,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
var items: [YHPrincipleContentUrlModel] = [] var items: [YHPrincipleContentUrlModel] = []
var expandClick:((Bool)->())? var expandClick:((Bool)->())?
var fileEditBlock:((YHPrincipleContentUrlModel, Int) -> ())? var fileEditBlock:((YHPrincipleContentUrlModel, Int) -> ())?
var fileClickBlock:((YHPrincipleContentUrlModel, Int) -> ())?
var uploadBtnClick:((YHPrincipleAgreementModel?)->())? var uploadBtnClick:((YHPrincipleAgreementModel?)->())?
var templateBtnClick:((YHPrincipleAgreementModel?)->())? var templateBtnClick:((YHPrincipleAgreementModel?)->())?
...@@ -469,6 +470,11 @@ extension YHPrincipleUploadStatusCell: UITableViewDataSource, UITableViewDelegat ...@@ -469,6 +470,11 @@ extension YHPrincipleUploadStatusCell: UITableViewDataSource, UITableViewDelegat
guard let self = self else { return } guard let self = self else { return }
self.fileEditBlock?(selectModel, indexPath.section) self.fileEditBlock?(selectModel, indexPath.section)
} }
cell.clickBlock = {
[weak self] selectModel in
guard let self = self else { return }
self.fileClickBlock?(selectModel, indexPath.section)
}
} }
return cell return cell
} }
......
...@@ -221,17 +221,14 @@ extension YHPrincleViewModel { ...@@ -221,17 +221,14 @@ extension YHPrincleViewModel {
return return
} }
self.envelopModel = resultModel self.envelopModel = resultModel
// self.envelopModel = self.getEnvelopModel()
callback?(true, nil) callback?(true, nil)
} else { } else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg) let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
// self.envelopModel = self.getEnvelopModel()
callback?(false, err) callback?(false, err)
} }
} failBlock: { err in } failBlock: { err in
// self.envelopModel = self.getEnvelopModel()
callback?(false, err) callback?(false, err)
} }
} }
......
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