Commit 0d719df6 authored by Steven杜宇's avatar Steven杜宇

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

parents 84c4d89b c88feb4a
......@@ -300,6 +300,7 @@
047AA3F82C5CC7B0009C4554 /* YHShareStepView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3F72C5CC7B0009C4554 /* YHShareStepView.swift */; };
047AA3FA2C60739E009C4554 /* YHInvitationWithGiftsSelectItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3F92C60739E009C4554 /* YHInvitationWithGiftsSelectItemView.swift */; };
047AA3FC2C61EE7F009C4554 /* YHSignAppendStepView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3FB2C61EE7F009C4554 /* YHSignAppendStepView.swift */; };
047AA3FF2C646844009C4554 /* YHTypingEffectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047AA3FE2C646844009C4554 /* YHTypingEffectViewController.swift */; };
0480976B2BA15269000B9DCA /* YHCertificateInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */; };
0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */; };
048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */; };
......@@ -945,6 +946,7 @@
047AA3F72C5CC7B0009C4554 /* YHShareStepView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHShareStepView.swift; sourceTree = "<group>"; };
047AA3F92C60739E009C4554 /* YHInvitationWithGiftsSelectItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInvitationWithGiftsSelectItemView.swift; sourceTree = "<group>"; };
047AA3FB2C61EE7F009C4554 /* YHSignAppendStepView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSignAppendStepView.swift; sourceTree = "<group>"; };
047AA3FE2C646844009C4554 /* YHTypingEffectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTypingEffectViewController.swift; sourceTree = "<group>"; };
0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfoCell.swift; sourceTree = "<group>"; };
0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateListVC.swift; sourceTree = "<group>"; };
048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchBar.swift; sourceTree = "<group>"; };
......@@ -1382,6 +1384,7 @@
children = (
0419A0992C48F87B00A5FCFA /* YHInvitationWithGiftsViewController.swift */,
047AA3D82C4A4A91009C4554 /* YHInvatationShareViewController.swift */,
047AA3FE2C646844009C4554 /* YHTypingEffectViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -3932,6 +3935,7 @@
044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */,
A567E5B02BD7643D00D5D5A0 /* YHHomeWebBottomView.swift in Sources */,
045EEF0D2B9F171A0022A143 /* YHBasicInfoFillCell.swift in Sources */,
047AA3FF2C646844009C4554 /* YHTypingEffectViewController.swift in Sources */,
044D0C1A2C22B40B00C5CF5E /* YHEditPersonalProfileViewController.swift in Sources */,
047AA3E82C4A6D69009C4554 /* YHListViewController.swift in Sources */,
048787D92BCF68530036E221 /* YHProgressView.swift in Sources */,
......
//
// YHTypingEffectViewController.swift
// galaxy
//
// Created by EDY on 2024/8/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHTypingEffectViewController: YHBaseViewController {
private let label: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.systemFont(ofSize: 18)
label.textColor = .white
label.textAlignment = .center
return label
}()
private var displayLink: CADisplayLink?
private var currentIndex: Int = 0
private var fullText: String = "恭喜您申请的【优秀人才入境计划】"
private var centerText: String = "已获得港府的正式批准!"
private var lastText: String = "从递交资料伊始,经历了235天,感谢您这一路以来对银河的信赖与包容!"
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .black
view.addSubview(label)
label.frame = view.bounds
startTypingEffect()
}
private func startTypingEffect() {
displayLink = CADisplayLink(target: self, selector: #selector(handleDisplayLink(_:)))
displayLink?.preferredFramesPerSecond = Int(1 / 0.1) // 设置帧率
displayLink?.add(to: .current, forMode: .common)
}
@objc private func handleDisplayLink(_ displayLink: CADisplayLink) {
if currentIndex < fullText.count + centerText.count + lastText.count {
var index = currentIndex
if currentIndex >= fullText.count {
index = fullText.count
}
let attributedString = NSMutableAttributedString(string: String(fullText[..<index]),
attributes: [
NSAttributedString.Key.foregroundColor: UIColor.white,
NSAttributedString.Key.paragraphStyle: {
let style = NSMutableParagraphStyle()
style.lineSpacing = 8 //控制行间距
style.alignment = .center
return style
}()
])
var centerIndex = 0
if currentIndex >= fullText.count + centerText.count {
centerIndex = centerText.count
} else if currentIndex >= fullText.count {
centerIndex = currentIndex - fullText.count
}
let centerattributedString = NSMutableAttributedString(string: String(centerText[..<centerIndex]),
attributes: [
NSAttributedString.Key.foregroundColor: UIColor.red,
NSAttributedString.Key.paragraphStyle: {
let style = NSMutableParagraphStyle()
style.lineSpacing = 8 //控制行间距
style.alignment = .center
return style
}()
])
var lastIndex = 0
if currentIndex >= fullText.count + centerText.count {
lastIndex = currentIndex - fullText.count - centerText.count
}
let lastattributedString = NSMutableAttributedString(string: String(lastText[..<lastIndex]),
attributes: [
NSAttributedString.Key.foregroundColor: UIColor.white,
NSAttributedString.Key.paragraphStyle: {
let style = NSMutableParagraphStyle()
style.lineSpacing = 8 //控制行间距
style.alignment = .center
return style
}()
])
var result = NSMutableAttributedString(attributedString: attributedString)
result.append(centerattributedString)
result.append(lastattributedString)
label.attributedText = result
currentIndex += 1
} else {
displayLink.invalidate()
}
}
}
......@@ -85,7 +85,7 @@ class YHInvitationWithGiftsViewModel: YHBaseViewModel {
if self.state < 3 {
param.updateValue(self.state + 1, forKey: "status")
}
if registered_date.isEmpty {
if !registered_date.isEmpty {
param.updateValue(registered_date, forKey: "registered_date")
}
......
......@@ -7,17 +7,15 @@
//
import UIKit
import AttributedString
class YHOffivialApprovalSuccessCheckView: UIView {
lazy var blackMaskView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.6)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismiss))
view.addGestureRecognizer(tap)
return view
}()
//香港身份获批指引操作
lazy var rewardBtn: UIButton = {
let button = UIButton(type: .custom)
......@@ -26,6 +24,13 @@ class YHOffivialApprovalSuccessCheckView: UIView {
return button
}()
lazy var closeBtn: UIButton = {
let button = UIButton(type: .custom)
button.addTarget(self, action: #selector(clickCloseBtn), for: .touchUpInside)
button.setImage(UIImage(named: "official_approval_close_btn"), for: .normal)
return button
}()
lazy var bkgImageV: UIImageView = {
let imageV = UIImageView()
imageV.image = UIImage(named: "official_approval_bkg")
......@@ -34,7 +39,6 @@ class YHOffivialApprovalSuccessCheckView: UIView {
return imageV
}()
lazy var holdView: UIView = {
let view = UIView()
return view
......@@ -43,8 +47,7 @@ class YHOffivialApprovalSuccessCheckView: UIView {
lazy var titleLabel: UILabel = {
var label = UILabel()
label.font = .PFSC_R(ofSize: 14)
// label.textAlignment = .center
label.font = .PFSC_R(ofSize: 15)
label.textColor = UIColor(hex: 0x671908, alpha: 1.0)
label.text = ""
label.numberOfLines = 0
......@@ -53,8 +56,6 @@ class YHOffivialApprovalSuccessCheckView: UIView {
}()
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
......@@ -68,7 +69,6 @@ class YHOffivialApprovalSuccessCheckView: UIView {
var timer: Timer?
var counter = 0
// var text = "打字机效果展示"
}
extension YHOffivialApprovalSuccessCheckView {
......@@ -87,6 +87,10 @@ extension YHOffivialApprovalSuccessCheckView {
}
@objc func clickSureBtn() {
YHHUD.flash(message: "点击了 xx")
}
@objc func clickCloseBtn() {
dismiss()
}
}
......@@ -126,18 +130,19 @@ private extension YHOffivialApprovalSuccessCheckView {
}
holdView.addSubview(closeBtn)
closeBtn.snp.makeConstraints { make in
make.top.equalTo(rewardBtn.snp.bottom).offset(156)
make.width.equalTo(24)
make.height.equalTo(24)
make.centerX.equalToSuperview()
}
closeBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
UIView.animate(withDuration: 1) {
self.holdView.frame = CGRect(x: 0, y: (KScreenHeight-imageH)/2, width: KScreenWidth, height: imageH)
self.holdView.frame = CGRect(x: 0, y: (KScreenHeight-imageH)/2 + 20, width: KScreenWidth, height: imageH)
} completion: { flag in
self.titleLabel.isHidden = false
// self.typewriterEffect(text: self.testContent) { finishedText in
// print("打字完成: \(finishedText)")
//
// }
self.startTyping()
}
......@@ -152,24 +157,16 @@ private extension YHOffivialApprovalSuccessCheckView {
@objc func typeText() {
if counter < testContent.count {
let char = testContent[testContent.index(testContent.startIndex, offsetBy: counter)]
self.titleLabel.text = String(testContent.prefix(counter + 1))
counter += 1
} else {
timer?.invalidate()
counter = 0
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = 6 // 设置行间距
paragraphStyle.alignment = .center
let attributes: [NSAttributedString.Key: Any] = [
.paragraphStyle: paragraphStyle,
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor:UIColor(hex: 0x671908, alpha: 1.0)
]
let attributedString = NSAttributedString(string: self.testContent, attributes: attributes)
self.titleLabel.attributedText = attributedString
let aa: ASAttributedString = .init("恭喜您申请的【优秀人才入境计划】", .font(UIFont.PFSC_R(ofSize: 15)),.foreground(UIColor(hex: 0x671908, alpha: 1.0)))
let bb: ASAttributedString = .init("已获得港府的正式批准!", .font(UIFont.PFSC_R(ofSize: 15)),.foreground(UIColor(hex: 0xAE1616, alpha: 1.0)))
let cc: ASAttributedString = .init("从递交资料伊始,经历了235天,感谢您这一路以来对银河的信赖与包容!", .font(UIFont.PFSC_R(ofSize: 15)),.foreground(UIColor(hex: 0x671908, alpha: 1.0)))
self.titleLabel.attributed.text = aa + bb + cc
}
}
}
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Group 2033194865@2x.png",
"filename" : "弹窗-信封@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033194865@3x.png",
"filename" : "弹窗-信封@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
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