Commit eee49ba7 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:
  //  搜索栏
  //  搜索bar
  // 资料上传
parents ed4d4524 2aee0be2
This diff is collapsed.
...@@ -17,8 +17,8 @@ class YHCollegeSearchViewController: YHBaseViewController { ...@@ -17,8 +17,8 @@ class YHCollegeSearchViewController: YHBaseViewController {
var lastSearchTime:TimeInterval = 0.0 var lastSearchTime:TimeInterval = 0.0
let educationRequest:YHEducationRequestViewModel = YHEducationRequestViewModel() let educationRequest:YHEducationRequestViewModel = YHEducationRequestViewModel()
lazy var searchBar: YHSearchBar = { lazy var searchBar: YHCollegeSearchBar = {
let bar = YHSearchBar.createBar() let bar = YHCollegeSearchBar.createBar()
return bar return bar
}() }()
...@@ -108,7 +108,7 @@ class YHCollegeSearchViewController: YHBaseViewController { ...@@ -108,7 +108,7 @@ class YHCollegeSearchViewController: YHBaseViewController {
searchBar.snp.makeConstraints { make in searchBar.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16) make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-16)
make.height.equalTo(YHSearchBar.height) make.height.equalTo(YHCollegeSearchBar.height)
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar+16) make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar+16)
} }
......
// //
// YHSearchBar.swift // YHCollegeSearchBar.swift
// galaxy // galaxy
// //
// Created by edy on 2024/2/22. // Created by edy on 2024/2/22.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class YHSearchBar: UIView { class YHCollegeSearchBar: UIView {
static let height = 40.0 static let height = 40.0
static let confirmBtnHeight = height-8.0 static let confirmBtnHeight = height-8.0
...@@ -61,8 +61,8 @@ class YHSearchBar: UIView { ...@@ -61,8 +61,8 @@ class YHSearchBar: UIView {
super.init(coder: coder) super.init(coder: coder)
} }
static func createBar() -> YHSearchBar { static func createBar() -> YHCollegeSearchBar {
let view = YHSearchBar(frame: CGRect(x: 0, y: 0, width: KScreenWidth-32, height: height)) let view = YHCollegeSearchBar(frame: CGRect(x: 0, y: 0, width: KScreenWidth-32, height: height))
return view return view
} }
......
//
// YHCertificateResourceUploadVC.swift
// galaxy
//
// Created by edy on 2024/3/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateResourceUploadVC: YHBaseViewController {
var items:[String] = ["1", "2", "2", "2", "2", "2", "2", "2"]
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
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)
return tableView
}()
lazy var searchView:UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(searchBar)
searchBar.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(16)
make.size.equalTo(CGSize(width: KScreenWidth-32.0, height:YHCertificateSearchBar.height))
}
return view
}()
lazy var searchBar: YHCertificateSearchBar = {
let bar = YHCertificateSearchBar(frame:CGRect(x: 0, y: 0, width:KScreenWidth-32, height:YHCertificateSearchBar.height))
return bar
}()
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white
self.gk_navTitle = "资料上传"
self.gk_navigationBar.backgroundColor = .white
createUI()
}
func createUI() {
view.addSubview(tableView)
view.addSubview(searchView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.bottom.equalToSuperview().offset(-k_Height_safeAreaInsetsBottom())
}
searchView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(YHCertificateSearchBar.height+32)
}
}
}
extension YHCertificateResourceUploadVC: 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 item = items[indexPath.section]
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
}
...@@ -2,21 +2,33 @@ ...@@ -2,21 +2,33 @@
// YHCertificateInfoCell.swift // YHCertificateInfoCell.swift
// galaxy // galaxy
// //
// Created by edy on 2024/3/12. // Created by edy on 2024/3/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved. // Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
// //
import UIKit import UIKit
import AttributedString
class YHCertificateInfoCell: UITableViewCell { class YHCertificateInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateInfoCell" static let cellReuseIdentifier = "YHCertificateNameCell"
var whiteView: UIView! var whiteView: UIView!
var iconImgV: UIImageView! var nameTextView: UITextView!
var nameLabel: UILabel! var infoLabel: UILabel!
var timeLabel: UILabel! var statusBtn: UIButton!
var editBtn: UIButton!
private lazy var templateLabel : UILabel = {
let customLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 48, height: 16))
customLabel.text = "资料模版"
customLabel.font = .PFSC_M(ofSize: 10)
customLabel.backgroundColor = .brandMainColor8
customLabel.textColor = .brandMainColor
customLabel.layer.cornerRadius = 3
customLabel.clipsToBounds = true
customLabel.textAlignment = .center
return customLabel
}()
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
...@@ -31,62 +43,71 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -31,62 +43,71 @@ class YHCertificateInfoCell: UITableViewCell {
func setupUI() { func setupUI() {
self.selectionStyle = .none self.selectionStyle = .none
contentView.backgroundColor = .white contentView.backgroundColor = UIColor(hexString:"#F8F8F8")
whiteView = UIView() whiteView = UIView()
whiteView.layer.cornerRadius = 6.0
whiteView.clipsToBounds = true
whiteView.backgroundColor = .white
contentView.addSubview(whiteView) contentView.addSubview(whiteView)
iconImgV = UIImageView(image:UIImage(named:"my_cer_type_pdf")) nameTextView = UITextView()
whiteView.addSubview(iconImgV) nameTextView.textColor = UIColor.mainTextColor
nameTextView.font = UIFont.PFSC_M(ofSize: 16)
nameLabel = UILabel() nameTextView.isScrollEnabled = false
nameLabel.textColor = UIColor.mainTextColor nameTextView.isEditable = false
nameLabel.textAlignment = .left nameTextView.isSelectable = false
nameLabel.font = UIFont.PFSC_M(ofSize:14) whiteView.addSubview(nameTextView)
nameLabel.text = "文档名称.doc"
whiteView.addSubview(nameLabel) nameTextView.attributed.text = """
\("我是资料名称", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateLabel, .original(.center)))
timeLabel = UILabel() """
timeLabel.textColor = UIColor.labelTextColor2
timeLabel.textAlignment = .left infoLabel = UILabel()
timeLabel.font = UIFont.PFSC_R(ofSize:11) infoLabel.textColor = UIColor.labelTextColor2
timeLabel.text = "上传于2024.01.01" infoLabel.textAlignment = .left
whiteView.addSubview(timeLabel) infoLabel.font = UIFont.PFSC_R(ofSize:11)
infoLabel.text = "类型:证件资料 所属人:张康"
editBtn = UIButton() whiteView.addSubview(infoLabel)
editBtn.setImage(UIImage(named:"my_cer_btn_edit"), for:.normal)
whiteView.addSubview(editBtn) statusBtn = UIButton()
statusBtn.titleLabel?.font = UIFont.PFSC_R(ofSize:14)
let iconWidth = 16.0
let titleWidth = 42.0
statusBtn.titleEdgeInsets = UIEdgeInsets(top: 0, left: -iconWidth, bottom: 0, right: iconWidth)
statusBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: titleWidth, bottom: 0, right: -titleWidth)
statusBtn.setImage(UIImage(named:"my_cer_arrow_right"), for:.normal)
statusBtn.setTitle("待上传", for:.normal)
statusBtn.setTitleColor(.blue, for:.normal)
whiteView.addSubview(statusBtn)
whiteView.snp.makeConstraints { make in whiteView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-20)
make.height.equalTo(55) make.top.bottom.equalToSuperview()
make.top.equalToSuperview().offset(15)
}
iconImgV.snp.makeConstraints { make in
make.width.height.equalTo(31)
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(6)
} }
nameLabel.snp.makeConstraints { make in nameTextView.snp.makeConstraints { make in
make.left.equalTo(iconImgV.snp.right).offset(18) make.left.equalToSuperview().offset(10)
make.height.equalTo(20) make.top.equalToSuperview().offset(4)
make.bottom.equalTo(whiteView.snp.centerY).offset(-1) make.right.equalTo(statusBtn.snp.left)
make.right.equalTo(editBtn.snp.left)
} }
timeLabel.snp.makeConstraints { make in infoLabel.snp.makeConstraints { make in
make.left.right.equalTo(nameLabel) make.left.equalToSuperview().offset(16)
make.top.equalTo(whiteView.snp.centerY).offset(1) make.right.equalTo(nameTextView)
make.top.equalTo(nameTextView.snp.bottom)
make.bottom.equalToSuperview().offset(-12)
make.height.equalTo(20) make.height.equalTo(20)
} }
editBtn.snp.makeConstraints { make in statusBtn.snp.makeConstraints { make in
make.width.height.equalTo(16) make.height.equalTo(60)
make.width.equalTo(92)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-6) make.right.equalToSuperview()
} }
} }
} }
//
// YHCertificateInfoCell.swift
// galaxy
//
// Created by edy on 2024/3/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateNameCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateNameCell"
var whiteView: UIView!
var iconImgV: UIImageView!
var nameLabel: UILabel!
var timeLabel: UILabel!
var editBtn: UIButton!
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
contentView.backgroundColor = .white
whiteView = UIView()
contentView.addSubview(whiteView)
iconImgV = UIImageView(image:UIImage(named:"my_cer_type_pdf"))
whiteView.addSubview(iconImgV)
nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_M(ofSize:14)
nameLabel.text = "文档名称.doc"
whiteView.addSubview(nameLabel)
timeLabel = UILabel()
timeLabel.textColor = UIColor.labelTextColor2
timeLabel.textAlignment = .left
timeLabel.font = UIFont.PFSC_R(ofSize:11)
timeLabel.text = "上传于2024.01.01"
whiteView.addSubview(timeLabel)
editBtn = UIButton()
editBtn.setImage(UIImage(named:"my_cer_btn_edit"), for:.normal)
whiteView.addSubview(editBtn)
whiteView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.height.equalTo(55)
make.top.equalToSuperview().offset(15)
}
iconImgV.snp.makeConstraints { make in
make.width.height.equalTo(31)
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(6)
}
nameLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgV.snp.right).offset(18)
make.height.equalTo(20)
make.bottom.equalTo(whiteView.snp.centerY).offset(-1)
make.right.equalTo(editBtn.snp.left)
}
timeLabel.snp.makeConstraints { make in
make.left.right.equalTo(nameLabel)
make.top.equalTo(whiteView.snp.centerY).offset(1)
make.height.equalTo(20)
}
editBtn.snp.makeConstraints { make in
make.width.height.equalTo(16)
make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-6)
}
}
}
//
// YHCertificateSearchBar.swift
// galaxy
//
// Created by edy on 2024/3/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateSearchBar: UIView {
static let height = 40.0
static let cancelBtnHeight = height-8.0
var textChange:((String?)->Void)?
var cancelBlock:(()->Void)?
var placeHolder:String? {
didSet {
if let placeholder = placeHolder {
textField.attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [NSAttributedString.Key.foregroundColor : UIColor.placeHolderColor])
}
}
}
private lazy var contentView = {
let view = UIView()
view.backgroundColor = .contentBkgColor
view.layer.cornerRadius = Self.height/2.0
view.clipsToBounds = true
return view
}()
lazy var textField:UITextField = {
let textField = UITextField()
textField.backgroundColor = .clear
textField.attributedPlaceholder = NSAttributedString(string: "请输入", attributes: [NSAttributedString.Key.foregroundColor : UIColor.placeHolderColor])
textField.font = UIFont.PFSC_M(ofSize: 12)
textField.tintColor = UIColor(hexString: "#3D88F8")
textField.textColor = UIColor.mainTextColor
textField.clearButtonMode = .whileEditing
textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged)
return textField
}()
lazy var cancelBtn: UIButton = {
let btn = UIButton()
btn.setTitle("取消".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString: "#3D88F8")
btn.layer.cornerRadius = Self.cancelBtnHeight/2.0
btn.addTarget(self, action: #selector(cancelBtnClicked), for: .touchUpInside)
return btn
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.createUI()
}
required init?(coder: NSCoder) {
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 cancelBtnClicked() {
if let cancelBlock = cancelBlock {
cancelBlock()
}
}
func createUI() {
self.backgroundColor = .white
contentView.addSubview(textField)
contentView.addSubview(cancelBtn)
self.addSubview(contentView)
contentView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
textField.snp.makeConstraints { make in
make.left.equalToSuperview().offset(Self.height/2.0)
make.right.equalTo(cancelBtn.snp.left).offset(-4)
make.centerY.equalToSuperview()
}
cancelBtn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: 66, height: Self.height-8.0))
make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-4)
}
}
@objc func textFieldChanged(textField:UITextField) {
if let textChange = textChange {
textChange(textField.text)
}
}
}
...@@ -70,8 +70,6 @@ class YHFileRenameInputView: UIView { ...@@ -70,8 +70,6 @@ class YHFileRenameInputView: UIView {
textField.font = UIFont.PFSC_M(ofSize: 16) textField.font = UIFont.PFSC_M(ofSize: 16)
textField.tintColor = UIColor.brandMainColor textField.tintColor = UIColor.brandMainColor
textField.textColor = UIColor.mainTextColor textField.textColor = UIColor.mainTextColor
// textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged)
// textField.addTarget(self, action: #selector(textFieldEditEnd(textField:)), for: .editingDidEnd)
return textField return textField
}() }()
......
...@@ -21,7 +21,7 @@ extension UIColor { ...@@ -21,7 +21,7 @@ extension UIColor {
static let brandMainColor16 : UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.16)! static let brandMainColor16 : UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.16)!
//品牌主色 8 //品牌主色 8
static let brandMainColor8: UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.16)! static let brandMainColor8: UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.08)!
//标题/主内容 //标题/主内容
static let mainTextColor : UIColor = UIColor(hexString: "#222222")! static let mainTextColor : UIColor = UIColor(hexString: "#222222")!
......
{
"images" : [
{
"filename" : "icon-展开.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"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