Commit 8a66593d authored by Steven杜宇's avatar Steven杜宇

// 空视图

parent 3ca433ea
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
044D0C1E2C22CFBF00C5CF5E /* YHEditWorkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1D2C22CFBF00C5CF5E /* YHEditWorkViewController.swift */; }; 044D0C1E2C22CFBF00C5CF5E /* YHEditWorkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1D2C22CFBF00C5CF5E /* YHEditWorkViewController.swift */; };
044D0C202C22D37500C5CF5E /* YHEditHonorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1F2C22D37500C5CF5E /* YHEditHonorViewController.swift */; }; 044D0C202C22D37500C5CF5E /* YHEditHonorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1F2C22D37500C5CF5E /* YHEditHonorViewController.swift */; };
045A08C02C37ABF500BCBABA /* YHSegmentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */; }; 045A08C02C37ABF500BCBABA /* YHSegmentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */; };
045A08C22C37EB8B00BCBABA /* YHMyFileListNoneCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08C12C37EB8B00BCBABA /* YHMyFileListNoneCell.swift */; };
045A7E672C2ACB1A008F995B /* YHLoginOneLeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */; }; 045A7E672C2ACB1A008F995B /* YHLoginOneLeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */; };
045EEE792B9F171A0022A143 /* YHPreviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */; }; 045EEE792B9F171A0022A143 /* YHPreviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */; };
045EEE7A2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */; }; 045EEE7A2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */; };
...@@ -651,6 +652,7 @@ ...@@ -651,6 +652,7 @@
044D0C1D2C22CFBF00C5CF5E /* YHEditWorkViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditWorkViewController.swift; sourceTree = "<group>"; }; 044D0C1D2C22CFBF00C5CF5E /* YHEditWorkViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditWorkViewController.swift; sourceTree = "<group>"; };
044D0C1F2C22D37500C5CF5E /* YHEditHonorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditHonorViewController.swift; sourceTree = "<group>"; }; 044D0C1F2C22D37500C5CF5E /* YHEditHonorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditHonorViewController.swift; sourceTree = "<group>"; };
045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSegmentView.swift; sourceTree = "<group>"; }; 045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSegmentView.swift; sourceTree = "<group>"; };
045A08C12C37EB8B00BCBABA /* YHMyFileListNoneCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileListNoneCell.swift; sourceTree = "<group>"; };
045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginOneLeadView.swift; sourceTree = "<group>"; }; 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginOneLeadView.swift; sourceTree = "<group>"; };
045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewViewModel.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>"; }; 045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewForOtherInfoModel.swift; sourceTree = "<group>"; };
...@@ -2924,6 +2926,7 @@ ...@@ -2924,6 +2926,7 @@
A53B61112BB128AF0010B573 /* YHFileListItemsView2.swift */, A53B61112BB128AF0010B573 /* YHFileListItemsView2.swift */,
041390682C1081FA0098CB8A /* YHFileListEmptyView.swift */, 041390682C1081FA0098CB8A /* YHFileListEmptyView.swift */,
04C85DE42C369AB5008B20D6 /* YHMyFileListCell.swift */, 04C85DE42C369AB5008B20D6 /* YHMyFileListCell.swift */,
045A08C12C37EB8B00BCBABA /* YHMyFileListNoneCell.swift */,
04C85DE62C36ADAE008B20D6 /* YHMyFileListHeaderView.swift */, 04C85DE62C36ADAE008B20D6 /* YHMyFileListHeaderView.swift */,
04C85DE82C36BF49008B20D6 /* YHMyFileListFooterView.swift */, 04C85DE82C36BF49008B20D6 /* YHMyFileListFooterView.swift */,
045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */, 045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */,
...@@ -3551,6 +3554,7 @@ ...@@ -3551,6 +3554,7 @@
04A7BD132BA42F4200BD35A2 /* YHMyDocumentsDetailViewController.swift in Sources */, 04A7BD132BA42F4200BD35A2 /* YHMyDocumentsDetailViewController.swift in Sources */,
04A671622BA058DE00C1FB91 /* YHCertificateEditSheetView.swift in Sources */, 04A671622BA058DE00C1FB91 /* YHCertificateEditSheetView.swift in Sources */,
04AD317D2C295AE800DF5655 /* YHUserInfoSettingViewModel.swift in Sources */, 04AD317D2C295AE800DF5655 /* YHUserInfoSettingViewModel.swift in Sources */,
045A08C22C37EB8B00BCBABA /* YHMyFileListNoneCell.swift in Sources */,
04FD85682C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift in Sources */, 04FD85682C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift in Sources */,
A566A79A2C219FA400980D06 /* YHHomeSalonAreaView.swift in Sources */, A566A79A2C219FA400980D06 /* YHHomeSalonAreaView.swift in Sources */,
A5ACE9432B4564F7002C94D2 /* UILable+Extension.swift in Sources */, A5ACE9432B4564F7002C94D2 /* UILable+Extension.swift in Sources */,
......
...@@ -14,7 +14,11 @@ import Photos ...@@ -14,7 +14,11 @@ import Photos
class YHMyFileListViewController: YHBaseViewController { class YHMyFileListViewController: YHBaseViewController {
let topSegmentHeight = 48.0 let topSegmentHeight = 48.0
var items:[[String]] = [["",""], [""], ["","",""]]
var items:[[String]] = [["",""], [], ["","",""]]
lazy var titles = ["主申请人", "配偶", "子女"]
let certificateReqVM : YHCertificateViewModel = YHCertificateViewModel()
lazy var navBar: YHCustomNavigationBar = { lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar() let bar = YHCustomNavigationBar.navBar()
bar.backgroundColor = .clear bar.backgroundColor = .clear
...@@ -25,16 +29,6 @@ class YHMyFileListViewController: YHBaseViewController { ...@@ -25,16 +29,6 @@ class YHMyFileListViewController: YHBaseViewController {
guard let self = self else { return } guard let self = self else { return }
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
} }
bar.rightBtnClick = {
YHHUD.show(.progress(message: "正在生成图片"))
if let image = self.gerateImage() {
YHHUD.hide()
self.saveImage(image)
} else {
YHHUD.hide()
YHHUD.flash(message: "生成图片失败")
}
}
return bar return bar
}() }()
...@@ -56,10 +50,11 @@ class YHMyFileListViewController: YHBaseViewController { ...@@ -56,10 +50,11 @@ class YHMyFileListViewController: YHBaseViewController {
tableView.contentInsetAdjustmentBehavior = .never tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionHeaderHeight = 1.0 tableView.estimatedSectionHeaderHeight = 1.0
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear tableView.backgroundColor = UIColor.init(hex: 0xDCE4F1)
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.bounces = false tableView.bounces = false
tableView.register(YHMyFileListCell.self, forCellReuseIdentifier: YHMyFileListCell.cellReuseIdentifier) tableView.register(YHMyFileListCell.self, forCellReuseIdentifier: YHMyFileListCell.cellReuseIdentifier)
tableView.register(YHMyFileListNoneCell.self, forCellReuseIdentifier: YHMyFileListNoneCell.cellReuseIdentifier)
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
tableView.tableHeaderView = self.headerView tableView.tableHeaderView = self.headerView
...@@ -78,7 +73,7 @@ class YHMyFileListViewController: YHBaseViewController { ...@@ -78,7 +73,7 @@ class YHMyFileListViewController: YHBaseViewController {
lazy var headerView:UIView = { lazy var headerView:UIView = {
let myView = UIView(frame: CGRectMake(0, 0, KScreenWidth, 264)) let myView = UIView(frame: CGRectMake(0, 0, KScreenWidth, 274))
bgImgView.frame = CGRectMake(0, 0, KScreenWidth, 264) bgImgView.frame = CGRectMake(0, 0, KScreenWidth, 264)
myView.addSubview(bgImgView) myView.addSubview(bgImgView)
...@@ -128,23 +123,52 @@ class YHMyFileListViewController: YHBaseViewController { ...@@ -128,23 +123,52 @@ class YHMyFileListViewController: YHBaseViewController {
return view return view
}() }()
func scrollToSection(_ section:Int) { lazy var bottomView = {
if 0 <= section && section < self.items.count { let view = UIView(frame: CGRectMake(0, 0, KScreenWidth, k_Height_safeAreaInsetsBottom()+64))
var sectionRect = self.tableView.rectForHeader(inSection: section) view.backgroundColor = .white
sectionRect.origin.y = sectionRect.origin.y-k_Height_NavigationtBarAndStatuBar-self.topSegmentHeight view.addSubview(self.saveBtn)
self.tableView.setContentOffset(CGPointMake(0, sectionRect.origin.y+4), animated: true) self.saveBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(8)
make.height.equalTo(48)
} }
} return view
}()
lazy var titles = ["主申请人", "配偶", "子女"] lazy var saveBtn:UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("保存清单图", for: .normal)
button.setTitleColor(.white, for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
button.addTarget(self, action: #selector(clickSaveBtn), for: .touchUpInside)
return button
}()
lazy var emptyView: YHFileListEmptyView = {
let view = YHFileListEmptyView()
view.isHidden = true
view.bottomBtnClick = {
[weak self] in
guard let self = self else { return }
NotificationCenter.default.post(name: YhConstant.YhNotification.didClickFileListBackToServiceTabNotifiction, object: nil)
}
return view
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
gk_navigationBar.isHidden = true gk_navigationBar.isHidden = true
self.view.backgroundColor = UIColor.init(hex: 0xDCE4F1) self.view.backgroundColor = UIColor.init(hex: 0xDCE4F1)
self.view.addSubview(self.tableView) self.view.addSubview(self.tableView)
self.view.addSubview(self.bottomView)
self.view.addSubview(self.navStatusBar) self.view.addSubview(self.navStatusBar)
self.view.addSubview(self.topSegmentView) self.view.addSubview(self.topSegmentView)
self.view.addSubview(self.emptyView)
updateCount() updateCount()
self.navStatusBar.snp.makeConstraints { make in self.navStatusBar.snp.makeConstraints { make in
...@@ -158,7 +182,16 @@ class YHMyFileListViewController: YHBaseViewController { ...@@ -158,7 +182,16 @@ class YHMyFileListViewController: YHBaseViewController {
} }
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.top.equalToSuperview() make.top.equalToSuperview()
make.left.right.equalToSuperview()
make.bottom.equalTo(self.bottomView.snp.top)
}
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(k_Height_safeAreaInsetsBottom()+64.0)
}
emptyView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview() make.left.right.bottom.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
} }
} }
...@@ -175,6 +208,14 @@ class YHMyFileListViewController: YHBaseViewController { ...@@ -175,6 +208,14 @@ class YHMyFileListViewController: YHBaseViewController {
let e: ASAttributedString = .init(" 项需重传", .font(textFont),.foreground(textColor)) let e: ASAttributedString = .init(" 项需重传", .font(textFont),.foreground(textColor))
totalLabel.attributed.text = a+b+c+d+e totalLabel.attributed.text = a+b+c+d+e
} }
func scrollToSection(_ section:Int) {
if 0 <= section && section < self.items.count {
var sectionRect = self.tableView.rectForHeader(inSection: section)
sectionRect.origin.y = sectionRect.origin.y-k_Height_NavigationtBarAndStatuBar-self.topSegmentHeight
self.tableView.setContentOffset(CGPointMake(0, sectionRect.origin.y+4), animated: true)
}
}
} }
extension YHMyFileListViewController : UITableViewDelegate, UITableViewDataSource { extension YHMyFileListViewController : UITableViewDelegate, UITableViewDataSource {
...@@ -186,33 +227,60 @@ extension YHMyFileListViewController : UITableViewDelegate, UITableViewDataSourc ...@@ -186,33 +227,60 @@ extension YHMyFileListViewController : UITableViewDelegate, UITableViewDataSourc
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if 0 <= section && section < items.count { if 0 <= section && section < items.count {
let arr = items[section] let arr = items[section]
return arr.count if arr.count > 0 {
return arr.count
}
return 1
} }
return 0 return 0
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyFileListCell.cellReuseIdentifier, for: indexPath) as! YHMyFileListCell
let noneCell = tableView.dequeueReusableCell(withIdentifier: YHMyFileListNoneCell.cellReuseIdentifier, for: indexPath) as! YHMyFileListNoneCell
if 0 <= indexPath.section && indexPath.section < items.count { if 0 <= indexPath.section && indexPath.section < items.count {
let arr = items[indexPath.section] let arr = items[indexPath.section]
if 0 <= indexPath.row && indexPath.row < arr.count { if arr.count > 0 {
cell.isLastCell = indexPath.row == arr.count-1 let cell = tableView.dequeueReusableCell(withIdentifier: YHMyFileListCell.cellReuseIdentifier, for: indexPath) as! YHMyFileListCell
if 0 <= indexPath.row && indexPath.row < arr.count {
cell.isLastCell = indexPath.row == arr.count-1
}
return cell
} }
} }
return cell return noneCell
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension if 0 <= indexPath.section && indexPath.section < items.count {
let arr = items[indexPath.section]
if arr.count > 0 {
return UITableView.automaticDimension
}
}
return 72.0
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = YHMyFileListHeaderView(frame: .zero) let view = YHMyFileListHeaderView(frame: .zero)
view.headerView.isHidden = true
if 0 <= section && section < items.count {
let arr = items[section]
if arr.count > 0 {
view.headerView.isHidden = false
}
}
return view return view
} }
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
103.0 if 0 <= section && section < items.count {
let arr = items[section]
if arr.count > 0 {
return 103.0
}
}
return 68.0
} }
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
...@@ -276,6 +344,17 @@ extension YHMyFileListViewController : UITableViewDelegate, UITableViewDataSourc ...@@ -276,6 +344,17 @@ extension YHMyFileListViewController : UITableViewDelegate, UITableViewDataSourc
extension YHMyFileListViewController { extension YHMyFileListViewController {
@objc func clickSaveBtn() {
YHHUD.show(.progress(message: "正在生成图片"))
if let image = self.gerateImage() {
YHHUD.hide()
self.saveImage(image)
} else {
YHHUD.hide()
YHHUD.flash(message: "生成图片失败")
}
}
// func gerateImage()-> UIImage? { // func gerateImage()-> UIImage? {
// //
// UIGraphicsBeginImageContextWithOptions(self.tableView.contentSize, false, UIScreen.main.scale) // UIGraphicsBeginImageContextWithOptions(self.tableView.contentSize, false, UIScreen.main.scale)
...@@ -340,4 +419,9 @@ extension YHMyFileListViewController { ...@@ -340,4 +419,9 @@ extension YHMyFileListViewController {
} }
YHHUD.flash(message: "保存成功") YHHUD.flash(message: "保存成功")
} }
func showEmptyView(_ show:Bool) {
self.emptyView.isHidden = !show
self.navStatusBar.backgroundColor = show ? UIColor.white : UIColor.clear
}
} }
//
// YHMyFileListNoneCell.swift
// galaxy
//
// Created by edy on 2024/7/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMyFileListNoneCell: UITableViewCell {
static let cellReuseIdentifier = "YHMyFileListNoneCell"
lazy var whiteContentView:UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
self.backgroundColor = .clear
self.contentView.backgroundColor = .clear
self.contentView.addSubview(self.whiteContentView)
self.whiteContentView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.bottom.equalToSuperview()
}
let grayView : UIView = UIView()
grayView.layer.cornerRadius = 6.0
grayView.clipsToBounds = true
grayView.backgroundColor = UIColor(hex: 0xE5E9F2, alpha: 0.3)
self.whiteContentView.addSubview(grayView)
grayView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(72)
}
let label = UILabel()
label.text = "暂无待完善清单"
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.yhGreyColor
grayView.addSubview(label)
label.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
}
}
}
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