对接招聘会接口

This commit is contained in:
xiebin
2025-11-22 18:53:52 +08:00
parent 4b8056b716
commit 99f02927ac
7 changed files with 688 additions and 91 deletions

View File

@@ -2,17 +2,18 @@
<view v-for="job in listData" :key="job.id"> <view v-for="job in listData" :key="job.id">
<view class="cards" @click="nextDetail(job)"> <view class="cards" @click="nextDetail(job)">
<view class="card-company"> <view class="card-company">
<text class="company line_1">{{ job.name }}</text> <text class="company line_1">{{ job.gsmc }}</text>
</view> </view>
<view class="card-bottom" > <view class="card-bottom" >
<view class="fl_box fs_14" > <view class="fl_box fs_14" >
<dict-tree-Label class="mar_ri10" dictType="industry" :value="job.industry"></dict-tree-Label> <!-- <dict-tree-Label class="mar_ri10" dictType="industry" :value="job.industry"></dict-tree-Label>
<dict-Label dictType="scale" :value="job.scale"></dict-Label> <dict-Label dictType="scale" :value="job.scale"></dict-Label> -->
<view>{{job.gsxy}}</view>
</view> </view>
<view class="ris" > <view class="ris" >
<text class="fs_14"> <text class="fs_14">
在招职位· 在招职位·
<text class="color_256BFA">{{ job.totalRecruitment || '-' }}</text> <text class="color_256BFA">{{ job.zzgwsl || '-' }}</text>
</text> </text>
</view> </view>
@@ -20,10 +21,14 @@
<view class="card-tags"> <view class="card-tags">
<view class="tag" v-if="job.nature"> <view class="tag" v-if="job.nature">
<dict-Label dictType="nature" :value="job.nature"></dict-Label> <dict-Label dictType="nature" :value="job.nature"></dict-Label>
<dict-Label dictType="nature" :value="job.nature"></dict-Label>
</view> </view>
<view class="tag"> <view class="tag">
{{ vacanciesTo(job.vacancies) }} {{ vacanciesTo(job.vacancies) }}
</view> </view>
<view class="tag" v-if="job.qyxz">
{{job.qyxz}}
</view>
</view> </view>
</view> </view>
</view> </view>
@@ -51,6 +56,10 @@ const props = defineProps({
type: String, type: String,
default: '', default: '',
}, },
zphId: {
type: String,
default: '',
},
}); });
const listData = computed(() => { const listData = computed(() => {
@@ -58,7 +67,7 @@ const listData = computed(() => {
}); });
function nextDetail(company) { function nextDetail(company) {
navTo(`/packageA/pages/UnitDetails/UnitDetails?companyId=${company.companyId}`); navTo(`/packageA/pages/UnitDetails/UnitDetails?companyId=${company.gsID}&companyName=${company.gsmc}&zphId=${props.zphId}`);
} }
</script> </script>
@@ -119,7 +128,7 @@ function nextDetail(company) {
} }
} }
.card-bottom{ .card-bottom{
margin-top: 4rpx margin-top: 15rpx
margin-bottom: 10rpx margin-bottom: 10rpx
display: flex display: flex
justify-content: space-between justify-content: space-between

View File

@@ -2,33 +2,33 @@
<view v-for="job in listData" :key="job.id"> <view v-for="job in listData" :key="job.id">
<view v-if="!job.isTitle" class="cards" @click="nextDetail(job)"> <view v-if="!job.isTitle" class="cards" @click="nextDetail(job)">
<view class="card-company"> <view class="card-company">
<text class="company">{{ job.jobTitle }}</text> <text class="company">{{ job.gwmc }}</text>
<view class="salary"> <view class="salary">
<Salary-Expectation :max-salary="job.maxSalary" :min-salary="job.minSalary"></Salary-Expectation> <Salary-Expectation :max-salary="job.maxSalary" :min-salary="job.minSalary"></Salary-Expectation>
</view> </view>
</view> </view>
<view class="card-companyName">{{ job.companyName }}</view> <view class="card-companyName">{{ job.gsmc }}</view>
<view class="card-tags"> <view class="card-tags">
<view class="tag"> <view class="tag">
<dict-Label dictType="education" :value="job.education"></dict-Label> {{job.xlyq == '不限' ? '学历不限' : job.xlyq}}
</view> </view>
<view class="tag"> <view class="tag">
<dict-Label dictType="experience" :value="job.experience"></dict-Label> {{job.gwgzjy == '不限' ? '经验不限' : job.gwgzjy}}
</view> </view>
<view class="tag"> <view class="tag">
{{ vacanciesTo(job.vacancies) }} {{ vacanciesTo(job.zprs) }}
</view> </view>
</view> </view>
<view class="card-bottom"> <view class="card-bottom">
<view>{{ job.postingDate }}</view> <view>{{ parseDateTime(job.createTime).date }}</view>
<view> <view>
<convert-distance <!-- <convert-distance
:alat="job.latitude" :alat="job.latitude"
:along="job.longitude" :along="job.longitude"
:blat="latitude" :blat="latitude"
:blong="longitude" :blong="longitude"
></convert-distance> ></convert-distance>
<dict-Label class="mar_le10" dictType="area" :value="job.jobLocationAreaCode"></dict-Label> <dict-Label class="mar_le10" dictType="area" :value="job.jobLocationAreaCode"></dict-Label> -->
</view> </view>
</view> </view>
</view> </view>
@@ -77,7 +77,25 @@ function nextDetail(job) {
const recordData = recommedIndexDb.JobParameter(job); const recordData = recommedIndexDb.JobParameter(job);
recommedIndexDb.addRecord(recordData); recommedIndexDb.addRecord(recordData);
} }
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`); navTo(`/packageA/pages/post/post?jobId=${btoa(job.id)}`);
}
function parseDateTime(datetimeStr) {
if (!datetimeStr) return { time: '', date: '' };
const dateObj = new Date(datetimeStr);
if (isNaN(dateObj.getTime())) return { time: '', date: '' }; // 无效时间
const year = dateObj.getFullYear();
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
const day = String(dateObj.getDate()).padStart(2, '0');
const hours = String(dateObj.getHours()).padStart(2, '0');
const minutes = String(dateObj.getMinutes()).padStart(2, '0');
return {
time: `${hours}:${minutes}`,
date: `${year}-${month}-${day}`,
};
} }
</script> </script>

View File

@@ -21,7 +21,7 @@
<image src="@/static/icon/companyIcon.png" mode=""></image> <image src="@/static/icon/companyIcon.png" mode=""></image>
</view> </view>
<view class="companyinfo-right"> <view class="companyinfo-right">
<view class="row1">{{ companyInfo?.name }}</view> <view class="row1">{{ companyInfo?.gsmc }}</view>
<view class="row2"> <view class="row2">
<dict-tree-Label <dict-tree-Label
v-if="companyInfo?.industry" v-if="companyInfo?.industry"
@@ -30,12 +30,13 @@
></dict-tree-Label> ></dict-tree-Label>
<span v-if="companyInfo?.industry">&nbsp;</span> <span v-if="companyInfo?.industry">&nbsp;</span>
<dict-Label dictType="scale" :value="companyInfo?.scale"></dict-Label> <dict-Label dictType="scale" :value="companyInfo?.scale"></dict-Label>
<span>{{companyInfo.gsxy}}</span>
</view> </view>
</view> </view>
</view> </view>
<view class="conetent-info" :class="{ expanded: isExpanded }"> <view class="conetent-info" :class="{ expanded: isExpanded }">
<view class="info-title">公司介绍</view> <view class="info-title">公司介绍</view>
<view class="info-desirption">{{ companyInfo.description }}</view> <view class="info-desirption">{{ companyInfo.qyxz }}</view>
<!-- <view class="info-title title2">公司地址</view> <!-- <view class="info-title title2">公司地址</view>
<view class="locationCompany"></view> --> <view class="locationCompany"></view> -->
</view> </view>
@@ -47,7 +48,8 @@
src="@/static/icon/downs.png" src="@/static/icon/downs.png"
></image> ></image>
</view> </view>
<scroll-view scroll-y class="Detailscroll-view" @scrolltolower="getJobsList('add')"> <!-- <scroll-view scroll-y class="Detailscroll-view" @scrolltolower="getJobsList('add')"> -->
<scroll-view scroll-y class="Detailscroll-view">
<view class="views"> <view class="views">
<view class="Detail-title"><text class="title">在招职位</text></view> <view class="Detail-title"><text class="title">在招职位</text></view>
<renderJobs <renderJobs
@@ -85,32 +87,32 @@ const companyInfo = ref({});
onLoad((options) => { onLoad((options) => {
console.log(options); console.log(options);
getCompanyInfo(options.companyId || options.bussinessId); getCompanyInfo(options.companyId,options.companyName,options.zphId);
}); });
function companyCollection() { function companyCollection() {
const companyId = companyInfo.value.companyId; const companyId = companyInfo.value.gsID;
if (companyInfo.value.isCollection) { if (companyInfo.value.isCollection) {
$api.createRequest(`/app/company/collection/${companyId}`, {}, 'DELETE').then((resData) => { $api.createRequest(`/app/company/collection/${companyId}`, {}, 'DELETE').then((resData) => {
getCompanyInfo(companyId); // getCompanyInfo(companyId);
$api.msg('取消收藏成功'); $api.msg('取消收藏成功');
}); });
} else { } else {
$api.createRequest(`/app/company/collection/${companyId}`, {}, 'POST').then((resData) => { $api.createRequest(`/app/company/collection/${companyId}`, {}, 'POST').then((resData) => {
getCompanyInfo(companyId); // getCompanyInfo(companyId);
$api.msg('收藏成功'); $api.msg('收藏成功');
}); });
} }
} }
function getCompanyInfo(id) { function getCompanyInfo(companyId,companyName,zphId) {
$api.createRequest(`/app/company/${id}`).then((resData) => { $api.createRequest(`/app/internal/companyThirdPart/${companyId}`).then((resData) => {
companyInfo.value = resData.data; companyInfo.value = resData.data;
getJobsList(); getJobsList(companyId,companyName,zphId);
}); });
} }
function getJobsList(type = 'add') { function getJobsList(companyId,companyName,zphId,type='add') {
if (type === 'refresh') { if (type === 'refresh') {
pageState.page = 1; pageState.page = 1;
pageState.maxPage = 1; pageState.maxPage = 1;
@@ -122,13 +124,14 @@ function getJobsList(type = 'add') {
current: pageState.page, current: pageState.page,
pageSize: pageState.pageSize, pageSize: pageState.pageSize,
}; };
$api.createRequest(`/app/company/job/${companyInfo.value.companyId}`, params).then((resData) => { $api.createRequest(`/app/internal/jobThirdPart?gsID=${companyId}&gsmc=${companyName}&zphID=${zphId}`, ).then((resData) => {
const { rows, total } = resData; const { rows, total } = resData;
if (type === 'add') { if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1); // const str = pageState.pageSize * (pageState.page - 1);
const end = pageState.list.length; // const end = pageState.list.length;
const reslist = rows; // const reslist = rows;
pageState.list.splice(str, end, ...reslist); // pageState.list.splice(str, end, ...reslist);
pageState.list = rows
} else { } else {
pageState.list = rows; pageState.list = rows;
} }

View File

@@ -11,15 +11,15 @@
<image src="@/static/icon/companyIcon.png" mode=""></image> <image src="@/static/icon/companyIcon.png" mode=""></image>
</view> </view>
<view class="companyinfo-right"> <view class="companyinfo-right">
<view class="row1 line_2">{{ fairInfo?.name }}</view> <view class="row1 line_2">{{ fairInfo?.zphmc }}</view>
<view class="row2"> <view class="row2">
<text>{{ fairInfo.location }}</text> <text>{{ fairInfo.jbf }}</text>
<convert-distance <!-- <convert-distance
:alat="fairInfo.latitude" :alat="fairInfo.latitude"
:along="fairInfo.longitude" :along="fairInfo.longitude"
:blat="latitudeVal" :blat="latitudeVal"
:blong="longitudeVal" :blong="longitudeVal"
></convert-distance> ></convert-distance> -->
</view> </view>
</view> </view>
</view> </view>
@@ -27,36 +27,36 @@
<image class="location-img" src="/static/icon/mapLine.png"></image> <image class="location-img" src="/static/icon/mapLine.png"></image>
<view class="location-info"> <view class="location-info">
<view class="info"> <view class="info">
<text class="info-title">{{ fairInfo.address }}</text> <text class="info-title">{{ fairInfo.zphdz }}</text>
<text class="info-text">位置</text> <!-- <text class="info-text">位置</text> -->
</view> </view>
</view> </view>
</view> </view>
<view class="conetent-info" :class="{ expanded: isExpanded }"> <view class="conetent-info" :class="{ expanded: isExpanded }">
<view class="info-title">内容描述</view> <view class="info-title">内容描述</view>
<view class="info-desirption">{{ fairInfo.description }}</view> <view class="info-desirption">{{ fairInfo.zphjj }}</view>
<!-- <view class="info-title title2">公司地址</view> <!-- <view class="info-title title2">公司地址</view>
<view class="locationCompany"></view> --> <view class="locationCompany"></view> -->
<view class="company-times"> <view class="company-times">
<view class="info-title">内容描述</view> <view class="info-title">内容描述</view>
<view class="card-times"> <view class="card-times">
<view class="time-left"> <view class="time-left">
<view class="left-date">{{ parseDateTime(fairInfo.startTime).time }}</view> <view class="left-date">{{ parseDateTime(fairInfo.zphjbsj).time }}</view>
<view class="left-dateDay">{{ parseDateTime(fairInfo.startTime).date }}</view> <view class="left-dateDay">{{ parseDateTime(fairInfo.zphjbsj).date }}</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="time-center"> <view class="time-center">
<view class="center-date"> <view class="center-date">
{{ getTimeStatus(fairInfo.startTime, fairInfo.endTime).statusText }} {{ getTimeStatus(fairInfo.zphjbsj, fairInfo.zphjzsj).statusText }}
</view> </view>
<view class="center-dateDay"> <view class="center-dateDay">
{{ getHoursBetween(fairInfo.startTime, fairInfo.endTime) }}小时 {{ getHoursBetween(fairInfo.zphjbsj, fairInfo.zphjzsj) }}小时
</view> </view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="time-right"> <view class="time-right">
<view class="left-date">{{ parseDateTime(fairInfo.endTime).time }}</view> <view class="left-date">{{ parseDateTime(fairInfo.zphjzsj).time }}</view>
<view class="left-dateDay">{{ parseDateTime(fairInfo.endTime).date }}</view> <view class="left-dateDay">{{ parseDateTime(fairInfo.zphjzsj).date }}</view>
</view> </view>
</view> </view>
</view> </view>
@@ -76,6 +76,7 @@
</view> </view>
<renderCompanys <renderCompanys
v-if="companyList.length" v-if="companyList.length"
:zphId="zphId"
:list="companyList" :list="companyList"
:longitude="longitudeVal" :longitude="longitudeVal"
:latitude="latitudeVal" :latitude="latitudeVal"
@@ -112,17 +113,24 @@ const isExpanded = ref(false);
const fairInfo = ref({}); const fairInfo = ref({});
const companyList = ref([]); const companyList = ref([]);
const hasnext = ref(true); const hasnext = ref(true);
const zphId = ref('');
onLoad((options) => { onLoad((options) => {
getCompanyInfo(options.jobFairId); zphId.value = options.jobFairId
getJobFairInfo(options.jobFairId, options.jobFairName);
getCompanyInfo(options.jobFairId, options.jobFairName);
}); });
function getCompanyInfo(id) { function getJobFairInfo(id,name) {
$api.createRequest(`/app/fair/${id}`).then((resData) => { $api.createRequest(`/app/internal/jobFairThirdPart/${id}`).then((resData) => {
fairInfo.value = resData.data; fairInfo.value = resData.data;
companyList.value = resData.data.companyList;
hasAppointment(); hasAppointment();
}); });
} }
function getCompanyInfo(id,name) {
$api.createRequest(`/app/internal/companyThirdPart/?zphID=${id}&zphmc=${name}`).then((resData) => {
companyList.value = resData.rows;
});
}
const hasAppointment = () => { const hasAppointment = () => {
const isTimePassed = (timeStr) => { const isTimePassed = (timeStr) => {

View File

@@ -23,20 +23,26 @@
:is-month="true" :is-month="true"
></Salary-Expectation> ></Salary-Expectation>
</view> </view>
<view class="top-name">{{ jobInfo.jobTitle }}</view> <view class="top-name">{{ jobInfo.gwmc }}</view>
<view class="top-info"> <view class="top-info">
<view class="info-img"><image src="/static/icon/post12.png"></image></view> <view class="info-img"><image src="/static/icon/post12.png"></image></view>
<view class="info-text"> <!-- <view class="info-text">
<dict-Label dictType="experience" :value="jobInfo.experience"></dict-Label> <dict-Label dictType="experience" :value="jobInfo.experience"></dict-Label>
</view> -->
<view class="info-text">
{{jobInfo.xlyq == '不限' ? '学历不限' : jobInfo.xlyq}}
</view> </view>
<view class="info-img mar_le20"><image src="/static/icon/post13.png"></image></view> <view class="info-img mar_le20"><image src="/static/icon/post13.png"></image></view>
<view class="info-text"> <!-- <view class="info-text">
<dict-Label dictType="education" :value="jobInfo.education"></dict-Label> <dict-Label dictType="education" :value="jobInfo.education"></dict-Label>
</view> -->
<view class="info-text">
{{jobInfo.gwgzjy == '不限' ? '经验不限' : jobInfo.gwgzjy}}
</view> </view>
</view> </view>
<view class="position-source"> <view class="position-source">
<text>来源&nbsp;</text> <text>来源&nbsp;</text>
{{ jobInfo.dataSource }} 青岛人才网
</view> </view>
</view> </view>
<view class="ai-explain" v-if="jobInfo.isExplain"> <view class="ai-explain" v-if="jobInfo.isExplain">
@@ -53,7 +59,7 @@
<text class="title">职位描述</text> <text class="title">职位描述</text>
</view> </view>
<view class="description" :style="{ whiteSpace: 'pre-wrap' }"> <view class="description" :style="{ whiteSpace: 'pre-wrap' }">
{{ jobInfo.description }} {{ jobInfo.gwms }}
</view> </view>
</view> </view>
<view class="content-card"> <view class="content-card">
@@ -61,7 +67,7 @@
<text class="title">公司信息</text> <text class="title">公司信息</text>
<text <text
class="btntext button-click" class="btntext button-click"
@click="navTo(`/packageA/pages/UnitDetails/UnitDetails?companyId=${jobInfo.company.companyId}`)" @click=" navTo(`/packageA/pages/UnitDetails/UnitDetails?companyId=${jobInfo.gsID}&companyName=${jobInfo.gsmc}&zphId=${jobInfo.zphID}`);"
> >
单位详情 单位详情
</text> </text>
@@ -71,7 +77,7 @@
<image src="@/static/icon/companyIcon.png" mode=""></image> <image src="@/static/icon/companyIcon.png" mode=""></image>
</view> </view>
<view class="companyinfo-right"> <view class="companyinfo-right">
<view class="row1">{{ jobInfo.company?.name }}</view> <view class="row1">{{ jobInfo.gsmc }}</view>
<view class="row2"> <view class="row2">
<dict-tree-Label <dict-tree-Label
v-if="jobInfo.company?.industry" v-if="jobInfo.company?.industry"
@@ -80,6 +86,7 @@
></dict-tree-Label> ></dict-tree-Label>
<span v-if="jobInfo.company?.industry">&nbsp;</span> <span v-if="jobInfo.company?.industry">&nbsp;</span>
<dict-Label dictType="scale" :value="jobInfo.company?.scale"></dict-Label> <dict-Label dictType="scale" :value="jobInfo.company?.scale"></dict-Label>
<span>{{jobInfo.qyxz}}</span>
</view> </view>
<view class="row2"> <view class="row2">
<text>在招</text> <text>在招</text>
@@ -187,12 +194,13 @@ function seeExplain() {
function getDetail(jobId) { function getDetail(jobId) {
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
$api.createRequest(`/app/job/${jobId}`).then((resData) => { $api.createRequest(`/app/internal/jobThirdPart/${jobId}`).then((resData) => {
const { latitude, longitude, companyName, companyId } = resData.data; const { gsID, gsmc, zphID} = resData.data;
jobInfo.value = resData.data; jobInfo.value = resData.data;
reslove(resData.data); reslove(resData.data);
getCompanyIsAJobs(companyId); getCompanyIsAJobs(gsID, gsmc, zphID);
getCompetivetuveness(jobId); // getCompetivetuveness(jobId);
return
if (latitude && longitude) { if (latitude && longitude) {
mapCovers.value = [ mapCovers.value = [
{ {
@@ -216,9 +224,9 @@ function getDetail(jobId) {
}); });
} }
function getCompanyIsAJobs(companyId) { function getCompanyIsAJobs(gsID, gsmc, zphID) {
$api.createRequest(`/app/company/count/${companyId}`).then((resData) => { $api.createRequest(`/app/internal/jobThirdPart?gsID=${gsID}&gsmc=${gsmc}&zphID=${zphID}`).then((resData) => {
companyCount.value = resData.data; companyCount.value = resData.total;
}); });
} }
@@ -238,7 +246,7 @@ function getCompetivetuveness(jobId) {
// 申请岗位 // 申请岗位
function jobApply() { function jobApply() {
const jobId = jobInfo.value.jobId; const jobId = jobInfo.value.id;
if (jobInfo.value.isApply) { if (jobInfo.value.isApply) {
const jobUrl = jobInfo.value.jobUrl; const jobUrl = jobInfo.value.jobUrl;
return window.open(jobUrl); return window.open(jobUrl);

View File

@@ -0,0 +1,545 @@
<template>
<view class="app-custom-root">
<view class="app-container">
<!-- 顶部头部区域 -->
<view class="container-header">
<view class="header-top">
<view class="header-btnLf button-click" @click="seemsg(0)" :class="{ active: state.current === 0 }">
现场招聘
</view>
<view class="header-btnLf button-click" @click="seemsg(1)" :class="{ active: state.current === 1 }">
VR虚拟招聘会
</view>
</view>
<view class="header-input btn-feel">
<uni-icons class="iconsearch" color="#666666" type="search" size="18"></uni-icons>
<input class="input" placeholder="招聘会" placeholder-class="inputplace" />
</view>
<view class="header-date">
<view class="data-week">
<view
class="weel-days button-click"
:class="{ active: currentDay.fullDate === item.fullDate }"
v-for="(item, index) in weekList"
:key="index"
@click="selectDate(item)"
>
<view class="label">{{ item.day }}</view>
<view class="day">{{ item.date }}</view>
</view>
</view>
<view class="data-all">
<image class="allimg button-click" @click="toSelectDate" src="/static/icon/date1.png"></image>
</view>
</view>
</view>
<!-- 主体内容区域 -->
<view class="container-main">
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
<view class="cards" v-if="fairList.length">
<view
class="card press-button"
v-for="(item, index) in fairList"
:key="index"
@click="navTo('/packageA/pages/exhibitors/exhibitors?jobFairId=' + item.jobFairId)"
>
<view class="card-title">{{ item.zphmc }}</view>
<view class="card-row">
<text class="">{{ item.zphdz }}</text>
<text class="">
<convert-distance
:alat="item.latitude"
:along="item.longitude"
:blat="latitudeVal"
:blong="longitudeVal"
></convert-distance>
</text>
</view>
<view class="card-times">
<view class="time-left">
<view class="left-date">{{ parseDateTime(item.zphjbsj).time }}</view>
<view class="left-dateDay">{{ parseDateTime(item.zphjbsj).date }}</view>
</view>
<view class="line"></view>
<view class="time-center">
<view class="center-date">
{{ getTimeStatus(item.zphjbsj, item.zphjzsj).statusText }}
</view>
<view class="center-dateDay">
{{ getHoursBetween(item.zphjbsj, item.zphjzsj) }}小时
</view>
</view>
<view class="line"></view>
<view class="time-right">
<view class="left-date">{{ parseDateTime(item.zphjzsj).time }}</view>
<view class="left-dateDay">{{ parseDateTime(item.zphjzsj).date }}</view>
</view>
</view>
<view class="recommend-card-line"></view>
<view class="card-footer">内容简介{{ item.zphjj }}</view>
</view>
</view>
<empty v-else pdTop="200"></empty>
</scroll-view>
</view>
<Tabbar :currentpage="1"></Tabbar>
</view>
</view>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import Tabbar from '@/components/tabbar/midell-box.vue';
import useLocationStore from '@/stores/useLocationStore';
import { storeToRefs } from 'pinia';
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const { $api, navTo, cloneDeep } = inject('globalFunction');
const weekList = ref([]);
const fairList = ref([]);
const currentDay = ref({});
const state = reactive({
current: 0,
all: [{}],
});
const pageState = reactive({
page: 0,
total: 0,
maxPage: 2,
pageSize: 10,
search: {},
});
onLoad(() => {
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0');
const day = String(today.getDate()).padStart(2, '0');
const currentDate = `${year}-${month}-${day}`;
const result = getNextDates({
startDate: currentDate,
});
weekList.value = result;
currentDay.value.fullDate = result[0].fullDate
getFair('refresh');
});
function toSelectDate() {
navTo('/packageA/pages/selectDate/selectDate', {
query: {
date: currentDay.value.fullDate,
},
onBack: (res) => {
console.log(res);
const result = getNextDates({
startDate: res.date,
});
const formattedDate = res.date.slice(5); // MM-DD
const dateFull = {
date: res.date.slice(5),
day: '周' + res.week,
fullDate: res.date,
};
currentDay.value = dateFull;
weekList.value = result;
getFair('refresh');
},
});
}
// 查看消息类型
function changeSwiperMsgType(e) {
const currented = e.detail.current;
state.current = currented;
}
function seemsg(index) {
if (index === 1) {
return $api.msg('功能确定中');
}
state.current = index;
}
const handleScrollToLower = () => {
return
getFair();
console.log('触底');
};
function getFair(type = 'add') {
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 1;
}
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
let params = {
...pageState.search,
// current: pageState.page,
// pageSize: pageState.pageSize,
};
// if (currentDay.value?.fullDate) {
// params.queryDate = currentDay.value.fullDate;
// }
if (currentDay.value?.fullDate) {
params.zphjbsj = currentDay.value.fullDate.replace(/-/g, '');
}
$api.createRequest('/app/internal/jobFairThirdPart', params).then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
// const str = pageState.pageSize * (pageState.page - 1);
// const end = fairList.value.length;
// const reslist = rows;
// fairList.value.splice(str, end, ...reslist);
fairList.value = rows
} else {
fairList.value = rows;
}
// pageState.list = resData.rows;
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
});
}
function parseDateTime(datetimeStr) {
if (!datetimeStr) return { time: '', date: '' };
const dateObj = new Date(datetimeStr);
if (isNaN(dateObj.getTime())) return { time: '', date: '' }; // 无效时间
const year = dateObj.getFullYear();
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
const day = String(dateObj.getDate()).padStart(2, '0');
const hours = String(dateObj.getHours()).padStart(2, '0');
const minutes = String(dateObj.getMinutes()).padStart(2, '0');
return {
time: `${hours}:${minutes}`,
date: `${year}${month}${day}`,
};
}
function getTimeStatus(startTimeStr, endTimeStr) {
const now = new Date();
const startTime = new Date(startTimeStr);
const endTime = new Date(endTimeStr);
// 判断状态0 开始中1 过期2 待开始
let status = 0;
let statusText = '开始中';
if (now < startTime) {
status = 2; // 待开始
statusText = '待开始';
} else if (now > endTime) {
status = 1; // 已过期
statusText = '已过期';
} else {
status = 0; // 进行中
statusText = '进行中';
}
return {
status, // 0: 进行中1: 已过期2: 待开始
statusText,
};
}
function getHoursBetween(startTimeStr, endTimeStr) {
const start = new Date(startTimeStr);
const end = new Date(endTimeStr);
const diffMs = end - start;
const diffHours = diffMs / (1000 * 60 * 60);
return +diffHours.toFixed(2); // 保留 2 位小数
}
const selectDate = (item) => {
if (currentDay.value?.fullDate === item.fullDate) {
currentDay.value = {};
getFair('refresh');
return;
}
currentDay.value = item;
getFair('refresh');
};
function getNextDates({ startDate = '', count = 6 }) {
const baseDate = startDate ? new Date(startDate) : new Date(); // 指定起点或今天
const dates = [];
const dayNames = ['日', '一', '二', '三', '四', '五', '六'];
for (let i = 0; i < count; i++) {
const date = new Date(baseDate);
date.setDate(baseDate.getDate() + i);
const fullDate = date.toISOString().slice(0, 10); // YYYY-MM-DD
const formattedDate = fullDate.slice(5); // MM-DD
const dayOfWeek = dayNames[date.getDay()];
dates.push({
date: formattedDate,
fullDate,
day: '周' + dayOfWeek,
});
}
// 可选设置默认选中项
// currentDay.value = dates[0];
return dates;
}
</script>
<style lang="stylus" scoped>
.app-custom-root {
position: fixed;
z-index: 10;
width: 100vw;
height: calc(100% - var(--window-bottom));
overflow: hidden;
}
.app-container {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
.container-header {
background: url('@/static/icon/background2.png') 0 0 no-repeat;
background-size: 100% 400rpx;
.header-top{
display: flex;
line-height: calc(88rpx - 14rpx);
padding: 16rpx 44rpx 14rpx 44rpx;
.header-btnLf {
display: flex;
width: fit-content;
white-space: nowrap
justify-content: flex-start;
align-items: center;
width: calc(60rpx * 3);
font-weight: 500;
font-size: 40rpx;
color: #696969;
margin-right: 44rpx;
position: relative;
.btns-wd{
position: absolute
top: 2rpx;
right: 2rpx
width: 16rpx;
height: 16rpx;
background: #F73636;
border-radius: 50%;
border: 4rpx solid #EEEEFF;
}
}
.active {
font-weight: 600;
font-size: 40rpx;
color: #000000;
}
}
.header-input{
padding: 0 24rpx
width: calc(100% - 48rpx);
position: relative
.iconsearch{
position: absolute
left: 50rpx;
top: 50%
transform: translate(0, -50%)
}
.input{
padding: 0 30rpx 0 80rpx
height: 80rpx;
background: #FFFFFF;
border-radius: 75rpx 75rpx 75rpx 75rpx;
font-size: 28rpx;
}
.inputplace{
font-weight: 400;
font-size: 28rpx;
color: #B5B5B5;
}
}
.header-date{
padding: 28rpx
display: flex
justify-content: space-between
align-items: center
.data-week{
flex: 1
display: flex
justify-content: space-between
flex-wrap: nowrap
overflow: hidden
.weel-days{
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
display: flex
justify-content: center
flex-direction: column
text-align: center
font-weight: 400;
font-size: 24rpx;
color: #333333;
width: 96rpx;
height: 88rpx;
.label{}
.day{
font-weight: 500;
}
}
.active{
background: rgba(37,107,250,0.1);
border-radius: 12rpx 12rpx 12rpx 12rpx;
color: #256BFA;
}
}
.data-all{
width: 66rpx;
height: 66rpx;
margin-left: 18rpx
.allimg{
width: 100%;
height: 100%
}
}
}
}
}
.container-main {
flex: 1;
overflow: hidden;
background-color: #f4f4f4;
}
.main-scroll {
width: 100%
height: 100%;
}
.cards{
padding: 28rpx 28rpx 28rpx 28rpx;
.card{
margin-top: 28rpx
padding: 32rpx;
background: #FFFFFF
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);
border-radius: 20rpx 20rpx 20rpx 20rpx;
.card-title{
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
.card-row{
display: flex
justify-content: space-between
font-weight: 400;
font-size: 28rpx;
color: #495265;
margin-top: 4rpx
}
.card-times{
display: flex;
justify-content: space-between
align-items: center
margin-top: 24rpx
.time-left,
.time-right{
text-align: center
.left-date{
font-weight: 500;
font-size: 48rpx;
color: #333333;
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
}
.left-dateDay{
font-weight: 400;
font-size: 24rpx;
color: #333333;
margin-top: 12rpx
}
}
.line{
width: 40rpx;
height: 0rpx;
border: 2rpx solid #D4D4D4;
margin-top: 64rpx
}
.time-center{
text-align: center;
display: flex
flex-direction: column
justify-content: center
align-items: center
.center-date{
font-weight: 400;
font-size: 28rpx;
color: #FF881A;
padding-top: 10rpx
}
.center-dateDay{
font-weight: 400;
font-size: 24rpx;
color: #333333;
margin-top: 6rpx
line-height: 48rpx;
width: 104rpx;
height: 48rpx;
background: #F9F9F9;
border-radius: 8rpx 8rpx 8rpx 8rpx;
}
}
}
.recommend-card-line{
width: calc(100%);
height: 0rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
border: 2rpx dashed rgba(0,0,0,0.14);
margin-top: 32rpx
position: relative
}
.recommend-card-line::before{
position: absolute
content: ''
left: 0
top: 0
transform: translate(-50% - 110rpx, -50%)
width: 28rpx;
height: 28rpx;
background: #F4F4F4;
border-radius: 50%;
}
.recommend-card-line::after{
position: absolute
content: ''
right: 0
top: 0
transform: translate(50% + 100rpx, -50%)
width: 28rpx;
height: 28rpx;
background: #F4F4F4;
border-radius: 50%;
}
.card-footer{
margin-top: 32rpx
min-height: 50rpx;
font-weight: 400;
font-size: 28rpx;
color: #6C7282;
}
}
.card:first-child{
margin-top: 0
}
}
</style>

View File

@@ -13,7 +13,7 @@
</view> </view>
<view class="header-input btn-feel"> <view class="header-input btn-feel">
<uni-icons class="iconsearch" color="#666666" type="search" size="18"></uni-icons> <uni-icons class="iconsearch" color="#666666" type="search" size="18"></uni-icons>
<input class="input" placeholder="招聘会" placeholder-class="inputplace" /> <input v-model="pageState.zphmc" confirm-type="search" @confirm="getFair" class="input" placeholder="招聘会" placeholder-class="inputplace" />
</view> </view>
<view class="header-date"> <view class="header-date">
<view class="data-week"> <view class="data-week">
@@ -42,42 +42,42 @@
class="card press-button" class="card press-button"
v-for="(item, index) in fairList" v-for="(item, index) in fairList"
:key="index" :key="index"
@click="navTo('/packageA/pages/exhibitors/exhibitors?jobFairId=' + item.jobFairId)" @click="navTo('/packageA/pages/exhibitors/exhibitors?jobFairId=' + item.zphID + '&jobFairName=' + item.zphmc)"
> >
<view class="card-title">{{ item.name }}</view> <view class="card-title">{{ item.zphmc }}</view>
<view class="card-row"> <view class="card-row">
<text class="">{{ item.location }}</text> <text class="">{{ item.jbf }}</text>
<text class=""> <text class="">
<convert-distance <!-- <convert-distance
:alat="item.latitude" :alat="item.latitude"
:along="item.longitude" :along="item.longitude"
:blat="latitudeVal" :blat="latitudeVal"
:blong="longitudeVal" :blong="longitudeVal"
></convert-distance> ></convert-distance> -->
</text> </text>
</view> </view>
<view class="card-times"> <view class="card-times">
<view class="time-left"> <view class="time-left">
<view class="left-date">{{ parseDateTime(item.startTime).time }}</view> <view class="left-date">{{ parseDateTime(item.zphjbsj).time }}</view>
<view class="left-dateDay">{{ parseDateTime(item.startTime).date }}</view> <view class="left-dateDay">{{ parseDateTime(item.zphjbsj).date }}</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="time-center"> <view class="time-center">
<view class="center-date"> <view class="center-date">
{{ getTimeStatus(item.startTime, item.endTime).statusText }} {{ getTimeStatus(item.zphjbsj, item.zphjzsj).statusText }}
</view> </view>
<view class="center-dateDay"> <view class="center-dateDay">
{{ getHoursBetween(item.startTime, item.endTime) }}小时 {{ getHoursBetween(item.zphjbsj, item.zphjzsj) }}小时
</view> </view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="time-right"> <view class="time-right">
<view class="left-date">{{ parseDateTime(item.endTime).time }}</view> <view class="left-date">{{ parseDateTime(item.zphjzsj).time }}</view>
<view class="left-dateDay">{{ parseDateTime(item.endTime).date }}</view> <view class="left-dateDay">{{ parseDateTime(item.zphjzsj).date }}</view>
</view> </view>
</view> </view>
<view class="recommend-card-line"></view> <view class="recommend-card-line"></view>
<view class="card-footer">内容简介{{ item.description }}</view> <view class="card-footer">内容简介{{ item.zphjj }}</view>
</view> </view>
</view> </view>
<empty v-else pdTop="200"></empty> <empty v-else pdTop="200"></empty>
@@ -95,7 +95,7 @@ import Tabbar from '@/components/tabbar/midell-box.vue';
import useLocationStore from '@/stores/useLocationStore'; import useLocationStore from '@/stores/useLocationStore';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore()); const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const { $api, navTo, cloneDeep } = inject('globalFunction'); const { $api, navTo, cloneDeep,debounce } = inject('globalFunction');
const weekList = ref([]); const weekList = ref([]);
const fairList = ref([]); const fairList = ref([]);
const currentDay = ref({}); const currentDay = ref({});
@@ -108,7 +108,7 @@ const pageState = reactive({
total: 0, total: 0,
maxPage: 2, maxPage: 2,
pageSize: 10, pageSize: 10,
search: {}, zphmc:''
}); });
onLoad(() => { onLoad(() => {
@@ -122,6 +122,7 @@ onLoad(() => {
startDate: currentDate, startDate: currentDate,
}); });
weekList.value = result; weekList.value = result;
currentDay.value.fullDate = result[0].fullDate
getFair('refresh'); getFair('refresh');
}); });
@@ -161,10 +162,12 @@ function seemsg(index) {
} }
const handleScrollToLower = () => { const handleScrollToLower = () => {
return
getFair(); getFair();
console.log('触底'); console.log('触底');
}; };
function getFair(type = 'add') { function getFair(type = 'add') {
if (type === 'refresh') { if (type === 'refresh') {
pageState.page = 1; pageState.page = 1;
@@ -174,21 +177,24 @@ function getFair(type = 'add') {
pageState.page += 1; pageState.page += 1;
} }
let params = { let params = {
...pageState.search, zphmc:pageState.zphmc,
current: pageState.page, // current: pageState.page,
pageSize: pageState.pageSize, // pageSize: pageState.pageSize,
}; };
// if (currentDay.value?.fullDate) {
// params.queryDate = currentDay.value.fullDate;
// }
if (currentDay.value?.fullDate) { if (currentDay.value?.fullDate) {
params.queryDate = currentDay.value.fullDate; params.zphjbsj = currentDay.value.fullDate.replace(/-/g, '');
} }
$api.createRequest('/app/fair', params).then((resData) => { $api.createRequest('/app/internal/jobFairThirdPart', params).then((resData) => {
const { rows, total } = resData; const { rows, total } = resData;
console.log(rows);
if (type === 'add') { if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1); // const str = pageState.pageSize * (pageState.page - 1);
const end = fairList.value.length; // const end = fairList.value.length;
const reslist = rows; // const reslist = rows;
fairList.value.splice(str, end, ...reslist); // fairList.value.splice(str, end, ...reslist);
fairList.value = rows
} else { } else {
fairList.value = rows; fairList.value = rows;
} }