Commit 052be38a authored by David黄金龙's avatar David黄金龙

我的文书 底部UI 及逻辑

parent 88d4a678
...@@ -248,6 +248,7 @@ ...@@ -248,6 +248,7 @@
A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; }; A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; };
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; }; A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; };
A514E5DC2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */; }; A514E5DC2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */; };
A517A4DF2BB53BE8000DEECD /* YHDocListBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A517A4DE2BB53BE8000DEECD /* YHDocListBottomView.swift */; };
A520124F2BABCE05008655EA /* YHFileListContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A520124E2BABCE05008655EA /* YHFileListContentView.swift */; }; A520124F2BABCE05008655EA /* YHFileListContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A520124E2BABCE05008655EA /* YHFileListContentView.swift */; };
A53026902B4E6F2700F35102 /* YHHomeCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */; }; A53026902B4E6F2700F35102 /* YHHomeCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */; };
A53B61122BB128AF0010B573 /* YHFileListItemsView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53B61112BB128AF0010B573 /* YHFileListItemsView2.swift */; }; A53B61122BB128AF0010B573 /* YHFileListItemsView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53B61112BB128AF0010B573 /* YHFileListItemsView2.swift */; };
...@@ -639,6 +640,7 @@ ...@@ -639,6 +640,7 @@
A51044172B493675006B60BB /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; }; A51044172B493675006B60BB /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
A51044192B495DD0006B60BB /* UIView+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = "<group>"; }; A51044192B495DD0006B60BB /* UIView+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = "<group>"; };
A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterSecondViewController.swift; sourceTree = "<group>"; }; A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterSecondViewController.swift; sourceTree = "<group>"; };
A517A4DE2BB53BE8000DEECD /* YHDocListBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDocListBottomView.swift; sourceTree = "<group>"; };
A520124E2BABCE05008655EA /* YHFileListContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHFileListContentView.swift; sourceTree = "<group>"; }; A520124E2BABCE05008655EA /* YHFileListContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHFileListContentView.swift; sourceTree = "<group>"; };
A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeCustomCell.swift; sourceTree = "<group>"; }; A530268F2B4E6F2700F35102 /* YHHomeCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeCustomCell.swift; sourceTree = "<group>"; };
A53B61112BB128AF0010B573 /* YHFileListItemsView2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFileListItemsView2.swift; sourceTree = "<group>"; }; A53B61112BB128AF0010B573 /* YHFileListItemsView2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFileListItemsView2.swift; sourceTree = "<group>"; };
...@@ -1616,6 +1618,7 @@ ...@@ -1616,6 +1618,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A53B61182BB3C9960010B573 /* YHMyDocListHeaderView.swift */, A53B61182BB3C9960010B573 /* YHMyDocListHeaderView.swift */,
A517A4DE2BB53BE8000DEECD /* YHDocListBottomView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2472,6 +2475,7 @@ ...@@ -2472,6 +2475,7 @@
045EEEE72B9F171A0022A143 /* YHMySignatureListTableViewCell.swift in Sources */, 045EEEE72B9F171A0022A143 /* YHMySignatureListTableViewCell.swift in Sources */,
A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */, A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */,
0477E17C2BA4238400436346 /* YHCertificateListContainerVC.swift in Sources */, 0477E17C2BA4238400436346 /* YHCertificateListContainerVC.swift in Sources */,
A517A4DF2BB53BE8000DEECD /* YHDocListBottomView.swift in Sources */,
04C8F4832B7216D800ADF59B /* YHUserInfoHeaderView.swift in Sources */, 04C8F4832B7216D800ADF59B /* YHUserInfoHeaderView.swift in Sources */,
045EEEAF2B9F171A0022A143 /* YHWorkExperienceTextItemView.swift in Sources */, 045EEEAF2B9F171A0022A143 /* YHWorkExperienceTextItemView.swift in Sources */,
A5ACE9492B4564F7002C94D2 /* YHHUDSuccessView.swift in Sources */, A5ACE9492B4564F7002C94D2 /* YHHUDSuccessView.swift in Sources */,
......
...@@ -12,7 +12,6 @@ import UIKit ...@@ -12,7 +12,6 @@ import UIKit
*/ */
class YHMyDocumentsListViewController: YHBaseViewController { class YHMyDocumentsListViewController: YHBaseViewController {
var bottomView: UIView!
var bottomButton: UIButton! var bottomButton: UIButton!
var tableView: UITableView! var tableView: UITableView!
var dataSource: [YHMyDocumentsListModel]? var dataSource: [YHMyDocumentsListModel]?
...@@ -21,6 +20,15 @@ class YHMyDocumentsListViewController: YHBaseViewController { ...@@ -21,6 +20,15 @@ class YHMyDocumentsListViewController: YHBaseViewController {
var mobile: String = "" var mobile: String = ""
private var isEditFlag : Bool = false {
didSet {
updateUI()
}
}
lazy var headSessionView : YHMyDocListHeaderView = { lazy var headSessionView : YHMyDocListHeaderView = {
...@@ -28,6 +36,12 @@ class YHMyDocumentsListViewController: YHBaseViewController { ...@@ -28,6 +36,12 @@ class YHMyDocumentsListViewController: YHBaseViewController {
return view return view
}() }()
lazy var bottomView : YHDocListBottomView = {
let view = YHDocListBottomView()
return view
}()
//头部背景图片 //头部背景图片
lazy var headBkgImagV: UIImageView = { lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView() let imagV = UIImageView()
...@@ -81,6 +95,16 @@ extension YHMyDocumentsListViewController { ...@@ -81,6 +95,16 @@ extension YHMyDocumentsListViewController {
make.height.equalTo(YHMyDocListHeaderView.viewH) make.height.equalTo(YHMyDocListHeaderView.viewH)
} }
headSessionView.block = { type in
self.updateUIForClickButton(type: type)
}
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(YHDocListBottomView.viewH)
}
bottomView.isHidden = true
tableView = { tableView = {
let tableView = UITableView(frame:.zero, style:.plain) let tableView = UITableView(frame:.zero, style:.plain)
...@@ -92,49 +116,52 @@ extension YHMyDocumentsListViewController { ...@@ -92,49 +116,52 @@ extension YHMyDocumentsListViewController {
tableView.register(cellWithClass: YHMySignatureListTableViewCell.self) tableView.register(cellWithClass: YHMySignatureListTableViewCell.self)
return tableView return tableView
}() }()
view.addSubview(tableView) view.addSubview(tableView)
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.top.equalTo(headSessionView.snp.bottom) make.top.equalTo(headSessionView.snp.bottom)
make.left.right.bottom.equalToSuperview() make.left.right.equalToSuperview()
make.bottom.equalToSuperview()
} }
// bottomView = {
// let bottom = UIView() bottomView.layoutIfNeeded()
// bottom.backgroundColor = .white bottomView.bottomButton.addYinHeGradualLayer()
// return bottom
// }()
// view.addSubview(bottomView)
// bottomView.snp.makeConstraints { make in
// make.left.right.bottom.equalToSuperview()
// make.height.equalTo(k_Height_safeAreaInsetsBottom() + 64)
// }
//
// bottomButton = {
// let button = UIButton(type: .custom)
// button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
// button.contentHorizontalAlignment = .center
// button.setTitle("提交", for: .normal)
// button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
// button.layer.cornerRadius = kCornerRadius6
// button.clipsToBounds = true
// button.addTarget(self, action: #selector(submit), for: .touchUpInside)
// return button
// }()
// bottomView.addSubview(bottomButton)
// bottomButton.snp.makeConstraints { make in
// make.right.equalTo(-16)
// make.top.equalTo(8)
// make.height.equalTo(48)
// make.left.equalTo(16)
// }
//
// bottomButton.layoutIfNeeded()
// bottomButton.addYinHeGradualLayer()
} }
@objc func submit() { @objc func submit() {
} }
private func updateUI() {
}
private func updateUIForClickButton(type : ClickButtonType) {
bottomView.snp.removeConstraints()
tableView.snp.removeConstraints()
if type == .downAll {
bottomView.isHidden = false
bottomView.snp.remakeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(YHDocListBottomView.viewH)
}
tableView.snp.remakeConstraints { make in
make.top.equalTo(headSessionView.snp.bottom)
make.left.right.equalToSuperview()
make.bottom.equalTo(bottomView.snp.top)
}
} else if type == .cancel {
bottomView.isHidden = true
tableView.snp.remakeConstraints { make in
make.top.equalTo(headSessionView.snp.bottom)
make.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
}
}
} }
extension YHMyDocumentsListViewController: UITableViewDelegate, UITableViewDataSource { extension YHMyDocumentsListViewController: UITableViewDelegate, UITableViewDataSource {
......
//
// YHDocListBottomView.swift
// galaxy
//
// Created by davidhuangA on 2024/3/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHDocListBottomView: UIView {
static let viewH : CGFloat = 98.0
typealias Block = (ClickButtonType,Bool) -> ()
var block: Block?
override init(frame: CGRect) {
super.init(frame: frame)
initView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
lazy var bottomButton : UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("下载", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.clipsToBounds = true
button.addTarget(self, action: #selector(clickDownloadBtn), for: .touchUpInside)
return button
}()
lazy var checkButton : UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setImage(UIImage(named: "my_doc_check_btn_0"), for: .normal)
button.setImage(UIImage(named: "my_doc_check_btn_1"), for: .selected)
button.setTitle("全选", for: .normal)
button.addTarget(self, action: #selector(clickCheckBtn), for: .touchUpInside)
return button
}()
private lazy var titleLable : UILabel = {
let lable0 = UILabel(text: "已选0条")
lable0.textColor = UIColor(hex: 0xC0C0C0, alpha: 1.0)
lable0.font = UIFont.PFSC_R(ofSize: 15)
return lable0
}()
}
private extension YHDocListBottomView {
func initView() {
addSubview(checkButton)
checkButton.snp.makeConstraints { make in
make.top.equalTo(21.5)
make.left.equalTo(kMargin)
make.width.equalTo(60)
make.height.equalTo(30)
}
checkButton.iconInLeft(spacing: 5)
addSubview(titleLable)
titleLable.snp.makeConstraints { make in
make.centerY.equalTo(checkButton)
make.left.equalTo(checkButton.snp.right).offset(6)
make.width.equalTo(60)
make.height.equalTo(22)
}
addSubview(bottomButton)
bottomButton.snp.makeConstraints { make in
make.right.equalTo(-kMargin)
make.centerY.equalTo(checkButton)
make.height.equalTo(44)
make.left.equalTo(titleLable.snp.right).offset(34)
}
}
@objc func clickCheckBtn() {
checkButton.isSelected = !checkButton.isSelected
block?(.allChoice,checkButton.isSelected)
}
@objc func clickDownloadBtn() {
block?(.downAllCheck,false)
}
}
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
import UIKit import UIKit
enum ClickButtonType { enum ClickButtonType {
case downAll //全部下载 case downAll //全部下载 按钮
case cancel //取消 case cancel //取消 按钮
case allChoice //全选 按钮
case downAllCheck //下载确认按钮
} }
class YHMyDocListHeaderView: UIView { class YHMyDocListHeaderView: UIView {
......
...@@ -9,13 +9,8 @@ ...@@ -9,13 +9,8 @@
import UIKit import UIKit
class YHMyDocumentsListViewModel: YHBaseViewModel { class YHMyDocumentsListViewModel: YHBaseViewModel {
var mainModel: YHMyDocumentsModel? var mainModel: YHMyDocumentsModel?
override init() {
super.init()
}
func requestDocumentsList(_ orderId: String, _ mobile: String, callBackBlock:@escaping (_ success: Bool?, _ error: YHErrorModel?)->()) { func requestDocumentsList(_ orderId: String, _ mobile: String, callBackBlock:@escaping (_ success: Bool?, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["order_id": orderId, let params: [String : Any] = ["order_id": orderId,
"mobile": mobile] "mobile": mobile]
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Ellipse 240@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Ellipse 240@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2500@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2500@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