Commit 6635b1c0 authored by Steven杜宇's avatar Steven杜宇

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

# Conflicts:
#	galaxy/galaxy.xcodeproj/project.pbxproj
parents 028999bf 15fd1db2
......@@ -32,6 +32,7 @@
0411CF142D1C0B0700644D35 /* YHGCSignatureAddModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF132D1C0B0700644D35 /* YHGCSignatureAddModel.swift */; };
0411CF162D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */; };
0411CF182D1D502D00644D35 /* YHlifeCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF172D1D502D00644D35 /* YHlifeCollectionReusableView.swift */; };
0411CF1A2D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF192D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.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 */; };
......@@ -63,6 +64,7 @@
04307BB02D215D1C00ED8E8D /* YHRecommendedLiveHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307BAF2D215D1C00ED8E8D /* YHRecommendedLiveHeader.swift */; };
04307BB42D21623300ED8E8D /* YHRecommendedAppointmentLiveView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307BB32D21623300ED8E8D /* YHRecommendedAppointmentLiveView.swift */; };
04307BB62D2180C300ED8E8D /* YHRecommendedOnLiveView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307BB52D2180C300ED8E8D /* YHRecommendedOnLiveView.swift */; };
04307BBC2D22A21E00ED8E8D /* YHLiveStatusModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307BBB2D22A21E00ED8E8D /* YHLiveStatusModel.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 */; };
......@@ -1247,6 +1249,7 @@
0411CF132D1C0B0700644D35 /* YHGCSignatureAddModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddModel.swift; sourceTree = "<group>"; };
0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddTableViewCell.swift; sourceTree = "<group>"; };
0411CF172D1D502D00644D35 /* YHlifeCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHlifeCollectionReusableView.swift; sourceTree = "<group>"; };
0411CF192D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkExperienceListReasonTableViewCell.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>"; };
......@@ -1278,6 +1281,7 @@
04307BAF2D215D1C00ED8E8D /* YHRecommendedLiveHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHRecommendedLiveHeader.swift; sourceTree = "<group>"; };
04307BB32D21623300ED8E8D /* YHRecommendedAppointmentLiveView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHRecommendedAppointmentLiveView.swift; sourceTree = "<group>"; };
04307BB52D2180C300ED8E8D /* YHRecommendedOnLiveView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHRecommendedOnLiveView.swift; sourceTree = "<group>"; };
04307BBB2D22A21E00ED8E8D /* YHLiveStatusModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLiveStatusModel.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>"; };
045C0A162D12CA5E00BD2DC0 /* YHNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNavigationController.swift; sourceTree = "<group>"; };
......@@ -2499,6 +2503,7 @@
children = (
0411CEEC2D15154A00644D35 /* YHGCWorkListHasWorkExperienceTableViewCell.swift */,
0411CEEE2D151E5F00644D35 /* YHGCWorkListHasDocTableViewCell.swift */,
0411CF192D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -5449,6 +5454,7 @@
045C0E932D12CA5E00BD2DC0 /* YHRecordedDetailModel.swift */,
04307BA92D1FF74500ED8E8D /* YHRecommendLiveListModel.swift */,
04307BAB2D1FFC1C00ED8E8D /* YHShareLiveInfoModel.swift */,
04307BBB2D22A21E00ED8E8D /* YHLiveStatusModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -6913,6 +6919,7 @@
045C10222D12CA5F00BD2DC0 /* YHMyFileListViewController.swift in Sources */,
045C10232D12CA5F00BD2DC0 /* YHClipperView.swift in Sources */,
045C10242D12CA5F00BD2DC0 /* YHAddressViewController.swift in Sources */,
04307BBC2D22A21E00ED8E8D /* YHLiveStatusModel.swift in Sources */,
045C10252D12CA5F00BD2DC0 /* YHPeopleSuccessView.swift in Sources */,
045C10262D12CA5F00BD2DC0 /* YHLookResignAlertView.swift in Sources */,
045C10272D12CA5F00BD2DC0 /* YHUploadCertificateDetailModel.swift in Sources */,
......@@ -7640,6 +7647,7 @@
045C12B82D12CA5F00BD2DC0 /* YHResignHaveAppointedApplicantsInfoCell.swift in Sources */,
045C12B92D12CA5F00BD2DC0 /* YHPrinciplePhotoListCell.swift in Sources */,
045C12BA2D12CA5F00BD2DC0 /* YHChangeHeadModel.swift in Sources */,
0411CF1A2D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift in Sources */,
045C12BB2D12CA5F00BD2DC0 /* YHResignDocumentStatus.swift in Sources */,
045C12BC2D12CA5F00BD2DC0 /* YHEditSchoolViewController.swift in Sources */,
045C12BD2D12CA5F00BD2DC0 /* YHMySchemeModel.swift in Sources */,
......
......@@ -17,6 +17,8 @@ class YHlifeCollectionReusableView: UICollectionReusableView {
self.tableView.reloadData()
}
}
private let viewModel = YHLiveSalesViewModel()
override init(frame: CGRect) {
super.init(frame: frame)
setupView()
......@@ -93,8 +95,23 @@ extension YHlifeCollectionReusableView: UITableViewDelegate, UITableViewDataSour
return
}
let model = dataSource[indexPath.row]
let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
UIViewController.current?.navigationController?.pushViewController(ctl)
YHHUD.show(.progress(message: "加载中..."))
viewModel.getLiveStatus(liveId: model.live_id) { liveInfo, error in
YHHUD.hide()
guard let liveInfo = liveInfo else {
let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
UIViewController.current?.navigationController?.pushViewController(ctl)
return
}
if liveInfo.status == 2 {
let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
UIViewController.current?.navigationController?.pushViewController(ctl)
} else {
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, url: nil, title: nil, roomId: nil, uid: nil, isLive: true, scene: .fullscreen)
YHPlayerManager.shared.enterLive(from: nil, playbackInfo: playbackInfo)
}
}
}
}
......
......@@ -282,9 +282,11 @@ class YHWorkExperienceItemView: UIView {
nextStepImageView.isHidden = true
messageTextField.isHidden = true
if dataSource.message == "0" {
buttonState(isLeft: false)
buttonState(isLeft: 1)
} else if dataSource.message == "1"{
buttonState(isLeft: 0)
} else {
buttonState(isLeft: true)
buttonState(isLeft: 2)
}
} else {
leftButton.isHidden = true
......@@ -342,8 +344,8 @@ class YHWorkExperienceItemView: UIView {
}
}
func buttonState(isLeft: Bool) {
if isLeft {
func buttonState(isLeft: Int) {
if isLeft == 0 {
leftButton.isSelected = true
rightButton.isSelected = false
leftButton.layer.borderWidth = 1
......@@ -351,7 +353,7 @@ class YHWorkExperienceItemView: UIView {
leftButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
rightButton.backgroundColor = UIColor.contentBkgColor
rightButton.layer.borderWidth = 0
} else {
} else if isLeft == 1 {
rightButton.isSelected = true
leftButton.isSelected = false
rightButton.layer.borderWidth = 1
......@@ -359,6 +361,14 @@ class YHWorkExperienceItemView: UIView {
rightButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
leftButton.backgroundColor = UIColor.contentBkgColor
leftButton.layer.borderWidth = 0
} else {
rightButton.isSelected = false
leftButton.isSelected = false
rightButton.layer.borderWidth = 0
rightButton.layer.borderColor = UIColor.brandMainColor.cgColor
rightButton.backgroundColor = UIColor.contentBkgColor
leftButton.backgroundColor = UIColor.contentBkgColor
leftButton.layer.borderWidth = 0
}
}
......
......@@ -117,16 +117,32 @@ extension YHGCMineSchemeViewController {
if success == true {
guard let model = self.reqSchemeVM.schemeModel else { return }
let industry = model.industry.defaultStringIfEmpty()
let model1 = YHScemeItemModel(title: "职业界别", mainMessage: "根据您目前给来的材料,初步建议您申请的行业:\n" + industry, lightMessage: industry, subMessage: "后续会根据您文书准备的补充情况来最终确定,如有修改会再告知您。", lightFont: UIFont.PFSC_B(ofSize: 16))
let contentStr = model.content.reduce("") { partialResult, current in
partialResult.count > 0 ? partialResult + "\n" + current : partialResult + current
let industry = model.industry
if !industry.isEmpty {
let model1 = YHScemeItemModel(title: "职业界别", mainMessage: "根据您目前给来的材料,初步建议您申请的行业:\n" + industry, lightMessage: industry, subMessage: "后续会根据您文书准备的补充情况来最终确定,如有修改会再告知您。", lightFont: UIFont.PFSC_B(ofSize: 16))
self.dataSource?.append(model1)
}
let model2 = YHScemeItemModel(title: "资料清单", buttonTitle: "资料清单", mainMessage: "这是您的资料清单,请您前往查看。请您在1-2周内上传基础类证件哦,需要重新办理的可以晚些提供。需要注意的点如下:", lightMessage: "1-2周内", subMessage: "按照您填报的学历信息, 证明文件如下:\(contentStr)")
self.dataSource = [model1, model2]
let contentStr: String
if model.content.count > 1 {
contentStr = model.content.enumerated().reduce("") { partialResult, current in
let (index, content) = current
return partialResult + "\n" + "(\(index + 1))" + content
}
} else if model.content.count > 0 {
contentStr = model.content.reduce("") { partialResult, current in
return partialResult + "\n" + current
}
} else {
contentStr = ""
}
let model2 = YHScemeItemModel(title: "资料清单", buttonTitle: "资料清单", mainMessage: "这是您的资料清单,请您前往查看,请您在1-2周内准备好文件并上传:", lightMessage: "1-2周内", subMessage: "按照您填报的收入信息, 证明文件如下:\(contentStr)")
self.dataSource?.append(model2)
self.tableView.reloadData()
let type = YHGCApplicationType(rawValue: model.application_type) ?? .typeA
self.headView.update(type: type, name: model.username.defaultStringIfEmpty())
let name = model.user_name.isEmpty ? "--" : "尊敬的\(model.user_name)"
self.headView.update(type: type, name: name)
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
......
......@@ -12,7 +12,7 @@ import SmartCodable
class YHGCMySchemeModel: SmartCodable {
var application_type: Int = 0
var industry : String = ""
var username : String = ""
var user_name : String = ""
var sex: Int = 0
var content: [String] = []
var certificate_skip_status: Bool = false
......
......@@ -832,7 +832,7 @@ private extension YHGCPreviewViewModel {
let tmp1 = YHPreviewQuestionAndAnswerModel(question: "2、是否曾因任何罪行或违法行为在香港或其他地方被定罪?", answer: answer1, remark: remark1)
let arr = [tmp0, tmp1]
let model1 = YHPreviewInfoSessionModel(cellType: .questionAndAnswer, cellTitle: "子女(\(model.name)", cellData0: arr)
let model1 = YHPreviewInfoSessionModel(cellType: .questionAndAnswer, cellTitle: "子女(\(model.name))", cellData0: arr)
arrDataForBasicInfo.append(model1)
}
}
......
......@@ -64,6 +64,7 @@ class YHGCWorkExperienceListViewController: YHBaseViewController {
tableView.register(cellWithClass: YHWorkExperienceListTableViewCell.self)
tableView.register(cellWithClass: YHGCWorkListHasWorkExperienceTableViewCell.self)
tableView.register(cellWithClass: YHGCWorkListHasDocTableViewCell.self)
tableView.register(cellWithClass: YHGCWorkExperienceListReasonTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
......@@ -122,7 +123,7 @@ class YHGCWorkExperienceListViewController: YHBaseViewController {
func showDeleteAlert(_ model: YHWorkItemListModel) {
YHCommonAlertView.show("", "您确定要删除这份工作经验吗?", "取消", "确认") {
self.viewModel?.requestDeleteWorkExperience(self.orderId, "\(model.id ?? 0)", callBackBlock: {[weak self] success, error in
self.viewModel?.requestDeleteWorkExperience(model.id ?? 0, "\(self.orderId)", callBackBlock: {[weak self] success, error in
guard let self = self else { return }
self.getData()
})
......@@ -140,7 +141,7 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
// count = count + 1
// }
// return count
return 3
return 4
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
......@@ -155,6 +156,11 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
return cell
} else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkExperienceListTableViewCell.self)
if self.viewModel.mainModel.has_work_experience == 1 {
cell.isHidden = false
} else {
cell.isHidden = true
}
cell.showPrompt = showPrompt
cell.dataSource = dataSource
if isMore {
......@@ -192,6 +198,19 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
cell.contentView.backgroundColor = .clear
return cell
} else if indexPath.row == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHGCWorkExperienceListReasonTableViewCell.self)
if viewModel.mainModel.has_work_time_overlap == 1 {
cell.isHidden = false
} else {
cell.isHidden = true
}
cell.model = viewModel?.mainModel
cell.clickBlock = { [weak self] value in
guard let self = self else { return }
self.viewModel?.mainModel.work_time_overlap_remark = value
}
return cell
} else if indexPath.row == 3 {
let cell = tableView.dequeueReusableCell(withClass: YHGCWorkListHasDocTableViewCell.self)
cell.companyList = self.viewModel.mainModel.list ?? []
cell.url = self.viewModel.mainModel.consent_template_url
......@@ -223,6 +242,14 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
}
if indexPath.row == 2 {
if viewModel.mainModel.has_work_time_overlap == 1 {
return UITableView.automaticDimension
} else {
return 0
}
}
if indexPath.row == 3 {
let array = docData.models ?? []
var h = 0
for i in 0..<array.count {
......@@ -237,35 +264,41 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
return CGFloat(h + 52 + 96 + 14)
}
_ = dataSource?.count ?? 0
var height = 23 + 154
if let data = dataSource {
for item in data {
if item.company_name == "" {
height = height + 76
} else {
let text = item.company_name // 要显示的文本内容
let font = UIFont.PFSC_B(ofSize: 14) // 字体大小
let maxWidth = 143.0 // 最大宽度限制
// 创建NSAttributedString对象并设置属性
let attributes = [NSAttributedString.Key.font : font] as [NSAttributedString.Key : Any]
_ = NSMutableAttributedString(string: text ?? "", attributes: attributes)
// 根据指定的最大宽度和字体大小计算文本的高度
let size = (text! as NSString).boundingRect(with: CGSize(width: maxWidth, height: .greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes: attributes, context: nil).size
if size.height > 20 {
height = height + 96
} else {
if self.viewModel.mainModel.has_work_experience == 1 {
_ = dataSource?.count ?? 0
var height = 23 + 154
if let data = dataSource {
for item in data {
if item.company_name == "" {
height = height + 76
} else {
let text = item.company_name // 要显示的文本内容
let font = UIFont.PFSC_B(ofSize: 14) // 字体大小
let maxWidth = 143.0 // 最大宽度限制
// 创建NSAttributedString对象并设置属性
let attributes = [NSAttributedString.Key.font : font] as [NSAttributedString.Key : Any]
_ = NSMutableAttributedString(string: text ?? "", attributes: attributes)
// 根据指定的最大宽度和字体大小计算文本的高度
let size = (text! as NSString).boundingRect(with: CGSize(width: maxWidth, height: .greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes: attributes, context: nil).size
if size.height > 20 {
height = height + 96
} else {
height = height + 76
}
}
if showPrompt && item.vacant_num != 0 {
height = height + 20
}
}
if showPrompt && item.vacant_num != 0 {
height = height + 20
}
}
return CGFloat(height)
} else {
return 0
}
return CGFloat(height)
}
}
//
// YHGCWorkExperienceListReasonTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/12/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHGCWorkExperienceListReasonTableViewCell: UITableViewCell {
typealias ExperienceListBlock = (_ value: String) -> ()
var clickBlock: ExperienceListBlock?
var centerView: UIView!
var titleLabel: UILabel!
var lineView: UIView!
var messageLabel: UILabel!
var messageView: UIView!
var messageTextField: UITextView!
var promptsLabel: UILabel!
var messageNumberLabel: UILabel!
var model: YHGCWorkModel? {
didSet {
if model?.has_work_time_overlap == 1 {
messageLabel.isHidden = false
messageView.isHidden = false
messageTextField.isHidden = false
promptsLabel.isHidden = false
messageNumberLabel.isHidden = false
messageLabel.snp.remakeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(68)
}
messageView.snp.remakeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(112)
make.height.equalTo(160)
}
messageTextField.snp.remakeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(112)
make.height.equalTo(128)
}
promptsLabel.snp.remakeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.top.equalTo(116)
}
messageNumberLabel.snp.remakeConstraints { make in
make.right.equalTo(-30)
make.top.equalTo(240)
make.height.equalTo(20)
make.bottom.equalTo(-28)
}
}
messageTextField.text = model?.work_time_overlap_remark
if messageTextField.text.count != 0 {
promptsLabel.isHidden = true
messageNumberLabel.text = "\(messageTextField.text.count)/1000"
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(7)
make.bottom.equalTo(-7)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.text = "工作时间说明"
label.textColor = UIColor.mainTextColor
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.top.equalTo(23)
make.height.equalTo(24)
make.right.equalTo(-20)
}
lineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(52)
make.height.equalTo(1)
}
messageLabel = {
let label = UILabel()
label.numberOfLines = 0
let a: ASAttributedString = .init("*", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.failColor))
let aa: ASAttributedString = .init(" 检测到您的", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor(hex:0x8893a2)))
let aaa: ASAttributedString = .init("工作时间有重叠", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.failColor))
let aaaa: ASAttributedString = .init(" 。请确认是否正确填报,若填报无误请在此处说明工作时间重叠的原因~", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor(hex:0x8893a2)))
label.attributed.text = a + aa + aaa + aaaa
return label
}()
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(68)
}
messageView = {
let view = UIView()
view.backgroundColor = UIColor.contentBkgColor
view.layer.cornerRadius = 1
return view
}()
centerView.addSubview(messageView)
messageView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(112)
make.height.equalTo(160)
}
messageTextField = {
let textField = UITextView()
textField.font = UIFont.PFSC_R(ofSize: 14)
textField.backgroundColor = .clear
textField.delegate = self
return textField
}()
centerView.addSubview(messageTextField)
messageTextField.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(112)
make.height.equalTo(128)
}
promptsLabel = {
let prompts = UILabel()
prompts.font = UIFont.PFSC_R(ofSize: 14)
prompts.textColor = UIColor(hex: 0xc0c0c0)
prompts.text = "如:工作时间灵活,可自由安排"
prompts.numberOfLines = 0
prompts.backgroundColor = .clear
return prompts
}()
centerView.addSubview(promptsLabel)
promptsLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.top.equalTo(116)
}
messageNumberLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.text = "0/1000"
label.textAlignment = .right
label.textColor = UIColor(hex: 0xd5dae1)
return label
}()
centerView.addSubview(messageNumberLabel)
messageNumberLabel.snp.makeConstraints { make in
make.right.equalTo(-30)
make.top.equalTo(240)
make.height.equalTo(20)
}
}
}
extension YHGCWorkExperienceListReasonTableViewCell: UITextViewDelegate {
func textViewDidChange(_ textView: UITextView) {
let number = textView.text.count
if textView.text.count != 0 {
promptsLabel.isHidden = true
messageNumberLabel.text = "\(number)/1000"
} else {
promptsLabel.isHidden = false
messageNumberLabel.text = "\(number)/1000"
}
if let block = clickBlock {
block(textView.text)
}
}
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
let newLength = (textView.text as NSString).length + text.count - range.length
return newLength <= 1000
}
}
......@@ -50,6 +50,11 @@ class YHGCWorkItemListViewModel: YHBaseViewModel {
company = item.company_name ?? ""
}
}
if company == "" && array.count == 1 {
let item = array.first
company = item?.company_name ?? ""
mainModel.consent_work_id = item?.id ?? 0
}
let item2 = YHWorkExperienceModel(id: .id4, isNeed: true, title: "可提供的在职公司", isUserKeyBoard: false, prompts: "请选择", message: company, type: .myCompany, isShowPrompts: isShowPrompt, alertMessage:"请选择")
if has_company_consent == 2 {
let section = YHSectionWorkExperienceModel(title: "赴港同意书提供", models: [item])
......
......@@ -325,9 +325,26 @@ class YHLiveStateViewController: YHBaseViewController {
self.bookLive(liveId: model.live_id, liveView: view)
}
view.buttonClickEvent = {
let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
UIViewController.current?.navigationController?.pushViewController(ctl)
view.buttonClickEvent = { [weak self] in
guard let self = self else {
return
}
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getLiveStatus(liveId: model.live_id) { liveInfo, error in
YHHUD.hide()
guard let liveInfo = liveInfo else {
let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
UIViewController.current?.navigationController?.pushViewController(ctl)
return
}
if liveInfo.status == 2 {
let ctl = YHLiveAppointmentViewController(liveId: model.live_id)
UIViewController.current?.navigationController?.pushViewController(ctl)
} else {
let playbackInfo = YHPlayerManager.PlaybackInfo(id: model.live_id, url: nil, title: nil, roomId: nil, uid: nil, isLive: true, scene: .fullscreen)
YHPlayerManager.shared.enterLive(from: nil, playbackInfo: playbackInfo)
}
}
}
self.bottomView.addSubview(view)
view.snp.makeConstraints { make in
......@@ -348,10 +365,7 @@ class YHLiveStateViewController: YHBaseViewController {
private func bookLive(liveId: Int, liveView: YHRecommendedAppointmentLiveView) {
YHHUD.show(.progress(message: "加载中..."))
viewModel.postLiveBook(id: liveId) { [weak self] success, error in
guard let self = self else {
return
}
viewModel.postLiveBook(id: liveId) { success, error in
YHHUD.hide()
if success {
liveView.updateAppointmentButton(isAppointmented: true)
......
//
// YHLiveStatusModel.swift
// galaxy
//
// Created by alexzzw on 2024/12/30.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
import SmartCodable
class YHLiveStatusModel: SmartCodable {
var status: Int = 0
var stream_status: Int = 0
required init() {
}
}
......@@ -302,6 +302,32 @@ extension YHLiveSalesViewModel {
callback(nil, err)
}
}
func getLiveStatus(liveId: Int, callback: @escaping (_ liveInfo: YHLiveStatusModel?, _ error: YHErrorModel?) -> Void) {
// 分享类型 1:直播 2录播
let param: [String: Any] = ["live_id": liveId]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.LiveSales.liveStatus
_ = YHNetRequest.getRequest(url: strUrl, params: param) { json, _ in
// 1. json字符串 转 对象
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String: Any], let resultModel = YHLiveStatusModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callback(nil, err)
return
}
callback(resultModel, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback(nil, err)
}
} failBlock: { err in
callback(nil, err)
}
}
}
......
......@@ -728,6 +728,8 @@ class YHAllApiName {
static let recommendLiveList = "super-app/live/recommend-live-list"
// APP分享直播间
static let shareLive = "super-app/live/share-live"
// app直播间状态
static let liveStatus = "super-app/live/live-status"
}
struct AIChat {
......
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