Commit 69c77f5c authored by Alex朱枝文's avatar Alex朱枝文

续签在港缴费页面调整

parent 90c050a9
This diff is collapsed.
...@@ -10,7 +10,7 @@ import UIKit ...@@ -10,7 +10,7 @@ import UIKit
class YHBaseDynamicCornerRadiusView: UIView { class YHBaseDynamicCornerRadiusView: UIView {
private var radius: CGFloat = 8 public var radius: CGFloat = 8
public var corner: UIRectCorner? { public var corner: UIRectCorner? {
didSet { didSet {
if corner != oldValue { if corner != oldValue {
......
//
// YHVisaRenewalItemDetailType.swift
// galaxy
//
// Created by alexzzw on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
import AttributedString
enum YHVisaRenewalItemDetailType {
case sectionHeader(_ title: String, _ actionTitle: String? = nil, _ action: (() -> Void)? = nil)
case tips(_ detail: ASAttributedString)
case residenceAction(_ title: String, _ status: YHVisaRenewalPresenceStatus, _ cellType: YHResignRoundCellType = .mid, _ action: (() -> Void)? = nil)
case payMethodUrl(_ title: String, _ tips: String, _ url: String, _ action: (() -> Void)? = nil)
case payMethodQrcode(_ title: String, _ tips: String, _ image: UIImage?)
case subHeader(_ title: String, _ status: YHVisaRenewalPaymentStatus)
case subInfo(_ title: String, _ detail: String, _ actionTitle: String? = nil, _ cellType: YHResignRoundCellType = .mid, _ defaultMargin: CGFloat? = nil, _ showBottomLine: Bool = false, _ action: (() -> Void)? = nil)
case subContent(_ title: String, _ detail: String, _ actionTitle: String? = nil, _ cellType: YHResignRoundCellType = .mid, _ action: (() -> Void)? = nil)
case subRemark(_ remark: String)
case occupyingSpace
}
//
// YHVisaRenewalPaymentStatus.swift
// galaxy
//
// Created by alexzzw on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
enum YHVisaRenewalPaymentStatus {
// 待缴费 待获批 已缴费 已过期
case pendingPayment
case pendingApproval
case paid
case expired
var title: String {
switch self {
case .pendingPayment:
return "待缴费"
case .pendingApproval:
return "待获批"
case .paid:
return "已缴费"
case .expired:
return "已过期"
}
}
var titleColor: UIColor? {
switch self {
case .pendingPayment:
return .brandMainColor
case .pendingApproval:
return .yhOrangeColor
case .paid:
return .mainTextColor50
case .expired:
return .failColor
}
}
}
//
// YHVisaRenewalPresenceStatus.swift
// galaxy
//
// Created by alexzzw on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
enum YHVisaRenewalPresenceStatus {
// 暂未获批 确认在港 已确认在港
case approvalPending
case confirmingPresence
case confirmedPresence
var title: String {
switch self {
case .approvalPending:
return "暂未获批"
case .confirmingPresence:
return "确认在港"
case .confirmedPresence:
return "已确认在港"
}
}
var titleColor: UIColor? {
switch self {
case .approvalPending:
return .mainTextColor30
case .confirmingPresence:
return UIColor(hexString: "#FFFFFF")
case .confirmedPresence:
return .yhGreenColor
}
}
var bgColor: UIColor? {
switch self {
case .approvalPending:
return UIColor(hexString: "#F4F6FA")
case .confirmingPresence:
return .brandMainColor
case .confirmedPresence:
return .clear
}
}
}
...@@ -125,18 +125,21 @@ extension YHHKVisaRenewalPaymentStepView { ...@@ -125,18 +125,21 @@ extension YHHKVisaRenewalPaymentStepView {
make.top.equalTo(secondStepLabel.snp.bottom).offset(6) make.top.equalTo(secondStepLabel.snp.bottom).offset(6)
make.centerX.equalTo(secondStepLabel.snp.centerX) make.centerX.equalTo(secondStepLabel.snp.centerX)
make.bottom.equalToSuperview().offset(-16) make.bottom.equalToSuperview().offset(-16)
make.left.greaterThanOrEqualTo(firstStepNameLabel.snp.right).offset(6)
} }
thirdStepNameLabel.snp.makeConstraints { make in thirdStepNameLabel.snp.makeConstraints { make in
make.top.equalTo(thirdStepLabel.snp.bottom).offset(6) make.top.equalTo(thirdStepLabel.snp.bottom).offset(6)
make.centerX.equalTo(thirdStepLabel.snp.centerX) make.centerX.equalTo(thirdStepLabel.snp.centerX)
make.bottom.equalToSuperview().offset(-16) make.bottom.equalToSuperview().offset(-16)
make.left.greaterThanOrEqualTo(secondStepNameLabel.snp.right).offset(6)
} }
fourthStepNameLabel.snp.makeConstraints { make in fourthStepNameLabel.snp.makeConstraints { make in
make.top.equalTo(fourthStepLabel.snp.bottom).offset(6) make.top.equalTo(fourthStepLabel.snp.bottom).offset(6)
make.centerX.equalTo(fourthStepLabel.snp.centerX) make.centerX.equalTo(fourthStepLabel.snp.centerX)
make.bottom.equalToSuperview().offset(-16) make.bottom.equalToSuperview().offset(-16)
make.left.greaterThanOrEqualTo(thirdStepNameLabel.snp.right).offset(6)
} }
} }
......
...@@ -61,6 +61,7 @@ class YHVisaRenewalGuideHeaderCell: UITableViewCell { ...@@ -61,6 +61,7 @@ class YHVisaRenewalGuideHeaderCell: UITableViewCell {
label.textColor = .mainTextColor70 label.textColor = .mainTextColor70
label.text = "获批后,3个月内完成缴费,否则身份会失效" label.text = "获批后,3个月内完成缴费,否则身份会失效"
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label return label
}() }()
...@@ -70,6 +71,7 @@ class YHVisaRenewalGuideHeaderCell: UITableViewCell { ...@@ -70,6 +71,7 @@ class YHVisaRenewalGuideHeaderCell: UITableViewCell {
label.textColor = .mainTextColor70 label.textColor = .mainTextColor70
label.text = "缴费领取电子签证时,涉及到的申请人应身在香港" label.text = "缴费领取电子签证时,涉及到的申请人应身在香港"
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label return label
}() }()
...@@ -91,6 +93,7 @@ class YHVisaRenewalGuideHeaderCell: UITableViewCell { ...@@ -91,6 +93,7 @@ class YHVisaRenewalGuideHeaderCell: UITableViewCell {
label.textColor = UIColor(hex: 0xFF8000) label.textColor = UIColor(hex: 0xFF8000)
label.text = "在港缴费领取电子签证时使用的入境证件,请务必和递交续签资料时入境香港使用的旅行证件保持一致" label.text = "在港缴费领取电子签证时使用的入境证件,请务必和递交续签资料时入境香港使用的旅行证件保持一致"
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label return label
}() }()
...@@ -99,6 +102,7 @@ class YHVisaRenewalGuideHeaderCell: UITableViewCell { ...@@ -99,6 +102,7 @@ class YHVisaRenewalGuideHeaderCell: UITableViewCell {
label.font = .PFSC_B(ofSize: 16) label.font = .PFSC_B(ofSize: 16)
label.textColor = .mainTextColor label.textColor = .mainTextColor
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
label.text = "一、递交续签申请后,未离境一直在港" label.text = "一、递交续签申请后,未离境一直在港"
return label return label
}() }()
...@@ -108,6 +112,7 @@ class YHVisaRenewalGuideHeaderCell: UITableViewCell { ...@@ -108,6 +112,7 @@ class YHVisaRenewalGuideHeaderCell: UITableViewCell {
label.font = .PFSC_R(ofSize: 14) label.font = .PFSC_R(ofSize: 14)
label.textColor = .mainTextColor70 label.textColor = .mainTextColor70
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
let paragraphStyle = NSMutableParagraphStyle() let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.07 paragraphStyle.lineHeightMultiple = 1.07
let attributedText = NSAttributedString( let attributedText = NSAttributedString(
......
...@@ -33,6 +33,7 @@ class YHVisaRenewalGuideIndentCell: UITableViewCell { ...@@ -33,6 +33,7 @@ class YHVisaRenewalGuideIndentCell: UITableViewCell {
label.font = .PFSC_R(ofSize: 13) label.font = .PFSC_R(ofSize: 13)
label.textColor = .mainTextColor70 label.textColor = .mainTextColor70
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label return label
}() }()
......
...@@ -16,6 +16,7 @@ class YHVisaRenewalGuideParagraphCell: UITableViewCell { ...@@ -16,6 +16,7 @@ class YHVisaRenewalGuideParagraphCell: UITableViewCell {
label.font = .PFSC_B(ofSize: 16) label.font = .PFSC_B(ofSize: 16)
label.textColor = .mainTextColor label.textColor = .mainTextColor
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label return label
}() }()
...@@ -24,6 +25,7 @@ class YHVisaRenewalGuideParagraphCell: UITableViewCell { ...@@ -24,6 +25,7 @@ class YHVisaRenewalGuideParagraphCell: UITableViewCell {
label.font = .PFSC_R(ofSize: 14) label.font = .PFSC_R(ofSize: 14)
label.textColor = .mainTextColor70 label.textColor = .mainTextColor70
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label return label
}() }()
......
...@@ -16,6 +16,7 @@ class YHVisaRenewalGuideRemarkCell: UITableViewCell { ...@@ -16,6 +16,7 @@ class YHVisaRenewalGuideRemarkCell: UITableViewCell {
label.font = .PFSC_R(ofSize: 14) label.font = .PFSC_R(ofSize: 14)
label.textColor = .mainTextColor70 label.textColor = .mainTextColor70
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label return label
}() }()
......
...@@ -30,6 +30,7 @@ class YHVisaRenewalGuideTipsCell: UITableViewCell { ...@@ -30,6 +30,7 @@ class YHVisaRenewalGuideTipsCell: UITableViewCell {
label.font = .PFSC_R(ofSize: 13) label.font = .PFSC_R(ofSize: 13)
label.textColor = .mainTextColor70 label.textColor = .mainTextColor70
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label return label
}() }()
......
//
// YHVisaRenewalPayContentCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalPayContentCell: YHVisaRenewalPayInfoBaseCell {
static let cellReuseIdentifier = "YHVisaRenewalPayContentCell"
var rightButtonEvent: (() -> Void)?
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 13)
label.textColor = .mainTextColor70
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 13)
label.textColor = UIColor(hexString: "#222222")
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label
}()
private lazy var rightButton: UIButton = {
let button = UIButton(type: .custom)
button.setTitleColor(.mainTextColor, for: .normal)
button.titleLabel?.font = .PFSC_M(ofSize: 10)
button.backgroundColor = .separatorColor
button.layer.cornerRadius = 8
button.clipsToBounds = true
button.addTarget(self, action: #selector(rightButtonClicked), for: .touchUpInside)
return button
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
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: String, rightButtonTitle: String? = nil, cellType: YHResignRoundCellType = .mid) {
infoTitleLabel.text = title
infoDetailLabel.text = detail
updateInnerCellCorner(cellType)
let bottomMargin = cellType == .bottom ? 16 : 12
bottomLineView.isHidden = cellType == .bottom
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalTo(infoTitleLabel.snp.bottom).offset(12)
make.right.lessThanOrEqualToSuperview().offset(-16)
make.left.equalTo(infoTitleLabel)
make.bottom.equalToSuperview().offset(-bottomMargin)
}
if let rightButtonTitle = rightButtonTitle, rightButtonTitle.count > 0 {
rightButton.setTitle(rightButtonTitle, for: .normal)
rightButton.isHidden = false
} else {
rightButton.setTitle(nil, for: .normal)
rightButton.isHidden = true
}
}
}
extension YHVisaRenewalPayContentCell {
@objc private func rightButtonClicked() {
rightButtonEvent?()
}
private func setupUI() {
updateInnerCellCorner(.mid)
innerContainerView.addSubview(rightButton)
innerContainerView.addSubview(infoTitleLabel)
innerContainerView.addSubview(infoDetailLabel)
innerContainerView.addSubview(bottomLineView)
rightButton.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
bottomLineView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview()
make.height.equalTo(0.5)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.top.equalToSuperview().offset(12)
}
rightButton.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.width.equalTo(36)
make.height.equalTo(18)
make.centerY.equalTo(infoTitleLabel)
make.left.greaterThanOrEqualTo(infoTitleLabel.snp.right).offset(12)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalTo(infoTitleLabel.snp.bottom).offset(12)
make.right.lessThanOrEqualToSuperview().offset(-16)
make.left.equalTo(infoTitleLabel)
make.bottom.equalToSuperview().offset(-12)
}
}
}
//
// YHVisaRenewalPayInfoBaseCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalPayInfoBaseCell: YHResignDocumentCell {
lazy var innerContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 6, corner: .none)
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 updateInnerCellCorner(_ cellType: YHResignRoundCellType) {
switch cellType {
case .top:
innerContainerView.corner = [.topLeft, .topRight]
case .mid:
innerContainerView.corner = .none
case .bottom:
innerContainerView.corner = [.bottomLeft, .bottomRight]
case .single:
innerContainerView.corner = .allCorners
}
}
}
extension YHVisaRenewalPayInfoBaseCell {
private func setupUI() {
subContainerView.radius = 6
updateCellCorner(.mid)
subContainerView.addSubview(innerContainerView)
innerContainerView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
}
}
}
//
// YHVisaRenewalPayInfoCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalPayInfoCell: YHVisaRenewalPayInfoBaseCell {
static let cellReuseIdentifier = "YHVisaRenewalPayInfoCell"
var rightButtonEvent: (() -> Void)?
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 13)
label.textColor = .mainTextColor70
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 13)
label.textColor = .mainTextColor
return label
}()
private lazy var rightButton: UIButton = {
let button = UIButton(type: .custom)
button.setTitleColor(.mainTextColor, for: .normal)
button.titleLabel?.font = .PFSC_M(ofSize: 10)
button.backgroundColor = .separatorColor
button.layer.cornerRadius = 8
button.clipsToBounds = true
button.addTarget(self, action: #selector(rightButtonClicked), for: .touchUpInside)
return button
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
view.isHidden = true
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: String, rightButtonTitle: String? = nil, cellType: YHResignRoundCellType = .mid, defaultMargin: CGFloat? = nil, showBottomLine: Bool = false) {
infoTitleLabel.text = title
infoDetailLabel.text = detail
updateInnerCellCorner(cellType)
bottomLineView.isHidden = !showBottomLine
var bottomMargin: CGFloat = cellType == .bottom ? 16 : 0
if let defaultMargin = defaultMargin {
bottomMargin = defaultMargin
}
if let rightButtonTitle = rightButtonTitle, rightButtonTitle.count > 0 {
rightButton.setTitle(rightButtonTitle, for: .normal)
rightButton.isHidden = false
infoDetailLabel.snp.remakeConstraints { make in
make.right.equalTo(rightButton.snp.left).offset(-6)
make.left.greaterThanOrEqualTo(infoTitleLabel.snp.right).offset(12)
make.centerY.equalTo(infoTitleLabel)
make.bottom.equalToSuperview().offset(-bottomMargin)
}
} else {
rightButton.setTitle(nil, for: .normal)
rightButton.isHidden = true
infoDetailLabel.snp.remakeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.left.greaterThanOrEqualTo(infoTitleLabel.snp.right).offset(12)
make.centerY.equalTo(infoTitleLabel)
make.bottom.equalToSuperview().offset(-bottomMargin)
}
}
}
}
extension YHVisaRenewalPayInfoCell {
@objc private func rightButtonClicked() {
rightButtonEvent?()
}
private func setupUI() {
updateInnerCellCorner(.mid)
innerContainerView.addSubview(rightButton)
innerContainerView.addSubview(infoTitleLabel)
innerContainerView.addSubview(infoDetailLabel)
innerContainerView.addSubview(bottomLineView)
rightButton.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
bottomLineView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview()
make.height.equalTo(0.5)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.top.equalToSuperview().offset(12)
}
rightButton.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.width.equalTo(36)
make.height.equalTo(18)
make.centerY.equalTo(infoTitleLabel)
}
infoDetailLabel.snp.makeConstraints { make in
make.right.equalTo(rightButton.snp.left).offset(-6)
make.left.greaterThanOrEqualTo(infoTitleLabel.snp.right).offset(12)
make.centerY.equalTo(infoTitleLabel)
make.bottom.equalToSuperview()
}
}
}
//
// YHVisaRenewalPayMethodQrcodeCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalPayMethodQrcodeCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHVisaRenewalPayMethodQrcodeCell"
var onLongPressEvent: ((UIImage) -> Void)?
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 14)
label.textColor = .mainTextColor
return label
}()
private lazy var infoTipsLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .mainTextColor50
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label
}()
private lazy var qrcodeIcon: UIImageView = {
let view = UIImageView()
view.contentMode = .scaleAspectFit
view.isUserInteractionEnabled = false
view.addGestureRecognizer(longPress)
return view
}()
/// 已添加的长按手势
private lazy var longPress: UILongPressGestureRecognizer = {
return UILongPressGestureRecognizer(target: self, action: #selector(onLongPress(_:)))
}()
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, tips: String, qrCode: UIImage?) {
infoTitleLabel.text = title
infoTipsLabel.text = tips
if let qrCode = qrCode {
qrcodeIcon.image = qrCode
qrcodeIcon.isUserInteractionEnabled = true
}
}
}
extension YHVisaRenewalPayMethodQrcodeCell {
/// 长按
@objc func onLongPress(_ press: UILongPressGestureRecognizer) {
if press.state == .began {
guard let image = self.qrcodeIcon.image else {
return
}
onLongPressEvent?(image)
}
}
private func setupUI() {
subContainerView.radius = 6
updateCellCorner(.bottom)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoTipsLabel)
subContainerView.addSubview(qrcodeIcon)
qrcodeIcon.snp.makeConstraints { make in
make.top.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-27)
make.width.height.equalTo(86)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.top.equalToSuperview().offset(31)
make.right.lessThanOrEqualTo(qrcodeIcon.snp.left).offset(-16)
}
infoTipsLabel.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.equalTo(infoTitleLabel.snp.bottom).offset(6)
make.right.lessThanOrEqualTo(qrcodeIcon.snp.left).offset(-16)
make.bottom.lessThanOrEqualToSuperview().offset(-18)
}
}
}
//
// YHVisaRenewalPayMethodUrlCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHVisaRenewalPayMethodUrlCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHVisaRenewalPayMethodUrlCell"
var urlClicked: ((String) -> Void)?
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 14)
label.textColor = .mainTextColor
return label
}()
private lazy var infoTipsLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .mainTextColor50
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label
}()
private lazy var bottomContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 4, corner: .allCorners)
view.backgroundColor = .contentBkgColor
return view
}()
private lazy var urlLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .brandMainColor
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
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, tips: String, url: String) {
infoTitleLabel.text = title
infoTipsLabel.text = tips
let attStr = ASAttributedString.init(string: url, .underline(.init(rawValue: 1)), .action { [weak self] in
self?.urlClicked?(url)
})
urlLabel.attributed.text = attStr
}
}
extension YHVisaRenewalPayMethodUrlCell {
private func setupUI() {
subContainerView.radius = 6
updateCellCorner(.mid)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoTipsLabel)
subContainerView.addSubview(bottomContainerView)
subContainerView.addSubview(bottomLineView)
bottomContainerView.addSubview(urlLabel)
infoTitleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.top.equalToSuperview()
make.right.lessThanOrEqualToSuperview().offset(-18)
}
infoTipsLabel.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.equalTo(infoTitleLabel.snp.bottom).offset(6)
make.right.lessThanOrEqualToSuperview().offset(-18)
}
bottomContainerView.snp.makeConstraints { make in
make.top.equalTo(infoTipsLabel.snp.bottom).offset(12)
make.left.equalTo(infoTitleLabel.snp.left)
make.right.equalToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-18)
}
urlLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
}
bottomLineView.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.right.equalTo(bottomContainerView.snp.right)
make.bottom.equalToSuperview()
make.height.equalTo(0.5)
}
}
}
//
// YHVisaRenewalPayOccupyingSpaceCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalPayOccupyingSpaceCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHVisaRenewalPayOccupyingSpaceCell"
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(isBottom: Bool = false) {
subContainerView.corner = isBottom ? [.bottomLeft, .bottomRight] : .none
let height: CGFloat = isBottom ? 18 : 12
subContainerView.snp.remakeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(height)
}
}
}
extension YHVisaRenewalPayOccupyingSpaceCell {
private func setupUI() {
subContainerView.radius = 6
updateCellCorner(.mid)
}
}
//
// YHVisaRenewalPayStatusCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalPayStatusCell: YHVisaRenewalPayInfoBaseCell {
static let cellReuseIdentifier = "YHVisaRenewalPayStatusCell"
private lazy var iconView: UIView = {
let view = UIView()
view.backgroundColor = .brandMainColor
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 15)
label.textColor = .mainTextColor
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 13)
label.textColor = .brandMainColor
return label
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
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, status: YHVisaRenewalPaymentStatus) {
infoTitleLabel.text = title
infoDetailLabel.text = status.title
infoDetailLabel.textColor = status.titleColor
}
}
extension YHVisaRenewalPayStatusCell {
private func setupUI() {
updateInnerCellCorner(.top)
innerContainerView.addSubview(iconView)
innerContainerView.addSubview(infoTitleLabel)
innerContainerView.addSubview(infoDetailLabel)
innerContainerView.addSubview(bottomLineView)
iconView.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
bottomLineView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(0.5)
}
iconView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.width.equalTo(4)
make.height.equalTo(15)
make.centerY.equalTo(infoTitleLabel)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalTo(iconView.snp.right).offset(12)
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-12)
}
infoDetailLabel.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.left.greaterThanOrEqualTo(infoTitleLabel.snp.right).offset(12)
make.centerY.equalTo(infoTitleLabel)
}
}
}
//
// YHVisaRenewalPayTipsCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalPayTipsCell: YHVisaRenewalPayInfoBaseCell {
static let cellReuseIdentifier = "YHVisaRenewalPayTipsCell"
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 13)
label.textColor = .mainTextColor50
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
label.textAlignment = .center
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) {
infoDetailLabel.text = detail
}
}
extension YHVisaRenewalPayTipsCell {
private func setupUI() {
updateInnerCellCorner(.bottom)
innerContainerView.addSubview(infoDetailLabel)
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(12)
make.bottom.equalToSuperview().offset(-16)
make.centerX.equalToSuperview()
make.left.greaterThanOrEqualToSuperview().offset(16)
make.right.lessThanOrEqualToSuperview().offset(-16)
}
}
}
//
// YHVisaRenewalResidenceActionCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalResidenceActionCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHVisaRenewalResidenceActionCell"
var rightButtonEvent: (() -> Void)?
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = .mainTextColor
return label
}()
private lazy var rightButton: UIButton = {
let button = UIButton(type: .custom)
button.setTitleColor(.mainTextColor, for: .normal)
button.titleLabel?.font = .PFSC_M(ofSize: 12)
button.addTarget(self, action: #selector(rightButtonClicked), for: .touchUpInside)
button.layer.cornerRadius = 2
button.clipsToBounds = true
return button
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
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, presenceStatus: YHVisaRenewalPresenceStatus, cellType: YHResignRoundCellType = .mid) {
updateCellCorner(cellType)
infoTitleLabel.text = title
rightButton.setTitle(presenceStatus.title, for: .normal)
rightButton.setTitleColor(presenceStatus.titleColor, for: .normal)
rightButton.backgroundColor = presenceStatus.bgColor
let isBottom = cellType == .bottom
bottomLineView.isHidden = isBottom ? true : false
let bottomMargin: CGFloat = isBottom ? 38 : 16
infoTitleLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(18)
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-bottomMargin)
}
}
}
extension YHVisaRenewalResidenceActionCell {
@objc private func rightButtonClicked() {
rightButtonEvent?()
}
private func setupUI() {
subContainerView.radius = 6
updateCellCorner(.mid)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(rightButton)
subContainerView.addSubview(bottomLineView)
infoTitleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
rightButton.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
}
rightButton.snp.makeConstraints { make in
make.left.greaterThanOrEqualTo(infoTitleLabel.snp.right).offset(6)
make.centerY.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(26)
make.width.equalTo(72)
}
bottomLineView.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.right.equalTo(rightButton.snp.right)
make.bottom.equalToSuperview()
make.height.equalTo(0.5)
}
}
}
//
// YHVisaRenewalSectionHeaderCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHVisaRenewalSectionHeaderCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHVisaRenewalSectionHeaderCell"
var rightButtonEvent: (() -> Void)?
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
return label
}()
private lazy var rightButton: UIButton = {
let button = UIButton(type: .custom)
button.setTitleColor(.brandMainColor, for: .normal)
button.titleLabel?.font = .PFSC_R(ofSize: 12)
button.addTarget(self, action: #selector(rightButtonClicked), for: .touchUpInside)
return button
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
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, buttonTitle: String? = nil) {
infoTitleLabel.text = title
guard let buttonTitle = buttonTitle, buttonTitle.count > 0 else {
rightButton.setTitle(nil, for: .normal)
rightButton.isHidden = true
return
}
rightButton.isHidden = false
rightButton.setTitle(buttonTitle, for: .normal)
}
}
extension YHVisaRenewalSectionHeaderCell {
@objc private func rightButtonClicked() {
rightButtonEvent?()
}
private func setupUI() {
subContainerView.radius = 6
updateCellCorner(.top)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(rightButton)
subContainerView.addSubview(bottomLineView)
infoTitleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
rightButton.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-12)
}
rightButton.snp.makeConstraints { make in
make.left.greaterThanOrEqualTo(infoTitleLabel.snp.right).offset(6)
make.centerY.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18)
}
bottomLineView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(0.5)
}
}
}
//
// YHVisaRenewalTipsCell.swift
// galaxy
//
// Created by alexzzw on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHVisaRenewalTipsCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHVisaRenewalTipsCell"
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .mainTextColor50
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: ASAttributedString) {
infoDetailLabel.attributed.text = detail
}
}
extension YHVisaRenewalTipsCell {
private func setupUI() {
subContainerView.radius = 6
updateCellCorner(.mid)
subContainerView.addSubview(infoDetailLabel)
infoDetailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.top.equalToSuperview().offset(12)
make.bottom.equalToSuperview().offset(-12)
make.right.lessThanOrEqualToSuperview().offset(-18)
}
}
}
...@@ -29,6 +29,7 @@ class YHVisaRenewalTroubleshootingGuideHeaderCell: UITableViewCell { ...@@ -29,6 +29,7 @@ class YHVisaRenewalTroubleshootingGuideHeaderCell: UITableViewCell {
label.font = .PFSC_R(ofSize: 14) label.font = .PFSC_R(ofSize: 14)
label.textColor = .mainTextColor70 label.textColor = .mainTextColor70
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
let paragraphStyle = NSMutableParagraphStyle() let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.07 paragraphStyle.lineHeightMultiple = 1.07
let attributedText = NSAttributedString( let attributedText = NSAttributedString(
......
...@@ -47,6 +47,15 @@ class YHVisaRenewalWorkflowCell: UITableViewCell { ...@@ -47,6 +47,15 @@ class YHVisaRenewalWorkflowCell: UITableViewCell {
func setupCellInfo(title: String, workflows: [String]) { func setupCellInfo(title: String, workflows: [String]) {
infoTitleLabel.text = title infoTitleLabel.text = title
stepLabels.forEach {
$0.removeFromSuperview()
}
circleViews.forEach {
$0.removeFromSuperview()
}
dashLines.forEach {
$0.removeFromSuperview()
}
stepLabels.removeAll() stepLabels.removeAll()
circleViews.removeAll() circleViews.removeAll()
dashLines.removeAll() dashLines.removeAll()
...@@ -141,6 +150,7 @@ extension YHVisaRenewalWorkflowCell { ...@@ -141,6 +150,7 @@ extension YHVisaRenewalWorkflowCell {
label.font = .PFSC_R(ofSize: 13) label.font = .PFSC_R(ofSize: 13)
label.textColor = .mainTextColor70 label.textColor = .mainTextColor70
label.numberOfLines = 0 label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
let paragraphStyle = NSMutableParagraphStyle() let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.1 paragraphStyle.lineHeightMultiple = 1.1
let attributedText = NSAttributedString( let attributedText = NSAttributedString(
......
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