Files
qingdao-employment-service/packageA/pages/post/post.vue

663 lines
22 KiB
Vue
Raw Normal View History

2024-11-18 16:33:37 +08:00
<template>
2025-05-13 11:10:38 +08:00
<AppLayout title="" backGorundColor="#F4F4F4">
<template #headerleft>
2025-07-14 15:38:39 +08:00
<view class="btnback">
2025-05-13 11:10:38 +08:00
<image src="@/static/icon/back.png" @click="navBack"></image>
2025-03-28 15:19:42 +08:00
</view>
2025-05-13 11:10:38 +08:00
</template>
<template #headerright>
<view class="btn mar_ri10">
<image src="@/static/icon/collect3.png" v-if="!jobInfo.isCollection" @click="jobCollection"></image>
<image src="@/static/icon/collect2.png" v-else @click="jobCollection"></image>
2025-03-28 15:19:42 +08:00
</view>
2025-05-13 11:10:38 +08:00
</template>
<!-- 根据 dataType 显示不同内容 -->
2025-06-10 09:36:04 +08:00
<view class="content" v-show="!isEmptyObject(jobInfo)">
<!-- 顶部信息区域 -->
2025-05-13 11:10:38 +08:00
<view class="content-top btn-feel">
<view class="top-salary" v-if="jobInfo.maxSalary">
2025-06-26 08:56:42 +08:00
<Salary-Expectation
:max-salary="jobInfo.maxSalary"
:min-salary="jobInfo.minSalary"
:is-month="true"
></Salary-Expectation>
</view>
<view class="top-salary" v-else>
<Salary-Expectation
:max-salary="jobInfo.maxSalary"
:min-salary="jobInfo.minSalary"
:is-month="true"
></Salary-Expectation>
</view>
<view class="top-name">{{ dataType === 2 ? jobInfo.gwmc : jobInfo.jobTitle }}</view>
2025-05-13 11:10:38 +08:00
<view class="top-info">
<view class="info-img"><image src="/static/icon/post12.png"></image></view>
<!-- 第三方数据展示 -->
<view class="info-text" v-if="dataType === 2">
2025-11-22 18:53:52 +08:00
{{jobInfo.xlyq == '不限' ? '学历不限' : jobInfo.xlyq}}
2025-05-13 11:10:38 +08:00
</view>
<!-- 原数据展示 -->
<view class="info-text" v-else>
<dict-Label dictType="experience" :value="jobInfo.experience"></dict-Label>
</view>
2025-05-13 11:10:38 +08:00
<view class="info-img mar_le20"><image src="/static/icon/post13.png"></image></view>
<!-- 第三方数据展示 -->
<view class="info-text" v-if="dataType === 2">
2025-11-22 18:53:52 +08:00
{{jobInfo.gwgzjy == '不限' ? '经验不限' : jobInfo.gwgzjy}}
2025-05-13 11:10:38 +08:00
</view>
<!-- 原数据展示 -->
<view class="info-text" v-else>
<dict-Label dictType="education" :value="jobInfo.education"></dict-Label>
</view>
2025-05-13 11:10:38 +08:00
</view>
<view class="position-source">
<text>来源&nbsp;</text>
{{ dataType === 2 ? '青岛人才网' : jobInfo.dataSource }}
2025-05-13 11:10:38 +08:00
</view>
2025-03-28 15:19:42 +08:00
</view>
<!-- AI讲解区域 -->
2025-05-13 11:10:38 +08:00
<view class="ai-explain" v-if="jobInfo.isExplain">
<view class="exbg">
<view class="explain-left btn-shaky">
<view class="leftText">AI+智能讲解职位一听就懂</view>
<view class="leftdownText">懒得看文字我用AI讲给你听</view>
</view>
<view class="explain-right button-click" @click="seeExplain">点击查看</view>
</view>
2025-03-28 15:19:42 +08:00
</view>
<!-- 职位描述区域 -->
2025-05-13 11:10:38 +08:00
<view class="content-card">
<view class="card-title">
<text class="title">职位描述</text>
</view>
<view class="description" :style="{ whiteSpace: 'pre-wrap' }">
{{ dataType === 2 ? jobInfo.gwms : jobInfo.description }}
2025-05-13 11:10:38 +08:00
</view>
2025-03-28 15:19:42 +08:00
</view>
<!-- 公司信息区域 -->
2025-05-13 11:10:38 +08:00
<view class="content-card">
<view class="card-title">
<text class="title">公司信息</text>
<text
class="btntext button-click"
@click="handleCompanyDetail"
2025-05-13 11:10:38 +08:00
>
单位详情
</text>
</view>
<view class="company-info">
<view class="companyinfo-left">
<image src="@/static/icon/companyIcon.png" mode=""></image>
</view>
<view class="companyinfo-right">
<view class="row1">{{ dataType === 2 ? jobInfo.gsmc : jobInfo.company?.name }}</view>
2025-05-13 11:10:38 +08:00
<view class="row2">
<dict-tree-Label
v-if="dataType !== 2 && jobInfo.company?.industry"
2025-05-13 11:10:38 +08:00
dictType="industry"
:value="jobInfo.company?.industry"
></dict-tree-Label>
<span v-if="dataType !== 2 && jobInfo.company?.industry">&nbsp;</span>
<dict-Label
v-if="dataType !== 2"
dictType="scale"
:value="jobInfo.company?.scale"
></dict-Label>
<span v-if="dataType === 2">{{jobInfo.qyxz}}</span>
2025-05-13 11:10:38 +08:00
</view>
<view class="row2">
<text>在招</text>
<text style="color: #256bfa">{{ companyCount }}</text>
<text>个职位</text>
</view>
</view>
</view>
<view class="company-map" v-if="jobInfo.latitude && jobInfo.longitude">
<map
style="width: 100%; height: 100%"
:latitude="jobInfo.latitude"
:longitude="jobInfo.longitude"
:markers="mapCovers"
></map>
</view>
2025-03-28 15:19:42 +08:00
</view>
<!-- 竞争力分析区域 -->
<view class="content-card" v-if="dataType !== 2">
2025-05-13 11:10:38 +08:00
<view class="card-title">
<text class="title">竞争力分析</text>
</view>
<view class="description">
2025-11-20 18:14:36 +08:00
三个月内共{{ raderData.totalApplicants }}位求职者申请你的简历匹配度为{{
raderData.matchScore
}}排名位于第{{ raderData.rank }}超过{{ raderData.percentile }}%的竞争者处在优秀位置
2025-05-13 11:10:38 +08:00
</view>
<RadarMap :value="raderData"></RadarMap>
2024-11-18 16:33:37 +08:00
2025-05-13 11:10:38 +08:00
<view class="card-footer">
<view class="footer-title">你与职位的匹配度</view>
<view class="footer-content">
<view class="progress-container">
<view
v-for="(item, index) in matchingDegree"
:key="index"
class="progress-item"
2025-07-09 15:15:37 +08:00
:class="getClass(index)"
2025-05-13 11:10:38 +08:00
/>
</view>
</view>
<view class="progress-text">
<view class="text-rpx" v-for="(item, index) in matchingDegree" :key="index">{{ item }}</view>
</view>
</view>
2025-03-28 15:19:42 +08:00
</view>
2025-05-13 11:10:38 +08:00
<view style="height: 24px"></view>
2025-03-28 15:19:42 +08:00
</view>
2025-05-13 11:10:38 +08:00
<template #footer>
<view class="footer">
2025-11-25 16:20:34 +08:00
<view v-if="dataType==2" class="btn-wq button-click" :class="{'btn-des' : jobInfo.isApply}" @click="jobApply">
<span v-if="jobInfo.isApply"> 已投递 </span>
<span v-if="!jobInfo.isApply"> 立即投递</span>
</view>
<view v-else class="btn-wq button-click" @click="jobApply">
<span v-if="jobInfo.isApply"> 立即前往</span>
<span v-if="!jobInfo.isApply">立即投递 </span>
</view>
2025-05-13 11:10:38 +08:00
</view>
</template>
<VideoPlayer ref="videoPalyerRef" />
</AppLayout>
2024-11-18 16:33:37 +08:00
</template>
<script setup>
2025-03-28 15:19:42 +08:00
import point from '@/static/icon/point.png';
2025-05-13 11:10:38 +08:00
import VideoPlayer from './component/videoPlayer.vue';
2025-03-28 15:19:42 +08:00
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
2025-07-14 15:38:39 +08:00
import { onLoad, onShow, onHide } from '@dcloudio/uni-app';
2025-03-28 15:19:42 +08:00
import dictLabel from '@/components/dict-Label/dict-Label.vue';
2025-05-13 11:10:38 +08:00
import RadarMap from './component/radarMap.vue';
2025-07-14 15:38:39 +08:00
const { $api, navTo, getLenPx, parseQueryParams, navBack, isEmptyObject } = inject('globalFunction');
import config from '@/config.js';
2025-05-13 11:10:38 +08:00
const matchingDegree = ref(['一般', '良好', '优秀', '极好']);
const currentStep = ref(1);
const companyCount = ref(0);
2025-03-28 15:19:42 +08:00
const jobInfo = ref({});
const state = reactive({});
const mapCovers = ref([]);
const jobIdRef = ref();
2025-05-13 11:10:38 +08:00
const raderData = ref({});
const videoPalyerRef = ref(null);
const explainUrlRef = ref('');
const dataType = ref(1); // 1: 原数据, 2: 第三方数据
2025-03-28 15:19:42 +08:00
onLoad((option) => {
if (option.jobId) {
dataType.value = option.dataType ? parseInt(option.dataType) : 1;
2025-03-28 15:19:42 +08:00
initLoad(option);
}
});
onShow(() => {
const option = parseQueryParams(); // 兼容微信内置浏览器
if (option.jobId) {
dataType.value = option.dataType ? parseInt(option.dataType) : 1;
2025-03-28 15:19:42 +08:00
initLoad(option);
}
});
function initLoad(option) {
const jobId = atob(option.jobId);
if (jobId !== jobIdRef.value) {
jobIdRef.value = jobId;
2025-07-22 15:20:21 +08:00
getDetail(jobId);
2025-05-13 11:10:38 +08:00
}
}
function seeExplain() {
if (jobInfo.value.explainUrl) {
videoPalyerRef.value?.open(jobInfo.value.explainUrl);
2025-03-28 15:19:42 +08:00
}
}
function getDetail(jobId) {
if (dataType.value === 2) {
// 第三方数据接口
return new Promise((reslove, reject) => {
$api.createRequest(`/app/internal/jobThirdPart/${jobId}`).then((resData) => {
const { gsID, gsmc, zphID } = resData.data;
jobInfo.value = resData.data;
reslove(resData.data);
getCompanyIsAJobs(gsID, gsmc, zphID);
if (resData.data.latitude && resData.data.longitude) {
initMapCovers(resData.data.latitude, resData.data.longitude, resData.data.gsmc);
}
});
});
} else {
// 原数据接口
$api.createRequest(`/app/job/${jobId}`).then((resData) => {
const { latitude, longitude, companyName, companyId } = resData.data;
2025-07-14 15:38:39 +08:00
jobInfo.value = resData.data;
getCompanyIsAJobs(companyId);
getCompetivetuveness(jobId);
2025-07-14 15:38:39 +08:00
if (latitude && longitude) {
initMapCovers(latitude, longitude, companyName);
2025-07-14 15:38:39 +08:00
}
});
}
2025-03-28 15:19:42 +08:00
}
function initMapCovers(latitude, longitude, companyName) {
mapCovers.value = [
{
latitude: latitude,
longitude: longitude,
iconPath: point,
label: {
content: companyName,
textAlign: 'center',
padding: 3,
fontSize: 12,
bgColor: '#FFFFFF',
anchorX: getTextWidth(companyName),
borderRadius: 5,
},
width: 34,
},
];
}
function getCompanyIsAJobs(...args) {
if (dataType.value === 2) {
// 第三方数据获取公司职位数量
const [gsID, gsmc, zphID] = args;
$api.createRequest(`/app/internal/jobThirdPart?gsID=${gsID}&gsmc=${gsmc}&zphID=${zphID}`).then((resData) => {
companyCount.value = resData.total;
});
} else {
// 原数据获取公司职位数量
const [companyId] = args;
$api.createRequest(`/app/company/count/${companyId}`).then((resData) => {
companyCount.value = resData.data;
});
}
2025-05-13 11:10:38 +08:00
}
2025-03-28 15:19:42 +08:00
function getTextWidth(text, size = 12) {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
context.font = `${12}px Arial`;
return -(context.measureText(text).width / 2) - 20;
2025-03-28 15:19:42 +08:00
}
2025-05-13 11:10:38 +08:00
function getCompetivetuveness(jobId) {
if (dataType.value !== 2) {
$api.createRequest(`/app/job/competitiveness/${jobId}`, {}, 'GET').then((resData) => {
raderData.value = resData.data;
currentStep.value = resData.data.matchScore * 0.04;
});
}
2025-05-13 11:10:38 +08:00
}
2025-03-28 15:19:42 +08:00
// 申请岗位
function jobApply() {
if (dataType.value === 2) {
// 第三方数据申请逻辑
2025-11-25 16:20:34 +08:00
const params = {
jobid:jobInfo.value.id,
jobname:jobInfo.value.gwmc
}
if (jobInfo.value.isApply) {
2025-11-25 16:20:34 +08:00
$api.msg('已经投递过该岗位了~');
return ;
} else {
2025-11-25 16:20:34 +08:00
$api.createRequest(`/app/internal/sendResume`, params, 'POST').then((resData) => {
$api.msg('投递成功');
2025-11-25 16:20:34 +08:00
getDetail(jobIdRef.value);
});
}
2025-03-28 15:19:42 +08:00
} else {
// 原数据申请逻辑
const jobId = jobInfo.value.jobId;
if (jobInfo.value.isApply) {
2025-03-28 15:19:42 +08:00
const jobUrl = jobInfo.value.jobUrl;
return window.open(jobUrl);
} else {
$api.createRequest(`/app/job/apply/${jobId}`, {}, 'GET').then((resData) => {
getDetail(jobId);
$api.msg('申请成功');
const jobUrl = jobInfo.value.jobUrl;
return window.open(jobUrl);
});
}
2025-03-28 15:19:42 +08:00
}
}
// 取消/收藏岗位
function jobCollection() {
if (dataType.value === 2) {
// 第三方数据收藏逻辑
const id = jobInfo.value.id;
if (jobInfo.value.isCollection) {
$api.createRequest(`/app/job/collection/${id}/2`, {}, 'DELETE').then((resData) => {
getDetail(jobIdRef.value);
$api.msg('取消收藏成功');
});
} else {
$api.createRequest(`/app/job/collection/${id}/2`, {}, 'POST').then((resData) => {
getDetail(jobIdRef.value);
$api.msg('收藏成功');
});
}
2025-03-28 15:19:42 +08:00
} else {
// 原数据收藏逻辑
const jobId = jobInfo.value.jobId;
if (jobInfo.value.isCollection) {
2025-11-24 09:38:56 +08:00
$api.createRequest(`/app/job/collection/${jobId}/1`, {}, 'DELETE').then((resData) => {
getDetail(jobId);
$api.msg('取消收藏成功');
});
} else {
2025-11-24 09:38:56 +08:00
$api.createRequest(`/app/job/collection/${jobId}/1`, {}, 'POST').then((resData) => {
getDetail(jobId);
$api.msg('收藏成功');
});
}
}
}
// 处理公司详情跳转
function handleCompanyDetail() {
if (dataType.value === 2) {
navTo(`/packageA/pages/UnitDetails/UnitDetails?companyId=${jobInfo.value.gsID}&companyName=${jobInfo.value.gsmc}&zphId=${jobInfo.value.zphID}&dataType=2`);
} else {
navTo(`/packageA/pages/UnitDetails/UnitDetails?companyId=${jobInfo.value.company.companyId}`);
2025-03-28 15:19:42 +08:00
}
}
2025-07-09 15:15:37 +08:00
function getClass(index) {
const current = currentStep.value;
const floorIndex = Math.floor(current);
if (index < floorIndex) {
return 'active';
} else if (index === floorIndex) {
const decimal = current % 1;
const percent = Math.round(decimal * 100);
return `half${percent}`;
} else {
return '';
}
}
2024-11-18 16:33:37 +08:00
</script>
<style lang="stylus" scoped>
/* 样式保持不变与现在的post页面相同 */
2025-07-14 15:38:39 +08:00
.btnback{
width: 64rpx;
height: 64rpx;
}
2025-05-13 11:10:38 +08:00
.btn {
display: flex;
justify-content: space-between;
align-items: center;
2025-07-14 15:38:39 +08:00
width: 52rpx;
height: 52rpx;
}
.btnshare {
width: 48rpx;
height: 48rpx;
margin-right: 46rpx;
2025-05-13 11:10:38 +08:00
}
image {
height: 100%;
width: 100%;
}
.progress-container {
display: flex;
align-items: center;
gap: 8rpx;
2025-05-13 11:10:38 +08:00
margin-top: 24rpx
2025-03-28 15:19:42 +08:00
}
2025-05-13 11:10:38 +08:00
.progress-text{
margin-top: 8rpx
display: flex;
align-items: center;
gap: 8rpx;
2025-05-13 11:10:38 +08:00
justify-content: space-around
width: 100%
font-weight: 400;
font-size: 20rpx;
color: #999999;
text-align: center;
2025-03-28 15:19:42 +08:00
}
2024-11-18 16:33:37 +08:00
2025-05-13 11:10:38 +08:00
.progress-item {
width: 25%;
height: 24rpx;
background-color: #eee;
border-radius: 24rpx;
overflow: hidden;
position: relative;
transition: background-color 0.3s;
}
2024-11-18 16:33:37 +08:00
2025-05-13 11:10:38 +08:00
.progress-item.active {
background: linear-gradient(to right, #256bfa, #8c68ff);
}
2025-07-09 15:15:37 +08:00
for i in 0..100
.progress-item.half{i}::before
content ''
position absolute
left 0
top 0
bottom 0
width 100%
background linear-gradient(to right, #256bfa (i)%, #eaeaea (i)%)
border-radius 24rpx
2025-05-13 11:10:38 +08:00
.card-footer{
.footer-title{
font-weight: 600;
font-size: 28rpx;
color: #000000;
}
}
// ai
.ai-explain{
margin-top: 28rpx
background-color: #FFFFFF
border-radius: 20rpx 20rpx 20rpx 20rpx;
2025-03-28 15:19:42 +08:00
overflow: hidden
2025-05-13 11:10:38 +08:00
.exbg{
padding: 28rpx 40rpx;
display: flex
align-items: center
justify-content: space-between
background: url('@/static/icon/aibg.png') center center no-repeat;
background-size: 100% 100%
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.explain-left{
.leftText{
font-weight: 600;
font-size: 32rpx;
}
.leftdownText{
margin-top: 12rpx
font-weight: 400;
font-size: 28rpx;
color: #495265;
}
}
.explain-right{
width: 168rpx;
height: 72rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
border: 2rpx solid #E7E9ED;
text-align: center;
line-height: 72rpx
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
}
.content{
padding: 0 28rpx
height: 100%
.content-top{
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);
border-radius: 20rpx 20rpx 20rpx 20rpx;
padding: 52rpx 32rpx 34rpx 32rpx
position: relative
overflow: hidden
.top-salary{
font-weight: 500;
font-size: 32rpx;
color: #4C6EFB;
}
.top-name{
font-weight: 600;
font-size: 36rpx;
color: #000000;
margin-top: 8rpx
}
.top-info{
margin-top: 22rpx
display: flex;
align-items: center
.info-img{
width: 40rpx;
height: 40rpx
}
.info-text{
font-weight: 400;
font-size: 28rpx;
color: #6C7282;
margin-left: 10rpx
}
}
.position-source{
position: absolute
top: 0
right: 0
width: fit-content;
height: 76rpx;
padding: 0 24rpx
background: rgba(37,107,250,0.1);
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);
text-align: center
line-height: 76rpx
font-weight: 400;
font-size: 28rpx;
color: #64779F;
border-bottom-left-radius: 20rpx
}
}
.content-card{
padding: 24rpx
margin-top: 28rpx
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);
border-radius: 20rpx 20rpx 20rpx 20rpx;
.card-title{
font-weight: 600;
font-size: 32rpx;
color: #000000;
position: relative;
display: flex
justify-content: space-between
.title{
position: relative;
z-index: 2;
}
.btntext{
white-space: nowrap
font-weight: 400;
font-size: 28rpx;
color: #256BFA;
}
}
.card-title::before{
position: absolute
content: '';
left: -14rpx
bottom: 0
height: 16rpx;
width: 108rpx;
background: linear-gradient(to right, #CBDEFF, #FFFFFF);
border-radius: 8rpx;
z-index: 1;
}
.description{
margin-top: 30rpx
font-weight: 400;
font-size: 28rpx;
color: #495265;
}
.company-info{
padding-top: 30rpx
display: flex
flex-direction: row
flex-wrap: nowrap
.companyinfo-left{
width: 96rpx;
height: 96rpx;
margin-right: 24rpx
}
.companyinfo-right{
.row1{
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
.row2{
font-weight: 400;
font-size: 28rpx;
color: #6C7282;
line-height: 45rpx;
}
}
}
.company-map{
margin-top: 28rpx
height: 416rpx;
border-radius: 20rpx 20rpx 20rpx 20rpx;
overflow: hidden
}
}
}
.footer{
background: #FFFFFF;
box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11,44,112,0.12);
border-radius: 0rpx 0rpx 0rpx 0rpx;
padding: 40rpx 28rpx 20rpx 28rpx
.btn-wq{
height: 90rpx;
background: #256BFA;
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 90rpx
}
2025-11-25 16:20:34 +08:00
.btn-des{
background: #6697FB;
box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11,44,112,0.12);
}
2025-05-13 11:10:38 +08:00
}
</style>