Commit 85123e4a authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  // 我的证件
  // 我的证书
  // 我的证书
parents 5e4476e0 d2a86234
......@@ -315,6 +315,7 @@ extension YHCertificateListVC {
func showUploadSheetView(_ supplementInfo: YHSupplementInfo) {
let sheetView = YHCertificateUploadSheetView.sheetView()
sheetView.maxSelectCount = 9
sheetView.templateInfo = supplementInfo.templateInfo
sheetView.clickTemplateBlock = {
[weak self] path in
......
......@@ -329,6 +329,7 @@ extension YHCertificateSearchViewController {
func showUploadSheetView(_ supplementInfo: YHSupplementInfo) {
let sheetView = YHCertificateUploadSheetView.sheetView()
sheetView.maxSelectCount = 9
sheetView.templateInfo = supplementInfo.templateInfo
sheetView.clickTemplateBlock = {
[weak self] path in
......
......@@ -138,6 +138,7 @@ class YHCertificateUploadContentListVC: YHBaseViewController {
}
let sheetView = YHCertificateUploadSheetView.sheetView()
sheetView.maxSelectCount = 99-items.count
sheetView.templateInfo = supplementInfo.templateInfo
sheetView.uploadFilesBlock = {
[weak self] fileUrl in
......@@ -145,7 +146,6 @@ class YHCertificateUploadContentListVC: YHBaseViewController {
print(fileUrl)
uploadFile(fileUrl)
}
sheetView.uploadImageBlock = {
[weak self] imgArr in
guard let self = self else { return }
......@@ -621,7 +621,10 @@ extension YHCertificateUploadContentListVC {
YHHUD.hide()
// 再调用业务接口
if let successUrl = successUrl, !successUrl.isEmpty {
let fileName = successUrl.lastPathComponent
var fileName = fileUrl.lastPathComponent
if fileName.isEmpty {
fileName = successUrl.lastPathComponent
}
let suffixName = successUrl.pathExtension.lowercased()
let model = YHContentUrl()
model.name = fileName
......
......@@ -14,7 +14,6 @@ class YHCertificateNameCell: UITableViewCell {
var editBlock:((YHContentUrl)->())?
var whiteView: UIView!
var iconImgV: UIImageView!
var nameLabel: UILabel!
var timeLabel: UILabel!
......@@ -74,49 +73,37 @@ class YHCertificateNameCell: UITableViewCell {
self.selectionStyle = .none
contentView.backgroundColor = .white
whiteView = UIView()
contentView.addSubview(whiteView)
iconImgV = UIImageView(image:UIImage(named:"my_cer_type_pdf"))
whiteView.addSubview(iconImgV)
iconImgV = UIImageView(image:UIImage(named:"my_cer_type_jpg"))
contentView.addSubview(iconImgV)
nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.numberOfLines = 0
nameLabel.font = UIFont.PFSC_M(ofSize:14)
nameLabel.text = "文档名称.doc"
whiteView.addSubview(nameLabel)
contentView.addSubview(nameLabel)
timeLabel = UILabel()
timeLabel.textColor = UIColor.labelTextColor2
timeLabel.textAlignment = .left
timeLabel.font = UIFont.PFSC_R(ofSize:11)
timeLabel.text = "上传于2024.01.01"
whiteView.addSubview(timeLabel)
contentView.addSubview(timeLabel)
editBtn = UIButton()
editBtn.setImage(UIImage(named:"my_cer_btn_edit"), for:.normal)
editBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 30, left: 30, bottom: 30, right: 30)
editBtn.addTarget(self, action: #selector(didEditBtnClicked), for: .touchUpInside)
whiteView.addSubview(editBtn)
whiteView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalToSuperview().offset(15)
make.bottom.equalToSuperview()
}
contentView.addSubview(editBtn)
iconImgV.snp.makeConstraints { make in
make.width.height.equalTo(31)
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(6)
make.left.equalToSuperview().offset(20+6)
}
nameLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgV.snp.right).offset(18)
make.top.equalToSuperview().offset(7)
make.top.equalToSuperview().offset(15+7)
make.right.equalTo(editBtn.snp.left)
}
......@@ -130,7 +117,7 @@ class YHCertificateNameCell: UITableViewCell {
editBtn.snp.makeConstraints { make in
make.width.height.equalTo(16)
make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-6)
make.right.equalToSuperview().offset(-20-6)
}
}
}
......@@ -42,34 +42,19 @@ enum YHCertificateUploadType: Int {
class YHCertificateUploadSheetView: UIView {
static func sheetView() -> YHCertificateUploadSheetView {
let view = YHCertificateUploadSheetView(frame:UIScreen.main.bounds)
return view
}
func calculateHeight() -> CGFloat {
guard let templateInfo = templateInfo else { return 0.0}
// 注意事项文字高度
var descHeight = templateInfo.description.boundingRect(with: CGSize(width:KScreenWidth-40.0 , height:.greatestFiniteMagnitude),
options: .usesLineFragmentOrigin,
attributes: [.font : UIFont.PFSC_R(ofSize:14)],
context: nil).size.height
descHeight = ceil(descHeight)+20
// 所有模版高度之和
let templatesHeight = 82.0 * Double(templateArr.count)
// 底部四个操作行高度之和
let actionsHeight = 52.0 * 4.0
let tableViewHeight = descHeight+templatesHeight+actionsHeight
// 白色View总高度
var totalHeight = 53.0+20.0+tableViewHeight+k_Height_safeAreaInsetsBottom()
if totalHeight > KScreenHeight {
totalHeight = 458
private var _maxSelectCount: Int = 9
var maxSelectCount = 9 {
didSet {
if maxSelectCount >= 9 {
_maxSelectCount = 9
} else if 0 < maxSelectCount && maxSelectCount < 9 {
_maxSelectCount = maxSelectCount
} else {
_maxSelectCount = 0
}
}
return totalHeight
}
var templateInfo: YHTemplateInfo? {
didSet {
templateArr.removeAll()
......@@ -222,6 +207,12 @@ class YHCertificateUploadSheetView: UIView {
createUI()
}
static func sheetView() -> YHCertificateUploadSheetView {
let view = YHCertificateUploadSheetView(frame:UIScreen.main.bounds)
return view
}
func createUI() {
self.addSubview(blackMaskView)
......@@ -254,6 +245,29 @@ class YHCertificateUploadSheetView: UIView {
}
}
func calculateHeight() -> CGFloat {
guard let templateInfo = templateInfo else { return 0.0}
// 注意事项文字高度
var descHeight = templateInfo.description.boundingRect(with: CGSize(width:KScreenWidth-40.0 , height:.greatestFiniteMagnitude),
options: .usesLineFragmentOrigin,
attributes: [.font : UIFont.PFSC_R(ofSize:14)],
context: nil).size.height
descHeight = ceil(descHeight)+20
// 所有模版高度之和
let templatesHeight = 82.0 * Double(templateArr.count)
// 底部四个操作行高度之和
let actionsHeight = 52.0 * 4.0
let tableViewHeight = descHeight+templatesHeight+actionsHeight
// 白色View总高度
var totalHeight = 53.0+20.0+tableViewHeight+k_Height_safeAreaInsetsBottom()
if totalHeight > KScreenHeight {
totalHeight = 458
}
return totalHeight
}
}
extension YHCertificateUploadSheetView {
......@@ -454,7 +468,7 @@ extension YHCertificateUploadSheetView: (UIImagePickerControllerDelegate & UINav
var configuration = PHPickerConfiguration()
// 设置最大选择数量
configuration.selectionLimit = 9
configuration.selectionLimit = _maxSelectCount
// 设置选择器的过滤条件 只显示图片
configuration.filter = .images
let picker = PHPickerViewController(configuration: configuration)
......@@ -520,6 +534,9 @@ extension YHCertificateUploadSheetView: PHPickerViewControllerDelegate {
picker.dismiss(animated: true, completion: nil)
self.dismiss()
if results.count <= 0 { // 取消的时候会调用到此处
return
}
let group = DispatchGroup()
let queue = DispatchQueue.global()
......
......@@ -74,6 +74,7 @@ class YHFileRenameInputView: UIView {
textField.tintColor = UIColor.brandMainColor
textField.textColor = UIColor.mainTextColor
textField.delegate = self
textField.clearButtonMode = .whileEditing
return textField
}()
......
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