Commit 12200d02 authored by David黄金龙's avatar David黄金龙
parents 2e03cb37 e6a92b14
......@@ -156,6 +156,8 @@
044867B62BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */; };
044867B82BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044867B72BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift */; };
0449EEE92C8EEB1E00A397FD /* YHResinMaterialManageListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0449EEE82C8EEB1E00A397FD /* YHResinMaterialManageListVC.swift */; };
0449EEEB2C8EF2B700A397FD /* YHResignMaterialUploadVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0449EEEA2C8EF2B700A397FD /* YHResignMaterialUploadVC.swift */; };
0449EEEE2C8EF8CB00A397FD /* YHResignMaterialCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0449EEED2C8EF8CB00A397FD /* YHResignMaterialCell.swift */; };
044BACC72BCFA58E00184C64 /* YHNoDataTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044BACC62BCFA58E00184C64 /* YHNoDataTipsView.swift */; };
044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CF8D32BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift */; };
044CF8D62BBA57DC00008CE8 /* YHFailPromptView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CF8D52BBA57DC00008CE8 /* YHFailPromptView.swift */; };
......@@ -931,6 +933,8 @@
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>"; };
0449EEE82C8EEB1E00A397FD /* YHResinMaterialManageListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResinMaterialManageListVC.swift; sourceTree = "<group>"; };
0449EEEA2C8EF2B700A397FD /* YHResignMaterialUploadVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignMaterialUploadVC.swift; sourceTree = "<group>"; };
0449EEED2C8EF8CB00A397FD /* YHResignMaterialCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignMaterialCell.swift; sourceTree = "<group>"; };
044BACC62BCFA58E00184C64 /* YHNoDataTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNoDataTipsView.swift; sourceTree = "<group>"; };
044CF8D32BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSignatureUploadTableViewCell.swift; sourceTree = "<group>"; };
044CF8D52BBA57DC00008CE8 /* YHFailPromptView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFailPromptView.swift; sourceTree = "<group>"; };
......@@ -1955,6 +1959,7 @@
0449EEE62C8EEA2B00A397FD /* ResignMaterialManage(续期资料管理) */ = {
isa = PBXGroup;
children = (
0449EEEC2C8EF7BA00A397FD /* V */,
0449EEE72C8EEA8A00A397FD /* C */,
);
path = "ResignMaterialManage(续期资料管理)";
......@@ -1964,10 +1969,19 @@
isa = PBXGroup;
children = (
0449EEE82C8EEB1E00A397FD /* YHResinMaterialManageListVC.swift */,
0449EEEA2C8EF2B700A397FD /* YHResignMaterialUploadVC.swift */,
);
path = C;
sourceTree = "<group>";
};
0449EEEC2C8EF7BA00A397FD /* V */ = {
isa = PBXGroup;
children = (
0449EEED2C8EF8CB00A397FD /* YHResignMaterialCell.swift */,
);
path = V;
sourceTree = "<group>";
};
044D0BE82C2019AC00C5CF5E /* Community(社区) */ = {
isa = PBXGroup;
children = (
......@@ -4648,6 +4662,7 @@
A5ACE9312B4564F7002C94D2 /* YHPersonalCenterCell.swift in Sources */,
0430E6562C7342AB000511E2 /* YHAdopterIncomeFileCountTableViewCell.swift in Sources */,
045EEE9A2B9F171A0022A143 /* YHWorkIntroductionViewModel.swift in Sources */,
0449EEEB2C8EF2B700A397FD /* YHResignMaterialUploadVC.swift in Sources */,
044D0C1C2C22C30B00C5CF5E /* YHEditSchoolViewController.swift in Sources */,
A5CA3F562C74850200EB22F5 /* YHUploadCertificateDetailVC.swift in Sources */,
A5ACE9532B4564F7002C94D2 /* YHBaseViewController.swift in Sources */,
......@@ -4740,6 +4755,7 @@
A58AC0A12BAC0B2900A30FA9 /* YHFileListItemView.swift in Sources */,
04213B2D2C48FEB000797900 /* YHHomeInfoSectionHeadView.swift in Sources */,
045EEED12B9F171A0022A143 /* YHScorePersonInfoCell.swift in Sources */,
0449EEEE2C8EF8CB00A397FD /* YHResignMaterialCell.swift in Sources */,
044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */,
A567E5B02BD7643D00D5D5A0 /* YHHomeWebBottomView.swift in Sources */,
045EEF0D2B9F171A0022A143 /* YHBasicInfoFillCell.swift in Sources */,
......
//
// YHResignMaterialUploadVC.swift
// galaxy
//
// Created by edy on 2024/9/9.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
class YHResignMaterialUploadVC: YHBaseViewController {
var items:[[YHSupplementInfo]] = []
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 14.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = UIColor(hexString:"#F8F8F8")
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateInfoCell.self, forCellReuseIdentifier: YHCertificateInfoCell.cellReuseIdentifier)
tableView.backgroundView = emptyDataTipsView
return tableView
}()
lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("没有找到相关资料哦~", kEmptyCommonBgName)
view.topMargin = 130
view.isHidden = false
return view
}()
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: self)
return tool
}()
override func viewDidLoad() {
super.viewDidLoad()
}
}
extension YHResignMaterialUploadVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if 0 <= section && section < items.count {
let arr = items[section]
return arr.count
}
return 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignMaterialCell.cellReuseIdentifier, for: indexPath) as! YHResignMaterialCell
if 0 <= indexPath.section && indexPath.section < items.count {
let arr = items[indexPath.section]
if 0 <= indexPath.row, indexPath.row < arr.count {
let item = arr[indexPath.row]
cell.updateModel(item)
cell.templateBlock = {
[weak self] in
guard let self = self else { return }
let view = YHCertificateTemplateSheetView.templateView(item.templateInfo)
view.scanTemplateBlock = {
[weak self] path in
guard let self = self else { return }
if let url = path?.url, !url.isEmpty {
print(url)
self.previewFileTool.openXLSXRemoteFile(urlString:url, fileName:"预览")
}
}
view.show()
}
}
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
// let item = items[indexPath.section]
//
// if item.checkStatus == YHCertificateUploadStatus.preUpload.rawValue { // 待上传
// showUploadSheetView(supplementId:item.id)
// return
// }
// // 非待上传的进入详情
// let vc = YHCertificateUploadContentListVC()
// vc.orderId = orderId ?? 0
// vc.categoryId = categoryInfo.categoryId
// vc.supplementId = item.id
// self.navigationController?.pushViewController(vc)
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 0.01
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
}
// MARK: - JXSegmentedListContainerViewListDelegate
extension YHResignMaterialUploadVC: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
}
......@@ -7,24 +7,89 @@
//
import UIKit
import JXSegmentedView
class YHResinMaterialManageListVC: YHBaseViewController {
static let segmentHeight = 49.0
var titles = ["全部", "待上传(0)", "已驳回(0)", "审核中(0)", "已完成(0)"]
var itemVCs:[YHResignMaterialUploadVC] = []
//分类title 所对应的VC
lazy var listContainerView: JXSegmentedListContainerView! = {
return JXSegmentedListContainerView(dataSource: self, type: .collectionView)
}()
lazy var segmentedView : JXSegmentedView = {
let segview = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: KScreenWidth, height: Self.segmentHeight))
segview.dataSource = segmentedDataSource
segview.delegate = self
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorHeight = 4.0
indicator.indicatorColor = .brandMainColor
segview.indicators = [indicator]
segview.backgroundColor = .clear
segview.listContainer = listContainerView
segview.backgroundColor = .white
return segview
}()
lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = titles
dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 14)
dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleSelectedColor = UIColor(hexString: "#000000")!
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
dataSource.itemSpacing = 24
return dataSource
}()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}
/*
// MARK: - Navigation
extension YHResinMaterialManageListVC: JXSegmentedListContainerViewDataSource {
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
return titleDataSource.dataSource.count
}
return 0
}
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
return itemVCs[index]
}
*/
}
extension YHResinMaterialManageListVC: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
if 0 <= index && index < itemVCs.count {
let vc = itemVCs[index]
// if index == 0 {
// vc.requestList(status: vc.status, extra: self.filterDict)
// } else {
// vc.requestList(status: vc.status)
// }
}
}
/// 正在滚动中的回调
///
/// - Parameters:
/// - segmentedView: JXSegmentedView
/// - leftIndex: 正在滚动中,相对位置处于左边的index
/// - rightIndex: 正在滚动中,相对位置处于右边的index
/// - percent: 从左往右计算的百分比
func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
}
}
//
// YHResignMaterialCell.swift
// galaxy
//
// Created by edy on 2024/9/9.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
enum YHMaterialUploadStatus : Int {
// 全部
case all = -1
// 审核中
case review = 0
// 已完成
case finish = 1
// 已驳回
case rejected = 2
// 待上传
case preUpload = 3
}
class YHResignMaterialCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignMaterialCell"
var model: YHSupplementInfo = YHSupplementInfo()
var status : YHCertificateUploadStatus = .preUpload
var templateBlock:(()->())?
var whiteView: UIView!
var nameTextView: UITextView!
var infoLabel: UILabel!
var statusLabel: UILabel!
var rightArrowImgV: UIImageView!
lazy var templateButton: UIButton = {
let btn = UIButton()
btn.frame = CGRect(x: 0, y: 0, width: 48, height: 16)
btn.setTitle("资料模版", for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 10)
btn.setTitleColor(.brandMainColor, for: .normal)
btn.layer.cornerRadius = kCornerRadius3
btn.clipsToBounds = true
btn.backgroundColor = .brandMainColor8
btn.addTarget(self, action: #selector(didTemplateBtnClicked), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
@objc func didTemplateBtnClicked() {
if self.model.isNeedDealt { // 银河代办
return
}
if let templateBlock = templateBlock {
templateBlock()
}
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func updateModel(_ model: YHSupplementInfo) {
self.model = model
if let status = YHCertificateUploadStatus(rawValue: model.checkStatus) {
var titleColor: UIColor = .labelTextColor2
var title = ""
switch status {
case .preUpload:
titleColor = .brandMainColor
title = "待上传".local
case .rejected:
titleColor = .failColor
title = "已驳回".local
case .review:
titleColor = .warnColor
title = "审核中".local
case .finish:
titleColor = .labelTextColor2
title = "已完成".local
case .all:
titleColor = .labelTextColor2
}
statusLabel.text = title
statusLabel.textColor = titleColor
}
var infoStr = ""
var typeStr = "无"
var ownerStr = "无"
if !model.typeName.isEmpty {
typeStr = model.typeName
}
if !model.nameExtra.applicant.isEmpty {
ownerStr = model.nameExtra.applicant
}
infoStr = "类型: \(typeStr)\n所属人: \(ownerStr)"
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize:12),
.foregroundColor: UIColor.labelTextColor2
]
let attrString = NSMutableAttributedString(string: infoStr, attributes: attributes)
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = 4.0 // 设置行间距为 8 点
attrString.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: infoStr.count))
infoLabel.attributedText = attrString
var result:ASAttributedString = .init(string:"", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.failColor))
var name = model.name
if !model.nameExtra.organization.isEmpty {
name += "(\(model.nameExtra.organization))"
}
let cerName: ASAttributedString = .init(string:name , .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
var template: ASAttributedString = " \(.view(templateButton, .original(.center)))"
// 是否展示右边的模版按钮
var showTemplateBtn = true
if model.isNeedDealt {
templateButton.setTitle("银河代办", for: .normal)
template = " \(.view(templateButton, .original(.center)))"
} else {
templateButton.setTitle("资料模版", for: .normal)
template = " \(.view(templateButton, .original(.center)))"
if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty {
showTemplateBtn = false
}
}
if model.isNeedSupplemnt() {
result += mustTag
}
result += cerName
if showTemplateBtn {
result += template
}
nameTextView.attributed.text = result
}
func setupUI() {
self.selectionStyle = .none
contentView.backgroundColor = UIColor(hexString:"#F8F8F8")
whiteView = UIView()
whiteView.layer.cornerRadius = kCornerRadius6
whiteView.clipsToBounds = true
whiteView.backgroundColor = .white
contentView.addSubview(whiteView)
nameTextView = UITextView()
nameTextView.textColor = UIColor.mainTextColor
nameTextView.font = UIFont.PFSC_M(ofSize: 16)
nameTextView.isScrollEnabled = false
nameTextView.isEditable = false
nameTextView.isSelectable = false
whiteView.addSubview(nameTextView)
nameTextView.attributed.text = """
\("资料名称", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateButton, .original(.center))))
"""
statusLabel = UILabel()
statusLabel.textColor = UIColor.labelTextColor2
statusLabel.textAlignment = .left
statusLabel.font = UIFont.PFSC_R(ofSize:14)
whiteView.addSubview(statusLabel)
rightArrowImgV = UIImageView(image: UIImage(named: "service_center_right_next_icon"))
whiteView.addSubview(rightArrowImgV)
whiteView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.bottom.equalToSuperview()
}
nameTextView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(10)
make.top.equalToSuperview().offset(4)
make.right.equalTo(statusLabel.snp.left).offset(-26)
}
statusLabel.snp.makeConstraints { make in
make.right.equalTo(rightArrowImgV.snp.left).offset(-6)
make.size.equalTo(CGSize(width: 42, height: 20))
make.centerY.equalToSuperview()
}
rightArrowImgV.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.size.equalTo(CGSize(width: 16, height: 16))
make.centerY.equalToSuperview()
}
}
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let hitView = super.hitTest(point, with: event)
if hitView == nameTextView {
return self
}
return hitView
}
}
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