Commit 02d5cd46 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:
  状态解决
  // 搜索
  文书bug修复
  // add 搜索列表
parents 6cae0b25 6cfa63cc
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
044E1E852BC3BEC300A3B4AF /* YHSearchInfoHistoryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044E1E842BC3BEC300A3B4AF /* YHSearchInfoHistoryCell.swift */; }; 044E1E852BC3BEC300A3B4AF /* YHSearchInfoHistoryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044E1E842BC3BEC300A3B4AF /* YHSearchInfoHistoryCell.swift */; };
044E1E872BC3D00E00A3B4AF /* YHSearchItemLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044E1E862BC3D00E00A3B4AF /* YHSearchItemLayout.swift */; }; 044E1E872BC3D00E00A3B4AF /* YHSearchItemLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044E1E862BC3D00E00A3B4AF /* YHSearchItemLayout.swift */; };
044E1E892BC3D7DF00A3B4AF /* YHSearchInfoBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044E1E882BC3D7DF00A3B4AF /* YHSearchInfoBar.swift */; }; 044E1E892BC3D7DF00A3B4AF /* YHSearchInfoBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044E1E882BC3D7DF00A3B4AF /* YHSearchInfoBar.swift */; };
044E1E8B2BC3E1CE00A3B4AF /* YHSearchInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044E1E8A2BC3E1CE00A3B4AF /* YHSearchInfoCell.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 */; };
045EEE7B2B9F171A0022A143 /* YHPersonInfoCellModel2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */; }; 045EEE7B2B9F171A0022A143 /* YHPersonInfoCellModel2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */; };
...@@ -468,6 +469,7 @@ ...@@ -468,6 +469,7 @@
044E1E842BC3BEC300A3B4AF /* YHSearchInfoHistoryCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSearchInfoHistoryCell.swift; sourceTree = "<group>"; }; 044E1E842BC3BEC300A3B4AF /* YHSearchInfoHistoryCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSearchInfoHistoryCell.swift; sourceTree = "<group>"; };
044E1E862BC3D00E00A3B4AF /* YHSearchItemLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHSearchItemLayout.swift; sourceTree = "<group>"; }; 044E1E862BC3D00E00A3B4AF /* YHSearchItemLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHSearchItemLayout.swift; sourceTree = "<group>"; };
044E1E882BC3D7DF00A3B4AF /* YHSearchInfoBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSearchInfoBar.swift; sourceTree = "<group>"; }; 044E1E882BC3D7DF00A3B4AF /* YHSearchInfoBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSearchInfoBar.swift; sourceTree = "<group>"; };
044E1E8A2BC3E1CE00A3B4AF /* YHSearchInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSearchInfoCell.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>"; };
045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPersonInfoCellModel2.swift; sourceTree = "<group>"; }; 045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPersonInfoCellModel2.swift; sourceTree = "<group>"; };
...@@ -2170,6 +2172,7 @@ ...@@ -2170,6 +2172,7 @@
044E1E862BC3D00E00A3B4AF /* YHSearchItemLayout.swift */, 044E1E862BC3D00E00A3B4AF /* YHSearchItemLayout.swift */,
044E1E822BC3BBFC00A3B4AF /* YHSearchInfoHistoryView.swift */, 044E1E822BC3BBFC00A3B4AF /* YHSearchInfoHistoryView.swift */,
044E1E842BC3BEC300A3B4AF /* YHSearchInfoHistoryCell.swift */, 044E1E842BC3BEC300A3B4AF /* YHSearchInfoHistoryCell.swift */,
044E1E8A2BC3E1CE00A3B4AF /* YHSearchInfoCell.swift */,
044E1E882BC3D7DF00A3B4AF /* YHSearchInfoBar.swift */, 044E1E882BC3D7DF00A3B4AF /* YHSearchInfoBar.swift */,
A5173D692BC3C187007D4E74 /* YHHkLifeAndIdView.swift */, A5173D692BC3C187007D4E74 /* YHHkLifeAndIdView.swift */,
A5173D6B2BC3C273007D4E74 /* YHHomeKingKongBlockView.swift */, A5173D6B2BC3C273007D4E74 /* YHHomeKingKongBlockView.swift */,
...@@ -2459,6 +2462,7 @@ ...@@ -2459,6 +2462,7 @@
045EEED22B9F171A0022A143 /* YHScoreTitleView.swift in Sources */, 045EEED22B9F171A0022A143 /* YHScoreTitleView.swift in Sources */,
A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */, A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */,
045EEEA72B9F171A0022A143 /* YHWorkExperienceViewController.swift in Sources */, 045EEEA72B9F171A0022A143 /* YHWorkExperienceViewController.swift in Sources */,
044E1E8B2BC3E1CE00A3B4AF /* YHSearchInfoCell.swift in Sources */,
A5FD63BD2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift in Sources */, A5FD63BD2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift in Sources */,
045EEE8D2B9F171A0022A143 /* YHPreviewInfoCell.swift in Sources */, 045EEE8D2B9F171A0022A143 /* YHPreviewInfoCell.swift in Sources */,
045EEF0C2B9F171A0022A143 /* YHBasicInfoFillBottomView.swift in Sources */, 045EEF0C2B9F171A0022A143 /* YHBasicInfoFillBottomView.swift in Sources */,
......
...@@ -45,19 +45,25 @@ class YHHomePageViewController: YHBaseViewController { ...@@ -45,19 +45,25 @@ class YHHomePageViewController: YHBaseViewController {
lazy var searchView: YHHomeSearchView = { lazy var searchView: YHHomeSearchView = {
let view = YHHomeSearchView() let view = YHHomeSearchView()
let tap = UITapGestureRecognizer(target: self, action: #selector(didSearchBarClicked))
view.addGestureRecognizer(tap)
return view return view
}() }()
lazy var homeHeaderView: YHHomeHeadView = { lazy var homeHeaderView: YHHomeHeadView = {
let view = YHHomeHeadView() let view = YHHomeHeadView()
return view return view
}() }()
@objc func didSearchBarClicked() {
let vc = YHSearchInfomationVC()
self.navigationController?.pushViewController(vc)
}
} }
private extension YHHomePageViewController { private extension YHHomePageViewController {
func setupUI() { func setupUI() {
gk_navTitle = "" gk_navigationBar.isHidden = true
view.backgroundColor = .white view.backgroundColor = .white
view.addSubview(searchView) view.addSubview(searchView)
......
...@@ -10,16 +10,122 @@ import UIKit ...@@ -10,16 +10,122 @@ import UIKit
class YHSearchInfomationVC: YHBaseViewController { class YHSearchInfomationVC: YHBaseViewController {
var searchHistoryView: YHSearchInfoHistoryView = { var items:[String] = ["阿斯顿法师法师法师","发大水发生大法师懂法守法三大发沙发沙发沙发沙发沙发啥打法上大V撒大V啊三大发啥打法四大法守法","发大水发生大法师懂法守法三大发沙发沙发沙发沙发沙发啥打法上大V撒大V啊三大发啥打法四大法守法发大水发生大法师懂法守法三大发沙发沙发沙发沙发沙发啥打法上大V撒大V啊三大发啥打法四大法守法","啊发顺丰"]
let view = YHSearchInfoHistoryView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: KScreenWidth, height: KScreenHeight-k_Height_NavigationtBarAndStatuBar))
lazy var searchBar: YHSearchInfoBar = {
let bar = YHSearchInfoBar(frame: CGRect(x: 20, y: k_Height_NavigationtBarAndStatuBar+8.0, width: KScreenWidth-40, height: 36.0))
return bar
}()
lazy var searchHistoryView: YHSearchInfoHistoryView = {
let view = YHSearchInfoHistoryView(frame: CGRect(x: 0, y: searchBar.frame.maxY+8, width: KScreenWidth, height: KScreenHeight-searchBar.frame.maxY-8))
view.isHidden = true
view.selectBlock = {
[weak self] text in
guard let self = self else { return }
self.searchHistoryView.isHidden = true
self.tableView.isHidden = false
}
return view return view
}() }()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.estimatedSectionHeaderHeight = 0.1
tableView.estimatedSectionFooterHeight = 20.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = .white
tableView.register(YHSearchInfoCell.self, forCellReuseIdentifier: YHSearchInfoCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = .white view.backgroundColor = .white
view.addSubview(searchBar)
view.addSubview(searchHistoryView) view.addSubview(searchHistoryView)
view.addSubview(tableView)
searchBar.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar+8.0)
make.height.equalTo(36.0)
}
searchHistoryView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(searchBar.snp.bottom).offset(20)
make.bottom.equalToSuperview()
}
tableView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(searchBar.snp.bottom).offset(8+20)
make.bottom.equalToSuperview()
}
}
}
extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHSearchInfoCell.cellReuseIdentifier, for: indexPath) as! YHSearchInfoCell
if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section]
cell.titleLabel.text = items[indexPath.section]
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 70.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
let text = items[indexPath.section]
self.tableView.isHidden = true
self.searchHistoryView.isHidden = false
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 0.1
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 20.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
} }
...@@ -11,7 +11,6 @@ import UIKit ...@@ -11,7 +11,6 @@ import UIKit
class YHSearchInfoBar: UIView { class YHSearchInfoBar: UIView {
static let height = 36.0 static let height = 36.0
static let cancelBtnHeight = height-8.0
static let maxWordsCount = 50 static let maxWordsCount = 50
var textChange:((String?)->Void)? var textChange:((String?)->Void)?
...@@ -25,24 +24,23 @@ class YHSearchInfoBar: UIView { ...@@ -25,24 +24,23 @@ class YHSearchInfoBar: UIView {
} }
private lazy var contentView = { private lazy var contentView = {
let view = UIView() let view = UIView()
view.backgroundColor = .contentBkgColor view.backgroundColor = UIColor(hex: 0xF4F6FA)
view.layer.cornerRadius = Self.height/2.0
view.clipsToBounds = true view.clipsToBounds = true
return view return view
}() }()
lazy var searchImgView: UIImageView = { lazy var searchImgView: UIImageView = {
let imgView = UIImageView(image: UIImage(named: "")) let imgView = UIImageView(image: UIImage(named: "home_search_icon"))
return imgView return imgView
}() }()
lazy var textField:UITextField = { lazy var textField:UITextField = {
let textField = UITextField() let textField = UITextField()
textField.backgroundColor = .clear textField.backgroundColor = .clear
textField.attributedPlaceholder = NSAttributedString(string: "请输入关键词搜索".local, attributes: [NSAttributedString.Key.foregroundColor : UIColor.placeHolderColor]) textField.attributedPlaceholder = NSAttributedString(string: "大家正在搜香港身份".local, attributes: [NSAttributedString.Key.foregroundColor : UIColor(hex: 0x94A3B8)])
textField.font = UIFont.PFSC_M(ofSize: 12) textField.font = UIFont.PFSC_M(ofSize: 12)
textField.tintColor = UIColor(hexString: "#3D88F8") textField.tintColor = UIColor(hex: 0x3570DC)
textField.textColor = UIColor.mainTextColor textField.textColor = UIColor(hexString: "#121A26")
textField.clearButtonMode = .whileEditing textField.clearButtonMode = .whileEditing
textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged) textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged)
textField.delegate = self textField.delegate = self
...@@ -52,10 +50,9 @@ class YHSearchInfoBar: UIView { ...@@ -52,10 +50,9 @@ class YHSearchInfoBar: UIView {
lazy var searchBtn: UIButton = { lazy var searchBtn: UIButton = {
let btn = UIButton() let btn = UIButton()
btn.setTitle("搜索".local, for: .normal) btn.setTitle("搜索".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 12) btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 12)
btn.setTitleColor(.white, for: .normal) btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString: "#3D88F8") btn.backgroundColor = UIColor(hexString: "#3570DC")
btn.layer.cornerRadius = Self.cancelBtnHeight/2.0
btn.addTarget(self, action: #selector(searchBtnClicked), for: .touchUpInside) btn.addTarget(self, action: #selector(searchBtnClicked), for: .touchUpInside)
return btn return btn
}() }()
...@@ -69,11 +66,6 @@ class YHSearchInfoBar: UIView { ...@@ -69,11 +66,6 @@ class YHSearchInfoBar: UIView {
super.init(coder: coder) super.init(coder: coder)
} }
static func createBar() -> YHCertificateSearchBar {
let view = YHCertificateSearchBar(frame: CGRect(x: 0, y: 0, width: KScreenWidth-32, height: height))
return view
}
@objc func searchBtnClicked() { @objc func searchBtnClicked() {
if let searchBlock = searchBlock { if let searchBlock = searchBlock {
searchBlock(textField.text) searchBlock(textField.text)
...@@ -90,6 +82,7 @@ class YHSearchInfoBar: UIView { ...@@ -90,6 +82,7 @@ class YHSearchInfoBar: UIView {
self.backgroundColor = .white self.backgroundColor = .white
setSearchButtonEnable(false) setSearchButtonEnable(false)
contentView.addSubview(searchImgView)
contentView.addSubview(textField) contentView.addSubview(textField)
contentView.addSubview(searchBtn) contentView.addSubview(searchBtn)
self.addSubview(contentView) self.addSubview(contentView)
...@@ -98,14 +91,20 @@ class YHSearchInfoBar: UIView { ...@@ -98,14 +91,20 @@ class YHSearchInfoBar: UIView {
make.edges.equalToSuperview() make.edges.equalToSuperview()
} }
searchImgView.snp.makeConstraints { make in
make.width.height.equalTo(16.0)
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(12.0)
}
textField.snp.makeConstraints { make in textField.snp.makeConstraints { make in
make.left.equalToSuperview().offset(Self.height/2.0) make.left.equalTo(searchImgView.snp.right).offset(8)
make.right.equalTo(searchBtn.snp.left).offset(-4) make.right.equalTo(searchBtn.snp.left).offset(-4)
make.centerY.equalToSuperview() make.top.bottom.equalToSuperview()
} }
searchBtn.snp.makeConstraints { make in searchBtn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: 66, height: Self.height-8.0)) make.size.equalTo(CGSize(width: 56, height: Self.height-8.0))
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-4) make.right.equalToSuperview().offset(-4)
} }
......
//
// YHSearchInfoCell.swift
// galaxy
//
// Created by edy on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSearchInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHSearchInfoCell"
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
lazy var headImgView: UIImageView = {
let imagV = UIImageView()
imagV.contentMode = .scaleAspectFill
imagV.clipsToBounds = true
imagV.image = UIImage(named: "home_cell0_head_icon")
return imagV
}()
lazy var titleLabel: UILabel = {
var label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textAlignment = .left
label.textColor = UIColor(hex: 0x121A26)
label.numberOfLines = 2
return label
}()
func setupUI() {
contentView.backgroundColor = .white
contentView.addSubview(headImgView)
contentView.addSubview(titleLabel)
headImgView.snp.makeConstraints { make in
make.width.height.equalTo(70.0)
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(20)
}
titleLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(headImgView.snp.right).offset(20)
make.right.equalToSuperview().offset(-20)
}
}
}
...@@ -12,6 +12,9 @@ class YHSearchInfoHistoryView: UIView { ...@@ -12,6 +12,9 @@ class YHSearchInfoHistoryView: UIView {
var historyItems:[String] = ["阿法守法发生懂法守法阿法守法发生懂法守法阿法守法发生懂法守法阿法守法发生懂法守法", "几天萨法", "阿德", "守法", "几天萨法", "德", "阿法守法发生懂法守法", "阿德", "几天", "阿德", "守法", "几天萨法"] var historyItems:[String] = ["阿法守法发生懂法守法阿法守法发生懂法守法阿法守法发生懂法守法阿法守法发生懂法守法", "几天萨法", "阿德", "守法", "几天萨法", "德", "阿法守法发生懂法守法", "阿德", "几天", "阿德", "守法", "几天萨法"]
// var historyItems:[String] = ["几天2345", "阿", "萨法", "阿德"] // var historyItems:[String] = ["几天2345", "阿", "萨法", "阿德"]
var selectBlock:((String)->())?
let interItemSpacing: CGFloat = 12.0 // 相邻单元格之间的水平间距 let interItemSpacing: CGFloat = 12.0 // 相邻单元格之间的水平间距
let gap: CGFloat = 12.0 let gap: CGFloat = 12.0
let cellHeight: CGFloat = 30.0 // 单元格的固定高度 let cellHeight: CGFloat = 30.0 // 单元格的固定高度
...@@ -103,4 +106,11 @@ extension YHSearchInfoHistoryView: UICollectionViewDelegate, UICollectionViewDat ...@@ -103,4 +106,11 @@ extension YHSearchInfoHistoryView: UICollectionViewDelegate, UICollectionViewDat
} }
return cell return cell
} }
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < historyItems.count {
let text = historyItems[indexPath.item]
selectBlock?(text)
}
}
} }
...@@ -18,13 +18,16 @@ class YHServerHKLifeViewController: YHBaseViewController { ...@@ -18,13 +18,16 @@ class YHServerHKLifeViewController: YHBaseViewController {
var homeTableView: UITableView = { var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .plain) let tableView = UITableView(frame: .zero, style: .plain)
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0
}
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 81.0 tableView.estimatedRowHeight = 81.0
tableView.register(YHContractCell.self,forCellReuseIdentifier: YHContractCell.cellReuseIdentifier) tableView.register(YHServerHKLifeViewCell.self,forCellReuseIdentifier: YHServerHKLifeViewCell.cellReuseIdentifier)
return tableView return tableView
}() }()
...@@ -68,8 +71,8 @@ extension YHServerHKLifeViewController { ...@@ -68,8 +71,8 @@ extension YHServerHKLifeViewController {
tableHeadView = YHServerTableHeadView() tableHeadView = YHServerTableHeadView()
tableHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 365) tableHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 365)
tableFootView = YHServiceTableFootView() // tableFootView = YHServiceTableFootView()
tableFootView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight) // tableFootView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)
view.addSubview(homeTableView) view.addSubview(homeTableView)
homeTableView.tableHeaderView = tableHeadView homeTableView.tableHeaderView = tableHeadView
homeTableView.tableFooterView = tableFootView homeTableView.tableFooterView = tableFootView
...@@ -109,7 +112,7 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour ...@@ -109,7 +112,7 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
} }
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0 return 0.01
} }
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
...@@ -118,11 +121,12 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour ...@@ -118,11 +121,12 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 0.1 return KScreenHeight
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = UITableViewCell() let cell0 = tableView.dequeueReusableCell(withClass: YHServerHKLifeViewCell.self)
cell0.selectionStyle = .none
return cell0 return cell0
} }
...@@ -162,3 +166,55 @@ extension YHServerHKLifeViewController: JXSegmentedListContainerViewListDelegate ...@@ -162,3 +166,55 @@ extension YHServerHKLifeViewController: JXSegmentedListContainerViewListDelegate
return view return view
} }
} }
class YHServerHKLifeViewCell: UITableViewCell {
static let cellReuseIdentifier = "YHServerHKLifeViewCell"
var tableFootView: YHServiceTableFootView!
var dataModel : YHContactItemModel? {
didSet {
updateUI()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
extension YHServerHKLifeViewCell {
func updateUI() {
}
func setupUI() {
let holdView = UIView()
holdView.backgroundColor = .white
holdView.layer.cornerRadius = kCornerRadius6
holdView.clipsToBounds = true
backgroundColor = .clear
contentView.backgroundColor = .clear
tableFootView = YHServiceTableFootView()
tableFootView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)
contentView.addSubview(tableFootView)
}
}
...@@ -124,9 +124,6 @@ class YHMyDocumentsDetailViewController: YHBaseViewController { ...@@ -124,9 +124,6 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
if self.type == 3 && self.viewModel.mainModel?.writing_document.doc_sign.doc_return_manual.count == 0 && !success { if self.type == 3 && self.viewModel.mainModel?.writing_document.doc_sign.doc_return_manual.count == 0 && !success {
self.bottomButton.isEnabled = false self.bottomButton.isEnabled = false
self.bottomButton.alpha = 0.4 self.bottomButton.alpha = 0.4
} else {
self.bottomButton.isEnabled = true
self.bottomButton.alpha = 1
} }
self.tableView.reloadData() self.tableView.reloadData()
}) })
......
...@@ -69,8 +69,9 @@ class YHDocumentFileItemView: UIView { ...@@ -69,8 +69,9 @@ class YHDocumentFileItemView: UIView {
}() }()
addSubview(centerButton) addSubview(centerButton)
centerButton.snp.makeConstraints { make in centerButton.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview() make.top.bottom.equalToSuperview()
make.left.equalTo(112) make.left.equalTo(112)
make.right.equalTo(-50)
} }
deleteButton = { deleteButton = {
...@@ -86,6 +87,7 @@ class YHDocumentFileItemView: UIView { ...@@ -86,6 +87,7 @@ class YHDocumentFileItemView: UIView {
make.width.height.equalTo(16) make.width.height.equalTo(16)
} }
deleteButton.YH_clickEdgeInsets = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
} }
func updateAllViews() { func updateAllViews() {
......
...@@ -211,61 +211,50 @@ class YHDocumentMessageTableViewCell: UITableViewCell { ...@@ -211,61 +211,50 @@ class YHDocumentMessageTableViewCell: UITableViewCell {
func updateAllViews() { func updateAllViews() {
guard let dataSource = dataSource else { return } guard let dataSource = dataSource else { return }
if dataSource.prospectus.id == 0 { if dataSource.prospectus.id == 0 {
/*
docOpt: {
1: '待确认',
2: '待签章',
3: '已驳回',
4: '待核对',
5: '已签章',
6: '已定稿',
7: '已完成'
},
*/
var statusTxt = "" var statusTxt = ""
var color : UIColor = .brandMainColor var color : UIColor = .brandMainColor
let status = dataSource.writing_document.status let status = dataSource.writing_document.status
if status == 1 { if status == 1 {
statusTxt = "待确认" statusTxt = "不展示"
color = UIColor.brandMainColor color = UIColor.brandMainColor
lookButton.isHidden = true lookButton.isHidden = true
} else if status == 2 { } else if status == 2 {
statusTxt = "待签章" statusTxt = " 待确认 "
color = UIColor.brandMainColor color = UIColor.brandMainColor
lookButton.isHidden = true lookButton.isHidden = true
} else if status == 3 { } else if status == 3 {
statusTxt = "已驳回" statusTxt = " 核对中 "
color = UIColor.failColor color = UIColor.failColor
editButton.isHidden = true editButton.isHidden = true
submitButton.isHidden = true submitButton.isHidden = true
bottomCenterLineView.isHidden = true bottomCenterLineView.isHidden = true
} else if status == 4 { } else if status == 4 {
statusTxt = "核对中" statusTxt = " 核对中 "
color = UIColor.warnColor color = UIColor.warnColor
editButton.isHidden = true editButton.isHidden = true
submitButton.isHidden = true submitButton.isHidden = true
bottomCenterLineView.isHidden = true bottomCenterLineView.isHidden = true
} else if status == 5 { } else if status == 5 {
statusTxt = "已签章" statusTxt = " 已驳回 "
color = UIColor.successColor color = UIColor.successColor
editButton.isHidden = true editButton.isHidden = true
submitButton.isHidden = true submitButton.isHidden = true
bottomCenterLineView.isHidden = true bottomCenterLineView.isHidden = true
} else if status == 6 { } else if status == 6 {
statusTxt = "已定稿" statusTxt = " 已定稿 "
color = UIColor.labelTextColor2 color = UIColor.labelTextColor2
editButton.isHidden = true editButton.isHidden = true
submitButton.isHidden = true submitButton.isHidden = true
bottomCenterLineView.isHidden = true bottomCenterLineView.isHidden = true
} else if status == 7 { } else if status == 7 {
statusTxt = "已完成" statusTxt = " 已完成 "
color = UIColor.labelTextColor2 color = UIColor.labelTextColor2
editButton.isHidden = true editButton.isHidden = true
submitButton.isHidden = true submitButton.isHidden = true
bottomCenterLineView.isHidden = true bottomCenterLineView.isHidden = true
} else { } else {
statusTxt = "--" statusTxt = " -- "
color = UIColor.failColor color = UIColor.failColor
editButton.isHidden = true editButton.isHidden = true
submitButton.isHidden = true submitButton.isHidden = true
......
...@@ -212,7 +212,7 @@ class YHDocumentToActionTableViewCell: UITableViewCell { ...@@ -212,7 +212,7 @@ class YHDocumentToActionTableViewCell: UITableViewCell {
func updateAllViews() { func updateAllViews() {
guard let dataSource = dataSource else { return } guard let dataSource = dataSource else { return }
let suffix = dataSource.writing_document.name.pathExtension.lowercased() let suffix = dataSource.writing_document.doc_sign.doc_send.pathExtension.lowercased()
var iconImgName = "my_cer_type_pdf" var iconImgName = "my_cer_type_pdf"
if suffix == "jpeg" { if suffix == "jpeg" {
iconImgName = "my_cer_type_jpg" iconImgName = "my_cer_type_jpg"
...@@ -232,7 +232,7 @@ class YHDocumentToActionTableViewCell: UITableViewCell { ...@@ -232,7 +232,7 @@ class YHDocumentToActionTableViewCell: UITableViewCell {
iconImgName = "my_cer_type_tiff" iconImgName = "my_cer_type_tiff"
} }
fileImageView.image = UIImage(named: iconImgName) fileImageView.image = UIImage(named: iconImgName)
fileNameLabel.text = dataSource.writing_document.name fileNameLabel.text = dataSource.writing_document.doc_sign.doc_type_name
} }
@objc func editButtonClick() { @objc func editButtonClick() {
......
...@@ -107,9 +107,6 @@ class YHMySignatureDetailViewController: YHBaseViewController { ...@@ -107,9 +107,6 @@ class YHMySignatureDetailViewController: YHBaseViewController {
if self.type == 3 && self.viewModel.mainModel?.doc_return_manual.count == 0 && !success { if self.type == 3 && self.viewModel.mainModel?.doc_return_manual.count == 0 && !success {
self.bottomButton.isEnabled = false self.bottomButton.isEnabled = false
self.bottomButton.alpha = 0.4 self.bottomButton.alpha = 0.4
} else {
self.bottomButton.isEnabled = true
self.bottomButton.alpha = 1
} }
self.tableView.reloadData() self.tableView.reloadData()
}) })
......
...@@ -224,7 +224,7 @@ class YHSignatureToActionTableViewCell: UITableViewCell { ...@@ -224,7 +224,7 @@ class YHSignatureToActionTableViewCell: UITableViewCell {
func updateAllViews() { func updateAllViews() {
guard let dataSource = dataSource else { return } guard let dataSource = dataSource else { return }
let suffix = dataSource.doc_type_name.pathExtension.lowercased() let suffix = dataSource.doc_send.pathExtension.lowercased()
var iconImgName = "my_cer_type_pdf" var iconImgName = "my_cer_type_pdf"
if suffix == "jpeg" { if suffix == "jpeg" {
iconImgName = "my_cer_type_jpg" iconImgName = "my_cer_type_jpg"
......
...@@ -11,7 +11,7 @@ import UIKit ...@@ -11,7 +11,7 @@ import UIKit
class YHServiceSectionView: UIView { class YHServiceSectionView: UIView {
var items: [String] = [] var items: [String] = []
var selectIndex = 0
lazy var myCollectView = { lazy var myCollectView = {
// 设置布局方向 // 设置布局方向
let flowLayout = UICollectionViewFlowLayout() let flowLayout = UICollectionViewFlowLayout()
...@@ -77,11 +77,18 @@ extension YHServiceSectionView: UICollectionViewDelegate, UICollectionViewDataSo ...@@ -77,11 +77,18 @@ extension YHServiceSectionView: UICollectionViewDelegate, UICollectionViewDataSo
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceSectionCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHServiceSectionCollectionViewCell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceSectionCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHServiceSectionCollectionViewCell
cell.dataSource = items[indexPath.row] cell.dataSource = items[indexPath.row]
if indexPath.row == selectIndex {
cell.isSelected = true
} else {
cell.isSelected = false
}
return cell return cell
} }
private func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { private func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
selectIndex = indexPath.row
collectionView.reloadData()
print("index is \(indexPath.row)") print("index is \(indexPath.row)")
} }
} }
...@@ -89,6 +96,31 @@ extension YHServiceSectionView: UICollectionViewDelegate, UICollectionViewDataSo ...@@ -89,6 +96,31 @@ extension YHServiceSectionView: UICollectionViewDelegate, UICollectionViewDataSo
class YHServiceSectionCollectionViewCell: UICollectionViewCell { class YHServiceSectionCollectionViewCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHServiceSectionCollectionViewCell" static let cellReuseIdentifier = "YHServiceSectionCollectionViewCell"
private var isSelect: Bool = false
override var isSelected: Bool {
set {
self.isSelect = newValue
if newValue {
self.setSelectedStyle()
} else {
self.setDeSelectedStyle()
}
}
get {
return self.isSelect
}
}
private func setSelectedStyle() {
contentView.backgroundColor = UIColor.brandMainColor
descripeLable.textColor = UIColor.white
}
private func setDeSelectedStyle() {
contentView.backgroundColor = UIColor(hex: 0xf4f6fa)
descripeLable.textColor = UIColor(hex: 0x94a3bb)
}
var dataSource: String? { var dataSource: String? {
didSet { didSet {
updataAllSubViews() updataAllSubViews()
......
...@@ -198,12 +198,6 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -198,12 +198,6 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
if (indexPath.row >= items.count) { return } if (indexPath.row >= items.count) { return }
if true {
let vc = YHSearchInfomationVC()
self.navigationController?.pushViewController(vc)
return
}
if !checkLogin() { if !checkLogin() {
let vc = UINavigationController(rootVC: YHPhoneLoginViewController()) let vc = UINavigationController(rootVC: YHPhoneLoginViewController())
vc.modalPresentationStyle = .custom vc.modalPresentationStyle = .custom
......
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