Files
ks-app-employment-service/pages/service/components/CareerRecommend.vue

219 lines
5.6 KiB
Vue
Raw Normal View History

2026-01-21 16:12:19 +08:00
<!--suppress JSFileReferences, NpmUsedModulesInstalled, VueMissingComponentImportInspection, HtmlUnknownTag -->
<script setup>
2026-01-21 16:12:19 +08:00
import { ref } from 'vue';
import { useCareerRecommendationStore } from '@/stores/useCareerRecommendationStore';
import uniList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue';
import uniListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue';
2025-11-12 12:20:58 +08:00
2026-01-21 14:26:34 +08:00
const store = useCareerRecommendationStore();
const popupRef = ref();
2026-01-21 14:26:34 +08:00
const eventSelectCurrentJob = () => {
popupRef.value?.open('bottom');
};
const eventCloseCurrentJob = () => {
popupRef.value?.close('bottom');
};
2026-01-21 16:12:19 +08:00
const eventProfession = (item) => {
store.eventProfession(item);
store.eventSearch();
popupRef.value?.close('bottom');
};
</script>
2026-01-21 09:47:09 +08:00
<template>
2026-01-21 14:26:34 +08:00
<div class="career-recommend">
<div class="info-card">
<div class="card-title">当前职位信息</div>
2026-01-21 16:12:19 +08:00
<div class="card-content" @click="eventSelectCurrentJob">
<span class="label">当前职位</span> <span class="value">{{ store.professionLabel }}</span>
2026-01-21 09:47:09 +08:00
</div>
2026-01-21 14:26:34 +08:00
</div>
<div class="info-card">
<div class="card-title">我的技能标签</div>
<div class="skill-tags">
2026-01-21 16:12:19 +08:00
<div v-for="(skill, index) in store.skillTags" :key="index" class="skill-tag">
2026-01-21 14:26:34 +08:00
{{ skill }}
2026-01-21 09:47:09 +08:00
</div>
2026-01-21 16:12:19 +08:00
<span v-if="!store.skillTags.length" class="empty-text">暂无技能数据</span>
2026-01-21 09:47:09 +08:00
</div>
2026-01-21 14:26:34 +08:00
</div>
<div class="section-title">
相似推荐职位
</div>
2026-01-21 16:12:19 +08:00
<div v-if="!store.result && store.result.length === 0" class="empty-text">暂无推荐职位</div>
<div v-for="(job, index) in store.result" :key="index" class="job-item-card">
2026-01-21 14:26:34 +08:00
<div class="job-header">
<span class="job-title">{{ job.title }}</span>
2026-01-21 09:47:09 +08:00
</div>
2026-01-21 16:12:19 +08:00
<div class="job-header">
<span>职业相似度{{ job.percentage }}%</span>
</div>
2026-01-21 14:26:34 +08:00
<div class="job-skills">
2026-01-21 16:12:19 +08:00
<div v-for="tag in job.tags" :key="tag" class="job-skill-tag">
{{ tag }}
2026-01-21 09:47:09 +08:00
</div>
</div>
</div>
2026-01-21 16:12:19 +08:00
<uni-popup ref="popupRef" :border-radius="'20rpx 20rpx 0 0'" :is-mask-click="true" background-color="#FFFFFF" mask-background-color="rgba(255, 255, 255, 0.6)" type="bottom" @mask-click="eventCloseCurrentJob">
<div class="professions">
<scroll-view scroll-y style="height: 100%;">
<div class="professions-list">
<uni-list>
<template v-for="item in store.professionsRef" :key="item.label">
<uni-list-item :title="item.label" clickable showArrow @click="eventProfession(item)" />
</template>
</uni-list>
</div>
</scroll-view>
</div>
</uni-popup>
2026-01-21 14:26:34 +08:00
</div>
2026-01-21 09:47:09 +08:00
</template>
<style lang="scss" scoped>
.career-recommend {
padding: 10rpx 28rpx 20rpx;
}
.info-card {
background-color: #FFFFFF;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
}
.card-title {
font-size: 32rpx;
font-weight: 600;
color: #000000;
margin-bottom: 24rpx;
}
.card-content {
display: flex;
justify-content: space-between;
align-items: center;
2026-01-21 09:47:09 +08:00
.label {
font-size: 24rpx;
line-height: 34rpx;
color: rgba(154, 154, 154, 1);
text-align: left;
font-family: 'PingFangSC-Bold', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
font-weight: 600;
}
2026-01-21 09:47:09 +08:00
.value {
font-size: 32rpx;
line-height: 46rpx;
color: rgb(16, 16, 16);
font-weight: 600;
text-align: left;
font-family: 'PingFangSC-Bold', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
}
}
.skill-tags {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
}
.skill-tag {
background-color: #EAEFFE;
color: rgba(44, 101, 247, 1);
padding: 8rpx 20rpx;
border-radius: 0;
font-size: 24rpx;
white-space: nowrap;
}
.section-title {
font-size: 32rpx;
font-weight: 600;
color: #000000;
margin-bottom: 20rpx;
margin-top: 8rpx;
}
.job-item-card {
background-color: #FFFFFF;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
border-left: 6rpx solid #409EFF;
position: relative;
}
.job-header {
margin-bottom: 16rpx;
}
.job-title {
font-size: 32rpx;
font-weight: 600;
color: rgb(16, 16, 16);
text-align: left;
font-family: 'PingFangSC-Bold', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
line-height: 46rpx;
width: 100%;
}
.job-skills {
display: flex;
flex-wrap: wrap;
gap: 12rpx;
}
.job-skill-tag {
width: 130rpx;
height: 36rpx;
line-height: 34rpx;
background-color: rgba(49, 100, 239, 0.1);
color: rgba(44, 101, 247, 1);
font-size: 24rpx;
text-align: center;
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
border-radius: 8rpx;
white-space: nowrap;
border: none;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
2025-11-12 12:20:58 +08:00
.recommend-count {
margin-left: 12rpx;
font-size: 22rpx;
color: #666666;
font-weight: 400;
}
.empty-text {
font-size: 24rpx;
color: #999999;
line-height: 34rpx;
}
button::after {
border: none;
}
2026-01-21 16:12:19 +08:00
.professions {
width: 100vw;
height: 80vh;
.professions-list {
padding-left: 20px;
}
}
</style>