Commit 95ddf51b authored by pete谢兆麟's avatar pete谢兆麟

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

# Conflicts:
#	galaxy/galaxy.xcodeproj/project.pbxproj
parents 4636fcc6 203cd5b0
......@@ -1250,6 +1250,17 @@
04D8FF6F2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF6E2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift */; };
04D8FF712D9550E700703C75 /* YHPlanPolicyCarouselImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF702D9550E700703C75 /* YHPlanPolicyCarouselImageCell.swift */; };
04D8FF732D96759400703C75 /* YHPlanScoreLevelTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF722D96759400703C75 /* YHPlanScoreLevelTextView.swift */; };
04D8FF752D978CF000703C75 /* YHPlanLinkShareView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF742D978CF000703C75 /* YHPlanLinkShareView.swift */; };
04D8FF772D979BCC00703C75 /* YHPlanPolicyDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF762D979BCC00703C75 /* YHPlanPolicyDetailViewController.swift */; };
04D8FF792D97BDBD00703C75 /* YHPlanShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF782D97BDBD00703C75 /* YHPlanShareViewController.swift */; };
04D8FF7B2D97C29E00703C75 /* YHPlanShareView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF7A2D97C29E00703C75 /* YHPlanShareView.swift */; };
04D8FFA82D97C80000703C75 /* YHMakePlanCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FFA12D97C80000703C75 /* YHMakePlanCardView.swift */; };
04D8FFA92D97C80000703C75 /* YHMakePlanBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FFA02D97C80000703C75 /* YHMakePlanBottomView.swift */; };
04D8FFAA2D97C80000703C75 /* YHMakePlanCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FFA22D97C80000703C75 /* YHMakePlanCell.swift */; };
04D8FFAB2D97C80000703C75 /* YHMakePlanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF9E2D97C80000703C75 /* YHMakePlanViewController.swift */; };
04D8FFAC2D97C80000703C75 /* YHMakePlanCusttomHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FFA32D97C80000703C75 /* YHMakePlanCusttomHeadView.swift */; };
04D8FFAD2D97C80000703C75 /* YHMakePlanStateHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FFA52D97C80000703C75 /* YHMakePlanStateHeadView.swift */; };
04D8FFAE2D97C80000703C75 /* YHMakePlanHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FFA42D97C80000703C75 /* YHMakePlanHeadView.swift */; };
04E4CF3E2D5C6D32004D4013 /* YHCountryMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */; };
04E4CF402D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */; };
04E507D62D6EE856005F758B /* YHUserLevelAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */; };
......@@ -2539,6 +2550,17 @@
04D8FF6E2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanPolicyCarouselView.swift; sourceTree = "<group>"; };
04D8FF702D9550E700703C75 /* YHPlanPolicyCarouselImageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanPolicyCarouselImageCell.swift; sourceTree = "<group>"; };
04D8FF722D96759400703C75 /* YHPlanScoreLevelTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanScoreLevelTextView.swift; sourceTree = "<group>"; };
04D8FF742D978CF000703C75 /* YHPlanLinkShareView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanLinkShareView.swift; sourceTree = "<group>"; };
04D8FF762D979BCC00703C75 /* YHPlanPolicyDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanPolicyDetailViewController.swift; sourceTree = "<group>"; };
04D8FF782D97BDBD00703C75 /* YHPlanShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanShareViewController.swift; sourceTree = "<group>"; };
04D8FF7A2D97C29E00703C75 /* YHPlanShareView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanShareView.swift; sourceTree = "<group>"; };
04D8FF9E2D97C80000703C75 /* YHMakePlanViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanViewController.swift; sourceTree = "<group>"; };
04D8FFA02D97C80000703C75 /* YHMakePlanBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanBottomView.swift; sourceTree = "<group>"; };
04D8FFA12D97C80000703C75 /* YHMakePlanCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanCardView.swift; sourceTree = "<group>"; };
04D8FFA22D97C80000703C75 /* YHMakePlanCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanCell.swift; sourceTree = "<group>"; };
04D8FFA32D97C80000703C75 /* YHMakePlanCusttomHeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanCusttomHeadView.swift; sourceTree = "<group>"; };
04D8FFA42D97C80000703C75 /* YHMakePlanHeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanHeadView.swift; sourceTree = "<group>"; };
04D8FFA52D97C80000703C75 /* YHMakePlanStateHeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanStateHeadView.swift; sourceTree = "<group>"; };
04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCountryMessageView.swift; sourceTree = "<group>"; };
04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectPhoneCountryViewController.swift; sourceTree = "<group>"; };
04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserLevelAlertView.swift; sourceTree = "<group>"; };
......@@ -6720,7 +6742,7 @@
04D8FF4F2D9257F700703C75 /* Plan(方案) */ = {
isa = PBXGroup;
children = (
04B00F782D94FA9500F640C5 /* MakePlan */,
04D8FFA72D97C80000703C75 /* MakePlan */,
04D8FF532D92581300703C75 /* VM */,
04D8FF522D92580F00703C75 /* M */,
04D8FF512D92580900703C75 /* V */,
......@@ -6737,6 +6759,8 @@
04A750D52D94242000974E5F /* YHSurveySubmitDoneViewController.swift */,
04A750D72D94F3F400974E5F /* YHSurveyMatchResultViewController.swift */,
04A750D92D94FDDF00974E5F /* YHSurveyMatchingViewController.swift */,
04D8FF762D979BCC00703C75 /* YHPlanPolicyDetailViewController.swift */,
04D8FF782D97BDBD00703C75 /* YHPlanShareViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -6758,6 +6782,8 @@
04D8FF6E2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift */,
04D8FF702D9550E700703C75 /* YHPlanPolicyCarouselImageCell.swift */,
04D8FF722D96759400703C75 /* YHPlanScoreLevelTextView.swift */,
04D8FF742D978CF000703C75 /* YHPlanLinkShareView.swift */,
04D8FF7A2D97C29E00703C75 /* YHPlanShareView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -6779,6 +6805,36 @@
path = VM;
sourceTree = "<group>";
};
04D8FF9F2D97C80000703C75 /* C */ = {
isa = PBXGroup;
children = (
04D8FF9E2D97C80000703C75 /* YHMakePlanViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
04D8FFA62D97C80000703C75 /* V */ = {
isa = PBXGroup;
children = (
04D8FFA02D97C80000703C75 /* YHMakePlanBottomView.swift */,
04D8FFA12D97C80000703C75 /* YHMakePlanCardView.swift */,
04D8FFA22D97C80000703C75 /* YHMakePlanCell.swift */,
04D8FFA32D97C80000703C75 /* YHMakePlanCusttomHeadView.swift */,
04D8FFA42D97C80000703C75 /* YHMakePlanHeadView.swift */,
04D8FFA52D97C80000703C75 /* YHMakePlanStateHeadView.swift */,
);
path = V;
sourceTree = "<group>";
};
04D8FFA72D97C80000703C75 /* MakePlan */ = {
isa = PBXGroup;
children = (
04D8FF9F2D97C80000703C75 /* C */,
04D8FFA62D97C80000703C75 /* V */,
);
path = MakePlan;
sourceTree = "<group>";
};
4758815B24BAF3CAA24EC6A8 /* Pods */ = {
isa = PBXGroup;
children = (
......@@ -7190,7 +7246,6 @@
045C0FF62D12CA5F00BD2DC0 /* YHMyIntroductionCell.swift in Sources */,
045C0FF72D12CA5F00BD2DC0 /* YHOtherInfoFillCell.swift in Sources */,
045C0FF82D12CA5F00BD2DC0 /* YHPrincipleUploadFileCell.swift in Sources */,
04B00F802D951D0B00F640C5 /* YHMakePlanHeadView.swift in Sources */,
045C0FF92D12CA5F00BD2DC0 /* YHVisaRenewalGuideRemarkCell.swift in Sources */,
045C0FFA2D12CA5F00BD2DC0 /* YHAdopterChinaLifeViewController.swift in Sources */,
045C0FFB2D12CA5F00BD2DC0 /* YHAITabBarItemContentView.swift in Sources */,
......@@ -7202,6 +7257,7 @@
045C10012D12CA5F00BD2DC0 /* YHCertificateAppointViewController.swift in Sources */,
045C10022D12CA5F00BD2DC0 /* YHResultBottomView.swift in Sources */,
045C10032D12CA5F00BD2DC0 /* YHWorkFileItemView.swift in Sources */,
04D8FF7B2D97C29E00703C75 /* YHPlanShareView.swift in Sources */,
045C10042D12CA5F00BD2DC0 /* YHSchemeModel.swift in Sources */,
045C10052D12CA5F00BD2DC0 /* YHPrincipleRequestModel.swift in Sources */,
045C10062D12CA5F00BD2DC0 /* YHWorkExperienceTextItemView.swift in Sources */,
......@@ -7361,7 +7417,6 @@
045C10852D12CA5F00BD2DC0 /* YHResignAppointOptionResultCell.swift in Sources */,
045C10862D12CA5F00BD2DC0 /* YHServiceItemCell.swift in Sources */,
045C10872D12CA5F00BD2DC0 /* YHServiceOrderProgressTableViewCell.swift in Sources */,
04B00F822D95497400F640C5 /* YHMakePlanStateHeadView.swift in Sources */,
045C10882D12CA5F00BD2DC0 /* YHResignUploadTravelCardDetailModel.swift in Sources */,
045C10892D12CA5F00BD2DC0 /* YHAppointHKResultModel.swift in Sources */,
04D8FF612D939D2400703C75 /* YHPlanScoreCell.swift in Sources */,
......@@ -7422,7 +7477,6 @@
045C10B92D12CA5F00BD2DC0 /* YHClipperButton.swift in Sources */,
045C10BA2D12CA5F00BD2DC0 /* YHInvitationNumberItemView.swift in Sources */,
045C10BB2D12CA5F00BD2DC0 /* YHChildInfoContainerVC.swift in Sources */,
04B00F8A2D96969E00F640C5 /* YHMakePlanCell.swift in Sources */,
045C10BC2D12CA5F00BD2DC0 /* YHSignatureWebViewController.swift in Sources */,
04307BA32D1E4CA600ED8E8D /* YHGCInformationFillTipsCell.swift in Sources */,
04D8FF6F2D954D9B00703C75 /* YHPlanPolicyCarouselView.swift in Sources */,
......@@ -7517,7 +7571,6 @@
045C11102D12CA5F00BD2DC0 /* YHMySignatureDetailViewModel.swift in Sources */,
045C11112D12CA5F00BD2DC0 /* YHSearchItemLayout.swift in Sources */,
045C11122D12CA5F00BD2DC0 /* YHServiceCenterViewController.swift in Sources */,
04B00F7E2D94FB3C00F640C5 /* YHMakePlanViewController.swift in Sources */,
045C11132D12CA5F00BD2DC0 /* YHVisaRenewalTroubleshootingGuideHeaderCell.swift in Sources */,
045C11142D12CA5F00BD2DC0 /* YHInfoConsentForHKTravelCell.swift in Sources */,
045C11152D12CA5F00BD2DC0 /* YHVisaRenewalGuideTipsCell.swift in Sources */,
......@@ -7613,6 +7666,13 @@
045C115B2D12CA5F00BD2DC0 /* YHHKRecordItemDetailType.swift in Sources */,
045C115C2D12CA5F00BD2DC0 /* YHHUDContainerView.swift in Sources */,
045C115D2D12CA5F00BD2DC0 /* YHOrderTipsView.swift in Sources */,
04D8FFA82D97C80000703C75 /* YHMakePlanCardView.swift in Sources */,
04D8FFA92D97C80000703C75 /* YHMakePlanBottomView.swift in Sources */,
04D8FFAA2D97C80000703C75 /* YHMakePlanCell.swift in Sources */,
04D8FFAB2D97C80000703C75 /* YHMakePlanViewController.swift in Sources */,
04D8FFAC2D97C80000703C75 /* YHMakePlanCusttomHeadView.swift in Sources */,
04D8FFAD2D97C80000703C75 /* YHMakePlanStateHeadView.swift in Sources */,
04D8FFAE2D97C80000703C75 /* YHMakePlanHeadView.swift in Sources */,
04AE203F2D13C36500891D24 /* YHGCQualificationDetailVC.swift in Sources */,
04307BAC2D1FFC1C00ED8E8D /* YHShareLiveInfoModel.swift in Sources */,
045C115E2D12CA5F00BD2DC0 /* YHInvitationWithGiftsSelectItemView.swift in Sources */,
......@@ -7733,6 +7793,7 @@
045C11C82D12CA5F00BD2DC0 /* YHOrderSearchViewController.swift in Sources */,
045C11C92D12CA5F00BD2DC0 /* YHNoDataTipsView.swift in Sources */,
045C11CA2D12CA5F00BD2DC0 /* YHHKRecordsInfoItemCell.swift in Sources */,
04D8FF792D97BDBD00703C75 /* YHPlanShareViewController.swift in Sources */,
045C11CB2D12CA5F00BD2DC0 /* YHLiveDetailModel.swift in Sources */,
045C11CC2D12CA5F00BD2DC0 /* YHMessageListVC.swift in Sources */,
045C11CD2D12CA5F00BD2DC0 /* YHCompanySelectViewController.swift in Sources */,
......@@ -7741,6 +7802,7 @@
045C11D02D12CA5F00BD2DC0 /* YHIdentityCardCell.swift in Sources */,
045C11D12D12CA5F00BD2DC0 /* UINavigationController+Extension.swift in Sources */,
04307BB42D21623300ED8E8D /* YHRecommendedAppointmentLiveView.swift in Sources */,
04D8FF772D979BCC00703C75 /* YHPlanPolicyDetailViewController.swift in Sources */,
045C11D22D12CA5F00BD2DC0 /* YHPrincipleWaitResultViewController.swift in Sources */,
045C11D32D12CA5F00BD2DC0 /* YHInvitationWithGiftsShareBottomView.swift in Sources */,
045C11D42D12CA5F00BD2DC0 /* YHPreviewInfoSingleLineTitleView.swift in Sources */,
......@@ -7905,7 +7967,6 @@
045C12582D12CA5F00BD2DC0 /* YHMatchResultListViewController.swift in Sources */,
045C12592D12CA5F00BD2DC0 /* YHMyNewSchemeViewController.swift in Sources */,
045C125A2D12CA5F00BD2DC0 /* YHVisaRenewalGuideParagraphCell.swift in Sources */,
04B00F862D966EAB00F640C5 /* YHMakePlanBottomView.swift in Sources */,
045C125B2D12CA5F00BD2DC0 /* YHMyWorkExperienceCell.swift in Sources */,
045C125C2D12CA5F00BD2DC0 /* YHAdopterCardTableViewCell.swift in Sources */,
045C125D2D12CA5F00BD2DC0 /* YHAIRequestManager.swift in Sources */,
......@@ -7954,6 +8015,7 @@
045C12872D12CA5F00BD2DC0 /* YHStatusAdvantageVC.swift in Sources */,
045C12882D12CA5F00BD2DC0 /* YHHKPlanDoctumentVC.swift in Sources */,
045C12892D12CA5F00BD2DC0 /* YHHomeHeadView.swift in Sources */,
04D8FF752D978CF000703C75 /* YHPlanLinkShareView.swift in Sources */,
0411CF062D1A88EA00644D35 /* YHGCDocListCell.swift in Sources */,
045C128A2D12CA5F00BD2DC0 /* YHAITextInputView.swift in Sources */,
045C128B2D12CA5F00BD2DC0 /* YHWorkExpDataModel.swift in Sources */,
......@@ -8004,7 +8066,6 @@
045C12B32D12CA5F00BD2DC0 /* YHFamilyInfoConfirmViewModel.swift in Sources */,
045C12B42D12CA5F00BD2DC0 /* YHLifeDetailViewController.swift in Sources */,
045C12B52D12CA5F00BD2DC0 /* YHIncomeRecordWorkExperienceViewController.swift in Sources */,
04B00F882D96964100F640C5 /* YHMakePlanCardView.swift in Sources */,
045C12B62D12CA5F00BD2DC0 /* YHMyLikeViewModel.swift in Sources */,
045C12B72D12CA5F00BD2DC0 /* YHCertificateUploadSheetView.swift in Sources */,
045C12B82D12CA5F00BD2DC0 /* YHResignHaveAppointedApplicantsInfoCell.swift in Sources */,
......@@ -8094,7 +8155,6 @@
045C13012D12CA5F00BD2DC0 /* YHPreviewFamilyMemberViewController.swift in Sources */,
0411CF102D1C055100644D35 /* YHGCSignatureAddViewController.swift in Sources */,
045C13022D12CA5F00BD2DC0 /* YHPictureReviewManager.swift in Sources */,
04B00F842D95518C00F640C5 /* YHMakePlanCusttomHeadView.swift in Sources */,
045C13032D12CA5F00BD2DC0 /* YHBasicInfoFillViewController.swift in Sources */,
045C13042D12CA5F00BD2DC0 /* YHImproveSchemeTemplateListCell.swift in Sources */,
0411CEE92D15123B00644D35 /* YHGCWorkExperienceListViewController.swift in Sources */,
......
//
// YHPlanPolicyDetailViewController.swift
// galaxy
//
// Created by Dufet on 2025/3/29.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPlanPolicyDetailViewController: YHBaseViewController {
var urls: [String] = []
lazy var scrollView: UIScrollView = {
let v = UIScrollView(frame: .zero)
return v
}()
lazy var shareBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .white
btn.setTitle("分享", for: .normal)
btn.setTitleColor(.mainTextColor, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 16)
btn.layer.cornerRadius = 3.0
btn.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return btn
}()
override func viewDidLoad() {
super.viewDidLoad()
gk_backImage = UIImage(named: "nav_back_white")
gk_navTitle = "1/24"
gk_navTitleColor = .white
view.backgroundColor = .init(hex: 0x000000, alpha: 1.0)
view.addSubview(scrollView)
view.addSubview(shareBtn)
scrollView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar+24.0)
make.height.equalTo(520)
}
shareBtn.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.height.equalTo(46)
make.top.equalTo(scrollView.snp.bottom).offset(32)
}
}
}
//
// YHPlanShareViewController.swift
// galaxy
//
// Created by Dufet on 2025/3/29.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
enum YHPlanShareBgType: Int {
case link = 1
case pdf = 2
}
class YHPlanShareBgView: UIView, JXSegmentedListContainerViewListDelegate {
let bgWidth = 293.0
let bgHeight = 380.0
var type: YHPlanShareBgType = .link {
didSet {
imgV.image = type == .link ? UIImage(named: "plan_share_link_bg") : UIImage(named: "plan_share_pdf_bg")
imgV.snp.remakeConstraints { make in
make.width.equalTo( type == .link ? bgWidth : 217)
make.height.equalTo(bgHeight)
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
lazy var imgV: UIImageView = {
let imgV = UIImageView()
imgV.image = UIImage(named: "plan_share_link_bg")
return imgV
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(imgV)
imgV.snp.makeConstraints { make in
make.width.equalTo(bgWidth)
make.height.equalTo(bgHeight)
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
}
}
func listView() -> UIView {
return self
}
}
class YHPlanShareViewController: YHBaseViewController {
var type: YHPlanShareBgType = .link
let segmentTitles = ["分享链接", "分享PDF"]
let bgWidth = 293.0
let bgHeight = 380.0
lazy var segmentedView: JXSegmentedView = {
let view = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_safeAreaInsetsTop(), width: KScreenWidth, height: 30))
view.backgroundColor = .clear
view.delegate = self
// 配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorHeight = 2
indicator.indicatorCornerRadius = 0.0
indicator.indicatorColor = UIColor.mainTextColor
view.indicators = [indicator]
view.dataSource = segmentedDataSource
view.listContainer = listContainerView
return view
}()
lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.titles = segmentTitles
dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 16)
dataSource.titleNormalColor = UIColor.init(hex: 0x94A3B8)
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleSelectedColor = .mainTextColor
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = 64
dataSource.itemSpacing = 22
return dataSource
}()
lazy var listContainerView: JXSegmentedListContainerView! = {
let view = JXSegmentedListContainerView(dataSource: self, type: .scrollView)
view.backgroundColor = .clear
return view
}()
lazy var bottomShareView: YHPlanShareView = {
let v = YHPlanShareView(frame: .zero)
v.type = .link
return v
}()
lazy var shareLinkBgView: YHPlanShareBgView = {
let v = YHPlanShareBgView()
v.type = .link
return v
}()
lazy var sharePdfBgView: YHPlanShareBgView = {
let v = YHPlanShareBgView()
v.type = .pdf
return v
}()
override func viewDidLoad() {
super.viewDidLoad()
gk_navigationBar.backgroundColor = .clear
view.backgroundColor = .init(hex: 0xF5F6F8)
view.addSubview(segmentedView)
view.addSubview(listContainerView)
view.addSubview(bottomShareView)
segmentedView.snp.makeConstraints { make in
make.top.equalTo(8+k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(34)
make.width.equalTo(64.0*2.0 + 24.0 + 22*2)
make.centerX.equalToSuperview()
}
listContainerView.snp.makeConstraints { make in
make.top.equalTo(segmentedView.snp.bottom).offset(20)
make.centerX.equalToSuperview()
make.width.equalTo(bgWidth)
make.height.equalTo(bgHeight)
}
bottomShareView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(216)
}
}
}
extension YHPlanShareViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
if index == 1 {
self.type = .pdf
} else {
self.type = .link
}
bottomShareView.type = self.type
}
}
extension YHPlanShareViewController: JXSegmentedListContainerViewDataSource {
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
return segmentTitles.count
}
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
if index == 0 {
return shareLinkBgView
}
return sharePdfBgView
}
}
......@@ -48,16 +48,23 @@ class YHPlanViewController: YHBaseViewController {
lazy var whiteBackBtn: UIButton = {
let v = UIButton()
v.setImage(UIImage(named: "back_icon_white"), for: .normal)
v.setImage(UIImage(named: "nav_back_white"), for: .normal)
v.addTarget(self, action: #selector(backItemClick(_:)), for: .touchUpInside)
return v
}()
lazy var shareBtn: UIButton = {
let v = UIButton()
v.setImage(UIImage(named: "plan_nav_share"), for: .normal)
v.addTarget(self, action: #selector(didShareBtnClicked), for: .touchUpInside)
return v
}()
@objc func didShareBtnClicked() {
let vc = YHPlanShareViewController()
self.navigationController?.pushViewController(vc)
}
lazy var headerView: UIView = {
let v = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: headerViewHeight))
v.addSubview(titleImgView)
......@@ -245,6 +252,7 @@ class YHPlanViewController: YHBaseViewController {
@objc func didRevalueBtnClicked() {
YHPlanLinkShareView.alertView().show()
}
override func viewDidLoad() {
......@@ -414,6 +422,7 @@ extension YHPlanViewController: UIScrollViewDelegate {
fixedSegmentView.alpha = scrollView.contentOffset.y >= topScrollHeight ? 1.0 : 0.0
gk_navigationBar.alpha = percent
whiteBackBtn.isHidden = percent >= 1.0
shareBtn.isHidden = percent >= 1.0
if scrollView.contentOffset.y > topScrollHeight {
......
//
// YHPlanLinkShareView.swift
// galaxy
//
// Created by Dufet on 2025/3/29.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
enum YHPlanShareItemButtonType: Int {
case wechat = 1
case copyLink = 2
case saveImg = 3
case cancel = 4
}
class YHPlanShareItemButton: UIButton {
lazy var iconImgV: UIImageView = {
let v = UIImageView()
return v
}()
lazy var textLabel: UILabel = {
let lable = UILabel()
lable.textColor = .init(hex: 0x666666)
lable.textAlignment = .center
lable.font = UIFont.PFSC_R(ofSize: 13)
return lable
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(iconImgV)
self.addSubview(textLabel)
iconImgV.snp.makeConstraints { make in
make.width.height.equalTo(48)
make.top.equalTo(0)
make.centerX.equalToSuperview()
}
textLabel.snp.makeConstraints { make in
make.top.equalTo(iconImgV.snp.bottom).offset(8)
make.centerX.equalToSuperview()
make.height.equalTo(18)
}
}
}
class YHPlanLinkShareView: UIView {
let wechatBtnTag = 9527
let copyLinkTag = 9528
let saveImgTag = 9529
let cancelTag = 9530
var clickBlock: ((YHPlanShareItemButtonType) -> Void)?
lazy var whiteContentView: UIView = {
let v = UIView()
v.backgroundColor = .white
v.layer.cornerRadius = 12.0
v.clipsToBounds = true
return v
}()
lazy var cancelBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .init(hex: 0xF5F6F8)
btn.setTitle("取消", for: .normal)
btn.setTitleColor(.mainTextColor, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 16)
btn.layer.cornerRadius = 3.0
btn.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return btn
}()
lazy var wechatBtn: YHPlanShareItemButton = {
let v = YHPlanShareItemButton()
v.tag = wechatBtnTag
v.textLabel.text = "微信"
v.iconImgV.image = UIImage(named: "plan_share_wechat")
v.addTarget(self, action: #selector(didFunctionBtnClicked(_:)), for: .touchUpInside)
return v
}()
lazy var copyLinkBtn: YHPlanShareItemButton = {
let v = YHPlanShareItemButton()
v.tag = copyLinkTag
v.textLabel.text = "复制链接"
v.iconImgV.image = UIImage(named: "plan_share_copy")
v.addTarget(self, action: #selector(didFunctionBtnClicked(_:)), for: .touchUpInside)
return v
}()
lazy var saveImgBtn: YHPlanShareItemButton = {
let v = YHPlanShareItemButton()
v.tag = saveImgTag
v.textLabel.text = "保存图片"
v.iconImgV.image = UIImage(named: "plan_share_save")
v.addTarget(self, action: #selector(didFunctionBtnClicked(_:)), for: .touchUpInside)
return v
}()
static func alertView() -> YHPlanLinkShareView {
let v = YHPlanLinkShareView(frame: UIScreen.main.bounds)
return v
}
@objc func didFunctionBtnClicked(_ sender: UIButton) {
if sender.tag == wechatBtnTag {
clickBlock?(.wechat)
} else if sender.tag == copyLinkTag {
clickBlock?(.copyLink)
} else if sender.tag == saveImgTag {
clickBlock?(.saveImg)
} else if sender.tag == cancelTag {
dismiss()
}
}
@objc func show() {
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
@objc func dismiss() {
DispatchQueue.main.async {
self.removeFromSuperview()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.backgroundColor = .init(hex: 0x000000, alpha: 0.7)
self.addSubview(whiteContentView)
whiteContentView.addSubview(wechatBtn)
whiteContentView.addSubview(copyLinkBtn)
whiteContentView.addSubview(saveImgBtn)
whiteContentView.addSubview(cancelBtn)
whiteContentView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(216)
}
copyLinkBtn.snp.makeConstraints { make in
make.width.equalTo(64)
make.height.equalTo(74)
make.top.equalTo(20)
make.centerX.equalToSuperview()
}
wechatBtn.snp.makeConstraints { make in
make.width.equalTo(64)
make.height.equalTo(74)
make.top.equalTo(20)
make.right.equalTo(copyLinkBtn.snp.left).offset(-70)
}
saveImgBtn.snp.makeConstraints { make in
make.width.equalTo(64)
make.height.equalTo(74)
make.top.equalTo(20)
make.left.equalTo(copyLinkBtn.snp.right).offset(70)
}
cancelBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(46)
make.top.equalTo(copyLinkBtn.snp.bottom).offset(24)
}
}
}
......@@ -87,6 +87,7 @@ class YHPlanScoreLevelTextView: UIView {
let btn = UIButton()
btn.setImage(UIImage(named: "plan_score_level_close"), for: .normal)
btn.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
......@@ -166,7 +167,7 @@ class YHPlanScoreLevelTextView: UIView {
}
closeBtn.snp.makeConstraints { make in
make.width.height.equalTo(16)
make.width.height.equalTo(24)
make.centerY.equalTo(titleLabel)
make.right.equalTo(-20)
}
......
//
// YHPlanShareView.swift
// galaxy
//
// Created by Dufet on 2025/3/29.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPlanShareView: UIView {
let wechatBtnTag = 9527
let copyLinkTag = 9528
let saveImgTag = 9529
let cancelTag = 9530
var type: YHPlanShareBgType = .link {
didSet {
if type == .link {
copyLinkBtn.iconImgV.image = UIImage(named: "plan_share_copy")
copyLinkBtn.textLabel.text = "复制链接"
} else if type == .pdf {
copyLinkBtn.iconImgV.image = UIImage(named: "plan_share_save")
copyLinkBtn.textLabel.text = "保存PDF"
}
}
}
var clickBlock: ((YHPlanShareItemButtonType) -> Void)?
lazy var whiteContentView: UIView = {
let v = UIView()
v.backgroundColor = .white
v.layer.cornerRadius = 12.0
v.clipsToBounds = true
return v
}()
lazy var cancelBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .init(hex: 0xF5F6F8)
btn.setTitle("取消", for: .normal)
btn.setTitleColor(.mainTextColor, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 16)
btn.layer.cornerRadius = 3.0
btn.addTarget(self, action: #selector(didFunctionBtnClicked(_:)), for: .touchUpInside)
return btn
}()
lazy var wechatBtn: YHPlanShareItemButton = {
let v = YHPlanShareItemButton()
v.tag = wechatBtnTag
v.textLabel.text = "微信"
v.iconImgV.image = UIImage(named: "plan_share_wechat")
v.addTarget(self, action: #selector(didFunctionBtnClicked(_:)), for: .touchUpInside)
return v
}()
lazy var copyLinkBtn: YHPlanShareItemButton = {
let v = YHPlanShareItemButton()
v.tag = copyLinkTag
v.textLabel.text = "复制链接"
v.iconImgV.image = UIImage(named: "plan_share_copy")
v.addTarget(self, action: #selector(didFunctionBtnClicked(_:)), for: .touchUpInside)
return v
}()
@objc func didFunctionBtnClicked(_ sender: UIButton) {
if sender.tag == wechatBtnTag {
clickBlock?(.wechat)
} else if sender.tag == copyLinkTag {
clickBlock?(.copyLink)
} else if sender.tag == saveImgTag {
clickBlock?(.saveImg)
} else if sender.tag == cancelTag {
}
}
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(whiteContentView)
whiteContentView.addSubview(wechatBtn)
whiteContentView.addSubview(copyLinkBtn)
whiteContentView.addSubview(cancelBtn)
whiteContentView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
copyLinkBtn.snp.makeConstraints { make in
make.width.equalTo(64)
make.height.equalTo(74)
make.top.equalTo(20)
make.left.equalTo(self.snp.centerX).offset(35)
}
wechatBtn.snp.makeConstraints { make in
make.width.equalTo(64)
make.height.equalTo(74)
make.top.equalTo(20)
make.right.equalTo(self.snp.centerX).offset(-35)
}
cancelBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(46)
make.top.equalTo(copyLinkBtn.snp.bottom).offset(20)
}
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "24pt导航栏@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "24pt导航栏@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
}
}
{
"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" : "分享PDF@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "分享PDF@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
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_wxhy@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_wxhy@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