IOS_Boss/IOS_study/Profile/ProfileView+JobUI.swift
2025-07-27 12:33:06 +08:00

57 lines
2.0 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// ProfileView+JobUI.swift
// IOS_study
//
// Created by CC-star on 2025/7/23.
//
import SwiftUI
extension ProfileView {
var myJobsView: some View {
VStack(alignment: .leading, spacing: kStackSpacing) {
let jobsCount = ProfileVM.pLJobsCount
let jobsCountText = jobsCount > 0 ? "\(ProfileVM.aPLJobsCount)/\(ProfileVM.pLJobsCount)" : ""
Text("我发布的工作\(jobsCountText)").headline().tc()
if !ProfileVM.plJobs.isEmpty {
ForEach(ProfileVM.plJobs) { job in
Button {
plJobVM.job = job
naviPath.append(Navi5.PLJobsToPLJob)
} label: {
HStack {
VStack(alignment: .leading, spacing: kStackSpacingS) {
HStack {
Text("兼职").labelPL()
Text(job.title).oneLineStyleMiddle()
}
HStack {
Text(job.needExp).labelBG()
Text(job.province + "-" + job.city).labelBG()
if !job.isActive {
Text("已下线").labelTA()
}
}
}.push(to: .leading)
Text("\(job.hourlyWage)").bold().accent()
}
}.buttonStyle(.borderless)
exDivider()
}
if !ProfileVM.isPLFinshed {
Button {
Task {
await ProfileVM.getPLJobs()
}
} label: {
if ProfileVM.isFcPLJobs { ProgressView().loadingJobStyleP() } else { Text("加载更多兼职职位").loadingJobStyle() }
}.buttonStyle(.borderless).padding(.top, -6).push(to: .center)
}
} else {
Text("暂无发布的工作").secondary()
}
}.push(to: .leading).textStyle().cellStyle()
}
}