Skip to content

[IDLE-000] 요양보호사 공고화면 세부 변경사항 반영 #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 12, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ extension AppliedAndLikedBoardCoordinator {
parent: self,
navigationController: navigationController,
recruitmentPostUseCase: injector.resolve(RecruitmentPostUseCase.self),
workerProfileUseCase: injector.resolve(WorkerProfileUseCase.self)
workerProfileUseCase: injector.resolve(WorkerProfileUseCase.self),
centerProfileUseCase: injector.resolve(CenterProfileUseCase.self)
)
)
addChildCoordinator(coodinator)
Expand All @@ -92,4 +93,6 @@ extension AppliedAndLikedBoardCoordinator {
coordinator.parent = self
coordinator.start()
}

func showWorkerProfile() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ extension WorkerRecruitmentBoardCoordinator {
parent: self,
navigationController: navigationController,
recruitmentPostUseCase: injector.resolve(RecruitmentPostUseCase.self),
workerProfileUseCase: injector.resolve(WorkerProfileUseCase.self)
workerProfileUseCase: injector.resolve(WorkerProfileUseCase.self),
centerProfileUseCase: injector.resolve(CenterProfileUseCase.self)
)
)
addChildCoordinator(coodinator)
Expand All @@ -81,5 +82,18 @@ extension WorkerRecruitmentBoardCoordinator {
coordinator.parent = self
coordinator.start()
}

public func showWorkerProfile() {
let coordinator = WorkerProfileCoordinator(
dependency: .init(
profileMode: .myProfile,
navigationController: navigationController,
workerProfileUseCase: injector.resolve(WorkerProfileUseCase.self)
)
)
addChildCoordinator(coordinator)
coordinator.parent = self
coordinator.start()
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ public class PhoneCSButton: TappableUIView {

self.nameLabel.textString = nameText
self.phoneNumberLabel.textString = phoneNumberText

self
.rx.tap
.subscribe(onNext: {

if let phoneURL = URL(string: "tel://\(phoneNumberText)"), UIApplication.shared.canOpenURL(phoneURL) {
UIApplication.shared.open(phoneURL, options: [:], completionHandler: nil)
}
})
.disposed(by: disposeBag)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,24 @@ public class PostDetailForWorkerCoodinator: ChildCoordinator {
let navigationController: UINavigationController
let recruitmentPostUseCase: RecruitmentPostUseCase
let workerProfileUseCase: WorkerProfileUseCase
let centerProfileUseCase: CenterProfileUseCase

public init(
postType: RecruitmentPostType,
postId: String,
parent: WorkerRecruitmentBoardCoordinatable? = nil,
navigationController: UINavigationController,
recruitmentPostUseCase: RecruitmentPostUseCase,
workerProfileUseCase: WorkerProfileUseCase
workerProfileUseCase: WorkerProfileUseCase,
centerProfileUseCase: CenterProfileUseCase
) {
self.postType = postType
self.postId = postId
self.parent = parent
self.navigationController = navigationController
self.recruitmentPostUseCase = recruitmentPostUseCase
self.workerProfileUseCase = workerProfileUseCase
self.centerProfileUseCase = centerProfileUseCase
}
}

Expand All @@ -45,6 +48,7 @@ public class PostDetailForWorkerCoodinator: ChildCoordinator {
public let navigationController: UINavigationController
let recruitmentPostUseCase: RecruitmentPostUseCase
let workerProfileUseCase: WorkerProfileUseCase
let centerProfileUseCase: CenterProfileUseCase

public init(
dependency: Dependency
Expand All @@ -55,6 +59,7 @@ public class PostDetailForWorkerCoodinator: ChildCoordinator {
self.navigationController = dependency.navigationController
self.recruitmentPostUseCase = dependency.recruitmentPostUseCase
self.workerProfileUseCase = dependency.workerProfileUseCase
self.centerProfileUseCase = dependency.centerProfileUseCase
}

deinit {
Expand All @@ -72,7 +77,8 @@ public class PostDetailForWorkerCoodinator: ChildCoordinator {
postId: postId,
coordinator: self,
recruitmentPostUseCase: recruitmentPostUseCase,
workerProfileUseCase: workerProfileUseCase
workerProfileUseCase: workerProfileUseCase,
centerProfileUseCase: centerProfileUseCase
)
nativeDetailVC.bind(viewModel: vm)
vc = nativeDetailVC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class NativePostDetailForWorkerVC: BaseViewController {
let applyButton: IdlePrimaryButton = {
let btn = IdlePrimaryButton(level: .medium)
btn.label.textString = "지원하기"
btn.setEnabled(false)
return btn
}()

Expand All @@ -47,7 +48,6 @@ public class NativePostDetailForWorkerVC: BaseViewController {
public override func viewDidLoad() {
setAppearance()
setLayout()
setObservable()
}

private func setAppearance() {
Expand Down Expand Up @@ -105,19 +105,7 @@ public class NativePostDetailForWorkerVC: BaseViewController {
buttonStack.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -16),
])
}

private func setObservable() {

// '문의하기'버튼 클릭시
csButton.rx.tap
.subscribe { [weak self] _ in
let vc = SelectCSTypeVC()
vc.modalPresentationStyle = .overFullScreen
self?.present(vc, animated: false)
}
.disposed(by: disposeBag)
}


public func bind(viewModel: NativePostDetailForWorkerViewModelable) {

super.bind(viewModel: viewModel)
Expand All @@ -135,6 +123,14 @@ public class NativePostDetailForWorkerVC: BaseViewController {

contentView.cardView.bind(ro: cardRO)

if bundle.applyDate != nil {
// 지원한 공고인 경우
applyButton.setEnabled(false)
} else {
// 지원하지 않은 공고인 경우
applyButton.setEnabled(true)
}

// 근무 조건
contentView.workConditionView.bind(
workTimeAndPayStateObject: bundle.workTimeAndPay,
Expand Down Expand Up @@ -203,10 +199,28 @@ public class NativePostDetailForWorkerVC: BaseViewController {
})
.disposed(by: disposeBag)

// 문의하기 버튼
if let centerInfo = viewModel.centerInfoForCS?.asObservable() {
csButton.rx.tap
.withLatestFrom(centerInfo.asObservable())
.subscribe (onNext: { [weak self] info in
let vc = SelectCSTypeVC()
vc.phoneCSButton.bind(
nameText: info.name,
phoneNumberText: info.phoneNumber
)
vc.modalPresentationStyle = .overFullScreen
self?.present(vc, animated: false)
})
.disposed(by: disposeBag)
}

// 지원성공시 비활성화
viewModel
.alertDriver?
.drive(onNext: { [weak self] alertVO in
self?.showAlert(vo: alertVO)
.applySuccess?
.drive(onNext: { [weak self] in
guard let self else { return }
self.applyButton.setEnabled(false)
})
.disposed(by: disposeBag)

Expand Down Expand Up @@ -246,6 +260,7 @@ public class NativePostDetailForWorkerVC: BaseViewController {
.rx.tap
.bind(to: viewModel.backButtonClicked)
.disposed(by: disposeBag)

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ import RxSwift
import Entity
import DSKit

public class SelectCSTypeVC: IdleBottomSheetVC {
class SelectCSTypeVC: IdleBottomSheetVC {

// Init

// View
let phoneCSButton: PhoneCSButton = .init()

public override init() {
override init() {
super.init()
setObservable()
}

public required init?(coder: NSCoder) { fatalError() }
required init?(coder: NSCoder) { fatalError() }

public override func viewDidLoad() {
override func viewDidLoad() {
super.viewDidLoad()

setLayout()
Expand All @@ -51,7 +51,6 @@ public class SelectCSTypeVC: IdleBottomSheetVC {
private func setObservable() {

}

}

@available(iOS 17.0, *)
Expand Down
Loading