Commit 7625d09b 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:
  在港记录页面调整
  // 续签
  //  续签
  //  资料上传
parents 93d7c75b a3107efb
......@@ -172,6 +172,8 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
//我的续签方案
} else if tag == 3 {
//添加在港记录
let vc = YHHKImmigrationRecordsVC()
UIViewController.current?.navigationController?.pushViewController(vc)
} else if tag == 4 {
//续签证件管理
let vc = YHResignCertificateListViewController()
......
......@@ -476,7 +476,8 @@ extension YHCertificateUploadSheetView: (UIImagePickerControllerDelegate & UINav
if imageName.isEmpty {
let timestamp = Date().timeIntervalSince1970
imageName = "\(timestamp).jpg"
var timestampString = "\(timestamp)".replacingOccurrences(of: ".", with: "")
imageName = "\(timestampString).jpg"
}
let item = YHSelectImageItem(name: imageName, data: image)
......
......@@ -118,6 +118,7 @@ extension YHHKImmigrationRecordsVC {
make.top.equalTo(segmentedView.snp.bottom)
make.bottom.equalTo(bottomView.snp.top)
}
segmentedView.listContainer = listContainerView
}
@objc private func clickAddNewButton() {
......@@ -126,11 +127,17 @@ extension YHHKImmigrationRecordsVC {
}
extension YHHKImmigrationRecordsVC: JXSegmentedViewDelegate {
//
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
//先更新数据源的数据
// segmentedDataSource.dotStates[index] = false
//再调用reloadItem(at: index)
// segmentedView.reloadItem(at: index)
}
}
extension YHHKImmigrationRecordsVC: JXSegmentedListContainerViewDataSource
{
extension YHHKImmigrationRecordsVC: JXSegmentedListContainerViewDataSource {
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
return titleDataSource.dataSource.count
......
......@@ -11,6 +11,15 @@ import JXSegmentedView
class YHHKRecordsContentVC: YHBaseViewController {
enum RowType {
case customer(_ title: String, _ detail: String)
case info(_ title: String, _ detail: String, _ topMargin: CGFloat = 18, _ bottomMargin: CGFloat = 18)
case remark(_ title: String, _ detail: String)
case edit(_ title: String)
}
private var datas: [[RowType]] = []
private lazy var tableView: UITableView = {
let view = UITableView(frame:.zero, style:.grouped)
view.estimatedSectionHeaderHeight = 16.0
......@@ -25,16 +34,22 @@ class YHHKRecordsContentVC: YHBaseViewController {
view.backgroundColor = .clear
view.rowHeight = 52
view.tableFooterView = UITableViewHeaderFooterView()
view.register(YHResignDocumentHeaderCell.self, forCellReuseIdentifier: YHResignDocumentHeaderCell.cellReuseIdentifier)
view.register(YHResignDocumentContentCell.self, forCellReuseIdentifier: YHResignDocumentContentCell.cellReuseIdentifier)
view.register(YHHKRecordsCustomerItemCell.self, forCellReuseIdentifier: YHHKRecordsCustomerItemCell.cellReuseIdentifier)
view.register(YHHKRecordsInfoItemCell.self, forCellReuseIdentifier: YHHKRecordsInfoItemCell.cellReuseIdentifier)
view.register(YHHKRecordsRemarkCell.self, forCellReuseIdentifier: YHHKRecordsRemarkCell.cellReuseIdentifier)
view.register(YHHKRecordsEditButtonCell.self, forCellReuseIdentifier: YHHKRecordsEditButtonCell.cellReuseIdentifier)
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
setupData()
}
}
extension YHHKRecordsContentVC {
......@@ -50,6 +65,11 @@ extension YHHKRecordsContentVC {
}
tableView.tableFooterView = UIView(frame: CGRect.init(x: 0, y: 0, width: KScreenWidth, height: kMargin))
}
private func setupData() {
datas = [[.customer("客户", "2023-12-13 12:00:00"), .info("逗留人员:", "张三丰、章一刀", 18, 9), .info("出入境时间:", "2023-10-04 ~ 2023-12-04", 9, 2), .remark("备注:", "这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息这里是备注信息"), .edit("编辑")], [.customer("客户", "2023-12-13 12:00:00"), .info("逗留人员:", "张三丰、章一刀", 18, 9), .info("出入境时间:", "2023-10-04 ~ 2023-12-04", 9, 18), .edit("编辑")]]
tableView.reloadData()
}
}
extension YHHKRecordsContentVC: JXSegmentedListContainerViewListDelegate {
......@@ -60,19 +80,85 @@ extension YHHKRecordsContentVC: JXSegmentedListContainerViewListDelegate {
extension YHHKRecordsContentVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
0
return datas.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
0
guard datas.count > section else {
return 0
}
let sectionArr = datas[section]
return sectionArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard datas.count > indexPath.section else {
return UITableViewCell()
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return UITableViewCell()
}
let row = sectionArr[indexPath.row]
switch row {
case let .customer(title, detail):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHHKRecordsCustomerItemCell.cellReuseIdentifier) as? YHHKRecordsCustomerItemCell {
cell.setupCellInfo(title: title, detail: detail)
return cell
}
case let .info(title, detail, top, bottom):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHHKRecordsInfoItemCell.cellReuseIdentifier) as? YHHKRecordsInfoItemCell {
cell.setupCellInfo(title: title, detail: detail, topMargin: top, bottomMargin: bottom)
return cell
}
case let .remark(title, detail):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHHKRecordsRemarkCell.cellReuseIdentifier) as? YHHKRecordsRemarkCell {
cell.setupCellInfo(title: title, detail: detail)
return cell
}
case let .edit(title):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHHKRecordsEditButtonCell.cellReuseIdentifier) as? YHHKRecordsEditButtonCell {
cell.setupCellInfo(title: title)
return cell
}
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
//
guard datas.count > indexPath.section else {
return
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return
}
let row = sectionArr[indexPath.row]
if case .edit = row {
let vc = YHHKRecordsEditContentVC()
navigationController?.pushViewController(vc)
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
guard datas.count > indexPath.section else {
return 0
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return 0
}
let row = sectionArr[indexPath.row]
switch row {
case .customer:
return 52
case .info:
return UITableView.automaticDimension
case .remark:
return 146
case .edit:
return 52
}
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
......
......@@ -15,7 +15,7 @@ class YHHKRecordsEditButtonCell: YHResignDocumentCell {
private lazy var centerLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 14)
label.textColor = UIColor(hexString: "#222222")
label.textColor = .brandMainColor
return label
}()
......
......@@ -27,12 +27,10 @@ class YHHKRecordsRemarkCell: YHResignDocumentCell {
view.textColor = .mainTextColor
view.tintColor = .mainTextColor
view.backgroundColor = .contentBkgColor
view.font = UIFont.systemFont(ofSize: 14)
view.returnKeyType = .default
view.enablesReturnKeyAutomatically = true
view.delegate = self
view.addObserver(self, forKeyPath: "attributedText", options: .new, context: nil)
view.textContainerInset = UIEdgeInsets.zero
view.textContainerInset = UIEdgeInsets(top: 10, left: 12, bottom: 10, right: 12)
view.textContainer.lineFragmentPadding = 0
return view
}()
......@@ -77,8 +75,8 @@ extension YHHKRecordsRemarkCell {
}
remarkTextView.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(18)
make.height.equalTo(88)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(86)
make.top.equalTo(infoTitleLabel.snp.bottom).offset(8)
make.bottom.equalToSuperview().offset(-16)
}
......
......@@ -219,6 +219,7 @@ extension YHResignDocumentDetailViewController {
let url = signatureModel.url
// 跳签字
let vc = YHSignatureWebViewController()
vc.titleName = self.name
vc.realNameUrl = url
self.navigationController?.pushViewController(vc)
}
......
......@@ -11,7 +11,7 @@ import UIKit
class YHSignatureWebViewController: YHBaseViewController {
var realNameUrl: String = ""
var titleName: String = ""
lazy var webView: WKWebView = {
let webView = WKWebView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: KScreenWidth, height: KScreenHeight-k_Height_NavigationtBarAndStatuBar), configuration: self.configuaration)
webView.navigationDelegate = self
......@@ -52,7 +52,7 @@ class YHSignatureWebViewController: YHBaseViewController {
}
func createUI() {
gk_navTitle = titleName
webView.addSubview(progressBar)
self.view.addSubview(webView)
// 监听网页加载的进度
......@@ -106,18 +106,18 @@ extension YHSignatureWebViewController : WKNavigationDelegate {
// 开始加载
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
YHHUD.flash(message: "开始加载")
// YHHUD.flash(message: "开始加载")
}
// 加载完成
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
YHHUD.flash(message: "加载完成")
// YHHUD.flash(message: "加载完成")
}
func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
YHHUD.flash(message: "加载失败: \(error.localizedDescription)")
// YHHUD.flash(message: "加载失败: \(error.localizedDescription)")
}
......
......@@ -425,7 +425,7 @@ extension YHResignMaterialUploadVC: UITableViewDelegate, UITableViewDataSource {
make.bottom.equalToSuperview().offset(-15)
}
if self.materialModel.status == YHMaterialStatus.rejected.rawValue {
if self.materialModel.status != YHMaterialStatus.rejected.rawValue {
return view
}
......
......@@ -103,7 +103,9 @@ class YHResignMaterialCell: UITableViewCell {
var result:ASAttributedString = .init(string:"", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.failColor))
let name = model.name
var name = model.name.trimmingCharacters(in: .whitespaces)
name = name.replacingOccurrences(of: "\n", with: "")
name = name.replacingOccurrences(of: "\r", with: "")
let cerName: ASAttributedString = .init(string:name , .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
let template: ASAttributedString = " \(.view(templateButton, .original(.center)))"
......@@ -114,7 +116,7 @@ class YHResignMaterialCell: UITableViewCell {
result += cerName
// 是否展示右边的模版按钮
var showTemplateBtn = true
let showTemplateBtn = true
if showTemplateBtn {
result += template
}
......@@ -163,7 +165,7 @@ class YHResignMaterialCell: UITableViewCell {
nameTextView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.top.equalToSuperview().offset(12)
make.right.equalTo(statusLabel.snp.left).offset(-14)
make.right.equalTo(statusLabel.snp.left).offset(-4)
make.bottom.equalTo(-12)
}
......
......@@ -271,8 +271,7 @@ class YHResignMaterialViewModel: YHBaseViewModel {
// 再调用业务接口
if let successUrl = successUrl, !successUrl.isEmpty {
let fileName = successUrl.lastPathComponent
let suffixName = successUrl.pathExtension.lowercased()
let fileName = fileUrl.absoluteString.lastPathComponent
let model = YHMaterialModelItemModel()
model.url = successUrl
......@@ -381,7 +380,7 @@ class YHResignMaterialViewModel: YHBaseViewModel {
model.url = url
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "YYYY-MM-dd"
dateFormatter.dateFormat = "YYYY-MM-dd HH:mm:ss"
let dateString = dateFormatter.string(from: Date())
model.updated_at = dateString
callBack?(true, model)
......
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