Commit 4b65004e authored by Steven杜宇's avatar Steven杜宇

// 指引UI

parent 7049c596
......@@ -194,6 +194,7 @@
044D0C1C2C22C30B00C5CF5E /* YHEditSchoolViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1B2C22C30B00C5CF5E /* YHEditSchoolViewController.swift */; };
044D0C1E2C22CFBF00C5CF5E /* YHEditWorkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1D2C22CFBF00C5CF5E /* YHEditWorkViewController.swift */; };
044D0C202C22D37500C5CF5E /* YHEditHonorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C1F2C22D37500C5CF5E /* YHEditHonorViewController.swift */; };
044E31C52CBCFDD200500F8E /* YHResignAppointGuideLineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044E31C42CBCFDD200500F8E /* YHResignAppointGuideLineView.swift */; };
044EE2232C8FE1D000A2FE3A /* YHServiceCenterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044EE2222C8FE1D000A2FE3A /* YHServiceCenterViewController.swift */; };
044EE2252C90138000A2FE3A /* YHServerCenterHoldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044EE2242C90138000A2FE3A /* YHServerCenterHoldViewController.swift */; };
044EE2272C91367800A2FE3A /* YHServiceStepThreeSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044EE2262C91367800A2FE3A /* YHServiceStepThreeSectionView.swift */; };
......@@ -1132,6 +1133,7 @@
044D0C1B2C22C30B00C5CF5E /* YHEditSchoolViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditSchoolViewController.swift; sourceTree = "<group>"; };
044D0C1D2C22CFBF00C5CF5E /* YHEditWorkViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditWorkViewController.swift; sourceTree = "<group>"; };
044D0C1F2C22D37500C5CF5E /* YHEditHonorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditHonorViewController.swift; sourceTree = "<group>"; };
044E31C42CBCFDD200500F8E /* YHResignAppointGuideLineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignAppointGuideLineView.swift; sourceTree = "<group>"; };
044EE2222C8FE1D000A2FE3A /* YHServiceCenterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterViewController.swift; sourceTree = "<group>"; };
044EE2242C90138000A2FE3A /* YHServerCenterHoldViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServerCenterHoldViewController.swift; sourceTree = "<group>"; };
044EE2262C91367800A2FE3A /* YHServiceStepThreeSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceStepThreeSectionView.swift; sourceTree = "<group>"; };
......@@ -3576,6 +3578,7 @@
isa = PBXGroup;
children = (
04912F6D2CB6A64700CC3105 /* YHResignAppointSubmitTipsView.swift */,
044E31C42CBCFDD200500F8E /* YHResignAppointGuideLineView.swift */,
04912F732CB7743900CC3105 /* YHResignAppointSelectTimeItemView.swift */,
04912F7B2CB7A7EE00CC3105 /* YHResignAppointShowTimeItemView.swift */,
04912F752CB77F4500CC3105 /* YHResignLeaveHKSwitchItemView.swift */,
......@@ -6015,6 +6018,7 @@
04174D782BCD5B74000BA46D /* YHMessageListVC.swift in Sources */,
0430E6742C74A02B000511E2 /* YHAdopterIdCardViewController.swift in Sources */,
04F243472C9BB6C000DF2C74 /* YHHKRecordsSectionHeaderCell.swift in Sources */,
044E31C52CBCFDD200500F8E /* YHResignAppointGuideLineView.swift in Sources */,
A517A4E12BB573EB000DEECD /* YHDocListCell.swift in Sources */,
A58037212BAD7B2A0031C312 /* YHMySchemeModel.swift in Sources */,
0493B3DE2BA80C2300AF9393 /* YHCertificateFilterButton.swift in Sources */,
......
......@@ -55,6 +55,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setImage(UIImage(named: "resign_appint_guide"), for: .normal)
button.centerTextAndImage(imageAboveText: true, spacing: 0.0)
button.addTarget(self, action: #selector(didGuideBtnClicked), for: .touchUpInside)
return button
}()
......@@ -64,7 +65,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
btn.setTitle("下一步,去查看递交凭证", for: .normal)
btn.setTitleColor(.white, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
btn.addTarget(self, action: #selector(didSubmitBtnClicked), for: .touchUpInside)
btn.addTarget(self, action: #selector(didNextBtnClicked), for: .touchUpInside)
btn.layer.cornerRadius = kCornerRadius3
return btn
}()
......@@ -107,22 +108,31 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
make.height.equalTo(98)
}
self.updateBottomBtnAndMotifyBtnStatus()
}
@objc func didSubmitBtnClicked() {
@objc func didNextBtnClicked() {
}
@objc func didGuideBtnClicked() {
let view = YHResignAppointGuideLineView.sheetView()
view.ischeckBeforeFlag = false
view.block = {
}
view.show()
}
// 更新底部下一步按钮点击状态
func updateBottomBtnAndMotifyBtnStatus() {
var isAtLeatOneHaveConfirmInHK = self.isAtLeatOneHaveConfirmInHK()
// 至少有一个行程已确认在港
let isAtLeatOneHaveConfirmInHK = self.isAtLeatOneHaveConfirmInHK()
self.nextBtn.isUserInteractionEnabled = isAtLeatOneHaveConfirmInHK
self.nextBtn.alpha = isAtLeatOneHaveConfirmInHK ? 1.0 : 0.3
// 所有分批都已确认在港 则无需修改了
self.isHiddenModifyBtn = self.isAllHaveHaveConfirmInHK()
self.tableView.reloadData()
}
func clickConfirmHKButton(status: YHResignConfirmHKStatus, _ model: YHResignAppointGroup) {
......
......@@ -75,6 +75,7 @@ class YHResignAppointTimeViewController: YHBaseViewController {
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setImage(UIImage(named: "resign_appoint_tips_btn"), for: .normal)
button.centerTextAndImage(imageAboveText: true, spacing: 0.0)
button.addTarget(self, action: #selector(didTipsBtnClicked), for: .touchUpInside)
return button
}()
......@@ -129,6 +130,10 @@ class YHResignAppointTimeViewController: YHBaseViewController {
self.updateUI()
}
@objc func didTipsBtnClicked() {
YHResignAppointSubmitTipsView.alertView().show()
}
func updateUI() {
togetherArr.removeAll()
......
//
// YHResignAppointGuideLineView.swift
// galaxy
//
// Created by edy on 2024/10/14.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignAppointGuideLineView: 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.showsHorizontalScrollIndicator = false
view.delegate = self
return view
}()
lazy var bkgImageV: UIImageView = {
let imageV = UIImageView()
imageV.image = UIImage(named: "resign_appoint_guide_text_img")
imageV.clipsToBounds = true
return imageV
}()
lazy var bkgImageV2: UIImageView = {
let imageV = UIImageView()
imageV.image = UIImage(named: "resign_appoint_guide_head_bg")
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 YHResignAppointGuideLineView {
static func sheetView() -> YHResignAppointGuideLineView {
let view = YHResignAppointGuideLineView(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 YHResignAppointGuideLineView {
@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(kCornerRadius6, kCornerRadius6));
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.equalTo(-20)
make.left.right.equalToSuperview()
make.height.equalTo(KScreenWidth*(151.0/375.0))
}
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.left.right.equalToSuperview()
make.width.equalTo(KScreenWidth)
make.height.equalTo(whiteHeight-98-20)
}
if let _ = UIImage(named:"resign_appoint_guide_text_img") {
let radio = 1549.0/375.0
myScrollView.addSubview(bkgImageV)
bkgImageV.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.equalTo(20)
make.right.equalTo(-20)
make.width.equalTo(KScreenWidth-40)
make.height.equalTo(ceil((KScreenWidth-40)*radio))
make.bottom.equalTo(0)
}
myScrollView.contentSize = CGSize(width: KScreenWidth, height: ceil((KScreenWidth-40.0)*radio))
}
}
}
extension YHResignAppointGuideLineView : 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 {
// 没有滚动到底部
}
}
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "背景头图@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "背景头图@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "续签在港递交指引@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "续签在港递交指引@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