招聘会模块

This commit is contained in:
2025-11-05 17:21:01 +08:00
parent 2fbd8ade5b
commit 19c48d7c71
9 changed files with 2885 additions and 1615 deletions

View File

@@ -105,16 +105,23 @@
</view>
<template #footer>
<view class="footer" v-if="hasnext">
<view class="btn-wq button-click" :class="{ 'btn-desbel': fairInfo.isCollection }"
<view class="btn-wq button-click" :class="{ 'btn-desbel': fairInfo.isSignUp==1 }"
@click="applyExhibitors">
{{ fairInfo.isCollection ? '预约招聘会' : '预约招聘会' }}
{{ fairInfo.isSignUp==1 ? '报名' : '报名招聘会' }}
</view>
</view>
</template>
<uni-popup ref="CompanySignPopup" background-color="#fff" :mask-click="false">
<view class="popup-content">
<signDialog v-if="signDialogisshow" :signType="signType" :signRole="signRole"
:jobFairId="fairInfo.jobFairId" @closePopup="closePopup"></signDialog>
</view>
</uni-popup>
</AppLayout>
</template>
<script setup>
import signDialog from '@/components/jobfair/signDialog.vue';
import config from "@/config.js"
import {
reactive,
@@ -128,7 +135,6 @@
onLoad,
onShow
} from '@dcloudio/uni-app';
import dictLabel from '@/components/dict-Label/dict-Label.vue';
import useLocationStore from '@/stores/useLocationStore';
const {
$api,
@@ -148,6 +154,15 @@
const fairInfo = ref({});
const companyList = ref([]);
const hasnext = ref(true);
const userInfo = ref({});
const signDialogisshow = ref(false)
// 弹窗
const signType = ref(1);
// person个人 ent企业
const signRole = ref('ent');
const CompanySignPopup = ref(null)
const jobFairId = ref(null)
const baseUrl = config.imgBaseUrl
const getItemBackgroundStyle = (imageName) => ({
@@ -157,28 +172,59 @@
backgroundRepeat: 'no-repeat'
});
onLoad((options) => {
getCompanyInfo(options.jobFairId);
jobFairId.value=options.jobFairId
const raw = uni.getStorageSync("Padmin-Token");
const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? {
Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`
} : {};
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (resData.code == 200) {
$api.myRequest("/system/user/login/user/info", {}, "GET", 10100, {
Authorization: `Bearer ${uni.getStorageSync("Padmin-Token")}`
}).then((userinfo) => {
userInfo.value = userinfo
getCompanyInfo(userInfo.value.info.userId, options.jobFairId);
});
} else {
getCompanyInfo('', options.jobFairId);
}
});
});
function getCompanyInfo(id) {
// $api.createRequest(`/app/fair/${id}`).then((resData) => {
// fairInfo.value = resData.data;
// companyList.value = resData.data.companyList;
// hasAppointment();
// });
$api.myRequest('/jobfair/public/jobfair/detail', {
jobFairId: id
}).then((resData) => {
console.log(resData, 'resData');
function closePopup() {
CompanySignPopup.value.close()
getCompanyInfo(userInfo.value.info.userId, jobFairId.value)
}
function getCompanyInfo(userId, id) {
let data={}
if (userInfo.value&&userInfo.value.userType == 'ent') {
data={
jobFairId: id,
enterpriseId: userId,
code:userInfo.value.info.entCreditCode
}
}else if(userInfo.value&&userInfo.value.userType == 'ent'){
data={
jobFairId: id,
personId: userId,
idCard:userInfo.value.info.personCardNo
}
}else{
data={
jobFairId: id,
personId: userId
}
}
$api.myRequest('/jobfair/public/jobfair/detail', data).then((resData) => {
fairInfo.value = resData.data;
console.log(fairInfo.value, 'fairInfo.value');
// hasAppointment()
});
$api.myRequest('/jobfair/public/jobfair/enterprises-with-jobs-by-job-fair-id', {
jobFairId: id
}).then((resData) => {
companyList.value = resData.data;
// hasAppointment()
});
};
@@ -205,21 +251,56 @@
isExpanded.value = !isExpanded.value;
}
// 取消/收藏岗位
// 报名招聘会
function applyExhibitors() {
const fairId = fairInfo.value.jobFairId;
if (fairInfo.value.isCollection) {
// $api.createRequest(`/app/fair/collection/${fairId}`, {}, 'DELETE').then((resData) => {
// getCompanyInfo(fairId);
// $api.msg('取消预约成功');
// });
$api.msg('已预约成功');
} else {
$api.createRequest(`/app/fair/collection/${fairId}`, {}, 'POST').then((resData) => {
getCompanyInfo(fairId);
$api.msg('预约成功');
});
if (fairInfo.value.isSignUp == 1) {
$api.msg('请勿重复报名');
return
}
const raw = uni.getStorageSync("Padmin-Token");
const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? {
Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`
} : {};
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (resData.code == 200) {
if (userInfo.value.userType == 'ent') {
// 企业
signType.value = fairInfo.value.jobFairType;
signRole.value = userInfo.userType;
signDialogisshow.value = true
CompanySignPopup.value.open()
}else{
$api.myRequest("/jobfair/public/job-fair-sign-up-person/sign-up", {
personId: userInfo.value.info.userId,
jobFairId: jobFairId.value,
idCard:userInfo.value.info.personCardNo
}, "POST", 9100, { "Content-Type": "application/json",...headers }).then((res) => {
if (res.code === 200) {
uni.showToast({
title: '报名成功',
icon: 'success'
});
getCompanyInfo(userInfo.value.info.userId, jobFairId.value)
} else {
uni.showToast({
title: res.msg || '报名失败',
icon: 'none'
});
}
})
}
} else {
$api.msg('请先登录');
setTimeout(() => {
uni.redirectTo({
url: '/packageB/login'
})
}, 1000)
}
});
}
function parseDateTime(datetimeStr) {
@@ -288,6 +369,12 @@
</script>
<style lang="stylus" scoped>
.popup-content {
width: 90vw;
height: 80vh;
position: relative;
}
.btnback {
width: 64rpx;
height: 64rpx;
@@ -528,6 +615,7 @@
color: #333333;
display: flex;
align-items: center;
image {
width: 30rpx;
height: 30rpx;
@@ -577,7 +665,8 @@
display: flex;
align-items: center;
margin-right: 20rpx;
image{
image {
width: 22rpx;
height: 22rpx;
margin-right: 8rpx;
@@ -677,4 +766,4 @@
box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11, 44, 112, 0.12);
}
}
</style>
</style>