Commit 84d18294 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 d6bd96d3 995cbd52
......@@ -12,6 +12,7 @@
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; };
044867B42BA1953B00DFAD4A /* YHCertificateFilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B32BA1953B00DFAD4A /* YHCertificateFilterView.swift */; };
044867B62BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */; };
044867B82BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B72BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift */; };
045EEE792B9F171A0022A143 /* YHPreviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */; };
045EEE7A2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */; };
045EEE7B2B9F171A0022A143 /* YHPersonInfoCellModel2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */; };
......@@ -354,6 +355,7 @@
0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileMethodTableViewCell.swift; sourceTree = "<group>"; };
044867B32BA1953B00DFAD4A /* YHCertificateFilterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateFilterView.swift; sourceTree = "<group>"; };
044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateFilterItemCell.swift; sourceTree = "<group>"; };
044867B72BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadFailTipsView.swift; sourceTree = "<group>"; };
045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewViewModel.swift; sourceTree = "<group>"; };
045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewForOtherInfoModel.swift; sourceTree = "<group>"; };
045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPersonInfoCellModel2.swift; sourceTree = "<group>"; };
......@@ -1339,6 +1341,7 @@
04A671612BA058DE00C1FB91 /* YHCertificateEditSheetView.swift */,
048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */,
044867B32BA1953B00DFAD4A /* YHCertificateFilterView.swift */,
044867B72BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift */,
04A6715F2BA0280800C1FB91 /* YHFileRenameInputView.swift */,
04A6715D2B9FFCA700C1FB91 /* YHCertificateNameCell.swift */,
0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */,
......@@ -1991,6 +1994,7 @@
045EEEF02B9F171A0022A143 /* YHChildPrimaryInfoVC.swift in Sources */,
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */,
045EEEF62B9F171A0022A143 /* YHSpousePrimaryInfoVC.swift in Sources */,
044867B82BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift in Sources */,
045EEF002B9F171A0022A143 /* YHFormItemEnterDetailCell.swift in Sources */,
A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */,
045EEEEF2B9F171A0022A143 /* YHCertificateInfoController.swift in Sources */,
......
......@@ -11,15 +11,34 @@ import UIKit
class YHCertificateFilterItemCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHCertificateFilterItemCell"
private let titleSelectColor = UIColor.brandMainColor
private let titleDefaultColor = UIColor.mainTextColor
private let btnSelectFont = UIFont.PFSC_M(ofSize: 13)
private let btnDefaultFont = UIFont.PFSC_R(ofSize: 13)
var title: String? {
didSet {
contentBtn.setTitle(title, for: .normal)
}
}
var isSelect: Bool = false {
didSet {
contentBtn.layer.borderColor = (isSelect ? titleSelectColor : .clear).cgColor
contentBtn.setTitleColor((isSelect ? titleSelectColor : titleDefaultColor), for: .normal)
contentBtn.titleLabel?.font = (isSelect ? btnSelectFont : btnDefaultFont)
}
}
lazy var contentBtn:UIButton = {
let btn = UIButton()
btn.setTitle("证件", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor.mainTextColor, for: .normal)
btn.setTitle("", for: .normal)
btn.titleLabel?.font = btnDefaultFont
btn.setTitleColor(titleDefaultColor, for: .normal)
btn.backgroundColor = UIColor(hexString:"#F8F9FB")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickBtn), for: .touchUpInside)
btn.layer.cornerRadius = YHCertificateFilterView.itemHeight/2.0
btn.layer.borderWidth = 1.0
btn.isEnabled = false
return btn
}()
......@@ -38,9 +57,4 @@ class YHCertificateFilterItemCell: UICollectionViewCell {
make.edges.equalToSuperview()
}
}
@objc func didClickBtn() {
}
}
......@@ -33,6 +33,7 @@ class YHCertificateFilterSectionInfo {
class YHCertificateFilterItem {
var type: YHCertificateFilterType
var title: String
var isSelected: Bool = false
init(type: YHCertificateFilterType, title: String) {
self.type = type
......@@ -43,22 +44,33 @@ class YHCertificateFilterItem {
class YHCertificateFilterView: UIView {
static let margin = 21.0
static let gap = 12.0
static let itemHeight = 36.0
static let sheetView = YHCertificateFilterView(frame:UIScreen.main.bounds)
var items:[YHCertificateFilterSectionInfo] = [
YHCertificateFilterSectionInfo(title: "类型".local, items: [YHCertificateFilterItem(type: .certificate, title: "证件")])
]
YHCertificateFilterSectionInfo(title: "类型".local, items: [YHCertificateFilterItem(type: .certificate, title: "证件"),
YHCertificateFilterItem(type: .degree, title: "学历"),
YHCertificateFilterItem(type: .employmentProof, title: "工作证明"),
YHCertificateFilterItem(type: .other, title: "其他"),
]),
YHCertificateFilterSectionInfo(title: "状态".local, items: [YHCertificateFilterItem(type: .preUpload, title: "待上传"),
YHCertificateFilterItem(type: .rejected, title: "已驳回"),
YHCertificateFilterItem(type: .review, title: "审核中"),
YHCertificateFilterItem(type: .pass, title: "已通过"),
])]
lazy var collectionView: UICollectionView = {
// 设置布局方向
let flowLayout = UICollectionViewFlowLayout()
let margin = 21.0
let gap = 12.0
flowLayout.minimumInteritemSpacing = 12.0
flowLayout.minimumLineSpacing = 12.0
flowLayout.minimumInteritemSpacing = Self.gap
flowLayout.minimumLineSpacing = Self.gap
flowLayout.scrollDirection = .vertical
collectionView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectionView.contentInset = UIEdgeInsets(top: 0, left: margin, bottom: 0, right: margin)
collectionView.contentInset = UIEdgeInsets(top: 0, left: Self.margin, bottom: 0, right: Self.margin)
collectionView.backgroundColor = UIColor.white
collectionView.register(YHCertificateFilterItemCell.self, forCellWithReuseIdentifier:YHCertificateFilterItemCell.cellReuseIdentifier)
collectionView.register(YHCertificateFilterTypeView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: YHCertificateFilterTypeView.reuseIdentifier)
......@@ -244,18 +256,32 @@ extension YHCertificateFilterView {
}
@objc func didClickResetBtn() {
for sectionInfo in items {
for item in sectionInfo.items {
item.isSelected = false
}
}
collectionView.reloadData()
}
}
extension YHCertificateFilterView:UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
func numberOfSections(in collectionView: UICollectionView) -> Int {
return items.count
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
if 0 <= section && section < items.count {
let sectionInfo = items[section]
return sectionInfo.items.count
}
return 0
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: 74, height: 36)
return CGSize(width:floorl((KScreenWidth-Self.margin*2-Self.gap*3)/4.0), height: Self.itemHeight)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection:Int) -> CGSize {
......@@ -267,22 +293,52 @@ extension YHCertificateFilterView:UICollectionViewDataSource, UICollectionViewDe
if kind == UICollectionView.elementKindSectionHeader {
let headerView: YHCertificateFilterTypeView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: YHCertificateFilterTypeView.reuseIdentifier, for: indexPath) as! YHCertificateFilterTypeView
return headerView
if 0 <= indexPath.section && indexPath.section < items.count {
let sectionInfo = items[indexPath.section]
headerView.title = sectionInfo.title
}
return headerView
}
return UICollectionReusableView()
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHCertificateFilterItemCell.cellReuseIdentifier, for: indexPath) as! YHCertificateFilterItemCell
if 0 <= indexPath.section && indexPath.section < items.count {
let sectionInfo = items[indexPath.section]
if 0 <= indexPath.row && indexPath.row < sectionInfo.items.count {
let item = sectionInfo.items[indexPath.row]
cell.title = item.title
cell.isSelect = item.isSelected
}
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
let sectionInfo = items[indexPath.section]
if 0 <= indexPath.row && indexPath.row < sectionInfo.items.count {
let item = sectionInfo.items[indexPath.row]
item.isSelected = !item.isSelected
}
collectionView.reloadData()
}
}
}
class YHCertificateFilterTypeView: UICollectionReusableView {
static let reuseIdentifier = "YHCertificateFilterTypeView"
var title: String? {
didSet {
titleLabel.text = title
}
}
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor
......
//
// YHCertificateUploadFailTipsView.swift
// galaxy
//
// Created by edy on 2024/3/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
/*
【Usage】
YHCertificateUploadFailTipsView.tipsView().show()
*/
import UIKit
class YHCertificateUploadFailTipsView: UIView {
lazy var blackMaskView: UIView = {
let view = UIView(frame:UIScreen.main.bounds)
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismiss))
view.addGestureRecognizer(tap)
return view
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 6.0
return view
}()
lazy var failIconImgView: UIImageView = {
let imgV = UIImageView(image: UIImage(named: "my_cer_upload_fail"))
return imgV
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor
label.textAlignment = .center
label.font = UIFont.PFSC_M(ofSize:17)
label.text = "上传失败"
return label
}()
lazy var tipsLabel: UILabel = {
let label = UILabel()
label.textColor = .labelTextColor2
label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize:14)
label.numberOfLines = 0
label.text = "请检查文件格式是否为docx、jpg、doc、png、pptx、pdf".local
return label
}()
lazy var knowBtn:UIButton = {
let btn = UIButton()
btn.setTitle("我知道了".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 6.0
btn.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return btn
}()
static func tipsView() -> YHCertificateUploadFailTipsView {
let view = YHCertificateUploadFailTipsView(frame:UIScreen.main.bounds)
return view
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
func createUI() {
self.addSubview(blackMaskView)
self.addSubview(whiteContentView)
whiteContentView.addSubview(failIconImgView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(tipsLabel)
whiteContentView.addSubview(knowBtn)
blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
whiteContentView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(38)
make.right.equalToSuperview().offset(-38)
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
}
failIconImgView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(30)
make.centerX.equalToSuperview()
make.width.height.equalTo(53)
}
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(24)
make.top.equalTo(failIconImgView.snp.bottom).offset(16)
}
tipsLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.top.equalTo(titleLabel.snp.bottom).offset(8)
}
knowBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(21)
make.right.equalToSuperview().offset(-21)
make.height.equalTo(45)
make.top.equalTo(tipsLabel.snp.bottom).offset(31)
make.bottom.equalToSuperview().offset(-21)
}
}
}
extension YHCertificateUploadFailTipsView {
func show() {
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
@objc func dismiss() {
self.removeFromSuperview()
}
}
......@@ -118,15 +118,15 @@ class YHFamilyMemberInfoListVC: YHBaseViewController {
}
@objc func didClickSubmitBtn() {
// let isChecked = checkIntegrity()
// isNeedShowError = !isChecked
//
// self.tableView .reloadData()
//
// if !isChecked {
// YHHUD.flash(message: "资料还未填完")
// return
// }
let isChecked = checkIntegrity()
isNeedShowError = !isChecked
self.tableView .reloadData()
if !isChecked {
YHHUD.flash(message: "资料还未填完")
return
}
submit()
}
......
......@@ -169,6 +169,21 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
if (indexPath.row >= items.count) { return }
// if true {
// YHCertificateUploadFailTipsView.tipsView().show()
// let vc = YHUploadContentVC()
// self.navigationController?.pushViewController(vc)
// let vc = YHCertificateResourceUploadVC()
// self.navigationController?.pushViewController(vc)
// return
// }
if !checkLogin() {
let vc = UINavigationController(rootVC: YHPhoneLoginViewController())
vc.modalPresentationStyle = .custom
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 3034@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3034@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