Commit 28455b36 authored by pete谢兆麟's avatar pete谢兆麟

Merge commit 'eee49ba7' into xiezhaolin

parents 8a2342c1 eee49ba7
This diff is collapsed.
......@@ -187,6 +187,11 @@ extension YHInformationPerfectListVC {
if success == true {
let model = self?.serviceCenterMainReqVM.allInfoScoreModel
YHSubmintAllInfoSuccessTipView.showCheckView(model: model) { agree in
//1、刷新当前界面
self?.loadData()
//2、跳转其他界面
if agree == true {
self?.goScoreVC()
}
......
......@@ -38,12 +38,13 @@ class YHContactMainItemStatusModel {
struct YHContactMainItemStatusModel2 : SmartCodable {
var fill_info_step : Int = 0
var fill_info_step : Int = 0 //我的信息 当前第几步
var supplement_not_submit_num : Int = 0 //资料上传 待上传的数量
var scheme_position_switch : Int = 0 //方案定位是否开启 0未开启 1开启
var my_signature : Bool = false //是否开启我的签字
var my_document : Bool = false //是否开启我的文书
}
struct YHContactInfoScoreModel : SmartCodable {
var sum_score : String = ""
var sum_score : String = ""
}
......@@ -17,8 +17,8 @@ class YHCollegeSearchViewController: YHBaseViewController {
var lastSearchTime:TimeInterval = 0.0
let educationRequest:YHEducationRequestViewModel = YHEducationRequestViewModel()
lazy var searchBar: YHSearchBar = {
let bar = YHSearchBar.createBar()
lazy var searchBar: YHCollegeSearchBar = {
let bar = YHCollegeSearchBar.createBar()
return bar
}()
......@@ -108,7 +108,7 @@ class YHCollegeSearchViewController: YHBaseViewController {
searchBar.snp.makeConstraints { make in
make.left.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)
}
......
//
// YHSearchBar.swift
// YHCollegeSearchBar.swift
// galaxy
//
// Created by edy on 2024/2/22.
......@@ -8,7 +8,7 @@
import UIKit
class YHSearchBar: UIView {
class YHCollegeSearchBar: UIView {
static let height = 40.0
static let confirmBtnHeight = height-8.0
......@@ -61,8 +61,8 @@ class YHSearchBar: UIView {
super.init(coder: coder)
}
static func createBar() -> YHSearchBar {
let view = YHSearchBar(frame: CGRect(x: 0, y: 0, width: KScreenWidth-32, height: height))
static func createBar() -> YHCollegeSearchBar {
let view = YHCollegeSearchBar(frame: CGRect(x: 0, y: 0, width: KScreenWidth-32, height: height))
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()
}
}
......@@ -7,10 +7,29 @@
//
import UIKit
import IQKeyboardManagerSwift
class YHUploadContentVC: YHBaseViewController {
var items:[String] = ["1", "2", "2", "2", "2", "2", "2", "2"]
var renameInputView: YHFileRenameInputView = {
let view = YHFileRenameInputView.inputView(defalutText:"adfasfsf", editBlock: {
text in
print("\(text)")
})
return view
}()
lazy var blackMaskView: UIView = {
let view = UIView(frame:UIScreen.main.bounds)
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismissed))
view.addGestureRecognizer(tap)
view.isHidden = true
return view
}()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
......@@ -25,7 +44,6 @@ class YHUploadContentVC: YHBaseViewController {
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateInfoCell.self, forCellReuseIdentifier: YHCertificateInfoCell.cellReuseIdentifier)
let size = headView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
let rect = CGRect(x: 0, y: 0, width: 0, height: size.height)
headView.frame = rect
......@@ -93,16 +111,29 @@ class YHUploadContentVC: YHBaseViewController {
super.viewDidLoad()
self.view.backgroundColor = .white
self.gk_navTitle = "上传内容"
addKeyBoardNotify()
createUI()
}
deinit {
removeNotify()
}
func createUI() {
view.addSubview(tableView)
view.addSubview(blackMaskView)
view.addSubview(renameInputView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.bottom.equalToSuperview().offset(-k_Height_safeAreaInsetsBottom())
}
renameInputView.snp.makeConstraints { make in
make.left.right.equalTo(view)
make.height.equalTo(YHFileRenameInputView.height)
make.bottom.equalToSuperview().offset(YHFileRenameInputView.height)
}
}
}
......@@ -179,5 +210,63 @@ extension YHUploadContentVC: UITableViewDelegate, UITableViewDataSource {
return view
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if true {
let items = [YHCertificateEditItem(type:.rename, title:"重命名"),
YHCertificateEditItem(type:.preview, title:"预览"),
YHCertificateEditItem(type:.delete, title:"删除"),
YHCertificateEditItem(type:.cancel, title:"取消")]
YHCertificateEditSheetView.sheetView(items:items) {
[weak self] editType in
guard let self = self else { return }
print("editType:\(editType.rawValue)")
if editType == .rename {
IQKeyboardManager.shared.enable = false
renameInputView.textField.becomeFirstResponder()
}
}.show()
return
}
}
@objc func dismissed() {
renameInputView.textField.resignFirstResponder()
}
}
extension YHUploadContentVC {
func addKeyBoardNotify() {
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification), name: UIResponder.keyboardWillHideNotification, object: nil)
}
func removeNotify() {
NotificationCenter.default.removeObserver(self)
}
@objc func handleKeyboardNotification(_ notification: Notification) {
if let userInfo = notification.userInfo {
guard let keyboardFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as AnyObject).cgRectValue else {return }
let isKeyboardShow = notification.name == UIResponder.keyboardWillShowNotification
self.blackMaskView.isHidden = !isKeyboardShow
let bottomMargin = (isKeyboardShow ? -keyboardFrame.height : YHFileRenameInputView.height)
if !isKeyboardShow {
IQKeyboardManager.shared.enable = true
}
self.renameInputView.snp.updateConstraints { make in
make.bottom.equalToSuperview().offset(bottomMargin)
}
self.view.setNeedsLayout()
self.view.layoutIfNeeded()
}
}
}
//
// YHCertificateActionSheetView.swift
// galaxy
//
// Created by edy on 2024/3/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
/*
【Usage】
let items = [YHCertificateEditItem(type:.rename, title:"重命名"),
YHCertificateEditItem(type:.preview, title:"预览"),
YHCertificateEditItem(type:.delete, title:"删除"),
YHCertificateEditItem(type:.cancel, title:"取消")]
YHCertificateEditSheetView.sheetView(items:items) {
[weak self] editType in
guard let self = self else { return }
print("editType:\(editType.rawValue)")
}.show()
*/
import UIKit
enum YHCertificateEditType:Int {
case rename = 1
case preview = 2
case delete = 3
case cancel = 4
}
class YHCertificateEditItem {
var type: YHCertificateEditType
var title: String
init(type:YHCertificateEditType, title: String) {
self.type = type
self.title = title
}
}
class YHCertificateEditItemView: UIView {
let item: YHCertificateEditItem
lazy var topLine:UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
label.font = UIFont.PFSC_M(ofSize:14)
return label
}()
init(item: YHCertificateEditItem) {
self.item = item
super.init(frame:CGRect(x: 0, y: 0, width: KScreenWidth, height: 52.0))
self.tag = item.type.rawValue
self.createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(titleLabel)
self.addSubview(topLine)
self.titleLabel.text = item.title
if self.item.type == .delete {
titleLabel.textColor = .failColor
} else if self.item.type == .cancel {
titleLabel.textColor = UIColor(hexString:"#909090")
} else {
titleLabel.textColor = .mainTextColor
}
titleLabel.snp.makeConstraints { make in
make.height.equalTo(20)
make.left.right.equalToSuperview()
make.centerY.equalToSuperview()
}
topLine.snp.makeConstraints { make in
make.left.equalToSuperview().offset(24)
make.right.equalToSuperview().offset(-24)
make.top.equalToSuperview()
make.height.equalTo(0.5)
}
}
}
class YHCertificateEditSheetView: UIView {
var items:[YHCertificateEditItem]
var action:((YHCertificateEditType)->())?
lazy var blackMaskView: UIView = {
let view = UIView(frame:UIScreen.main.bounds)
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismiss))
view.addGestureRecognizer(tap)
return view
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
label.font = UIFont.PFSC_B(ofSize:17)
label.text = "请选择操作"
return label
}()
lazy var closeBtn: UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named:"my_cer_sheet_close"), for: .normal)
btn.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return btn
}()
init(items:[YHCertificateEditItem]) {
self.items = items
super.init(frame:UIScreen.main.bounds)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
static func sheetView(items:[YHCertificateEditItem], action:((YHCertificateEditType)->())?) -> YHCertificateEditSheetView {
let view = YHCertificateEditSheetView(items:items)
view.action = action
return view
}
func createUI() {
self.addSubview(blackMaskView)
self.addSubview(whiteContentView)
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
let path = UIBezierPath(roundedRect:bounds,byRoundingCorners: corner,cornerRadii:CGSizeMake(16.0, 16.0));
let layer = CAShapeLayer();
layer.frame = whiteContentView.bounds;
layer.path = path.cgPath;
whiteContentView.layer.mask = layer;
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(closeBtn)
blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
whiteContentView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(52.0 + CGFloat(items.count) * 52.0 + k_Height_safeAreaInsetsBottom())
}
titleLabel.snp.makeConstraints { make in
make.height.equalTo(52)
make.left.right.top.equalToSuperview()
}
closeBtn.snp.makeConstraints { make in
make.centerY.equalTo(titleLabel)
make.right.equalToSuperview().offset(-20)
make.width.height.equalTo(24)
}
for (index, item) in items.enumerated() {
let itemView = YHCertificateEditItemView(item:item)
whiteContentView.addSubview(itemView)
let tap = UITapGestureRecognizer(target:self, action:#selector(action(_:)))
itemView.addGestureRecognizer(tap)
itemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(52.0)
make.top.equalTo(titleLabel.snp.bottom).offset(index * 52)
}
}
}
}
extension YHCertificateEditSheetView {
func show() {
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
@objc func dismiss() {
self.removeFromSuperview()
}
@objc func action(_ sender:UITapGestureRecognizer) {
if let targetView = sender.view {
let tag = targetView.tag
if let type = YHCertificateEditType(rawValue:tag), let action = action {
action(type)
dismiss()
}
}
}
}
......@@ -2,21 +2,33 @@
// YHCertificateInfoCell.swift
// 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.
//
import UIKit
import AttributedString
class YHCertificateInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateInfoCell"
static let cellReuseIdentifier = "YHCertificateNameCell"
var whiteView: UIView!
var iconImgV: UIImageView!
var nameLabel: UILabel!
var timeLabel: UILabel!
var editBtn: UIButton!
var nameTextView: UITextView!
var infoLabel: UILabel!
var statusBtn: 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) {
......@@ -31,62 +43,71 @@ class YHCertificateInfoCell: UITableViewCell {
func setupUI() {
self.selectionStyle = .none
contentView.backgroundColor = .white
contentView.backgroundColor = UIColor(hexString:"#F8F8F8")
whiteView = UIView()
whiteView.layer.cornerRadius = 6.0
whiteView.clipsToBounds = true
whiteView.backgroundColor = .white
contentView.addSubview(whiteView)
iconImgV = UIImageView(image:UIImage(named:"my_cer_type_pdf"))
whiteView.addSubview(iconImgV)
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)
nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_M(ofSize:14)
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
timeLabel.font = UIFont.PFSC_R(ofSize:11)
timeLabel.text = "上传于2024.01.01"
whiteView.addSubview(timeLabel)
infoLabel = UILabel()
infoLabel.textColor = UIColor.labelTextColor2
infoLabel.textAlignment = .left
infoLabel.font = UIFont.PFSC_R(ofSize:11)
infoLabel.text = "类型:证件资料 所属人:张康"
whiteView.addSubview(infoLabel)
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)
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)
make.top.bottom.equalToSuperview()
}
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)
nameTextView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(10)
make.top.equalToSuperview().offset(4)
make.right.equalTo(statusBtn.snp.left)
}
timeLabel.snp.makeConstraints { make in
make.left.right.equalTo(nameLabel)
make.top.equalTo(whiteView.snp.centerY).offset(1)
infoLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalTo(nameTextView)
make.top.equalTo(nameTextView.snp.bottom)
make.bottom.equalToSuperview().offset(-12)
make.height.equalTo(20)
}
editBtn.snp.makeConstraints { make in
make.width.height.equalTo(16)
statusBtn.snp.makeConstraints { make in
make.height.equalTo(60)
make.width.equalTo(92)
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)
}
}
}
......@@ -18,7 +18,7 @@
import UIKit
enum YHCertificateActionType: Int {
enum YHCertificateUploadType: Int {
case sample = 1
case camera = 2
......@@ -28,10 +28,10 @@ enum YHCertificateActionType: Int {
}
class YHCertificateUploadItem {
var type: YHCertificateActionType
var type: YHCertificateUploadType
var title: String
var subtitle: String
init(type:YHCertificateActionType, title: String, subtitle: String = "") {
init(type:YHCertificateUploadType, title: String, subtitle: String = "") {
self.type = type
self.title = title
self.subtitle = subtitle
......@@ -181,7 +181,7 @@ class YHCertificateUploadSheetView: UIView {
static let sheetView = YHCertificateUploadSheetView(frame:UIScreen.main.bounds)
var action:((YHCertificateActionType)->())?
var action:((YHCertificateUploadType)->())?
lazy var blackMaskView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
......@@ -253,7 +253,7 @@ class YHCertificateUploadSheetView: UIView {
lazy var templateView: YHCertificateSampleTemplateView = {
let view = YHCertificateSampleTemplateView(frame:CGRectZero)
view.tag = YHCertificateActionType.sample.rawValue
view.tag = YHCertificateUploadType.sample.rawValue
let tap = UITapGestureRecognizer(target:self, action:#selector(action(_:)))
view.addGestureRecognizer(tap)
return view
......@@ -331,7 +331,7 @@ class YHCertificateUploadSheetView: UIView {
extension YHCertificateUploadSheetView {
func show(_ action:((YHCertificateActionType)->())?) {
func show(_ action:((YHCertificateUploadType)->())?) {
self.action = action
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
......@@ -344,7 +344,7 @@ extension YHCertificateUploadSheetView {
if let targetView = sender.view {
let tag = targetView.tag
if let type = YHCertificateActionType(rawValue:tag), let action = action {
if let type = YHCertificateUploadType(rawValue:tag), let action = action {
action(type)
}
}
......
//
// YHFileRenameInputView.swift
// galaxy
//
// Created by edy on 2024/3/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
/*
【Usage】
let view = YHFileRenameInputView.inputView(defalutText:"adfasfsf", editBlock: {
text in
print("\(text)")
})
*/
import UIKit
class YHFileRenameInputView: UIView {
static let height = 217.0
var editBlock:((String?)->())?
lazy var blackMaskView: UIView = {
let view = UIView(frame:UIScreen.main.bounds)
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismiss))
view.addGestureRecognizer(tap)
return view
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
label.font = UIFont.PFSC_B(ofSize:17)
label.text = "请选择上传方式"
return label
}()
lazy var closeBtn: UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named:"my_cer_sheet_close"), for: .normal)
btn.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return btn
}()
lazy var topLine:UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var inputContentView: UIView = {
let view = UIView()
view.backgroundColor = .contentBkgColor
view.layer.cornerRadius = 6.0
view.clipsToBounds = true
return view
}()
lazy var textField:UITextField = {
let textField = UITextField()
textField.backgroundColor = .clear
textField.placeholder = "请输入文件名称"
textField.font = UIFont.PFSC_M(ofSize: 16)
textField.tintColor = UIColor.brandMainColor
textField.textColor = UIColor.mainTextColor
return textField
}()
lazy var cancelBtn:UIButton = {
let btn = UIButton()
btn.setTitle("取消", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
btn.setTitleColor(UIColor.mainTextColor, for: .normal)
btn.backgroundColor = .contentBkgColor
btn.layer.cornerRadius = 6.0
btn.addTarget(self, action: #selector(didClickCancelBtn), for: .touchUpInside)
return btn
}()
lazy var confirmBtn:UIButton = {
let btn = UIButton()
btn.setTitle("确定".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 6.0
btn.addTarget(self, action: #selector(didClickConfirmBtn), for: .touchUpInside)
return btn
}()
override init(frame: CGRect) {
super.init(frame:frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
static func inputView(defalutText:String?, editBlock:((String?)->())?)-> YHFileRenameInputView {
let view = YHFileRenameInputView(frame:CGRect(x: 0, y: 0, width:KScreenWidth, height:Self.height))
view.textField.text = defalutText
view.editBlock = editBlock
return view
}
func createUI() {
self.addSubview(whiteContentView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(closeBtn)
whiteContentView.addSubview(topLine)
whiteContentView.addSubview(inputContentView)
inputContentView.addSubview(textField)
whiteContentView.addSubview(cancelBtn)
whiteContentView.addSubview(confirmBtn)
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
let path = UIBezierPath(roundedRect:bounds,byRoundingCorners: corner,cornerRadii:CGSizeMake(16.0, 16.0));
let layer = CAShapeLayer();
layer.frame = whiteContentView.bounds;
layer.path = path.cgPath;
whiteContentView.layer.mask = layer;
whiteContentView.snp.makeConstraints { make in
make.left.right.top.bottom.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(52.0)
}
closeBtn.snp.makeConstraints { make in
make.width.height.equalTo(24.0)
make.right.equalToSuperview().offset(-20)
make.centerY.equalTo(titleLabel)
}
topLine.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(titleLabel.snp.bottom)
make.height.equalTo(1)
}
inputContentView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(topLine.snp.bottom).offset(20)
make.height.equalTo(48)
}
textField.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(20)
make.centerY.equalToSuperview()
}
cancelBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalTo(whiteContentView.snp.centerX).offset(-6)
make.top.equalTo(inputContentView.snp.bottom).offset(30)
make.height.equalTo(45)
}
confirmBtn.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.left.equalTo(whiteContentView.snp.centerX).offset(6)
make.top.equalTo(cancelBtn)
make.height.equalTo(45)
}
}
}
extension YHFileRenameInputView {
@objc func dismiss() {
self.textField.resignFirstResponder()
UIApplication.shared.yhKeyWindow()?.endEditing(true)
}
@objc func didClickCancelBtn() {
dismiss()
}
@objc func didClickConfirmBtn() {
dismiss()
if let editBlock = editBlock {
editBlock(textField.text)
}
}
}
......@@ -250,6 +250,9 @@ extension YHPreviewMainViewController : UITableViewDelegate,UITableViewDataSourc
let cell = UITableViewCell()
cellView.view.frame = CGRect(x: 0, y: 0, width: cell.contentView.bounds.size.width, height: myCellHeight)
cell.contentView.addSubview(cellView.view)
cellView.view.snp.makeConstraints { make in
make.edges.equalTo(0)
}
return cell
}
......
......@@ -229,8 +229,20 @@ private extension YHPreviewViewModel {
let tmp4 = YHPreviewQuestionAndAnswerModel(question: "用人单位官网:", answer: model.company_website.defaultStringIfEmpty())
var title = "-"
if let item = model.location {
title = item.country + "-" + item.details
// title = item.country + "-" + item.details
if item.country.contains("中国") {
title = "国内 "
if item.area.count > 1 {
title = title + item.area[0] + "/" + item.area[1]
}
} else {
title = "国外 " + item.country + "-" + item.foreign
}
}
let tmp5 = YHPreviewQuestionAndAnswerModel(question: "工作地点:", answer: title)
let tmp6 = YHPreviewQuestionAndAnswerModel(question: "职位:", answer: model.position)
let tmp7 = YHPreviewQuestionAndAnswerModel(question: "入职年月:", answer: model.entry_time)
......@@ -331,7 +343,7 @@ private extension YHPreviewViewModel {
title = title + item.area[0] + "/" + item.area[1]
}
} else {
title = "国外 " + item.country + item.foreign
title = "国外 " + item.country + "-" + item.foreign
}
} else {
title = "--"
......@@ -363,7 +375,7 @@ private extension YHPreviewViewModel {
title = title + item.area[0] + "/" + item.area[1]
}
} else {
title = "国外 " + item.country + item.foreign
title = "国外 " + item.country + "-" + item.foreign
}
} else {
title = "--"
......
......@@ -13,7 +13,8 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
var webview = WKWebView()
var progBar = UIProgressView()
var url = "https://www.baidu.com"
// var url = "https://www.baidu.com"
var url = "https://docs.qq.com/openapi/drive/v2/files/embed/temporary?timestamp=1710294842&id=50b4f6dab5df4497aeb23e5a54933d83&clientID=2aebc2da4f0b4883bf33ef20836f2e2d"
override func viewDidLoad() {
super.viewDidLoad()
......@@ -50,8 +51,9 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
webview.removeObserver(self, forKeyPath: "estimatedProgress")
}
// MARK: - WKNavigationDelegate
// MARK: - WKNavigationDelegate
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.navigationItem.title = webview.title
}
......
......@@ -8,6 +8,7 @@
import UIKit
import SnapKit
import NEConversationUIKit
import SafariServices
enum YHPersonalModuleItemType: Int {
case none = 0
......@@ -175,7 +176,29 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
} else {
YHHUD.flash(message: "已登录: 功能完善中...")
}
return //for test hjl
return
// let url = URL(string: "https://docs.qq.com/openapi/drive/v2/files/embed/temporary?timestamp=1710298232&id=6bcaa379b0e5488abbaff85d51ee2fab&clientID=2aebc2da4f0b4883bf33ef20836f2e2d")!
//
// let tmpVC = SFSafariViewController(url: url)
// navigationController?.pushViewController(tmpVC)
//
//
// return
// if indexPath.row == 0 {
//
//
// let vc = YHWebViewViewController()
// navigationController?.pushViewController(vc, animated: true)
// } else {
// let vc = YHWebViewViewController()
// navigationController?.pushViewController(vc, animated: true)
// }
//
// return
let item: PersonalModuleItem = items[indexPath.row];
......
......@@ -21,7 +21,7 @@ extension UIColor {
static let brandMainColor16 : UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.16)!
//品牌主色 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")!
......
{
"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