Commit 5676a2ef authored by David黄金龙's avatar David黄金龙

删除 不使用的代码

parent 34130e10
//
// YHOfficalLetterListModel.swift
// galaxy
//
// Created by davidhuangA on 2024/8/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHOfficalLetterModel: SmartCodable {
var id : Int = -1//申请记录的唯一标识符
var applicant : String = ""//申请人的姓名
var approval_date : String = ""//申请人姓名
var applicant_approval_date : String = ""//申请的日期和时间
var archivist_id : Int = -1//来自相关记录的数据ID
var data_from_type : Int = -1 //数据来源的类型
var deleted_at : String = ""//申请记录被删除的时间(可选)
var e_visa_cn : String = ""//申请人姓名
var email_received_at : String = "" //邮件接收时间
var file_no : String = ""//文件编号
var file_num : String = ""//文件号(可能与file_no重复,用于不同场景)
var file_type : Int = -1 //文件类型
var file_url_transformed : String = ""//转换后的文件URL
var from_order_id : Int = -1 //来源订单ID
var from_relation : Int = -1//与申请人关系的代码
var from_relation_cn : String = ""//与申请人关系的中文描述
var handler : String = ""//处理申请的人员
var is_check : Int = -1//是否进行了检查
var name : String = ""//申请人的姓名
var pay_deadline : String = ""//支付截止日期
var read_status : Int = -1 //阅读状态(例如:未读,已读)
var remark : String = ""//备注信息
var remark_archivist : [String] = []//备注信息,可包含多个档案管理员的备注
var result : Int = -1//申请结果代码
var result_at : String = ""//申请结果的时间
var result_cn : String = ""//申请结果的中文描述
var type : String = ""//申请的类型(例如:旅游,商务)
var updated_at : String = "" //申请记录最后更新的时间
var url : String = ""//文件的URL
var localShowFlag : Bool = false //信件是否点击打开 本地变量
required init() {
}
}
class YHOfficalLetterListModel: SmartCodable {
var order_id : Int = -1//订单id
var applicant_id :Int = -1//申请人id
var applicant_name : String = ""//申请人姓名
var applicant_approval_date : String = ""//申请人通过时间
var applicant_sex : Int = -1//申请人性别
var days : Int = -1 //天数
var list : [YHOfficalLetterModel] = []
required init() {
}
}
//
// YHOfficailLetterColledtionCell.swift
// galaxy
//
// Created by davidhuangA on 2024/8/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import FSPagerView
class YHOfficailLetterColledtionCell: FSPagerViewCell {
static let cellReuseIdentifier = "YHOfficailLetterColledtionCell"
var dataModel: YHOfficalLetterModel? {
didSet {
updateUI()
}
}
lazy var bkgImageView:UIImageView = {
let imageV = UIImageView(image: UIImage(named: "official_approval_result_envelope_not_read"))
imageV.contentMode = .scaleAspectFill
return imageV
}()
lazy var nameLable:UILabel = {
let label = UILabel()
label.text = ""
label.textColor = UIColor(hex: 0xA96B42, alpha: 1.0)
label.font = UIFont.PFSC_M(ofSize: 15)
return label
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(frame: CGRect) {
super.init(frame: frame)
contentView.removeSubviews()
setupUI()
}
}
private extension YHOfficailLetterColledtionCell {
func setupUI() {
backgroundColor = .clear
contentView.backgroundColor = .clear
clipsToBounds = true
contentView.layer.shadowColor = UIColor.clear.cgColor
contentView.layer.shadowRadius = 0
contentView.layer.shadowOpacity = 0
contentView.layer.shadowOffset = .zero
contentView.addSubview(bkgImageView)
bkgImageView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
contentView.addSubview(nameLable)
nameLable.snp.makeConstraints { make in
make.top.equalToSuperview().offset(kMargin + 12)
make.left.equalToSuperview().offset(60)
make.height.equalTo(21)
}
}
func updateUI() {
guard let model = dataModel else { return }
nameLable.text = model.applicant
if !model.localShowFlag {
//未读
bkgImageView.image = UIImage(named: "official_approval_result_envelope_not_read")
} else {
//已读
bkgImageView.image = UIImage(named: "official_approval_result_envelope_readed")
}
}
}
//
// YHOffivialApprovalGuildLineCheckView.swift
// galaxy
//
// Created by davidhuangA on 2024/8/7.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHOffivialApprovalGuildLineCheckView: UIView {
typealias Block = () -> ()
var block: Block?
lazy var blackMaskView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismiss))
view.addGestureRecognizer(tap)
return view
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .clear
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
}()
//我已悉知,确认
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.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.addTarget(self, action: #selector(clickSureBtn), for: .touchUpInside)
button.backgroundColor = UIColor.brandMainColor
return button
}()
lazy var myScrollView: UIScrollView = {
let view = UIScrollView()
view.backgroundColor = .clear
view.showsVerticalScrollIndicator = false
view.delegate = self
return view
}()
lazy var bkgImageV: UIImageView = {
let imageV = UIImageView()
imageV.image = UIImage(named: "official_approval_guideline")
imageV.contentMode = .scaleToFill
imageV.clipsToBounds = true
return imageV
}()
lazy var bkgImageV2: UIImageView = {
let imageV = UIImageView()
imageV.image = UIImage(named: "official_approval_guideline_bkg")
imageV.contentMode = .scaleToFill
imageV.clipsToBounds = true
return imageV
}()
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
private var timer : Timer?
private var maxCount : Int = 5
//之前是否展示过
var ischeckBeforeFlag : Bool = false {
didSet {
if ischeckBeforeFlag {
setButtonEnable(true)
} else {
setButtonEnable(false)
startTimer()
}
}
}
}
extension YHOffivialApprovalGuildLineCheckView {
static func sheetView() -> YHOffivialApprovalGuildLineCheckView {
let view = YHOffivialApprovalGuildLineCheckView(frame:UIScreen.main.bounds)
return view
}
func show() {
UIApplication.shared.yhKeyWindow()?.addSubview(self)
UIView.animate(withDuration: 0.5) {
let whiteHeight = KScreenHeight - k_Height_NavigationtBarAndStatuBar
self.whiteContentView.frame = CGRect(x: 0, y: KScreenHeight - whiteHeight, width: KScreenWidth, height: whiteHeight)
}
}
@objc func dismiss() {
self.removeFromSuperview()
}
@objc func clickSureBtn() {
self.block?()
dismiss()
}
}
private extension YHOffivialApprovalGuildLineCheckView {
@objc func timerFired() {
// 定时器触发时执行的代码
print("Timer fired")
self.maxCount = self.maxCount - 1
if self.maxCount < 0 {
self.stopTimer()
self.setButtonEnable(true)
} else {
rewardBtn.setTitle("请上滑看完指引后操作(\(maxCount)s)", for: .normal)
}
}
func startTimer() {
stopTimer()
timer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(timerFired), userInfo: nil, repeats: true)
RunLoop.current.add(timer!, forMode: .common)
}
func stopTimer() {
maxCount = 5
timer?.invalidate()
timer = nil
}
func setButtonEnable(_ enable : Bool) {
rewardBtn.isEnabled = enable
if enable {
rewardBtn.setTitle("我已悉知,确认", for: .normal)
rewardBtn.backgroundColor = UIColor.brandMainColor
} else {
rewardBtn.setTitle("请上滑看完指引后操作(5s)", for: .normal)
rewardBtn.backgroundColor = UIColor(hex: 0xB7C0CC, alpha: 1.0)
}
}
func setupUI() {
self.addSubview(blackMaskView)
self.addSubview(whiteContentView)
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
let path = UIBezierPath(roundedRect:bounds,byRoundingCorners: corner,cornerRadii:CGSizeMake(16.0, 16.0));
let layer = CAShapeLayer();
layer.frame = whiteContentView.bounds;
layer.path = path.cgPath;
whiteContentView.layer.mask = layer;
whiteContentView.clipsToBounds = true
blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
let whiteHeight = KScreenHeight - k_Height_NavigationtBarAndStatuBar
// whiteContentView.snp.makeConstraints { make in
// make.left.right.bottom.equalToSuperview()
// make.height.equalTo(whiteHeight)
// }
whiteContentView.frame = CGRect(x: 0, y: KScreenHeight, width: KScreenWidth, height: whiteHeight)
whiteContentView.addSubview(bkgImageV2)
bkgImageV2.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(375)
}
whiteContentView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(98)
}
whiteContentView.addSubview(myScrollView)
myScrollView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.right.equalToSuperview()
make.width.equalTo(KScreenWidth)
make.height.equalTo(whiteHeight-98 - 20)
}
if let tmpImage = UIImage(named:"official_approval_guideline") {
let scale = Double(tmpImage.size.height / tmpImage.size.width)
let imageH = scale * KScreenWidth
myScrollView.addSubview(bkgImageV)
bkgImageV.snp.makeConstraints { make in
make.top.left.equalToSuperview()
make.width.equalTo(KScreenWidth)
make.height.equalTo(imageH)
}
myScrollView.contentSize = CGSize(width: KScreenWidth, height: imageH)
}
}
}
extension YHOffivialApprovalGuildLineCheckView : UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if !ischeckBeforeFlag {
let scrollViewContentHeight = scrollView.contentSize.height
let scrollOffsetThreshold = scrollViewContentHeight - scrollView.bounds.size.height
// 当前滚动位置
let currentOffset = scrollView.contentOffset.y
if currentOffset > scrollOffsetThreshold { // 接近底部
// 滚动到了底部
ischeckBeforeFlag = true
stopTimer()
setButtonEnable(true)
} else {
// 没有滚动到底部
}
}
}
}
//
// YHOffivialApprovalSuccessView.swift
// galaxy
//
// Created by EDY on 2024/8/9.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHOffivialApprovalSuccessView: UIView {
var dataModel : YHOfficalLetterListModel? {
didSet {
updateUI()
}
}
private var titleLabel: UILabel!
private var arrViews : [UIView] = []
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
func setupUI() {
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 30)
label.textColor = UIColor(hex: 0x881000)
label.text = "恭喜"
return label
}()
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(5)
make.top.equalTo(0)
make.right.equalTo(-5)
make.height.equalTo(42)
}
}
func updataView(data: [String]) {
for (_,item) in arrViews.enumerated() {
item.removeFromSuperview()
}
var h = 60
var index = 0
for item in data {
let label = UILabel()
label.text = item
label.font = UIFont.PFSC_M(ofSize: 15)
label.textColor = UIColor(hex: 0x881000)
if index == 2 {
label.textColor = UIColor(hex: 0xd12501)
}
addSubview(label)
label.snp.makeConstraints { make in
make.left.equalTo(5)
make.top.equalTo(h)
make.right.equalTo(-5)
make.height.equalTo(26)
}
let line = UIView()
line.backgroundColor = UIColor(hex: 0x881000).withAlphaComponent(0.15)
addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(5)
make.top.equalTo(h + 26 + 2)
make.width.equalTo(234)
make.height.equalTo(1)
}
h = h + 26 + 10
index = index + 1
arrViews.append(label)
arrViews.append(line)
}
}
}
private extension YHOffivialApprovalSuccessView {
func updateUI() {
// backgroundColor = .purple // for test hjl
guard let model = dataModel else { return }
titleLabel.text = "恭喜 " + model.applicant_name + model.applicant_sex.gentlemanDescribe() + "!"
if model.applicant_approval_date.count >= "2023年10月1日".count {
var tmp = model.applicant_approval_date.slice(from: 0, length: "2023年10月1日".count)
let arr = tmp.split(separator: "-")
if arr.count == 3 {
tmp = arr[0] + "年" + arr[1] + "月" + arr[2] + "日" + "正式获批"
let fourItems = ["祝贺您和您的家人申请的","【优秀人才入境计划】",tmp,"这意味着,您领取香港居民身份证","仅有一步之遥!!"]
updataView(data: fourItems)
}
}
}
}
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