// // 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() } }