Commit 03e70528 authored by David黄金龙's avatar David黄金龙

Merge commit '8e0d1f12' into davidhuang

* commit '8e0d1f12':
  // 证书
parents 20a64040 8e0d1f12
...@@ -127,7 +127,7 @@ extension AppDelegate { ...@@ -127,7 +127,7 @@ extension AppDelegate {
//4. //4.
IQKeyboardManager.shared.enable = true IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = false IQKeyboardManager.shared.enableAutoToolbar = true
IQKeyboardManager.shared.resignOnTouchOutside = true // 控制点击背景是否收起键盘 IQKeyboardManager.shared.resignOnTouchOutside = true // 控制点击背景是否收起键盘
} }
} }
......
...@@ -247,6 +247,25 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -247,6 +247,25 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if !(0..<items.count).contains(indexPath.section) { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if !(0..<arr.count).contains(indexPath.row) { return }
let item = arr[indexPath.row]
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .certificateValidDate ||
detailItem.type == .certificateSignDate { // 届满日期 签发日期
self.view?.endEditing(true)
YHDatePickView.show(type: .yyyymmdd) { date in
let dataArr = date.components(separatedBy: YHDatePickView.separator)
print(date)
}
}
return
}
} }
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) { func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
......
...@@ -23,6 +23,7 @@ class YHCertificateViewController: YHBaseViewController { ...@@ -23,6 +23,7 @@ class YHCertificateViewController: YHBaseViewController {
if #available(iOS 11.0, *) { if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never tableView.contentInsetAdjustmentBehavior = .never
} }
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.separatorStyle = .none tableView.separatorStyle = .none
...@@ -73,7 +74,9 @@ class YHCertificateViewController: YHBaseViewController { ...@@ -73,7 +74,9 @@ class YHCertificateViewController: YHBaseViewController {
let item12 = YHFormDetailItem(type: .certificateSignPlace) let item12 = YHFormDetailItem(type: .certificateSignPlace)
let item13 = YHFormDetailItem(type: .certificateSignDate) let item13 = YHFormDetailItem(type: .certificateSignDate)
let item14 = YHFormDetailItem(type: .certificateValidDate) let item14 = YHFormDetailItem(type: .certificateValidDate)
let arr1:[YHFormItemProtocol] = [title1, item10, item11, item12, item13, item14] let item15 = YHFormDetailItem(type: .certificateSignPlace)
let arr1:[YHFormItemProtocol] = [title1, item10, item11, item12, item13, item14, item15]
items.append(contentsOf: [arr0, arr1]) items.append(contentsOf: [arr0, arr1])
tableView.reloadData() tableView.reloadData()
...@@ -187,10 +190,9 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour ...@@ -187,10 +190,9 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section >= items.count { return } if !(0..<items.count).contains(indexPath.section) { return }
let arr:[YHFormItemProtocol] = items[indexPath.section] let arr:[YHFormItemProtocol] = items[indexPath.section]
if !(0..<arr.count).contains(indexPath.row) { return }
if indexPath.row >= arr.count || indexPath.row < 0 { return }
let item = arr[indexPath.row] let item = arr[indexPath.row]
if item is YHFormTitleItem { if item is YHFormTitleItem {
...@@ -201,10 +203,11 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour ...@@ -201,10 +203,11 @@ extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSour
if detailItem.type == .certificateValidDate || if detailItem.type == .certificateValidDate ||
detailItem.type == .certificateSignDate { // 届满日期 签发日期 detailItem.type == .certificateSignDate { // 届满日期 签发日期
self.view?.endEditing(true)
YHDatePickView.show(type: .yyyymmdd) { date in YHDatePickView.show(type: .yyyymmdd) { date in
let arr = date.components(separatedBy: YHDatePickView.separator) let dataArr = date.components(separatedBy: YHDatePickView.separator)
// [yyyy, mm, dd] eg ["2024", "01", "20"] print(dataArr)
print(date)
} }
} }
return return
......
...@@ -36,8 +36,6 @@ class YHChildBasicInfoVC: YHBaseViewController { ...@@ -36,8 +36,6 @@ class YHChildBasicInfoVC: YHBaseViewController {
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier) tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier) tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
tableView.register(YHFormItemDegreeInfoCell.self, forCellReuseIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier) tableView.register(YHFormItemDegreeInfoCell.self, forCellReuseIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier)
return tableView return tableView
}() }()
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
// //
import UIKit import UIKit
import IQKeyboardManagerSwift
enum YHFormTitleItemEditType:Int { enum YHFormTitleItemEditType:Int {
case none = 1 case none = 1
......
...@@ -177,6 +177,7 @@ class YHDatePickView: UIView { ...@@ -177,6 +177,7 @@ class YHDatePickView: UIView {
removeFromSuperview() removeFromSuperview()
} }
@objc func sure() { @objc func sure() {
guard let type = type else { return } guard let type = type else { return }
var date = "" var date = ""
...@@ -191,6 +192,7 @@ class YHDatePickView: UIView { ...@@ -191,6 +192,7 @@ class YHDatePickView: UIView {
if self.backDate != nil { if self.backDate != nil {
self.backDate!(date) self.backDate!(date)
} }
dismiss()
} }
} }
......
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