Commit 992c5094 authored by Steven杜宇's avatar Steven杜宇

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

parents c8cd1043 df0e361f
This diff is collapsed.
......@@ -23,8 +23,8 @@ class YHBannerModel: SmartCodable {
var isLocalItemFlag : Bool = false
//分享相关参数
var isShareH5Flag : Bool = false
var addtitionParam: YHBannerAdditionModel?
var is_share_h5_flag : Bool = false
var addtition_param : YHBannerAdditionModel?
required init() {
}
......@@ -41,9 +41,9 @@ class YHBannerModel: SmartCodable {
class YHBannerAdditionModel : SmartCodable {
var shareH5Title : String = ""
var shareH5Describe : String = ""
var shareH5Url:String = ""
var ShareH5Title : String = ""
var ShareH5Describe : String = ""
var ShareH5Url:String = ""
required init() {
}
......
......@@ -152,13 +152,13 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
vc.url = url
vc.isFullScreenFlag = false
if model.isShareH5Flag {
if let tModel = model.addtitionParam {
if !tModel.shareH5Url.isEmpty {
if model.is_share_h5_flag {
if let tModel = model.addtition_param {
if !tModel.ShareH5Url.isEmpty {
vc.isShowRightShareItemFlag = true
vc.shareH5Title = tModel.shareH5Title
vc.shareH5Describe = tModel.shareH5Describe
vc.shareUrlFromOutside = tModel.shareH5Title
vc.shareH5Title = tModel.ShareH5Title
vc.shareH5Describe = tModel.ShareH5Describe
vc.shareUrlFromOutside = tModel.ShareH5Url
}
}
}
......
......@@ -185,7 +185,7 @@ extension YHHomePageViewModel {
// type: 0 APP首页 1 香港身份 2香港生活
func getHomeBanner(_ type: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let params: [String : Any] = ["type": type]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.banner
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.bannerApi
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
guard let self = self else { return }
//1. json字符串 转 对象
......
......@@ -238,7 +238,10 @@ extension YHServiceCenterViewController {
}
@objc func pushOrderView() {
// let vc = YHResignUploadTravelHKViewController()
// self.navigationController?.pushViewController(vc)
//
// return
var flag = true
if self.state == 1 || self.state == 3 {
flag = false
......
......@@ -194,6 +194,24 @@ class YHServiceOrderListView: YHBaseViewController {
//续签文书管理
let vc = YHResignDocumentManagementVC(orderId: orderId, id: stepId)
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 33 {
//续签信息确认
} else if type == 34 {
//在港递交预约
} else if type == 35 {
//查看续签结果
} else if type == 36 {
//续签补件
} else if type == 37 {
//在港签证缴费
} else if type == 38 {
//上传旅行证件
}
}
}
......@@ -377,7 +395,7 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
let arr = self.arrDataForSeviceCenterProgress
if 0 <= indexPath.row, indexPath.row < arr.count {
let model = arr[indexPath.row]
if model.type == 27 || model.type == 32 || model.type == 31 {
if model.type == 27 || model.type == 32 || model.type == 31 || model.type == 34 {
return 162
}
return 144
......
......@@ -28,6 +28,7 @@ class YHHKVisaRenewalPaymentVC: YHBaseViewController {
return view
}()
private var didShowGuideVC = false
private let orderId: Int
init(orderId: Int) {
......@@ -43,7 +44,17 @@ class YHHKVisaRenewalPaymentVC: YHBaseViewController {
super.viewDidLoad()
setupUI()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if !didShowGuideVC {
didShowGuideVC = true
let didShowGuide = YHVisaRenewalGuideVC.didShowGuide
if !didShowGuide {
showGuideVC()
}
}
}
}
extension YHHKVisaRenewalPaymentVC {
......@@ -69,6 +80,28 @@ extension YHHKVisaRenewalPaymentVC {
tableView.tableHeaderView = UIView(frame: CGRect.init(x: 0, y: 0, width: KScreenWidth, height: kMargin))
tableView.tableFooterView = UIView(frame: CGRect.init(x: 0, y: 0, width: KScreenWidth, height: kMargin))
}
private func showGuideVC() {
let vc = YHVisaRenewalGuideVC()
let pc = YHBottomPresentationController(presentedViewController: vc, presenting: self)
pc.customRadius = 16.0
vc.transitioningDelegate = pc
vc.sureButtonEvent = { [weak vc] in
vc?.dismiss(animated: true)
}
present(vc, animated: true, completion: nil)
}
private func showTroubleshootingGuideVC() {
let vc = YHVisaRenewalTroubleshootingGuideVC()
let pc = YHBottomPresentationController(presentedViewController: vc, presenting: self)
pc.customRadius = 16.0
vc.transitioningDelegate = pc
vc.sureButtonEvent = { [weak vc] in
vc?.dismiss(animated: true)
}
present(vc, animated: true, completion: nil)
}
}
extension YHHKVisaRenewalPaymentVC: UITableViewDelegate, UITableViewDataSource {
......
//
// YHVisaRenewalTroubleshootingGuideVC.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHVisaRenewalTroubleshootingGuideVC: YHBaseViewController {
enum TableRow {
case header
case tips(_ title: String, _ detail: ASAttributedString)
case workflow(_ title: String, _ workflows: [String])
}
private lazy var tableView: UITableView = {
let view = UITableView(frame: .zero, style: .plain)
view.backgroundColor = .clear
view.separatorStyle = .none
view.rowHeight = UITableView.automaticDimension
view.estimatedRowHeight = 52.0
view.dataSource = self
view.delegate = self
view.showsVerticalScrollIndicator = false
view.register(YHVisaRenewalTroubleshootingGuideHeaderCell.self, forCellReuseIdentifier: YHVisaRenewalTroubleshootingGuideHeaderCell.cellReuseIdentifier)
view.register(YHVisaRenewalWorkflowCell.self, forCellReuseIdentifier: YHVisaRenewalWorkflowCell.cellReuseIdentifier)
view.register(YHVisaRenewalGuideTipsCell.self, forCellReuseIdentifier: YHVisaRenewalGuideTipsCell.cellReuseIdentifier)
return view
}()
private lazy var sureButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.setTitle("我知道了", for: .normal)
button.setTitle("我知道了", for: .highlighted)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .highlighted)
button.setTitleColor( UIColor(hex:0xffffff), for: .disabled)
button.addTarget(self, action: #selector(clickSureButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
return button
}()
private lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
var sureButtonEvent: (() -> Void)?
private lazy var datas: [TableRow] = []
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
setupDatas()
}
}
extension YHVisaRenewalTroubleshootingGuideVC {
@objc private func clickSureButton() {
sureButtonEvent?()
}
private func setupUI() {
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
view.backgroundColor = UIColor.white
view.addSubview(tableView)
view.addSubview(bottomView)
bottomView.addSubview(sureButton)
bottomView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.right.equalToSuperview()
make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
make.height.equalTo(64)
}
sureButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(kMargin)
make.right.equalToSuperview().offset(-kMargin)
make.centerY.equalToSuperview()
make.height.equalTo(48)
}
tableView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.top.equalToSuperview()
make.bottom.equalTo(bottomView.snp.top)
}
tableView.tableFooterView = UIView(frame: CGRect.init(x: 0, y: 0, width: KScreenWidth, height: 24))
preferredContentSize = CGSize(width: KScreenWidth, height: KScreenHeight - k_Height_NavigationtBarAndStatuBar)
}
private func setupDatas() {
datas.append(.header)
let firstAtt: ASAttributedString = .init(string: "将军澳出入境大厅(将军澳宝邑路61号,港铁将军澳B出口,或调景岭A2出口)", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor.mainTextColor70), .paragraph(.lineHeightMultiple(1.07)))
datas.append(.tips("办理地址:", firstAtt))
let secAtt: ASAttributedString = .init(string: "有效旅行证件原件、香港身份证原件、获批函", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor.mainTextColor70), .paragraph(.lineHeightMultiple(1.07)))
datas.append(.tips("携带资料:", secAtt))
datas.append(.workflow("操作流程:", ["将军澳出入境6楼接待窗口取号", "等待叫号,告知主任需要缴费查看签证,等待主任核实", "若核实是以访客身份入境,现场写一份声明解释为何没有及时回港", "等待重发,预计3-6周,重发期间可以先离开香港", "重发后再持有效申请旅行证件入境香港后线上缴费"]))
let fourthAtt: ASAttributedString = .init(string: "1、可尝试现场和主任说明为何不能长期待在香港的原因,争取能够直接签证缴费,比如两地都有业务需要自己处理\n\n2、如验证码失效、网页加载无法接入确认缴费页面,请退出后检查网络后重新操作\n\n3、如缴费提示正在有一笔付款进行中要隔1个小时后再重新进到网页操作", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor.mainTextColor70), .paragraph(.lineHeightMultiple(1.07)))
datas.append(.tips("注意事项:", fourthAtt))
tableView.reloadData()
}
}
extension YHVisaRenewalTroubleshootingGuideVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return datas.count > 0 ? 1 : 0
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return datas.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard datas.count > indexPath.row else {
return UITableViewCell()
}
let tableRow = datas[indexPath.row]
switch tableRow {
case .header:
if let cell = tableView.dequeueReusableCell(withIdentifier: YHVisaRenewalTroubleshootingGuideHeaderCell.cellReuseIdentifier) as? YHVisaRenewalTroubleshootingGuideHeaderCell {
return cell
}
case let .tips(title, detail):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHVisaRenewalGuideTipsCell.cellReuseIdentifier) as? YHVisaRenewalGuideTipsCell {
cell.setupCellInfo(title: title, detail: detail)
return cell
}
case let .workflow(title, workflows):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHVisaRenewalWorkflowCell.cellReuseIdentifier) as? YHVisaRenewalWorkflowCell {
cell.setupCellInfo(title: title, workflows: workflows)
return cell
}
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
}
......@@ -12,11 +12,13 @@ class YHDashLineView: UIView {
private var strokeColor: CGColor = UIColor(hex: 0x121A26, alpha: 0.12).cgColor
private var lineWidth: CGFloat = 1
private var lineDashPattern: [NSNumber] = [2, 2]
private var isHorizontal: Bool = true
init(strokeColor: CGColor = UIColor(hex: 0x121A26, alpha: 0.12).cgColor, lineWidth: CGFloat = 1, lineDashPattern: [NSNumber] = [2, 2]) {
init(strokeColor: CGColor = UIColor(hex: 0x121A26, alpha: 0.12).cgColor, lineWidth: CGFloat = 1, lineDashPattern: [NSNumber] = [2, 2], isHorizontal: Bool = true) {
self.strokeColor = strokeColor
self.lineWidth = lineWidth
self.lineDashPattern = lineDashPattern
self.isHorizontal = isHorizontal
super.init(frame: CGRect.zero)
}
......@@ -36,9 +38,13 @@ class YHDashLineView: UIView {
shapeLayer.lineDashPattern = lineDashPattern // 实线长度,间隔长度
let path = CGMutablePath()
path.move(to: CGPoint(x: 0, y: bounds.midY))
path.addLine(to: CGPoint(x: bounds.width, y: bounds.midY))
if isHorizontal {
path.move(to: CGPoint(x: 0, y: bounds.midY))
path.addLine(to: CGPoint(x: bounds.width, y: bounds.midY))
} else {
path.move(to: CGPoint(x: bounds.midX, y: 0)) // 从顶部中间开始
path.addLine(to: CGPoint(x: bounds.midX, y: bounds.height)) // 到底部中间结束
}
shapeLayer.path = path
layer.addSublayer(shapeLayer)
}
......
......@@ -144,10 +144,11 @@ extension YHHKVisaRenewalPaymentStepView {
private func getStepLabel(_ title: String) -> UILabel {
let label = UILabel()
label.font = UIFont(name: "DIN Alternate Bold", size: 12)
label.textColor = .mainTextColor70
label.backgroundColor = UIColor(hex: 0xf4f6fa)
label.textColor = .brandMainColor
label.layer.cornerRadius = stepLabelHeight / 2.0
label.clipsToBounds = true
label.layer.borderWidth = 1
label.layer.borderColor = UIColor.brandMainColor16.cgColor
label.text = title
label.textAlignment = .center
return label
......@@ -156,13 +157,13 @@ extension YHHKVisaRenewalPaymentStepView {
private func getStepNameLabel(_ title: String) -> UILabel {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .mainTextColor70
label.textColor = .mainTextColor
label.text = title
return label
}
private func getDashLineView() -> YHDashLineView {
let view = YHDashLineView(strokeColor: UIColor(hex: 0x121A26, alpha: 0.12).cgColor, lineWidth: 1, lineDashPattern: [2, 2])
let view = YHDashLineView(strokeColor: UIColor.brandMainColor16.cgColor, lineWidth: 1, lineDashPattern: [2, 2])
return view
}
}
//
// YHVisaRenewalGuideIndentCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalGuideIndentCell: UITableViewCell {
static let cellReuseIdentifier = "YHVisaRenewalGuideIndentCell"
private let infoTitleLabelHorizontalOffset: CGFloat = 5
private let infoTitleLabelToDetail: CGFloat = 4
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 2, corner: .allCorners)
view.backgroundColor = UIColor(hex: 0xF4F6FA)
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.textAlignment = .center
label.font = .PFSC_M(ofSize: 13)
label.textColor = .brandMainColor
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 13)
label.textColor = .mainTextColor70
label.numberOfLines = 0
return label
}()
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")
}
func setupCellInfo(title: String, detail: String) {
infoTitleLabel.text = title
infoTitleLabel.sizeToFit()
subContainerView.sizeToFit()
let paragraphStyle = NSMutableParagraphStyle()
// 设置首行缩进量,单位为points
paragraphStyle.firstLineHeadIndent = infoTitleLabel.bounds.size.width + infoTitleLabelHorizontalOffset * 2 + infoTitleLabelToDetail
paragraphStyle.headIndent = 0
paragraphStyle.lineHeightMultiple = 1.07
let attributedText = NSAttributedString(
string: detail,
attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle]
)
infoDetailLabel.attributedText = attributedText
}
}
extension YHVisaRenewalGuideIndentCell {
private func setupUI() {
selectionStyle = .none
contentView.addSubview(subContainerView)
subContainerView.addSubview(infoTitleLabel)
contentView.addSubview(infoDetailLabel)
subContainerView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.left.equalToSuperview().offset(20)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(infoTitleLabelHorizontalOffset)
make.right.equalToSuperview().offset(-infoTitleLabelHorizontalOffset)
make.top.bottom.equalToSuperview()
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalTo(subContainerView)
make.left.equalTo(subContainerView)
make.right.lessThanOrEqualToSuperview().offset(-20)
make.bottom.equalToSuperview()
}
}
}
//
// YHVisaRenewalGuideParagraphCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalGuideParagraphCell: UITableViewCell {
static let cellReuseIdentifier = "YHVisaRenewalGuideParagraphCell"
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_B(ofSize: 16)
label.textColor = .mainTextColor
label.numberOfLines = 0
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = .mainTextColor70
label.numberOfLines = 0
return label
}()
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")
}
func setupCellInfo(title: String, detail: String) {
infoTitleLabel.text = title
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.07
let attributedText = NSAttributedString(
string: detail,
attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle]
)
infoDetailLabel.attributedText = attributedText
}
}
extension YHVisaRenewalGuideParagraphCell {
private func setupUI() {
selectionStyle = .none
contentView.addSubview(infoTitleLabel)
contentView.addSubview(infoDetailLabel)
infoTitleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.left.equalToSuperview().offset(20)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalTo(infoTitleLabel.snp.bottom).offset(20)
make.left.equalTo(infoTitleLabel)
make.right.lessThanOrEqualToSuperview().offset(-20)
make.bottom.equalToSuperview()
}
}
}
//
// YHVisaRenewalGuideRemarkCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalGuideRemarkCell: UITableViewCell {
static let cellReuseIdentifier = "YHVisaRenewalGuideRemarkCell"
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = .mainTextColor70
label.numberOfLines = 0
return label
}()
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")
}
func setupCellInfo(detail: String) {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.07
let attributedText = NSAttributedString(
string: detail,
attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle]
)
infoDetailLabel.attributedText = attributedText
}
}
extension YHVisaRenewalGuideRemarkCell {
private func setupUI() {
selectionStyle = .none
contentView.addSubview(infoDetailLabel)
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(12)
make.left.equalToSuperview().offset(20)
make.right.lessThanOrEqualToSuperview().offset(-20)
make.bottom.equalToSuperview()
}
}
}
//
// YHVisaRenewalGuideTipsCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHVisaRenewalGuideTipsCell: UITableViewCell {
static let cellReuseIdentifier = "YHVisaRenewalGuideTipsCell"
private lazy var iconView: UIView = {
let view = UIView()
view.backgroundColor = .brandMainColor
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_B(ofSize: 14)
label.textColor = .mainTextColor
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 13)
label.textColor = .mainTextColor70
label.numberOfLines = 0
return label
}()
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 6, corner: .allCorners)
view.backgroundColor = .contentBkgColor
return view
}()
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")
}
func setupCellInfo(title: String, detail: ASAttributedString) {
infoTitleLabel.text = title
infoDetailLabel.attributed.text = detail
}
}
extension YHVisaRenewalGuideTipsCell {
private func setupUI() {
selectionStyle = .none
contentView.addSubview(subContainerView)
subContainerView.addSubview(iconView)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.setContentHuggingPriority(.defaultLow, for: .vertical)
subContainerView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.bottom.equalToSuperview()
}
iconView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(18)
make.left.equalToSuperview()
make.width.equalTo(4)
make.height.equalTo(14)
}
infoTitleLabel.snp.makeConstraints { make in
make.centerY.equalTo(iconView)
make.left.equalTo(iconView.snp.right).offset(12)
make.right.lessThanOrEqualToSuperview().offset(-16)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalTo(infoTitleLabel.snp.bottom).offset(12)
make.left.equalTo(infoTitleLabel)
make.right.lessThanOrEqualToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-16)
}
}
}
//
// YHVisaRenewalTroubleshootingGuideHeaderCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalTroubleshootingGuideHeaderCell: UITableViewCell {
static let cellReuseIdentifier = "YHVisaRenewalTroubleshootingGuideHeaderCell"
private lazy var infoTitleIcon: UIImageView = {
let view = UIImageView()
view.contentMode = .scaleAspectFit
view.image = UIImage(named: "resign_visa_guide_error_title")
return view
}()
private lazy var bgIcon: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "resign_visa_guide_bg")
return view
}()
private lazy var paragraphDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = .mainTextColor70
label.numberOfLines = 0
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.07
let attributedText = NSAttributedString(
string: "如缴费页面最终出现“不符合使用網上付款服務的资格”字样,请亲自前往将军澳入境处人工处理,以下是办理指引:",
attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle]
)
label.attributedText = attributedText
return label
}()
private lazy var errorIcon: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "resign_visa_guide_error_content")
return view
}()
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 YHVisaRenewalTroubleshootingGuideHeaderCell {
private func setupUI() {
selectionStyle = .none
contentView.addSubview(bgIcon)
contentView.addSubview(infoTitleIcon)
contentView.addSubview(paragraphDetailLabel)
contentView.addSubview(errorIcon)
bgIcon.snp.makeConstraints { make in
make.left.top.right.equalToSuperview()
make.width.equalTo(bgIcon.snp.height)
}
infoTitleIcon.snp.makeConstraints { make in
make.top.equalToSuperview().offset(25)
make.left.equalToSuperview().offset(22)
make.height.equalTo(25)
make.width.equalTo(202)
}
paragraphDetailLabel.snp.makeConstraints { make in
make.top.equalTo(infoTitleIcon.snp.bottom).offset(34)
make.left.equalToSuperview().offset(20)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
let whR = 335.0 / 300.0
errorIcon.snp.makeConstraints { make in
make.top.equalTo(paragraphDetailLabel.snp.bottom).offset(12)
make.left.equalTo(paragraphDetailLabel)
make.right.equalToSuperview().offset(-20)
make.width.equalTo(errorIcon.snp.height).multipliedBy(whR)
make.bottom.equalToSuperview()
}
}
}
//
// YHVisaRenewalWorkflowCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalWorkflowCell: UITableViewCell {
static let cellReuseIdentifier = "YHVisaRenewalWorkflowCell"
private let circleWidth: CGFloat = 8
private var stepLabels: [UILabel] = []
private var circleViews: [UIView] = []
private var dashLines: [YHDashLineView] = []
private lazy var iconView: UIView = {
let view = UIView()
view.backgroundColor = .brandMainColor
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_B(ofSize: 14)
label.textColor = .mainTextColor
return label
}()
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 6, corner: .allCorners)
view.backgroundColor = .contentBkgColor
return view
}()
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")
}
func setupCellInfo(title: String, workflows: [String]) {
infoTitleLabel.text = title
stepLabels.removeAll()
circleViews.removeAll()
dashLines.removeAll()
let count = workflows.count
workflows.enumerated().forEach { [weak self] index, title in
guard let self = self else {
return
}
let circleView = self.getCircleView()
let label = self.getStepLabel(title)
self.stepLabels.append(label)
self.circleViews.append(circleView)
self.subContainerView.addSubview(label)
self.subContainerView.addSubview(circleView)
label.snp.makeConstraints { make in
if index == 0 {
make.top.equalTo(self.infoTitleLabel.snp.bottom).offset(12)
} else {
make.top.equalTo(self.stepLabels[index - 1].snp.bottom).offset(16)
}
make.left.equalTo(circleView.snp.right).offset(8)
make.right.lessThanOrEqualToSuperview().offset(-16)
if index == count - 1 {
make.bottom.equalToSuperview().offset(-20)
}
}
circleView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.top.equalTo(label.snp.top).offset(6)
make.width.height.equalTo(self.circleWidth)
}
if index != count - 1 {
let dashLine = self.getDashLineView()
self.dashLines.append(dashLine)
self.subContainerView.addSubview(dashLine)
}
}
guard dashLines.count > 0 else {
return
}
dashLines.enumerated().forEach { [weak self] index, line in
guard let self = self else {
return
}
guard self.circleViews.count > index + 1 else {
return
}
line.snp.makeConstraints { make in
make.width.equalTo(1)
make.centerX.equalTo(self.circleViews[index])
make.top.equalTo(self.circleViews[index].snp.bottom).offset(1)
make.bottom.equalTo(self.circleViews[index + 1].snp.top).offset(-1)
}
}
}
}
extension YHVisaRenewalWorkflowCell {
private func setupUI() {
selectionStyle = .none
contentView.addSubview(subContainerView)
subContainerView.addSubview(iconView)
subContainerView.addSubview(infoTitleLabel)
subContainerView.setContentHuggingPriority(.defaultLow, for: .vertical)
subContainerView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.bottom.equalToSuperview()
}
iconView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(18)
make.left.equalToSuperview()
make.width.equalTo(4)
make.height.equalTo(14)
}
infoTitleLabel.snp.makeConstraints { make in
make.centerY.equalTo(iconView)
make.left.equalTo(iconView.snp.right).offset(12)
make.right.lessThanOrEqualToSuperview().offset(-16)
make.bottom.lessThanOrEqualToSuperview().offset(-20)
}
}
private func getStepLabel(_ title: String) -> UILabel {
let label = UILabel()
label.font = .PFSC_R(ofSize: 13)
label.textColor = .mainTextColor70
label.numberOfLines = 0
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.1
let attributedText = NSAttributedString(
string: title,
attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle]
)
label.attributedText = attributedText
return label
}
private func getDashLineView() -> YHDashLineView {
let view = YHDashLineView(strokeColor: UIColor.brandMainColor30.cgColor, lineWidth: 1, lineDashPattern: [2, 2], isHorizontal: false)
return view
}
private func getCircleView() -> UIView {
let view = UIView()
view.layer.cornerRadius = circleWidth / 2.0
view.clipsToBounds = true
view.layer.borderColor = UIColor.brandMainColor30.cgColor
view.layer.borderWidth = 1.5
return view
}
}
//
// YHResignUploadDocListViewController.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHResignUploadDocListViewController: YHBaseViewController {
var orderId: Int = 0
lazy var viewModel: YHTravelDocsPreparationViewModel = {
let vm = YHTravelDocsPreparationViewModel()
return vm
}()
var bgImageView: UIImageView!
var titleLabel: UILabel!
var messageLabel: UILabel!
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 16.0
tableView.estimatedSectionFooterHeight = 0.01
tableView.contentInsetAdjustmentBehavior = .never
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = .clear
tableView.register(YHResignUploadDocListCell.self, forCellReuseIdentifier: YHResignUploadDocListCell.cellReuseIdentifier)
tableView.register(YHTravelDocsPreparationTipsCell.self, forCellReuseIdentifier: YHTravelDocsPreparationTipsCell.cellReuseIdentifier)
return tableView
}()
//我已知悉,确认
lazy var rewardBtn: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("去查看港府续签结果结", for: .normal)
button.setTitleColor(UIColor.white, for: .normal)
button.setTitleColor(UIColor.white, for: .disabled)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.addTarget(self, action: #selector(clickNextBtn), for: .touchUpInside)
button.backgroundColor = UIColor.brandMainColor
return button
}()
lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(self.rewardBtn)
self.rewardBtn.snp.makeConstraints { make in
make.top.equalToSuperview().offset(10)
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
make.height.equalTo(44)
}
view.layer.zPosition = 10
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
loadData()
}
@objc func clickNextBtn() {
}
}
private extension YHResignUploadDocListViewController {
func loadData() {
let params: [String : Any] = ["order_id": orderId]
YHHUD.show(.progress(message: "加载中..."))
viewModel.getTravelDocsList(param: params){ success, error in
YHHUD.hide()
if success {
} else {
// let msg = error?.errorMsg ?? "获取数据出错"
// YHHUD.flash(message: msg)
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
// self.navigationController?.popViewController()
// }
}
self.tableView.reloadData()
}
}
func setupUI() {
gk_navTitle = "续签补件"
view.backgroundColor = UIColor.contentBkgColor
bgImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "resign_upload_doc_head")
return imageView
}()
view.addSubview(bgImageView)
bgImageView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(375.fix)
}
titleLabel = {
let label = UILabel()
label.numberOfLines = 0
let a = ASAttributedString.init("您申请的【优才入境计划】续签,", .font(UIFont.PFSC_M(ofSize:17)), .foreground(UIColor.mainTextColor50))
let b = ASAttributedString.init("港澳通行证逗留(D)签注延期-办理指引", .font(UIFont.PFSC_M(ofSize:17)),.foreground(UIColor.yhOrangeColor))
label.attributed.text = a+b
return label
}()
view.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.height.equalTo(60)
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 24)
}
messageLabel = {
let label = UILabel()
label.numberOfLines = 0
let a = ASAttributedString.init("请您于", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
let b = ASAttributedString.init("2024年8月8日前", .font(UIFont.PFSC_M(ofSize:14)),.foreground(UIColor.brandMainColor))
let c = ASAttributedString.init("根据补件清单上传资料递交至港府;如无及时递交,可能导致身份失效!", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
label.attributed.text = a+b+c
return label
}()
view.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.height.equalTo(44)
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 84)
}
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.height.equalTo(98)
make.bottom.equalToSuperview()
}
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 160)
make.bottom.equalTo(-98)
}
}
}
extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadDocListCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadDocListCell
return approveCell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return YHTravelDocsPreparationListCell.cellH
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 16.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
return view
}
}
//
// YHFileExplainReasonInputView.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFileExplainReasonInputView: UIView {
static let height = 294.0
var maxWordsCount = 50
var editBlock:((String?)->Void)?
var dismissBlock:(()->())?
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
let tap = UITapGestureRecognizer(target: self, action: #selector(didWhiteContentViewTap))
view.addGestureRecognizer(tap)
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 = kCornerRadius6
view.clipsToBounds = true
return view
}()
lazy var textField: UITextView = {
let textField = UITextView()
textField.backgroundColor = .clear
textField.font = UIFont.PFSC_M(ofSize: 16)
textField.tintColor = UIColor.brandMainColor
textField.textColor = UIColor.mainTextColor
textField.delegate = self
textField.returnKeyType = .done
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 = kCornerRadius3
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.brandMainColor
btn.layer.cornerRadius = kCornerRadius3
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?,_ placeholde: String = "请输入文件名称", _ title: String = "文件重命名")-> YHFileExplainReasonInputView {
let view = YHFileExplainReasonInputView(frame:CGRect(x: 0, y: 0, width:KScreenWidth, height:Self.height))
view.textField.text = defalutText
view.titleLabel.text = title
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(kCornerRadius6, kCornerRadius6));
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 YHFileExplainReasonInputView {
@objc func dismiss() {
self.textField.resignFirstResponder()
UIApplication.shared.yhKeyWindow()?.endEditing(true)
self.dismissBlock?()
}
@objc func didWhiteContentViewTap() {
self.textField.becomeFirstResponder()
}
@objc func didClickCancelBtn() {
dismiss()
}
@objc func didClickConfirmBtn() {
if isEmptyString(textField.text) {
YHHUD.flash(message: "重命名不可为空")
return
}
if let editBlock = editBlock {
editBlock(textField.text)
}
dismiss()
}
}
extension YHFileExplainReasonInputView: UITextViewDelegate {
}
//
// YHResignUploadDocListCell.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignUploadDocListCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignUploadDocListCell"
typealias ExperienceListBlock = (_ model: YHAdopterDependentModel) -> ()
var clickBlock: ExperienceListBlock?
var centerView: UIView!
var titleLabel: UILabel!
var mainItemView: UIView!
var lineView: UIView!
var dataSource: [YHAdopterDependentModel]? {
didSet {
updateAllViews()
}
}
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
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(14)
make.bottom.equalTo(-7)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.text = "新增受养人"
label.textColor = UIColor.mainTextColor
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(23)
make.height.equalTo(24)
make.right.equalTo(-20)
}
lineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(62.5)
make.height.equalTo(0.5)
}
mainItemView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(-63)
make.top.equalTo(63)
}
}
func updateAllViews() {
mainItemView.removeSubviews()
guard let dataSource = dataSource else {
return
}
var total = 0
for i in 0 ..< dataSource.count {
if i != 0 {
let line = UIView()
line.backgroundColor = UIColor.separatorColor
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(total)
make.height.equalTo(0.5)
make.right.equalTo(-18)
}
}
total = total + 1
let itemView = YHResignUploadDocItemView()
itemView.clickBlock = {[weak self] model in
guard let self = self else { return }
if let block = self.clickBlock {
block(model)
}
}
let model = dataSource[i]
itemView.tag = 4000 + i
itemView.dataSource = dataSource[i]
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(total)
make.height.equalTo(51)
make.right.equalTo(-18)
}
total = total + 51
}
}
}
class YHResignUploadDocItemView: UIView {
typealias ItemBlock = (_ model: YHAdopterDependentModel) -> ()
var clickBlock: ItemBlock?
var deleteBlock: ItemBlock?
var titleLabel: UILabel!
var explainLabel: UILabel!
var nextStepImageView: UIImageView!
var centerButton: UIButton!
var dataSource: YHAdopterDependentModel? {
didSet {
updateAllViews()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 14)
label.textAlignment = .left
label.numberOfLines = 2
label.textColor = UIColor.mainTextColor
return label
}()
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview()
make.right.equalTo(-30)
}
explainLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textAlignment = .right
label.textColor = UIColor.labelTextColor2
return label
}()
addSubview(explainLabel)
explainLabel.snp.makeConstraints { make in
make.right.equalTo(-24)
make.left.equalToSuperview()
make.height.equalTo(20)
make.centerY.equalToSuperview()
}
nextStepImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "form_right_arrow")
return imageView
}()
addSubview(nextStepImageView)
nextStepImageView.snp.makeConstraints { make in
make.right.equalToSuperview()
make.centerY.equalTo(explainLabel.snp.centerY)
make.height.width.equalTo(20)
}
centerButton = {
let button = UIButton(type: .custom)
button.addTarget(self, action: #selector(centerClick), for: .touchUpInside)
return button
}()
addSubview(centerButton)
centerButton.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.left.equalTo(112)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
var spouse = "子女"
if dataSource.is_spouse == 1 {
spouse = "配偶"
}
if dataSource.dep_name.count != 0 {
titleLabel.text = spouse + "(\(dataSource.dep_name))"
} else {
titleLabel.text = spouse
}
if dataSource.status == 0 {
explainLabel.text = "待上传"
explainLabel.textColor = UIColor.brandMainColor
nextStepImageView.image = UIImage(named: "service_adopter_income_start")
}
if dataSource.status == 1 {
explainLabel.text = "审核中"
explainLabel.textColor = UIColor(hex: 0xff8000)
nextStepImageView.image = UIImage(named: "service_adopter_income_wait")
}
if dataSource.status == 2 {
explainLabel.text = "已驳回"
explainLabel.textColor = UIColor.failColor
nextStepImageView.image = UIImage(named: "service_adopter_income_fail")
}
if dataSource.status == 3 {
explainLabel.text = "已完成"
explainLabel.textColor = UIColor(hex: 0x3cc694)
nextStepImageView.image = UIImage(named: "service_adopter_income_success")
}
}
func updateDocAllViews() {
guard let dataSource = dataSource else { return }
if dataSource.status == 0 {
explainLabel.text = "待确认"// “待签字”
explainLabel.textColor = UIColor.brandMainColor
nextStepImageView.image = UIImage(named: "service_adopter_income_start")
}
if dataSource.status == 1 {
explainLabel.text = "写作中"// 定稿中 审核中
explainLabel.textColor = UIColor(hex: 0xff8000)
nextStepImageView.image = UIImage(named: "service_adopter_income_wait")
}
if dataSource.status == 2 {
explainLabel.text = "已驳回"
explainLabel.textColor = UIColor.failColor
nextStepImageView.image = UIImage(named: "service_adopter_income_fail")
}
if dataSource.status == 3 {
explainLabel.text = "已完成"
explainLabel.textColor = UIColor(hex: 0x3cc694)
nextStepImageView.image = UIImage(named: "service_adopter_income_success")
}
}
@objc func centerClick() {
if let block = clickBlock {
block(self.dataSource ?? YHAdopterDependentModel())
}
}
}
//
// YHResignUploadSuccessDocListCell.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignUploadSuccessDocListCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignUploadSuccessDocListCell"
typealias ExperienceListBlock = (_ model: YHWorkExperienceFileModel, _ type: YHWorkFileClickType) -> ()
var experienceListBlock: ExperienceListBlock?
var mainItemView: UIView!
var dataSource: [YHWorkExperienceFileModel]?{
didSet {
updateAllViews()
}
}
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
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
mainItemView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
contentView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalToSuperview()
make.top.equalTo(16)
}
}
func updateAllViews() {
mainItemView.removeSubviews()
for i in 0 ..< (dataSource?.count ?? 0) {
let itemView = YHResignUploadFileItemView()
itemView.dataSource = dataSource?[i]
itemView.block = {[weak self] model, type in
guard let self = self else { return }
if let block = self.experienceListBlock {
block(model, type)
}
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(55 * i)
make.height.equalTo(55)
}
}
}
}
class YHResignUploadFileItemView: UIView {
typealias ItemBlock = (_ model: YHWorkExperienceFileModel, _ type: YHWorkFileClickType) -> ()
var block: ItemBlock?
var whiteView: UIButton!
var iconImgV: UIImageView!
var nameLabel: UILabel!
var timeLabel: UILabel!
var editBtn: UIButton!
var dataSource: YHWorkExperienceFileModel? {
didSet {
updateAllViews()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
whiteView = UIButton()
whiteView.addTarget(self, action: #selector(itemClick), for: .touchUpInside)
addSubview(whiteView)
iconImgV = UIImageView(image:UIImage(named:"my_cer_type_jpg"))
whiteView.addSubview(iconImgV)
nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.numberOfLines = 0
nameLabel.font = UIFont.PFSC_M(ofSize:14)
whiteView.addSubview(nameLabel)
timeLabel = UILabel()
timeLabel.textColor = UIColor.labelTextColor2
timeLabel.textAlignment = .left
timeLabel.font = UIFont.PFSC_R(ofSize:11)
whiteView.addSubview(timeLabel)
editBtn = UIButton()
editBtn.setImage(UIImage(named:"my_cer_btn_edit"), for:.normal)
editBtn.setTitle("查看", for: .normal)
editBtn.setTitleColor(UIColor.mainTextColor, for: .normal)
editBtn.setBackgroundColor(color: UIColor(hex: 0xf4f6fa), forState: .normal)
editBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 30, left: 30, bottom: 30, right: 30)
editBtn.addTarget(self, action: #selector(deleteClick), for: .touchUpInside)
editBtn.layer.cornerRadius = 10
whiteView.addSubview(editBtn)
whiteView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.centerY.equalToSuperview()
make.height.equalTo(55)
}
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.top.equalToSuperview().offset(7)
make.right.equalTo(editBtn.snp.left)
}
timeLabel.snp.makeConstraints { make in
make.left.right.equalTo(nameLabel)
make.top.equalTo(nameLabel.snp.bottom).offset(2)
make.bottom.equalToSuperview().offset(-7)
make.height.equalTo(20)
}
editBtn.snp.makeConstraints { make in
make.width.equalTo(38)
make.height.equalTo(20)
make.centerY.equalToSuperview()
make.right.equalToSuperview()
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
nameLabel.text = dataSource.fileName
timeLabel.text = "上传于\(dataSource.uploadedAt)"
let suffix = dataSource.fileUrl.pathExtension.lowercased()
var iconImgName = ""
if suffix == "jpeg" {
iconImgName = "my_cer_type_jpg"
} else if suffix == "jpg" {
iconImgName = "my_cer_type_jpg"
} else if suffix == "png" {
iconImgName = "my_cer_type_png"
} else if suffix == "pdf" {
iconImgName = "my_cer_type_pdf"
} else if suffix == "doc" || suffix == "docx" {
iconImgName = "my_cer_type_word"
} else if suffix == "ppt" || suffix == "pptx" {
iconImgName = "my_cer_type_ppt"
} else if suffix == "bmp" {
iconImgName = "my_cer_type_bmp"
} else if suffix == "tiff" {
iconImgName = "my_cer_type_tiff"
} else if suffix == "xls" || suffix == "xlsx" {
iconImgName = "my_cer_type_excel"
}
iconImgV.image = UIImage(named: iconImgName)
}
@objc func itemClick() {
if let block = block, let dataSource = dataSource {
block(dataSource, .click)
}
}
@objc func deleteClick() {
if let block = block, let dataSource = dataSource {
block(dataSource, .click)
}
}
}
//
// YHResignUploadTravelCardListViewController.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignUploadTravelCardListViewController: YHBaseViewController {
var orderId: Int = 0
lazy var viewModel: YHTravelDocsPreparationViewModel = {
let vm = YHTravelDocsPreparationViewModel()
return vm
}()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 16.0
tableView.estimatedSectionFooterHeight = 0.01
tableView.contentInsetAdjustmentBehavior = .never
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.tableHeaderView = YHResignUploadTravelCardListheadView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 16 + 90.fix))
tableView.tableFooterView = YHResignUploadTravelCardListfootView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 837.fix))
tableView.backgroundColor = .clear
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHTravelDocsPreparationListCell.self, forCellReuseIdentifier: YHTravelDocsPreparationListCell.cellReuseIdentifier)
tableView.register(YHTravelDocsPreparationTipsCell.self, forCellReuseIdentifier: YHTravelDocsPreparationTipsCell.cellReuseIdentifier)
return tableView
}()
//我已知悉,确认
lazy var rewardBtn: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("下一步,去查看续签总结", for: .normal)
button.setTitle("下一步,去查看续签总结", for: .disabled)
button.setTitleColor(UIColor.white, for: .normal)
button.setTitleColor(UIColor.white, for: .disabled)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.addTarget(self, action: #selector(clickNextBtn), for: .touchUpInside)
button.backgroundColor = UIColor.brandMainColor
return button
}()
lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(self.rewardBtn)
self.rewardBtn.snp.makeConstraints { make in
make.top.equalToSuperview().offset(10)
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
make.height.equalTo(44)
}
view.layer.zPosition = 10
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
loadData()
}
@objc func clickNextBtn() {
}
}
private extension YHResignUploadTravelCardListViewController {
func loadData() {
let params: [String : Any] = ["order_id": orderId]
YHHUD.show(.progress(message: "加载中..."))
viewModel.getTravelDocsList(param: params){ success, error in
YHHUD.hide()
if success {
} else {
let msg = error?.errorMsg ?? "获取数据出错"
YHHUD.flash(message: msg)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
self.navigationController?.popViewController()
}
}
self.tableView.reloadData()
}
}
func setupUI() {
gk_navTitle = "上传旅行证件"
gk_navBarAlpha = 1.0
gk_navBackgroundColor = .white
view.backgroundColor = UIColor.contentBkgColor
if orderId == 0 {
if let id = UserDefaults.standard.value(forKey: "orderIdForPreview") {
self.orderId = (id as? Int) ?? 0
}
}
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.height.equalTo(98)
make.bottom.equalToSuperview()
}
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(-98)
}
}
}
extension YHResignUploadTravelCardListViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return viewModel.arrTravelDocs.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHTravelDocsPreparationListCell.cellReuseIdentifier, for: indexPath) as! YHTravelDocsPreparationListCell
approveCell.dataModel = viewModel.arrTravelDocs[indexPath.section]
return approveCell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return YHTravelDocsPreparationListCell.cellH
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let model = viewModel.arrTravelDocs[indexPath.section] {
if model.status == -1 {
return
} else {
let vc = YHTravelDocsPreparationDetailVC()
vc.dataModel = model
vc.orderId = orderId
self.navigationController?.pushViewController(vc)
}
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 16.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
return view
}
}
//
// YHResignUploadTravelCardFootViewController.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
class YHResignUploadTravelCardFootViewController: YHBaseViewController {
var type: Int = 0
var imageView: UIImageView!
var linkButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadData()
}
}
extension YHResignUploadTravelCardFootViewController {
func loadData() {
}
func setupUI() {
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
view.backgroundColor = .white
imageView = {
let tableView = UIImageView()
return tableView
}()
view.addSubview(imageView)
var height = 0.0
if type == 0 {
height = 528.fix
imageView.image = UIImage(named: "resign_upload_travel_foot_one")
} else {
height = 699.fix
imageView.image = UIImage(named: "resign_upload_travel_foot_two")
}
imageView.snp.makeConstraints { make in
make.top.right.left.equalToSuperview()
make.height.equalTo(height)
}
if type == 1 {
linkButton = {
let tableView = UIButton(type: .custom)
tableView.addTarget(self, action: #selector(click), for: .touchUpInside)
return tableView
}()
view.addSubview(linkButton)
linkButton.snp.makeConstraints { make in
make.left.equalTo(44)
make.right.equalTo(-44)
make.top.equalTo(152.fix)
make.height.equalTo(40.fix)
}
}
view.layer.cornerRadius = kCornerRadius6
view.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner]
}
@objc func click() {
let vc = YHH5WebViewVC()
vc.url = "https://www.ctshk.com/mep/zh/"
vc.isShowRightShareItemFlag = false
vc.isFullScreenFlag = false
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
extension YHResignUploadTravelCardFootViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
}
//
// YHResignUploadTravelCardListfootView.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
class YHResignUploadTravelCardListfootView: UIView {
var lineView: UIView!
var titleLabel: UILabel!
var controllerOne: YHResignUploadTravelCardFootViewController = YHResignUploadTravelCardFootViewController()
var controllerTwo: YHResignUploadTravelCardFootViewController = YHResignUploadTravelCardFootViewController()
var arrItemTitles = ["大陆办理", "香港办理"]
var arrItemVCs: [YHResignUploadTravelCardFootViewController] = []
var segmentedView : JXSegmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 48))
lazy var segmentedDataSource: JXSegmentedDotDataSource = {
let dataSource = JXSegmentedDotDataSource()
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PFSC_M(ofSize: 14)
dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 14)
dataSource.titleSelectedColor = .mainTextColor
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
dataSource.itemSpacing = 16
dataSource.dotStates = [false, false, false, false]
dataSource.dotSize = CGSize(width: 6, height: 6)
return dataSource
}()
//分类title 所对应的VC
lazy var listContainerView: JXSegmentedListContainerView! = {
return JXSegmentedListContainerView(dataSource: self, type: .scrollView)
}()
override init(frame: CGRect) {
super.init(frame: frame)
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
backgroundColor = .clear
lineView = {
let view = UIView()
view.backgroundColor = UIColor.brandMainColor
return view
}()
addSubview(lineView)
lineView.snp.remakeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(38)
make.height.equalTo(12)
make.width.equalTo(3)
}
titleLabel = {
let view = UILabel()
view.text = "港澳通行证逗留(D)签注延期-办理指引"
view.font = UIFont.PFSC_M(ofSize: 17)
view.textColor = UIColor.mainTextColor
return view
}()
addSubview(titleLabel)
titleLabel.snp.remakeConstraints { make in
make.left.equalTo(27)
make.centerY.equalTo(lineView.snp.centerY)
make.height.equalTo(24)
make.right.equalToSuperview()
}
controllerOne.type = 0
controllerTwo.type = 1
arrItemVCs.append(controllerOne)
arrItemVCs.append(controllerTwo)
//segmentedViewDataSource一定要通过属性强持有!!!!!!!!!
// segmentedView.backgroundColor = .clear
segmentedView.collectionView.backgroundColor = .white
// segmentedView.contentScrollView?.backgroundColor = .clear
addSubview(segmentedView)
segmentedView.listContainer = listContainerView
addSubview(listContainerView)
//分类Title
segmentedView.dataSource = segmentedDataSource
segmentedView.delegate = self
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorColor = UIColor.brandMainColor
indicator.indicatorHeight = 2
indicator.indicatorCornerRadius = 0
indicator.verticalOffset = 4
segmentedView.indicators = [indicator]
segmentedView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1)
segmentedView.snp.remakeConstraints { make in
make.right.equalTo(-16)
make.left.equalTo(16)
make.top.equalTo(82)
make.height.equalTo(44)
}
listContainerView.snp.remakeConstraints { make in
make.right.equalTo(-16)
make.left.equalTo(16)
make.top.equalTo(segmentedView.snp.bottom)
make.height.equalTo(528.fix)
}
let whiteView = UIView()
whiteView.backgroundColor = .white
whiteView.layer.cornerRadius = kCornerRadius6
whiteView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
addSubview(whiteView)
whiteView.snp.remakeConstraints { make in
make.bottom.equalTo(segmentedView.snp.top)
make.right.equalTo(-16)
make.left.equalTo(16)
make.height.equalTo(6)
}
}
}
extension YHResignUploadTravelCardListfootView: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
if index == 0 {
listContainerView.snp.remakeConstraints { make in
make.right.equalTo(-16)
make.left.equalTo(16)
make.top.equalTo(segmentedView.snp.bottom)
make.height.equalTo(528.fix)
}
} else {
listContainerView.snp.remakeConstraints { make in
make.right.equalTo(-16)
make.left.equalTo(16)
make.top.equalTo(segmentedView.snp.bottom)
make.bottom.equalTo(-16)
}
}
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
}
/// 正在滚动中的回调
///
/// - Parameters:
/// - segmentedView: JXSegmentedView
/// - leftIndex: 正在滚动中,相对位置处于左边的index
/// - rightIndex: 正在滚动中,相对位置处于右边的index
/// - percent: 从左往右计算的百分比
func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewWillBeginDragging"), object: nil)
}
}
extension YHResignUploadTravelCardListfootView: JXSegmentedListContainerViewDataSource {
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
return titleDataSource.dataSource.count
}
return 0
}
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
return arrItemVCs[index] as! JXSegmentedListContainerViewListDelegate
}
}
//
// YHResignUploadTravelCardListheadView.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignUploadTravelCardListheadView: UIView {
var fileImageView: UIImageView!
override init(frame: CGRect) {
super.init(frame: frame)
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
fileImageView = {
let view = UIImageView()
view.image = UIImage(named: "resign_upload_travel_head")
return view
}()
addSubview(fileImageView)
fileImageView.snp.makeConstraints { make in
make.right.equalTo(-16)
make.top.left.equalTo(16)
make.height.equalTo(90.fix)
}
}
}
......@@ -123,16 +123,32 @@ extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
if model.skip_url.isEmpty == false {
switch model.skip_type {
case 1: //跳转H5
let token = YHLoginManager.shared.h5Token
var url = model.skip_url + "?param=" + token
let urlHasParam = String.hasQueryParameters(urlString: model.skip_url)
if urlHasParam {
url = model.skip_url + "&param=" + token
var url = ""
if YHLoginManager.shared.isLogin() {
let token = YHLoginManager.shared.h5Token
url = model.skip_url + "?param=" + token
let urlHasParam = String.hasQueryParameters(urlString: model.skip_url)
if urlHasParam {
url = model.skip_url + "&param=" + token
}
} else {
url = model.skip_url
}
printLog("url: \(url)")
let vc = YHH5WebViewVC()
vc.url = url
vc.isFullScreenFlag = false
if model.is_share_h5_flag {
if let tModel = model.addtition_param {
if !tModel.ShareH5Url.isEmpty {
vc.isShowRightShareItemFlag = true
vc.shareH5Title = tModel.ShareH5Title
vc.shareH5Describe = tModel.ShareH5Describe
vc.shareUrlFromOutside = tModel.ShareH5Url
}
}
}
self.parentViewController?.navigationController?.pushViewController(vc)
case 2: //跳转APP内Tab
goAppTab(tabBarName:model.skip_url)
......
......@@ -251,7 +251,7 @@ private extension YHH5WebViewVC {
if !shareUrl.isEmpty &&
!self.shareH5Title.isEmpty &&
!self.shareH5Describe.isEmpty {
YHShareManager.shared.sendLinkContent(self.shareH5Title, self.shareH5Describe, UIImage(named: "AppIcon") ?? UIImage(), link: shareUrl)
YHShareManager.shared.sendLinkContent(self.shareH5Title, self.shareH5Describe, UIImage(named: "shareIcon") ?? UIImage(), link: shareUrl)
}
}
}
......
......@@ -93,7 +93,7 @@ class YHAllApiName {
//获取首页展示的资讯
static let consultApi = "infoflow/home/consult"
//获取首页展示的banner
static let banner = "infoflow/banner/list"
static let bannerApi = "infoflow/banner/list"
//获取栏目
static let classify = "infoflow/classify/list"
//获取资讯
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "shareIcon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "shareIcon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "resign_upload_doc_head@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "resign_upload_doc_head@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "resign_upload_guideline@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "resign_upload_guideline@3x.png",
"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