Commit 47c8d594 authored by pete谢兆麟's avatar pete谢兆麟

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

parents 8ee34cbc 1e7b52e2
......@@ -25,6 +25,10 @@
0411CF062D1A88EA00644D35 /* YHGCDocListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF052D1A88EA00644D35 /* YHGCDocListCell.swift */; };
0411CF082D1A896800644D35 /* YHGCMySignatureListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF072D1A896800644D35 /* YHGCMySignatureListModel.swift */; };
04307B662D1942F500ED8E8D /* YHDynamicSheetPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */; };
04307B682D19911800ED8E8D /* YHIncomeInfoEditCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */; };
04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */; };
04307B6C2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B6B2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift */; };
04307B6E2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */; };
045C0F7F2D12CA5F00BD2DC0 /* submit_page_scroll.gif in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F4F2D12CA5E00BD2DC0 /* submit_page_scroll.gif */; };
045C0F802D12CA5F00BD2DC0 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F762D12CA5E00BD2DC0 /* Localizable.xcstrings */; };
045C0F812D12CA5F00BD2DC0 /* img_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F5E2D12CA5E00BD2DC0 /* img_0.png */; };
......@@ -1200,6 +1204,10 @@
0411CF052D1A88EA00644D35 /* YHGCDocListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCDocListCell.swift; sourceTree = "<group>"; };
0411CF072D1A896800644D35 /* YHGCMySignatureListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMySignatureListModel.swift; sourceTree = "<group>"; };
04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDynamicSheetPickerView.swift; sourceTree = "<group>"; };
04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoEditCell.swift; sourceTree = "<group>"; };
04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoSelectCell.swift; sourceTree = "<group>"; };
04307B6B2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeDateTillNowCell.swift; sourceTree = "<group>"; };
04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeUploadWorkIDCell.swift; sourceTree = "<group>"; };
045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; };
045C0A142D12CA5E00BD2DC0 /* YHBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewController.swift; sourceTree = "<group>"; };
045C0A152D12CA5E00BD2DC0 /* YHBaseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewModel.swift; sourceTree = "<group>"; };
......@@ -6025,6 +6033,10 @@
isa = PBXGroup;
children = (
047A96922D16C0900033BB4E /* YHInfoQuestionSelectionCell.swift */,
04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */,
04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */,
04307B6B2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift */,
04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -7132,6 +7144,7 @@
045C11952D12CA5F00BD2DC0 /* YHFourKingViewController.swift in Sources */,
045C11962D12CA5F00BD2DC0 /* YHActivityTipsItemView.swift in Sources */,
045C11972D12CA5F00BD2DC0 /* YHHUDRotatingImageView.swift in Sources */,
04307B6C2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift in Sources */,
045C11982D12CA5F00BD2DC0 /* YHCerAppointViewModel.swift in Sources */,
045C11992D12CA5F00BD2DC0 /* YHPayMembersCell.swift in Sources */,
04AE203D2D13C14900891D24 /* YHGCEducationDetailVC.swift in Sources */,
......@@ -7219,6 +7232,7 @@
045C11E92D12CA5F00BD2DC0 /* YHWorkExperiencePositionModel.swift in Sources */,
045C11EA2D12CA5F00BD2DC0 /* YHMySignatureDetailModel.swift in Sources */,
045C11EB2D12CA5F00BD2DC0 /* YHPlayerControlView.swift in Sources */,
04307B6E2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift in Sources */,
045C11EC2D12CA5F00BD2DC0 /* YHMyDocumentsListViewController.swift in Sources */,
045C11ED2D12CA5F00BD2DC0 /* YHCertificateEntryBottomView.swift in Sources */,
045C11EE2D12CA5F00BD2DC0 /* YHAppointItem.swift in Sources */,
......@@ -7312,6 +7326,7 @@
045C12452D12CA5F00BD2DC0 /* YHHUDErrorView.swift in Sources */,
045C12462D12CA5F00BD2DC0 /* YHPrincleViewModel.swift in Sources */,
045C12472D12CA5F00BD2DC0 /* YHUploadCertificateListModel.swift in Sources */,
04307B682D19911800ED8E8D /* YHIncomeInfoEditCell.swift in Sources */,
045C12482D12CA5F00BD2DC0 /* YHResignUploadDetailModel.swift in Sources */,
045C12492D12CA5F00BD2DC0 /* UIApplication+Extension.swift in Sources */,
045C124A2D12CA5F00BD2DC0 /* YHAIChatBannerCollectionCell.swift in Sources */,
......@@ -7341,6 +7356,7 @@
045C12612D12CA5F00BD2DC0 /* YHImageClipperViewController.swift in Sources */,
045C12622D12CA5F00BD2DC0 /* YHMessageSessionCell.swift in Sources */,
045C12632D12CA5F00BD2DC0 /* YHTotalIncomeCell.swift in Sources */,
04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */,
045C12642D12CA5F00BD2DC0 /* YHPayMemberContentItem.swift in Sources */,
045C12652D12CA5F00BD2DC0 /* YHSheetPickerView.swift in Sources */,
045C12662D12CA5F00BD2DC0 /* YHScorePersonInfoCell.swift in Sources */,
......
......@@ -69,8 +69,40 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
AGCInstance.startUp()
AGCAppLinking.instance().handle { (link, error) in
let deepLink = link?.deepLink
//TODO: 增加deeplink地址跳转
if let deepLink = link?.deepLink,deepLink.contains(YhConstant.DeepLink.compareUrl) {
if let url = URL(string: deepLink) {
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
if let queryItems = components?.queryItems {
var arrItems : [String : Any] = [:]
for item in queryItems {
if let value = item.value {
arrItems.updateValue(value, forKey: item.name)
}
}
if arrItems.count > 0 {
if let type = arrItems["type"] as? String,let iType = Int(type) {
if iType == 1 {
//跳转
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
if !YHLoginManager.shared.isLogin() {
printLog("需要登录")
return
}
//直播 - 获取它对应的参数
if let liveId = arrItems["LiveID"] as? String {
let playbackInfo = YHPlayerManager.PlaybackInfo(id: liveId.intValue(), isLive: true, isFromSaleDetail: true)
YHPlayerManager.shared.enterLive(from: nil, playbackInfo: playbackInfo)
}
}
} else {
}
}
}
}
}
}
}
// QiYu SDK初始化
......
......@@ -150,7 +150,7 @@ extension YHHomeInformationViewController : CollectionViewWaterfallLayoutDelegat
return 0.0
}
var row = self.sectionItems.count/3
if row%3 != 0 {
if self.sectionItems.count%3 != 0 {
row = row + 1
}
let listHeight = Float(Double(row) * kHomeItemHeight)
......
......@@ -20,7 +20,7 @@ class YHHomeInfoSectionHeadView: UICollectionReusableView {
didSet {
self.collectView.reloadData()
var row = items.count/3
if row%3 != 0 {
if items.count%3 != 0 {
row = row + 1
}
let totalHeight = Double(row) * kHomeItemHeight
......
......@@ -619,11 +619,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
self.showTipsAlert()
return
}
if serviceCenterMainReqVM.myInfoFillStep > 0 {
gotoApplyTypeVC(.typeA)
} else {
gotoApplyTypeVC(nil)
}
gotoApplyTypeVC()
//高A- 申请类别
} else if tapIndex == 1 {
//高A- 主申请人信息
......@@ -661,17 +657,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
self.showTipsAlert()
return
}
if serviceCenterMainReqVM.myInfoFillStep > 0 {
var type: YHGCApplicationType = .typeB
if productType == 2 {
type = .typeB
} else if productType == 3 {
type = .typeC
}
gotoApplyTypeVC(type)
} else {
gotoApplyTypeVC(nil)
}
gotoApplyTypeVC()
//高才BC- 申请类别
} else if tapIndex == 1 {
//高才BC- 主申请人信息
......@@ -710,13 +696,29 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
}
}
private func gotoApplyTypeVC(_ type: YHGCApplicationType?) {
if let type = type {
let ctl = YHGCApplicationTypeResultController(type: type)
navigationController?.pushViewController(ctl)
} else {
let ctl = YHGCApplicationTypeController(orderId: orderId ?? 0)
navigationController?.pushViewController(ctl)
private func gotoApplyTypeVC() {
let orderId = orderId ?? 0
YHHUD.show(.progress(message: "加载中..."))
YHGCApplicationTypeViewModel().getApplyType(orderId: orderId) { [weak self] model, error in
YHHUD.hide()
guard let self = self else {
return
}
guard let model = model else {
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg)
}
return
}
let type = YHGCApplicationType(rawValue: model.apply_type)
if let type = type {
let ctl = YHGCApplicationTypeResultController(type: type)
self.navigationController?.pushViewController(ctl)
} else {
let ctl = YHGCApplicationTypeController(orderId: orderId)
self.navigationController?.pushViewController(ctl)
}
}
}
}
......@@ -44,7 +44,9 @@ class YHEducationInfo: SmartCodable {
var admissionTime: String?
var graduateTime: String?
var vacantNum: Int = 0
var majorOther: String?
var hasBachelorDegree: Int = 0
enum CodingKeys: String, CodingKey {
case id = "id"
case college = "college"
......@@ -53,11 +55,30 @@ class YHEducationInfo: SmartCodable {
case admissionTime = "admission_time"
case graduateTime = "graduate_time"
case vacantNum = "vacant_num"
case majorOther = "major_other"
case hasBachelorDegree = "has_bachelor_degree"
}
required init() {
}
func getDegree() -> String {
if hasBachelorDegree == 1 {
return "学士学位"
}
if hasBachelorDegree == 2 {
return "无学位"
}
return ""
}
func getRealMajor() -> String? {
if let major = major, major == "其他" {
return majorOther
}
return major
}
}
class YHQualificationInfo: SmartCodable {
......@@ -94,7 +115,19 @@ class YHEducationDetailInfo: SmartCodable {
// 证件提供确认 0 未选择 1 是 2 否
var certConfirm: Int = 0
var isNeedInputMajor: Bool = false
func isNeedInputMajor() -> Bool {
return major == "其他"
}
func getDegree() -> String {
if hasBachelorDegree == 1 {
return "学士学位"
}
if hasBachelorDegree == 2 {
return "无学位"
}
return ""
}
enum CodingKeys: String, CodingKey {
......
......@@ -92,6 +92,8 @@ enum YHFormDetailItemType:Int {
case isAccompanyToHK = 1
// 是否与主申请人同住
case isLiveTother
// 永久居留身份
case permanentResidenceStatus
// 国家/地区
case nationOrArea
// 现居住城市
......@@ -182,6 +184,8 @@ enum YHFormDetailItemType:Int {
case graduateTime
// 专业
case educationMajor
// 具体专业
case detailMajor
// 学位
case educationDegree
// 学位类型
......@@ -508,6 +512,8 @@ class YHFormDetailItem : YHFormItemProtocol {
return "毕业年月".local
case .educationMajor:
return "专业".local
case .detailMajor:
return "具体专业".local
case .educationDegree:
return "学位".local
case .degreeType:
......@@ -531,6 +537,8 @@ class YHFormDetailItem : YHFormItemProtocol {
return "证件提供确认".local
case .cerUpload:
return ""
case .permanentResidenceStatus:
return "是否拥有现时定居国家/地区的永久居留身份"
}
}
......@@ -658,6 +666,10 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var birthPlaceAboard: Int = 0
// 是否与主申请人同住 1:是 0:否
var nows: Int = 0
// 是否拥有现时定居国家/地区的永久居留身份 0:否 1:是 2没有选择
var isCurrentlyOverseas: Int = 2
// 海外居留开始时间
var residenceTime: String = ""
// 是否办理过港澳通行证 1:是 0:否
var isHandled: Int = 0
// notFillNumber = -1 表示还没开始填写任意数据项
......@@ -743,6 +755,8 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
case isHkHandled = "is_hk_handled"
case isInHk = "is_in_hk"
case isLiveOverseaYear = "is_live_oversea_year"
case isCurrentlyOverseas = "is_currently_overseas"
case residenceTime = "residence_time"
case surname = "surname"
}
......@@ -782,6 +796,15 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
self.nows = (value ? 1 : 0)
}
// 是否拥有现时定居国家/地区的永久居留身份
func isHavePermanentResidenceStatus() -> Bool {
return self.isCurrentlyOverseas == 1
}
func setHavePermanentResidenceStatus(_ value: Bool) {
return self.isCurrentlyOverseas = value ? 1 : 2
}
// 是否在海外居住满1年及以上
func isOverSeasOver1Year() -> Bool {
return self.isLiveOverseaYear == 1
......
......@@ -180,7 +180,7 @@ class YHSheetPickerView: UIView {
YHSheetPickerViewItem(title:"博士学位".local, index:3)
],
.degree2:
[YHSheetPickerViewItem(title:"无学位".local, index:0),
[YHSheetPickerViewItem(title:"无学位".local, index:2),
YHSheetPickerViewItem(title:"学士学位".local, index:1),
],
......
......@@ -6,6 +6,7 @@
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import AttributedString
import UIKit
class YHIncomeRecordCompanyTipsCell: YHResignDocumentCell {
......@@ -33,6 +34,10 @@ class YHIncomeRecordCompanyTipsCell: YHResignDocumentCell {
infoDetailLabel.text = detail
}
func setupCellInfo(tipsDetail: ASAttributedString) {
infoDetailLabel.attributed.text = tipsDetail
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(infoDetailLabel)
......
......@@ -33,6 +33,19 @@ class YHIncomeRecordFromCell: YHResignDocumentCell {
return label
}()
private lazy var rightArrowIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "form_right_arrow"))
return imageView
}()
private lazy var infoFailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .failColor
label.text = "请选择"
return label
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#E9ECF0")
......@@ -48,24 +61,79 @@ class YHIncomeRecordFromCell: YHResignDocumentCell {
fatalError("init(coder:) has not been implemented")
}
func setupCellInfo(title: String, detail: String, showBottomLine: Bool = true) {
func setupCellInfo(title: String, detail: String?, showBottomLine: Bool = true, showRightArrow: Bool = false, placeholder: String = "", needShowFailButton: Bool = false) {
infoTitleLabel.text = title
infoDetailLabel.text = detail
if let detail = detail, detail.count > 0 {
infoDetailLabel.text = detail
infoDetailLabel.font = .PFSC_M(ofSize: 14)
infoDetailLabel.textColor = UIColor.mainTextColor
} else {
infoDetailLabel.text = placeholder
infoDetailLabel.font = .PFSC_R(ofSize: 14)
infoDetailLabel.textColor = UIColor(hexString: "#B9C1CC")
}
bottomLineView.isHidden = !showBottomLine
rightArrowIcon.isHidden = !showRightArrow
updateFailLabel(needShowFailButton)
}
}
extension YHIncomeRecordFromCell {
private func updateFailLabel(_ needShowFailButton: Bool) {
if needShowFailButton {
let isRightArrowIconHidden = rightArrowIcon.isHidden
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(147)
if isRightArrowIconHidden {
make.right.lessThanOrEqualToSuperview().offset(-18)
} else {
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
}
infoFailLabel.snp.remakeConstraints { make in
make.top.equalTo(infoDetailLabel.snp.bottom).offset(6)
make.left.equalTo(dotIcon)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = false
} else {
let isRightArrowIconHidden = rightArrowIcon.isHidden
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
if isRightArrowIconHidden {
make.right.lessThanOrEqualToSuperview().offset(-18)
} else {
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
}
infoFailLabel.snp.remakeConstraints { make in
make.left.equalTo(dotIcon)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
}
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(dotIcon)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(rightArrowIcon)
subContainerView.addSubview(bottomLineView)
subContainerView.addSubview(infoFailLabel)
dotIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
rightArrowIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
dotIcon.snp.makeConstraints { make in
make.centerY.equalToSuperview()
......@@ -78,12 +146,25 @@ extension YHIncomeRecordFromCell {
make.left.equalTo(dotIcon.snp.right).offset(2)
}
rightArrowIcon.snp.makeConstraints { make in
make.centerY.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18)
make.width.height.equalTo(20)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalTo(dotIcon)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
......
......@@ -122,16 +122,14 @@ class YHGCEducationDetailVC: YHBaseViewController {
item03.value = detailInfo.graduateTime
let item04 = YHFormDetailItem(type: .educationMajor)
if detailInfo.isNeedInputMajor {
item04.tips = "请输入专业".local
item04.placeHolder = "请输入专业".local
item04.value = detailInfo.major
} else {
item04.tips = "请选择专业".local
item04.placeHolder = "请选择专业".local
item04.value = detailInfo.major
}
item04.tips = "请选择专业".local
item04.placeHolder = "请选择专业".local
item04.value = detailInfo.major
let item09 = YHFormDetailItem(type: .detailMajor)
item09.tips = "请输入专业".local
item09.placeHolder = "请输入专业".local
item09.value = detailInfo.majorOther
let item01 = YHFormDetailItem(type: .educationStyle)
item01.tips = "请选择授课形式".local
......@@ -141,7 +139,7 @@ class YHGCEducationDetailVC: YHBaseViewController {
let item05 = YHFormDetailItem(type: .educationDegree)
item05.tips = "请选择学位".local
item05.placeHolder = "请选择学位".local
item05.value = detailInfo.degree
item05.value = detailInfo.getDegree()
// let item02 = YHFormDetailItem(type: .educationTime)
// item02.tips = "请选择年月".local
......@@ -169,12 +167,16 @@ class YHGCEducationDetailVC: YHBaseViewController {
item08.tips = "请选择城市".local
}
let arr0:[YHFormItemProtocol] = [title0, item00, item03, item04, item05, item07, item08]
var arr0:[YHFormItemProtocol] = [title0, item00, item03, item04, item05, item07, item08]
if detailInfo.isNeedInputMajor() {
arr0 = [title0, item00, item03, item04, item09, item05, item07, item08]
}
items.append(arr0)
let item10 = YHFormDetailItem(type: .cerUpload)
let arr1:[YHFormItemProtocol] = [item10]
items.append(arr1)
// let item10 = YHFormDetailItem(type: .cerUpload)
// let arr1:[YHFormItemProtocol] = [item10]
// items.append(arr1)
self.tableView.reloadData()
}
......@@ -227,7 +229,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
textField in
var max = -1
if detailItem.type == .educationMajor {
if detailItem.type == .detailMajor {
max = 50
} else if detailItem.type == .educationCity {
max = 100
......@@ -252,11 +254,11 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
detailInfo.schoolAddress.foreign = ""
}
} else if detailItem.type == .educationMajor {
} else if detailItem.type == .detailMajor {
if let text = text, !text.isEmpty {
detailInfo.major = text
detailInfo.majorOther = text
} else {
detailInfo.major = ""
detailInfo.majorOther = ""
}
} else if detailItem.type == .universityFullName {
if let text = text, !text.isEmpty {
......@@ -428,7 +430,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
YHSheetPickerView.show(type:.degree2, selectTitle:detailInfo.degree) {
[weak self] item in
guard let self = self else { return }
detailInfo.degree = item.title
detailInfo.hasBachelorDegree = item.index
loadInfo()
saveInfoSilent()
}
......@@ -482,15 +484,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
YHSheetPickerView.show(type:.major, selectTitle: detailInfo.major) {
[weak self] item in
guard let self = self else { return }
if item.title == "其他" {
detailInfo.isNeedInputMajor = true
detailInfo.major = ""
} else {
detailInfo.isNeedInputMajor = false
detailInfo.major = item.title
}
detailInfo.major = item.title
loadInfo()
saveInfoSilent()
}
......@@ -578,14 +572,12 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
return .selectSheet
}
if detailItem.type == .educationMajor {
if detailInfo.isNeedInputMajor {
return .inputText
}
return .selectSheet
if detailItem.type == .detailMajor {
return .inputText
}
if detailItem.type == .educationStyle
if detailItem.type == .educationMajor
|| detailItem.type == .educationStyle
|| detailItem.type == .educationTime
|| detailItem.type == .graduateTime
|| detailItem.type == .educationDegree
......@@ -602,7 +594,8 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
extension YHGCEducationDetailVC {
func getDetailInfo() {
self.educationRequest.getEducationDetailInfo(params: ["id": self.detailId]) {
self.educationRequest.getEducationDetailInfo(params: ["id": self.detailId,
"order_id": self.orderId]) {
[weak self] success, error in
guard let self = self else { return }
if success {
......@@ -632,8 +625,6 @@ extension YHGCEducationDetailVC {
if detailInfo.college.isEmpty
|| detailInfo.graduateTime.isEmpty
|| detailInfo.major.isEmpty
|| detailInfo.degree.isEmpty
|| detailInfo.schoolAddress.country.isEmpty
{
return false
......@@ -643,6 +634,14 @@ extension YHGCEducationDetailVC {
// return false
// }
if detailInfo.getDegree().isEmpty {
return false
}
if detailInfo.isNeedInputMajor(), detailInfo.majorOther.isEmpty {
return false
}
if detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.foreign.isEmpty {
return false
}
......
......@@ -195,7 +195,13 @@ extension YHGCEducationInfoListVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
let isNeedWrap = (formItem.type == .mainApplicantProfessionalQualification)
cell.setTitleAndSubTitle(title:formItem.getTitle(), subTitle:formItem.getSubTitle(), isNeedWrap:isNeedWrap)
var title = formItem.getTitle()
var subTitle = formItem.getSubTitle()
if formItem.type == .mainApplicantEducation {
title = "主申请人学士学位"
subTitle = "(仅申报百强名校学士学位)"
}
cell.setTitleAndSubTitle(title:title, subTitle:subTitle, isNeedWrap:isNeedWrap)
// 决定右边按钮显示样式
cell.showEditType(type: .none)
......@@ -336,13 +342,14 @@ extension YHGCEducationInfoListVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHEducationInfoCell.cellReuseIdentifier, for: indexPath) as! YHEducationInfoCell
cell.titleLabel.text = eduInfo.college
cell.subTitleLabel.text = ""
if let major = eduInfo.major, let degree = eduInfo.degree {
let degree = eduInfo.getDegree()
if let major = eduInfo.getRealMajor(), !degree.isEmpty {
cell.subTitleLabel.text = String("\(degree)-\(major)")
}
cell.timeLabel.text = ""
if let admissionTime = eduInfo.admissionTime, let graduateTime = eduInfo.graduateTime {
cell.timeLabel.text = String("\(admissionTime) ~ \(graduateTime)")
}
// if let admissionTime = eduInfo.admissionTime, let graduateTime = eduInfo.graduateTime {
// cell.timeLabel.text = String("\(admissionTime) ~ \(graduateTime)")
// }
cell.isShowDeleteBtn = (isDegreeEditMode == .canCancel)
cell.deleteBlock = {
var title = "确定删除该学历吗?"
......
......@@ -162,6 +162,18 @@ class YHGCCertificateInfoController: YHBaseViewController, YHFamilyMemberProtol
let showPassport = a.showPassport
let isPassportMust = a.isPassportMust
if familyMember.nationality.contains("中国") {
var isChinaIdCardMust = true
let title1 = YHFormTitleItem(type: .chinaIdCardInfo)
let item10 = YHFormDetailItem(type: .chinaIdentityCardNumber, isNeed:isChinaIdCardMust, value: familyMember.certificates.cnIdentityCard.number, tips:"请输入证件号码".local)
let item11 = YHFormDetailItem(type: .certificateSignPlace, isNeed:isChinaIdCardMust, value: familyMember.certificates.cnIdentityCard.issueAt, tips:"请输入签发地".local)
let item12 = YHFormDetailItem(type: .certificateSignDate, isNeed:isChinaIdCardMust, value: familyMember.certificates.cnIdentityCard.issueDateStartAt, tips:"请选择签发日期".local)
let item13 = YHFormDetailItem(type: .certificateValidDate, isNeed:isChinaIdCardMust, value: familyMember.certificates.cnIdentityCard.issueDateEndAt, tips:"请选择届满日期".local)
let arr1:[YHFormItemProtocol] = [title1, item10, item11, item12, item13]
items.append(arr1)
}
if showHK { // 显示港澳通行证
let title1 = YHFormTitleItem(type: .hkAndMacaoPassport)
let item10 = YHFormDetailItem(type: .traverlPassportNumber, isNeed:isHKMust, value: familyMember.certificates.hkMacaoPass.number, tips:"请输入证件号码".local)
......@@ -542,6 +554,17 @@ extension YHGCCertificateInfoController : UITableViewDelegate, UITableViewDataSo
let showPassport = a.showPassport
let isPassportMust = a.isPassportMust
if familyMember.nationality.contains("中国") {
if familyMember.certificates.cnIdentityCard.number.count <= 0
|| familyMember.certificates.cnIdentityCard.issueAt.count <= 0
|| familyMember.certificates.cnIdentityCard.issueDateStartAt.count <= 0
|| familyMember.certificates.cnIdentityCard.issueDateEndAt.count <= 0
{
return false
}
}
if showHK, isHKMust {
if familyMember.certificates.hkMacaoPass.number.count <= 0
......
......@@ -69,24 +69,30 @@ class YHGCChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
// 子女信息
let title0 = YHFormTitleItem(type: .childInfo)
let item00 = YHFormDetailItem(type: .childName)
item00.value = child.subsetName
item00.tips = "请输入子女姓名".local
let item01 = YHFormDetailItem(type: .everName, isNeed: false)
item01.value = child.usedName
let item02 = YHFormDetailItem(type: .befourMarryFirstName, isNeed: false)
item02.value = child.surname
let item03 = YHFormDetailItem(type: .gender)
item03.value = child.sexName()
item03.tips = "请选择性别".local
let item04 = YHFormDetailItem(type: .marriageState)
item04.value = child.married
item04.tips = "请选择婚姻状况".local
let item06 = YHFormDetailItem(type: .birthNation)
item06.value = String(child.isBirthOverSeas())
item06.tips = "请选择出生国家/地区".local
let item07 = YHFormDetailItem(type: .birthCity)
let item07 = YHFormDetailItem(type: .birthCity)
if child.isBirthOverSeas() {
item07.value = child.birthPlace.foreign
item07.tips = "请输入出生城市".local
......
......@@ -74,11 +74,17 @@ class YHGCSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
// 居住信息
var arr2 = [YHFormItemProtocol]()
let title2 = YHFormTitleItem(type: .liveInfo)
let item20 = YHFormDetailItem(type:.isLiveTother, value:String(spouse.isLiveTother()))
arr2.append(title2)
let item20 = YHFormDetailItem(type:.isLiveTother, value:String(spouse.isLiveTother()))
arr2.append(item20)
// let item21 = YHFormDetailItem(type:.permanentResidenceStatus, value: "")
// arr2.append(item21)
if !spouse.isLiveTother() { // 不同住 才需填写国家/地区
let item21 = YHFormDetailItem(type:.nationOrArea, value:spouse.address.country, placeHolder:"请选择".local, tips:"请选择国家/地区".local)
arr2.append(item21)
......@@ -197,7 +203,11 @@ extension YHGCSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem
// 是否随行到香港 / 是否办理港澳通行证 / // 是否与主申请人同住 均用双项按钮cell
if detailItem.type == .isAccompanyToHK || detailItem.type == .isHandleHKPassPort || detailItem.type == .isLiveTother || detailItem.type == .isLiveOverSeasMore1Year {
if detailItem.type == .isAccompanyToHK ||
detailItem.type == .isHandleHKPassPort ||
detailItem.type == .isLiveTother ||
detailItem.type == .isLiveOverSeasMore1Year ||
detailItem.type == .permanentResidenceStatus {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed
......
......@@ -19,6 +19,7 @@ class YHGCIncomeRecordViewController: YHBaseViewController {
case consentForHKTravel(_ title: String, _ detail: ASAttributedString, _ question: String)
case questionSelect(_ question: String)
case employmentVerification
case workingHoursStatement(_ placeholder: String, _ detail: ASAttributedString)
}
private lazy var datas: [[TableRow]] = []
......@@ -89,6 +90,7 @@ class YHGCIncomeRecordViewController: YHBaseViewController {
view.register(YHAddIncomeRecordCell.self, forCellReuseIdentifier: YHAddIncomeRecordCell.cellReuseIdentifier)
view.register(YHInfoQuestionSelectionCell.self, forCellReuseIdentifier: YHInfoQuestionSelectionCell.cellReuseIdentifier)
view.register(YHEmploymentVerificationAvailableCell.self, forCellReuseIdentifier: YHEmploymentVerificationAvailableCell.cellReuseIdentifier)
view.register(YHWorkingHoursStatementCell.self, forCellReuseIdentifier: YHWorkingHoursStatementCell.cellReuseIdentifier)
view.keyboardDismissMode = .onDrag
return view
......@@ -134,7 +136,7 @@ extension YHGCIncomeRecordViewController {
}
private func setupUI() {
gk_navTitle = "收入记录信息填写"
gk_navTitle = "收入记录/工作经验填写"
gk_navBarAlpha = 1.0
gk_navBackgroundColor = .white
......@@ -186,7 +188,6 @@ extension YHGCIncomeRecordViewController {
let incomeItem: TableRow = .incomeItem(false, companyModel.company_name, moneyStr, timeStr, companyModel.income_id, index != listCount - 1)
firstSection.append(incomeItem)
}
firstSection.append(.addItem)
if listCount > 0 {
let totalNum = hkdFormatter.string(from: NSNumber(value: money / rate)) ?? "0"
let totalMoney: ASAttributedString = .init(string: "约 ", .font(.PFSC_R(ofSize: 14))) + .init(string: totalNum, .font(UIFont(name: "DINAlternate-Bold", size: 20) ?? UIFont.systemFont(ofSize: 20))) + .init(string: " 港币", .font(.PFSC_R(ofSize: 14)))
......@@ -195,15 +196,20 @@ extension YHGCIncomeRecordViewController {
let incomeItem: TableRow = .incomeItem(false, "收入信息1", "", "待填写", 0, false)
firstSection.append(incomeItem)
}
firstSection.append(.addItem)
let tipsIcon = ASAttributedString.init(.image(UIImage(named: "red_dot_6") ?? UIImage(), .custom(.offset(CGPoint(x: 0, y: 1)), size: .init(width: 6, height: 6))))
let tips: ASAttributedString = tipsIcon + .init(string: " 检测到您的", .font(.PFSC_R(ofSize: 13)), .foreground(UIColor(hexString: "#8993A2") ?? .gray)) + .init(string: "工作时间有重叠", .font(.PFSC_R(ofSize: 13)), .foreground(UIColor.failColor)) + .init(string: "。请确认是否正确填报,若填报无误请在此处说明工作时间重叠的原因~", .font(.PFSC_R(ofSize: 13)), .foreground(UIColor(hexString: "#8993A2") ?? .gray))
let secondSection: [TableRow] = [.workingHoursStatement("如:工作时间灵活,可自由安排", tips)]
let detail: ASAttributedString = .init(string: "备注:赴港同意书为目前在职公司盖章提供,若目前未就职于任何公司,则由档案所在地人才中心盖章提供,", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor(hexString: "#8993A2") ?? .gray))
let actionStr = ASAttributedString.init(string: "查看示例模板", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor.brandMainColor), .underline(.init(rawValue: 1)), .action {
//
})
var secondSection: [TableRow] = [.consentForHKTravel("赴港同意书提供", detail + actionStr, "在职公司是否可以提供赴港同意书")]
secondSection.append(.questionSelect("人才中心是否可以提供赴港同意书"))
secondSection.append(.employmentVerification)
datas = [firstSection, secondSection]
var thirdSection: [TableRow] = [.consentForHKTravel("赴港同意书提供", detail + actionStr, "在职公司是否可以提供赴港同意书")]
thirdSection.append(.questionSelect("人才中心是否可以提供赴港同意书"))
thirdSection.append(.employmentVerification)
datas = [firstSection, secondSection, thirdSection]
tableView.reloadData()
}
......@@ -344,6 +350,11 @@ extension YHGCIncomeRecordViewController: UITableViewDelegate, UITableViewDataSo
cell.setupCellInfo(detail: selectedEmployment)
return cell
}
case let .workingHoursStatement(placeholder, tips):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHWorkingHoursStatementCell.cellReuseIdentifier) as? YHWorkingHoursStatementCell {
cell.setupCellInfo(placeholder: placeholder, remark: nil, detail: tips, isShowBottomLine: false)
return cell
}
}
return UITableViewCell()
}
......
//
// YHIncomeDateTillNowCell.swift
// galaxy
//
// Created by alexzzw on 2024/12/24.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHIncomeDateTillNowCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHIncomeDateTillNowCell"
var tillNowButtonEvent: (() -> Void)?
private lazy var dotIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "red_dot_6"))
return imageView
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "收入来源公司"
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "请选择"
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#E9ECF0")
return view
}()
private lazy var infoFailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .failColor
label.text = "请选择"
return label
}()
private lazy var tillNowButton: UIButton = {
let button = UIButton(type: .custom)
button.iconInLeft(spacing: 6)
button.setTitle("至今", for: .normal)
button.titleLabel?.font = .PFSC_R(ofSize: 14)
button.setTitleColor(.mainTextColor, for: .normal)
button.setImage(UIImage(named: "income_date_check_btn_0"), for: .normal)
button.setImage(UIImage(named: "income_date_check_btn_1"), for: .selected)
button.addTarget(self, action: #selector(tillNowButtonClicked), for: .touchUpInside)
return button
}()
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?, placeholder: String = "请选择", showBottomLine: Bool = true, tillNow: Bool, needShowFailButton: Bool) {
infoTitleLabel.text = title
updateContentState(detail: detail, placeholder: placeholder)
bottomLineView.isHidden = !showBottomLine
infoFailLabel.text = placeholder
updateFailLabel(needShowFailButton)
}
}
extension YHIncomeDateTillNowCell {
@objc private func tillNowButtonClicked() {
tillNowButtonEvent?()
}
private func updateFailLabel(_ needShowFailButton: Bool) {
if needShowFailButton {
infoFailLabel.isHidden = false
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(tillNowButton.snp.left).offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.top.equalTo(infoDetailLabel.snp.bottom).offset(6)
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
} else {
infoFailLabel.isHidden = true
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(tillNowButton.snp.left).offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
}
}
private func updateContentState(detail: String?, placeholder: String) {
if let detail = detail, !detail.isEmpty {
infoDetailLabel.font = .PFSC_M(ofSize: 14)
infoDetailLabel.textColor = UIColor.mainTextColor
infoDetailLabel.text = detail
} else {
infoDetailLabel.text = placeholder
infoDetailLabel.font = .PFSC_R(ofSize: 14)
infoDetailLabel.textColor = UIColor(hexString: "#B9C1CC")
}
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(dotIcon)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(bottomLineView)
subContainerView.addSubview(infoFailLabel)
subContainerView.addSubview(tillNowButton)
dotIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
tillNowButton.setContentCompressionResistancePriority(.required, for: .horizontal)
dotIcon.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.width.height.equalTo(6)
}
infoTitleLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(dotIcon.snp.right).offset(2)
}
tillNowButton.snp.makeConstraints { make in
make.centerY.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18)
make.width.equalTo(50)
make.height.equalTo(30)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(tillNowButton.snp.left).offset(-18)
}
bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(0.5)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
}
}
//
// YHIncomeInfoEditCell.swift
// galaxy
//
// Created by alexzzw on 2024/12/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHIncomeInfoEditCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHIncomeInfoEditCell"
private let maxCount = 100
var didBeginEditing: ((UITextField) -> Void)?
var didEndEditing: ((UITextField) -> Void)?
private lazy var dotIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "red_dot_6"))
return imageView
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "收入来源公司"
return label
}()
private lazy var inputTextField: UITextField = {
let textField = UITextField(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 40))
textField.textColor = .mainTextColor
textField.font = .PFSC_M(ofSize: 14)
textField.borderStyle = .none
textField.delegate = self
textField.keyboardType = .default
return textField
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#E9ECF0")
return view
}()
private lazy var infoFailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .failColor
label.text = "请选择"
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(title: String, detail: String?, placeholder: String = "请输入", showBottomLine: Bool = true, needShowFailButton: Bool) {
infoTitleLabel.text = title
inputTextField.text = detail
inputTextField.attributedPlaceholder = NSAttributedString(
string: placeholder,
attributes: [
.foregroundColor: UIColor(hex: 0xB9C1CC),
.font: UIFont.PFSC_R(ofSize: 14),
]
)
bottomLineView.isHidden = !showBottomLine
updateFailLabel(needShowFailButton)
}
}
extension YHIncomeInfoEditCell {
private func updateFailLabel(_ needShowFailButton: Bool) {
if needShowFailButton {
infoFailLabel.isHidden = false
inputTextField.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualToSuperview().offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.top.equalTo(inputTextField.snp.bottom).offset(6)
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
} else {
infoFailLabel.isHidden = true
inputTextField.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualToSuperview().offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
}
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(dotIcon)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(inputTextField)
subContainerView.addSubview(bottomLineView)
subContainerView.addSubview(infoFailLabel)
dotIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
inputTextField.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
dotIcon.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.width.height.equalTo(6)
}
infoTitleLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(dotIcon.snp.right).offset(2)
}
inputTextField.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualToSuperview().offset(-18)
}
bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(0.5)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
}
}
extension YHIncomeInfoEditCell: UITextFieldDelegate {
// MARK: - UITextFieldDelegate
func textFieldDidBeginEditing(_ textField: UITextField) {
if textField == inputTextField {
didBeginEditing?(textField)
}
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.endEditing(false)
return true
}
func textFieldDidEndEditing(_ textField: UITextField) {
if textField == inputTextField {
didEndEditing?(textField)
}
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
if textField == inputTextField {
/// 输入删除
if string == "" {
return true
}
let count = (textField.text?.utf16.count ?? 0) - range.length + string.utf16.count
if count > maxCount {
return false
}
return true
}
return true
}
}
//
// YHIncomeInfoSelectCell.swift
// galaxy
//
// Created by alexzzw on 2024/12/24.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHIncomeInfoSelectCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHIncomeInfoSelectCell"
private lazy var dotIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "red_dot_6"))
return imageView
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "收入来源公司"
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "请选择"
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#E9ECF0")
return view
}()
private lazy var infoFailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .failColor
label.text = "请选择"
return label
}()
private lazy var rightArrowIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "form_right_arrow"))
return imageView
}()
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?, placeholder: String = "请选择", showBottomLine: Bool = true, needShowFailButton: Bool) {
infoTitleLabel.text = title
updateContentState(detail: detail, placeholder: placeholder)
bottomLineView.isHidden = !showBottomLine
infoFailLabel.text = placeholder
updateFailLabel(needShowFailButton)
}
}
extension YHIncomeInfoSelectCell {
private func updateFailLabel(_ needShowFailButton: Bool) {
if needShowFailButton {
infoFailLabel.isHidden = false
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.top.equalTo(infoDetailLabel.snp.bottom).offset(6)
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
} else {
infoFailLabel.isHidden = true
infoDetailLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
infoFailLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
}
}
private func updateContentState(detail: String?, placeholder: String) {
if let detail = detail, !detail.isEmpty {
infoDetailLabel.font = .PFSC_M(ofSize: 14)
infoDetailLabel.textColor = UIColor.mainTextColor
infoDetailLabel.text = detail
} else {
infoDetailLabel.text = placeholder
infoDetailLabel.font = .PFSC_R(ofSize: 14)
infoDetailLabel.textColor = UIColor(hexString: "#B9C1CC")
}
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(dotIcon)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(bottomLineView)
subContainerView.addSubview(infoFailLabel)
subContainerView.addSubview(rightArrowIcon)
dotIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
rightArrowIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
dotIcon.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.width.height.equalTo(6)
}
infoTitleLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(dotIcon.snp.right).offset(2)
}
rightArrowIcon.snp.makeConstraints { make in
make.centerY.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18)
make.width.height.equalTo(20)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.left.equalToSuperview().offset(147)
make.right.lessThanOrEqualTo(rightArrowIcon.snp.left).offset(-18)
}
bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(0.5)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
}
}
//
// YHIncomeUploadWorkIDCell.swift
// galaxy
//
// Created by alexzzw on 2024/12/24.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHIncomeUploadWorkIDCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHIncomeUploadWorkIDCell"
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "上传工作证件"
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = .brandMainColor
label.text = "去上传"
return label
}()
private lazy var rightArrowIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "blue_right_arrow"))
return imageView
}()
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) {
infoTitleLabel.text = title
infoDetailLabel.text = detail
}
private func setupUI() {
updateCellCorner(.bottom)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(rightArrowIcon)
infoTitleLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
rightArrowIcon.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(18)
}
rightArrowIcon.snp.makeConstraints { make in
make.centerY.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18)
make.width.height.equalTo(20)
}
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.bottom.equalToSuperview().offset(-16)
make.right.equalTo(rightArrowIcon.snp.left)
}
}
}
......@@ -65,6 +65,12 @@ class YHInfoQuestionSelectionCell: YHResignDocumentCell {
return label
}()
private lazy var bottomLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#E9ECF0")
return view
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
......@@ -77,6 +83,7 @@ class YHInfoQuestionSelectionCell: YHResignDocumentCell {
func setupCellInfo(question: String, showBottomLine: Bool = false, needShowFailButton: Bool) {
infoQuestionLabel.text = question
updateFailLabel(needShowFailButton)
bottomLineView.isHidden = !showBottomLine
}
}
......@@ -137,6 +144,7 @@ extension YHInfoQuestionSelectionCell {
subContainerView.addSubview(sureButton)
subContainerView.addSubview(cancelButton)
subContainerView.addSubview(infoFailLabel)
subContainerView.addSubview(bottomLineView)
sureButton.setContentCompressionResistancePriority(.required, for: .horizontal)
cancelButton.setContentCompressionResistancePriority(.required, for: .horizontal)
......@@ -170,6 +178,13 @@ extension YHInfoQuestionSelectionCell {
make.centerY.equalTo(infoQuestionLabel)
make.left.greaterThanOrEqualTo(infoQuestionLabel.snp.right).offset(8)
}
bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
make.height.equalTo(0.5)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
......
......@@ -8,8 +8,8 @@
import AgoraRtcKit
import HyphenateChat
//import AVKit
import UIKit
import AGConnectAppLinking
class YHLivePlayerViewController: YHBasePlayerViewController {
// MARK: - Properties
......@@ -347,15 +347,25 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
// MARK: - Chat Room Methods
private func joinChatRoom(roomId: String) {
YHIMHelper.shared.joinChatRoom(roomID: roomId, leaveOtherRooms: true) { [weak self] error in
guard let self = self else { return }
func joinRoom() {
YHIMHelper.shared.joinChatRoom(roomID: roomId, leaveOtherRooms: true) { [weak self] error in
guard let self = self else { return }
if let error = error {
printLog("joinChatRoom: \(error)")
} else {
self.loadHistoryMessages(roomId: roomId)
if let error = error {
printLog("joinChatRoom: \(error)")
} else {
self.loadHistoryMessages(roomId: roomId)
}
}
}
if !YHIMHelper.shared.isCurrentUserLogin {
YHIMHelper.shared.registerAndLoginCurrentUser { _ in
joinRoom()
}
} else {
joinRoom()
}
}
private func loadHistoryMessages(roomId: String) {
......@@ -416,7 +426,32 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
guard let liveModel = viewModel.liveDetailModel else {
return
}
YHShareAlertView.show(image: liveModel.live_image, title: "@" + liveModel.account, subMessage: liveModel.live_title, linkUrl: liveModel.live_h5_url, isLive: true, fromAiSale: true)
// //直播 分享连接
// let components = AGCAppLinkingComponents()
// //通过urlPrefix属性设置为申请链接前缀中的链接前缀
// components.uriPrefix = "https://yinheapp.drcn.agconnect.link"
// //通过deepLink属性设置深度链接地址
// components.deepLink = "yinheapp://hkdiy-h5.galaxy-immi.com/galaxyapp?type=1&liveId=106"
// components.iosBundleId = Bundle.main.bundleIdentifier
// components.androidDeepLink = "yinheapp://hkdiy-h5.galaxy-immi.com/galaxyapp?type=1&liveId=106"
// components.androidPackageName = "com.galaxy.galaxyandroid"
// let url = components.buildLongLink()
DispatchQueue.global().async {
if let url = YHShareManager.shared.createMutilShareUrl(type: 1, param: ["LiveID":"106"]) {
printLog(url) //for test hjl
}
// printLog(url.absoluteString)
DispatchQueue.main.async {
YHShareAlertView.show(image: liveModel.live_image, title: "@" + liveModel.account, subMessage: liveModel.live_title, linkUrl: liveModel.live_h5_url, isLive: true, fromAiSale: true)
}
}
}
private func showGoods() {
......
......@@ -16,7 +16,7 @@ class YHLiveDetailModel: SmartCodable {
var hxUid: String = ""
var access_num: String = ""
var tips: String = ""
// 1:直播中 2:未直播 0:未知状态 3:结束直播
// 0:未知状态 1:直播中 2:未直播 3:结束直播
var status: Int = 0
// 1:正常 2:播放中 3:禁推---(当status==1才监测,3代表离开了)
var stream_status: Int = 0
......
......@@ -8,6 +8,7 @@
import UIKit
import Alamofire
import AGConnectAppLinking
class YHShareManager: NSObject {
static let shared = YHShareManager()
......@@ -267,4 +268,42 @@ extension YHShareManager {
WXApi.send(miniProgram)
}
/*
生成多平台分享链接,完成回环操作
type : 业务类型 1-直播
param : 业务对应的参数
*/
func createMutilShareUrl(type: Int,param : [String : String]) -> String? {
if type < 1 {
return nil
}
//直播 分享连接
let components = AGCAppLinkingComponents()
//通过urlPrefix属性设置为申请链接前缀中的链接前缀
components.uriPrefix = "https://yinheapp.drcn.agconnect.link"
//通过deepLink属性设置深度链接地址
var linkUrl = YhConstant.DeepLink.url + "?" + "type=\(type)"
let arrKey = param.keys
for (_,item) in arrKey.enumerated() {
if let value = param[item],!value.isEmpty,let value2 = YHURLEncodeHelper.urlEncodedString(value) {
linkUrl = linkUrl + "&" + item + "=" + value2
}
}
components.deepLink = linkUrl
components.iosBundleId = Bundle.main.bundleIdentifier
components.androidDeepLink = linkUrl//安卓平台调用不过 所以需要单独写出来
components.androidPackageName = "com.galaxy.galaxyandroid"
let url = components.buildLongLink()
return url.absoluteString
}
}
......@@ -237,6 +237,14 @@ class YhConstant {
extension YhConstant {
//DeepLink 常量
struct DeepLink {
static let url = "yinheapp://hkdiy-h5.galaxy-immi.com/galaxyapp"
static let compareUrl = "yinheapp://hkdiy-h5.galaxy-immi.com/galaxyapp?type="
}
// MARK: - 环信IM
struct IM {
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "income_date_check_btn_0@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "income_date_check_btn_0@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "income_date_check_btn_1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "income_date_check_btn_1@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