Merge remote-tracking branch 'origin/main'

This commit is contained in:
2026-02-11 17:24:27 +08:00
15 changed files with 1138 additions and 593 deletions

View File

@@ -63,7 +63,7 @@ const generateTabbarList = () => {
{ {
id: 2, id: 2,
text: '', text: '',
path: '/pages/chat/chat', path: '/packageA/pages/chat/chat',
iconPath: '/static/tabbar/robot2.png', iconPath: '/static/tabbar/robot2.png',
selectedIconPath: '/static/tabbar/robot2.png', selectedIconPath: '/static/tabbar/robot2.png',
centerItem: true, centerItem: true,

View File

@@ -76,7 +76,7 @@ const generateTabbarList = () => {
{ {
id: 2, id: 2,
text: 'AI+', text: 'AI+',
path: '/pages/chat/chat', path: '/packageA/pages/chat/chat',
iconPath: '../../static/tabbar/logo3.png', iconPath: '../../static/tabbar/logo3.png',
selectedIconPath: '../../static/tabbar/logo3.png', selectedIconPath: '../../static/tabbar/logo3.png',
centerItem: true, centerItem: true,
@@ -148,7 +148,7 @@ const changeItem = (item) => {
const tabBarPages = [ const tabBarPages = [
'/pages/index/index', '/pages/index/index',
'/pages/careerfair/careerfair', '/pages/careerfair/careerfair',
'/pages/chat/chat', '/packageA/pages/chat/chat',
'/pages/msglog/msglog', '/pages/msglog/msglog',
'/pages/mine/mine' '/pages/mine/mine'
]; ];

View File

@@ -3,5 +3,8 @@
"@dcloudio/uni-ui": "^1.5.11", "@dcloudio/uni-ui": "^1.5.11",
"dayjs": "^1.11.19", "dayjs": "^1.11.19",
"sm-crypto": "^0.3.13" "sm-crypto": "^0.3.13"
},
"devDependencies": {
"crypto-js": "^4.2.0"
} }
} }

View File

@@ -1,16 +1,11 @@
<template> <template>
<AppLayout title="" :use-scroll-view="false"> <AppLayout title="单位详情" :use-scroll-view="false">
<template #headerleft> <template #headerleft>
<view class="btnback"> <view class="btnback">
<image src="@/static/icon/back.png" @click="navBack"></image> <image src="@/static/icon/back.png" @click="navBack"></image>
</view> </view>
</template> </template>
<template #headerright>
<view class="btn mar_ri10">
<image src="@/static/icon/collect3.png" v-if="!companyInfo?.isCollection"></image>
<image src="@/static/icon/collect2.png" v-else></image>
</view>
</template>
<view class="content"> <view class="content">
<view class="content-top"> <view class="content-top">
<view class="companyinfo-left"> <view class="companyinfo-left">
@@ -22,6 +17,10 @@
{{ getScaleLabel(companyInfo?.scale) }} {{ getScaleLabel(companyInfo?.scale) }}
</view> </view>
</view> </view>
<view class="companyinfo-collect" @click="toggleCollection">
<image src="@/static/icon/collect3.png" v-if="!companyInfo?.isCollection"></image>
<image src="@/static/icon/collect2.png" v-else></image>
</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>
@@ -372,6 +371,37 @@
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(jobId)}`); navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(jobId)}`);
} }
} }
// 收藏和取消收藏企业
function toggleCollection() {
const companyId = companyInfo.value.id || companyInfo.value.companyId;
if (!companyId) {
$api.msg('获取公司信息失败,无法操作');
return;
}
const isCollection = companyInfo.value.isCollection;
const method = isCollection ? 'DELETE' : 'POST';
const apiUrl = `/app/company/collection/${companyId}`;
uni.showLoading({
title: '操作中'
});
$api.createRequest(apiUrl, {}, method).then((resData) => {
uni.hideLoading();
if (resData && resData.code === 200) {
companyInfo.value.isCollection = !isCollection;
$api.msg(isCollection ? '取消收藏成功' : '收藏成功');
} else {
$api.msg((resData && resData.msg) || (isCollection ? '取消收藏失败' : '收藏失败'));
}
}).catch((error) => {
uni.hideLoading();
console.error('API error when toggling collection:', error);
$api.msg('网络请求失败,请检查网络连接');
});
}
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@@ -404,6 +434,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
align-items: center;
.companyinfo-left { .companyinfo-left {
width: 96rpx; width: 96rpx;
@@ -412,6 +443,8 @@
} }
.companyinfo-right { .companyinfo-right {
flex: 1;
.row1 { .row1 {
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
@@ -425,6 +458,17 @@
line-height: 45rpx; line-height: 45rpx;
} }
} }
.companyinfo-collect {
width: 52rpx;
height: 52rpx;
margin-left: 20rpx;
image {
width: 100%;
height: 100%;
}
}
} }
.conetent-info { .conetent-info {

View File

@@ -67,6 +67,7 @@
<view class="Detail-title"> <view class="Detail-title">
<text class="title">参会单位{{ companyList.length }}</text> <text class="title">参会单位{{ companyList.length }}</text>
</view> </view>
<view v-if="isCompanyUser">
<view v-for="job in companyList" :key="job.id"> <view v-for="job in companyList" :key="job.id">
<view class="cards" :style="getItemBackgroundStyle('bj.png')" <view class="cards" :style="getItemBackgroundStyle('bj.png')"
@click="navTo('/packageA/pages/UnitDetails/UnitDetails?job='+JSON.stringify(job))"> @click="navTo('/packageA/pages/UnitDetails/UnitDetails?job='+JSON.stringify(job))">
@@ -101,6 +102,69 @@
</view> </view>
</view> </view>
</view> </view>
<view v-else>
<view class="detail-box">
<view class="" v-for="(item1, index1) in companyList" :key="index1">
<view class="company-header1">
<view class="left">
<image
:src="`${baseUrl}/jobfair/gs.png`"
alt=""
class="company-icon"
/>
<text class="name1">{{ item1.companyName }}</text>
<!-- <div class="header-detail">企业详情 ></div> -->
</view>
</view>
<view
class="detail-item"
v-for="(job, index) in item1.jobInfoList"
:key="index"
>
<view class="gw">
<text>{{ job.jobTitle }}</text>
<view v-if="job.minSalary && job.maxSalary" class="salary">
{{ job.minSalary }}-{{ job.maxSalary }}
</view>
</view>
<view class="bottom">
<view class="tag">
<view class="tag-item">{{ job.industry }}</view>
<view class="tag-item success">{{ job.scale }}</view>
</view>
</view>
<view class="name">
<!-- 应聘状态1已投递2已邀请面试3已录用4不录用 -->
<view class="status" v-if="job.jobFairPersonJob?.status">
<text
:style="{
color: getStatusText(job.jobFairPersonJob?.status)
.color,
}"
>{{
getStatusText(job.jobFairPersonJob?.status).text
}}</text
>
</view>
<view v-else class="btn">
<button
plain
:disabled="deliveringJobs[job.jobId]"
style="color: #1685f7; border-color: #1685f7"
@click="deliverResume(job)"
>
{{
deliveringJobs[job.jobId] ? "投递中..." : "简历投递"
}}
</button>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view> </scroll-view>
</view> </view>
<template #footer> <template #footer>
@@ -150,224 +214,350 @@
latitudeVal latitudeVal
} = storeToRefs(useLocationStore()); } = storeToRefs(useLocationStore());
const isExpanded = ref(false); 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 userInfo = ref({}); const userInfo = ref({});
const signDialogisshow = ref(false) const signDialogisshow = ref(false);
// 弹窗 // 弹窗
const signType = ref(1); const signType = ref(1);
// person个人 ent企业 // person个人 ent企业
const signRole = ref('ent'); const signRole = ref("ent");
const CompanySignPopup = ref(null) const CompanySignPopup = ref(null);
// 报名loading状态 // 报名loading状态
const isLoading = ref(false) const isLoading = ref(false);
const jobFairId = ref(null) const jobFairId = ref(null);
const isCompanyUser = ref(false);
const baseUrl = config.imgBaseUrl isCompanyUser.value = uni.getStorageSync("userInfo")?.isCompanyUser == 0;
const getItemBackgroundStyle = (imageName) => ({ // 获取状态文本
backgroundImage: `url(${baseUrl}/jobfair/${imageName})`, const getStatusText = (status) => {
backgroundSize: '100% 100%', // 覆盖整个容器 switch (status) {
backgroundPosition: 'center', // 居中 case "1":
backgroundRepeat: 'no-repeat' return {
}); text: "已投递",
onLoad((options) => { color: "#2aa553",
jobFairId.value=options.jobFairId };
case "2":
return {
text: "已邀请面试",
color: "#409EFF",
};
case "3":
return {
text: "已录用",
color: "#67C23A",
};
case "4":
return {
text: "不录用",
color: "#F56C6C",
};
default:
return {
text: "未知状态",
color: "#2aa553",
};
}
};
const deliveringJobs = reactive({});
// 岗位投递
function deliverResume(job) {
uni.showModal({
title: "提示",
content: "请确认是否投递简历?",
showCancel: true,
confirmText: "确定",
cancelText: "取消",
success: (res) => {
if (res.confirm) {
if (deliveringJobs[job.jobId]) return;
deliveringJobs[job.jobId] = true;
const raw = uni.getStorageSync("Padmin-Token"); const raw = uni.getStorageSync("Padmin-Token");
const token = typeof raw === "string" ? raw.trim() : ""; const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? { const headers = token? { Authorization: raw.startsWith("Bearer ") ? raw: `Bearer ${token}`,}: {};
Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`
} : {};
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => { $api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData1) => {
if (resData1.code == 200) {
$api.myRequest(
"/system/user/login/user/info",
{},
"GET",
10100,
headers
)
.then((resData) => {
$api.myRequest(
"/jobfair/public/job-fair-person-job/insert",
{
jobFairId: job.jobFairId, // 招聘会id
personId: resData.info.userId, // 当前登录用户id
enterpriseId: job.companyId, // 企业id
jobId: job.jobId, // 岗位id
idCard: resData.info.personCardNo,
},
"post",
9100,
{
"Content-Type": "application/json",
}
)
.then((data) => {
if (data && data.code === 200) {
$api.msg("简历投递成功");
if (!job.jobFairPersonJob) {
job.jobFairPersonJob = {};
}
job.jobFairPersonJob.status = "1";
getCompanyInfo(userInfo.value.info.userId, jobFairId.value);
} else {
$api.msg((data && data.msg) || "简历投递失败");
}
deliveringJobs[job.jobId] = false;
});
});
} else {
$api.msg("请先登录");
deliveringJobs[job.jobId] = false;
}
})
.catch(() => {
deliveringJobs[job.jobId] = false;
});
}
},
});
}
const baseUrl = config.imgBaseUrl;
const getItemBackgroundStyle = (imageName) => ({
backgroundImage: `url(${baseUrl}/jobfair/${imageName})`,
backgroundSize: "100% 100%", // 覆盖整个容器
backgroundPosition: "center", // 居中
backgroundRepeat: "no-repeat",
});
onLoad((options) => {
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) { if (resData.code == 200) {
$api.myRequest("/system/user/login/user/info", {}, "GET", 10100, { $api
Authorization: `Bearer ${uni.getStorageSync("Padmin-Token")}` .myRequest("/system/user/login/user/info", {}, "GET", 10100, {
}).then((userinfo) => { Authorization: `Bearer ${uni.getStorageSync("Padmin-Token")}`,
userInfo.value = userinfo })
.then((userinfo) => {
userInfo.value = userinfo;
getCompanyInfo(userInfo.value.info.userId, options.jobFairId); getCompanyInfo(userInfo.value.info.userId, options.jobFairId);
}); });
} else { } else {
getCompanyInfo('', options.jobFairId); getCompanyInfo("", options.jobFairId);
} }
}); });
}); });
function closePopup() { function closePopup() {
CompanySignPopup.value.close() CompanySignPopup.value.close();
getCompanyInfo(userInfo.value.info.userId, jobFairId.value) getCompanyInfo(userInfo.value.info.userId, jobFairId.value);
} }
function getCompanyInfo(userId, id) { function getCompanyInfo(userId, id) {
let data={} let data = {};
if (userInfo.value&&userInfo.value.userType == 'ent') { if (userInfo.value && userInfo.value.userType == "ent") {
data={ data = {
jobFairId: id, jobFairId: id,
enterpriseId: userId, enterpriseId: userId,
code:userInfo.value.info.entCreditCode code: userInfo.value.info.entCreditCode,
} };
}else if(userInfo.value&&userInfo.value.userType == 'ent'){ } else if (userInfo.value && userInfo.value.userType == "ent") {
data={ data = {
jobFairId: id, jobFairId: id,
personId: userId, personId: userId,
idCard:userInfo.value.info.personCardNo idCard: userInfo.value.info.personCardNo,
} };
}else{ } else {
data={ data = {
jobFairId: id, jobFairId: id,
personId: userId personId: userId,
};
} }
} $api.myRequest("/jobfair/public/jobfair/detail", data).then((resData) => {
$api.myRequest('/jobfair/public/jobfair/detail', data).then((resData) => {
fairInfo.value = resData.data; fairInfo.value = resData.data;
}); });
$api.myRequest('/jobfair/public/jobfair/enterprises-with-jobs-by-job-fair-id', { $api
jobFairId: id .myRequest("/jobfair/public/jobfair/enterprises-with-jobs-by-job-fair-id", {
}).then((resData) => { personId: userInfo.value?.info?.userId,
jobFairId: jobFairId.value,
})
.then((resData) => {
if(resData.code == 200){
companyList.value = resData.data; companyList.value = resData.data;
}
}); });
}; }
const hasAppointment = () => { const hasAppointment = () => {
const isTimePassed = (timeStr) => { const isTimePassed = (timeStr) => {
const targetTime = new Date(timeStr.replace(/-/g, '/')).getTime(); // 兼容格式 const targetTime = new Date(timeStr.replace(/-/g, "/")).getTime(); // 兼容格式
const now = Date.now(); const now = Date.now();
return now < targetTime; return now < targetTime;
}; };
hasnext.value = isTimePassed(fairInfo.value.startTime); hasnext.value = isTimePassed(fairInfo.value.startTime);
}; };
function openMap(lat, lng, name = '位置') { function openMap(lat, lng, name = "位置") {
const isConfirmed = window.confirm('是否打开地图查看位置?'); const isConfirmed = window.confirm("是否打开地图查看位置?");
if (!isConfirmed) return; if (!isConfirmed) return;
// 使用高德地图或百度地图的 H5 链接打开 // 使用高德地图或百度地图的 H5 链接打开
const url = `https://uri.amap.com/marker?position=${lng},${lat}&name=${encodeURIComponent(name)}`; const url = `https://uri.amap.com/marker?position=${lng},${lat}&name=${encodeURIComponent(
name
)}`;
window.location.href = url; window.location.href = url;
} }
function expand() { function expand() {
isExpanded.value = !isExpanded.value; isExpanded.value = !isExpanded.value;
} }
// 报名招聘会 // 报名招聘会
function applyExhibitors() { function applyExhibitors() {
if (isLoading.value) return if (isLoading.value) return;
if (fairInfo.value.isSignUp == 1) { if (fairInfo.value.isSignUp == 1) {
$api.msg('请勿重复报名'); $api.msg("请勿重复报名");
return return;
} }
const raw = uni.getStorageSync("Padmin-Token"); const raw = uni.getStorageSync("Padmin-Token");
const token = typeof raw === "string" ? raw.trim() : ""; const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? { const headers = token
Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}` ? {
} : {}; Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`,
isLoading.value = true }
: {};
isLoading.value = true;
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => { $api
.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers)
.then((resData) => {
if (resData.code == 200) { if (resData.code == 200) {
if (userInfo.value.userType == 'ent') { if (userInfo.value.userType == "ent") {
// 企业 // 企业
signType.value = fairInfo.value.jobFairType; signType.value = fairInfo.value.jobFairType;
signRole.value = userInfo.userType; signRole.value = userInfo.userType;
signDialogisshow.value = true signDialogisshow.value = true;
CompanySignPopup.value.open() CompanySignPopup.value.open();
isLoading.value = false isLoading.value = false;
}else{ } else {
$api.myRequest("/jobfair/public/job-fair-sign-up-person/sign-up", { $api
.myRequest(
"/jobfair/public/job-fair-sign-up-person/sign-up",
{
personId: userInfo.value.info.userId, personId: userInfo.value.info.userId,
jobFairId: jobFairId.value, jobFairId: jobFairId.value,
idCard:userInfo.value.info.personCardNo idCard: userInfo.value.info.personCardNo,
}, "POST", 9100, { "Content-Type": "application/json",...headers }).then((res) => { },
"POST",
9100,
{ "Content-Type": "application/json", ...headers }
)
.then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.showToast({ uni.showToast({
title: '报名成功', title: "报名成功",
icon: 'success' icon: "success",
}); });
fairInfo.value.isSignUp = 1; fairInfo.value.isSignUp = 1;
getCompanyInfo(userInfo.value.info.userId, jobFairId.value); getCompanyInfo(userInfo.value.info.userId, jobFairId.value);
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg || '报名失败', title: res.msg || "报名失败",
icon: 'none' icon: "none",
}); });
} }
isLoading.value = false isLoading.value = false;
}) });
} }
} else { } else {
$api.msg('请先登录'); $api.msg("请先登录");
// setTimeout(() => { // setTimeout(() => {
// uni.redirectTo({ // uni.redirectTo({
// url: '/packageB/login' // url: '/packageB/login'
// }) // })
// }, 1000) // }, 1000)
isLoading.value = false isLoading.value = false;
} }
}).catch(() => { })
isLoading.value = false .catch(() => {
isLoading.value = false;
}); });
} }
function parseDateTime(datetimeStr) { function parseDateTime(datetimeStr) {
if (!datetimeStr) return { if (!datetimeStr)
time: '', return {
date: '' time: "",
date: "",
}; };
const dateObj = new Date(datetimeStr); const dateObj = new Date(datetimeStr);
if (isNaN(dateObj.getTime())) return { if (isNaN(dateObj.getTime()))
time: '', return {
date: '' time: "",
date: "",
}; // 无效时间 }; // 无效时间
const year = dateObj.getFullYear(); const year = dateObj.getFullYear();
const month = String(dateObj.getMonth() + 1).padStart(2, '0'); const month = String(dateObj.getMonth() + 1).padStart(2, "0");
const day = String(dateObj.getDate()).padStart(2, '0'); const day = String(dateObj.getDate()).padStart(2, "0");
const hours = String(dateObj.getHours()).padStart(2, '0'); const hours = String(dateObj.getHours()).padStart(2, "0");
const minutes = String(dateObj.getMinutes()).padStart(2, '0'); const minutes = String(dateObj.getMinutes()).padStart(2, "0");
return { return {
time: `${hours}:${minutes}`, time: `${hours}:${minutes}`,
date: `${year}${month}${day}`, date: `${year}${month}${day}`,
}; };
} }
function getTimeStatus(startTimeStr, endTimeStr) { function getTimeStatus(startTimeStr, endTimeStr) {
const now = new Date(); const now = new Date();
const startTime = new Date(startTimeStr); const startTime = new Date(startTimeStr);
const endTime = new Date(endTimeStr); const endTime = new Date(endTimeStr);
// 判断状态0 开始中1 过期2 待开始 // 判断状态0 开始中1 过期2 待开始
let status = 0; let status = 0;
let statusText = '开始中'; let statusText = "开始中";
let color = '#13C57C'; // 进行中 - 绿色 let color = "#13C57C"; // 进行中 - 绿色
if (now < startTime) { if (now < startTime) {
status = 2; // 待开始 status = 2; // 待开始
statusText = '待开始'; statusText = "待开始";
color = '#015EEA'; // 未开始 - 蓝色 color = "#015EEA"; // 未开始 - 蓝色
} else if (now > endTime) { } else if (now > endTime) {
status = 1; // 已过期 status = 1; // 已过期
statusText = '已过期'; statusText = "已过期";
color = '#999999'; // 已过期 - 灰色 color = "#999999"; // 已过期 - 灰色
} else { } else {
status = 0; // 进行中 status = 0; // 进行中
statusText = '进行中'; statusText = "进行中";
color = '#13C57C'; // 进行中 - 绿色 color = "#13C57C"; // 进行中 - 绿色
} }
return { return {
status, // 0: 进行中1: 已过期2: 待开始 status, // 0: 进行中1: 已过期2: 待开始
statusText, statusText,
color color,
}; };
} }
function getHoursBetween(startTimeStr, endTimeStr) { function getHoursBetween(startTimeStr, endTimeStr) {
const start = new Date(startTimeStr); const start = new Date(startTimeStr);
const end = new Date(endTimeStr); const end = new Date(endTimeStr);
@@ -375,35 +565,35 @@
const diffHours = diffMs / (1000 * 60 * 60); const diffHours = diffMs / (1000 * 60 * 60);
return +diffHours.toFixed(2); // 保留 2 位小数 return +diffHours.toFixed(2); // 保留 2 位小数
} }
</script> </script>
<style lang="stylus" scoped> <style lang="scss" scoped>
.popup-content { .popup-content {
width: 90vw; width: 90vw;
height: 80vh; height: 80vh;
position: relative; position: relative;
} }
.btnback { .btnback {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
} }
.btn { .btn {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
width: 52rpx; width: 52rpx;
height: 52rpx; height: 52rpx;
} }
image { image {
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
.content { .content {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -428,13 +618,14 @@
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif; font-family: "PingFangSC-Medium", "PingFang SC", "Helvetica Neue",
Helvetica, Arial, "Microsoft YaHei", sans-serif;
} }
.row2 { .row2 {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #6C7282; color: #6c7282;
line-height: 45rpx; line-height: 45rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -451,7 +642,7 @@
.location-img { .location-img {
border-radius: 8rpx 8rpx 8rpx 8rpx; border-radius: 8rpx 8rpx 8rpx 8rpx;
border: 2rpx solid #EFEFEF; border: 2rpx solid #efefef;
} }
.location-info { .location-info {
@@ -479,35 +670,34 @@
.info-text { .info-text {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #9B9B9B; color: #9b9b9b;
position: relative; position: relative;
padding-right: 20rpx padding-right: 20rpx;
} }
.info-text::before { .info-text::before {
position: absolute; position: absolute;
right: 0; right: 0;
top: 50%; top: 50%;
content: ''; content: "";
width: 4rpx; width: 4rpx;
height: 16rpx; height: 16rpx;
border-radius: 2rpx; border-radius: 2rpx;
background: #9B9B9B; background: #9b9b9b;
transform: translate(0, -75%) rotate(-45deg) transform: translate(0, -75%) rotate(-45deg);
} }
.info-text::after { .info-text::after {
position: absolute; position: absolute;
right: 0; right: 0;
top: 50%; top: 50%;
content: ''; content: "";
width: 4rpx; width: 4rpx;
height: 16rpx; height: 16rpx;
border-radius: 2rpx; border-radius: 2rpx;
background: #9B9B9B; background: #9b9b9b;
transform: translate(0, -25%) rotate(45deg) transform: translate(0, -25%) rotate(45deg);
} }
} }
} }
} }
@@ -533,7 +723,7 @@
} }
.title2 { .title2 {
margin-top: 48rpx margin-top: 48rpx;
} }
} }
@@ -559,7 +749,7 @@
margin-bottom: 46rpx; margin-bottom: 46rpx;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #256BFA; color: #256bfa;
.expand-img { .expand-img {
width: 40rpx; width: 40rpx;
@@ -567,15 +757,15 @@
} }
.expand-img-active { .expand-img-active {
transform: rotate(180deg) transform: rotate(180deg);
}
} }
} }
}
.Detailscroll-view { .Detailscroll-view {
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
background: #F4F4F4; background: #f4f4f4;
.views { .views {
padding: 28rpx; padding: 28rpx;
@@ -597,19 +787,19 @@
.Detail-title::before { .Detail-title::before {
position: absolute; position: absolute;
content: ''; content: "";
left: -14rpx; left: -14rpx;
bottom: 0; bottom: 0;
height: 16rpx; height: 16rpx;
width: 108rpx; width: 108rpx;
background: linear-gradient(to right, #CBDEFF, #FFFFFF); background: linear-gradient(to right, #cbdeff, #ffffff);
border-radius: 8rpx; border-radius: 8rpx;
z-index: 1; z-index: 1;
} }
.cards { .cards {
padding: 32rpx; padding: 32rpx;
background: #FFFFFF; background: #ffffff;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.04); box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.04);
border-radius: 20rpx 20rpx 20rpx 20rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;
margin-top: 22rpx; margin-top: 22rpx;
@@ -630,7 +820,6 @@
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
} }
@@ -642,7 +831,7 @@
} }
.ris { .ris {
background: #53ACFF; background: #53acff;
color: #fff; color: #fff;
padding: 7rpx 20rpx; padding: 7rpx 20rpx;
border-radius: 8rpx; border-radius: 8rpx;
@@ -652,7 +841,7 @@
.card-companyName { .card-companyName {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #6C7282; color: #6c7282;
} }
.card-tags { .card-tags {
@@ -662,7 +851,7 @@
.tag { .tag {
width: fit-content; width: fit-content;
height: 30rpx; height: 30rpx;
background: #E0F0FF; background: #e0f0ff;
border-radius: 4rpx; border-radius: 4rpx;
padding: 6rpx 26rpx; padding: 6rpx 26rpx;
line-height: 30rpx; line-height: 30rpx;
@@ -689,13 +878,129 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 28rpx; font-size: 28rpx;
color: #6C7282; color: #6c7282;
}
}
.detail-box {
padding-top: 20rpx;
box-sizing: border-box;
.company-header1 {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 12px;
.name1 {
font-weight: 600;
margin-right: 12px;
font-size: 18px;
}
.company-icon {
width: 20px;
height: 20px;
margin-right: 15px;
}
.left {
display: flex;
align-items: center;
.header-detail {
background: #5599ff;
border-radius: 18px;
padding: 2px 16px;
color: #fff;
font-size: 14px;
}
}
.icon {
margin-right: 6px;
color: #409eff;
}
.booth-no {
color: #909399;
}
}
.detail-item {
margin-top: 16rpx;
background: linear-gradient(to bottom, #deecff 0%, #ffffff 100%);
box-shadow: 0 0 10rpx rgba(0, 95, 169, 0.19);
border-radius: 12rpx;
border: 2rpx solid #ffffff;
padding: 30rpx;
}
.name {
font-size: 32rpx;
font-weight: 600;
display: flex;
align-items: center;
justify-content: flex-end;
margin-top: 10rpx;
.status {
width: 160rpx;
text-align: center;
margin-left: 24rpx;
font-size: 24rpx;
background-size: 100% 100%;
font-weight: 600;
padding: 6rpx 0;
margin: 18rpx 0;
}
.btn {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
button {
margin: 10rpx;
font-size: 24rpx;
}
}
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
.tag {
width: 100%;
display: flex;
align-items: center;
gap: 16rpx;
flex-wrap: wrap;
.tag-item {
padding: 6rpx 30rpx;
border-radius: 6rpx;
background-color: #e5f1ff;
color: #589bff;
font-size: 28rpx;
&.success {
background-color: #e6f8eb;
color: #21aa5b;
} }
} }
} }
} }
.card-times { .gw {
display: flex;
align-items: center;
justify-content: space-between;
color: #1477f1;
font-weight: 600;
font-size: 30rpx;
}
}
}
}
.card-times {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@@ -722,7 +1027,7 @@
.line { .line {
width: 40rpx; width: 40rpx;
height: 0rpx; height: 0rpx;
border: 2rpx solid #D4D4D4; border: 2rpx solid #d4d4d4;
margin-top: 64rpx; margin-top: 64rpx;
} }
@@ -736,7 +1041,7 @@
.center-date { .center-date {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #FF881A; color: #ff881a;
} }
.center-dateDay { .center-dateDay {
@@ -747,14 +1052,14 @@
line-height: 48rpx; line-height: 48rpx;
width: 104rpx; width: 104rpx;
height: 48rpx; height: 48rpx;
background: #F9F9F9; background: #f9f9f9;
border-radius: 8rpx 8rpx 8rpx 8rpx; border-radius: 8rpx 8rpx 8rpx 8rpx;
} }
} }
} }
.footer { .footer {
background: #FFFFFF; background: #ffffff;
box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11, 44, 112, 0.12); box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11, 44, 112, 0.12);
border-radius: 0rpx 0rpx 0rpx 0rpx; border-radius: 0rpx 0rpx 0rpx 0rpx;
@@ -762,18 +1067,18 @@
.btn-wq { .btn-wq {
height: 90rpx; height: 90rpx;
background: #256BFA; background: #256bfa;
border-radius: 12rpx 12rpx 12rpx 12rpx; border-radius: 12rpx 12rpx 12rpx 12rpx;
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #ffffff;
text-align: center; text-align: center;
line-height: 90rpx line-height: 90rpx;
} }
.btn-desbel { .btn-desbel {
background: #6697FB; background: #6697fb;
box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11, 44, 112, 0.12); box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11, 44, 112, 0.12);
} }
} }
</style> </style>

View File

@@ -878,7 +878,7 @@ function navToService(serviceType) {
// 'skill-evaluation': '/pages/service/skill-evaluation', // 'skill-evaluation': '/pages/service/skill-evaluation',
"question-bank": "/pages/service/question-bank", "question-bank": "/pages/service/question-bank",
"quality-assessment": "/pages/service/quality-assessment", "quality-assessment": "/pages/service/quality-assessment",
"ai-interview": "/pages/chat/chat", "ai-interview": "/packageA/pages/chat/chat",
"job-search": "/pages/search/search", "job-search": "/pages/search/search",
"career-planning": "/pages/service/career-planning", "career-planning": "/pages/service/career-planning",
"salary-query": "/pages/service/salary-query", "salary-query": "/pages/service/salary-query",

View File

@@ -36,15 +36,6 @@
"navigationBarTitleText": "搜索职位" "navigationBarTitleText": "搜索职位"
} }
}, },
{
"path": "pages/chat/chat",
"style": {
"navigationBarTitleText": "智能客服",
"navigationBarBackgroundColor": "#4778EC",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/service/career-planning", "path": "pages/service/career-planning",
"style": { "style": {
@@ -331,6 +322,15 @@
"style": { "style": {
"navigationBarTitleText": "隐私政策" "navigationBarTitleText": "隐私政策"
} }
},
{
"path": "pages/chat/chat",
"style": {
"navigationBarTitleText": "智能客服",
"navigationBarBackgroundColor": "#4778EC",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
} }
] ]
}, },

View File

@@ -305,7 +305,7 @@
> >
<view v-for="(job, index) in list" :key="index" :slot="`slot${index}`"> <view v-for="(job, index) in list" :key="index" :slot="`slot${index}`">
<view class="item btn-feel" v-if="!job.recommend"> <view class="item btn-feel" v-if="!job.recommend">
<view class="falls-card" @click="nextDetail(job)"> <view class="falls-card" :class="{ 'disabled-card': Number(job.jobStatus) === 1 }" @click="nextDetail(job)">
<view class="falls-card-pay"> <view class="falls-card-pay">
<view class="pay-text"> <view class="pay-text">
<Salary-Expectation <Salary-Expectation
@@ -350,6 +350,17 @@
{{ job.companyName }} {{ job.companyName }}
</view> </view>
</view> </view>
<!-- 招聘者显示上下架开关 -->
<view class="falls-card-actions" v-if="isRecruiter">
<view class="job-status-switch" @click.stop="toggleJobStatus(job)">
<view class="switch-track" :class="{ 'active': Number(job.jobStatus) === 0 }">
<view class="switch-thumb" :class="{ 'active': Number(job.jobStatus) === 0 }"></view>
</view>
<view class="switch-label">
{{ Number(job.jobStatus) === 0 ? '已上架' : '已下架' }}
</view>
</view>
</view>
<!-- <view class="falls-card-matchingrate"> <!-- <view class="falls-card-matchingrate">
<view class=""><matchingDegree :job="job"></matchingDegree></view> <view class=""><matchingDegree :job="job"></matchingDegree></view>
<uni-icons type="star" size="30"></uni-icons> <uni-icons type="star" size="30"></uni-icons>
@@ -382,7 +393,7 @@
> >
<template v-slot:default="job"> <template v-slot:default="job">
<view class="item btn-feel" v-if="!job.recommend"> <view class="item btn-feel" v-if="!job.recommend">
<view class="falls-card" @click="nextDetail(job)"> <view class="falls-card" :class="{ 'disabled-card': Number(job.jobStatus) === 1 }" @click="nextDetail(job)">
<view class="falls-card-pay"> <view class="falls-card-pay">
<view class="pay-text"> <view class="pay-text">
<Salary-Expectation <Salary-Expectation
@@ -427,6 +438,17 @@
{{ job.companyName }} {{ job.companyName }}
</view> </view>
</view> </view>
<!-- 招聘者显示上下架开关 -->
<view class="falls-card-actions" v-if="isRecruiter">
<view class="job-status-switch" @click.stop="toggleJobStatus(job)">
<view class="switch-track" :class="{ 'active': Number(job.jobStatus) === 0 }">
<view class="switch-thumb" :class="{ 'active': Number(job.jobStatus) === 0 }"></view>
</view>
<view class="switch-label">
{{ Number(job.jobStatus) === 0 ? '已上架' : '已下架' }}
</view>
</view>
</view>
<!-- <view class="falls-card-matchingrate"> <!-- <view class="falls-card-matchingrate">
<view class=""><matchingDegree :job="job"></matchingDegree></view> <view class=""><matchingDegree :job="job"></matchingDegree></view>
<uni-icons type="star" size="30"></uni-icons> <uni-icons type="star" size="30"></uni-icons>
@@ -556,6 +578,25 @@ const shouldShowCompanyContent = computed(() => {
return userType === 0; return userType === 0;
}); });
// 判断当前用户是否为招聘者(企业用户)
const isRecruiter = computed(() => {
if (!hasLogin.value) {
return false;
}
// 优先从store获取如果为空则从缓存获取
const storeIsCompanyUser = userInfo.value?.isCompanyUser;
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const cachedIsCompanyUser = cachedUserInfo.isCompanyUser;
// 获取用户类型优先使用store中的isCompanyUser如果store中没有使用缓存中的isCompanyUser
// 缓存中的值可能是字符串,需要转换为数值类型
const userType = storeIsCompanyUser !== undefined ? Number(storeIsCompanyUser) : Number(cachedIsCompanyUser);
// 企业用户(isCompanyUser=0)是招聘者
return userType === 0;
});
import useDictStore from '@/stores/useDictStore'; import useDictStore from '@/stores/useDictStore';
const { getTransformChildren, oneDictData, dictLabel: getDictLabel, industryLabel } = useDictStore(); const { getTransformChildren, oneDictData, dictLabel: getDictLabel, industryLabel } = useDictStore();
import useLocationStore from '@/stores/useLocationStore'; import useLocationStore from '@/stores/useLocationStore';
@@ -1024,7 +1065,7 @@ function navToService(serviceType) {
// 'skill-evaluation': '/pages/service/skill-evaluation', // 'skill-evaluation': '/pages/service/skill-evaluation',
'question-bank': '/pages/service/question-bank', 'question-bank': '/pages/service/question-bank',
// 'quality-assessment': '/packageCa/search/search', // 'quality-assessment': '/packageCa/search/search',
// 'ai-interview': '/pages/chat/chat', // 'ai-interview': '/packageA/pages/chat/chat',
'job-search': '/pages/search/search', 'job-search': '/pages/search/search',
'career-planning': '/pages/service/career-planning', 'career-planning': '/pages/service/career-planning',
'salary-query': '/pages/service/salary-query', 'salary-query': '/pages/service/salary-query',
@@ -1144,6 +1185,9 @@ function getJobRecommend(type = 'add') {
// 只有企业用户(isCompanyUser=0)才添加current字段 // 只有企业用户(isCompanyUser=0)才添加current字段
if (userType === 0) { if (userType === 0) {
params.current = pageNull.value; params.current = pageNull.value;
} else {
// 求职者只显示已上架的岗位jobStatus=0
params.jobStatus = 0;
} }
let comd = { recommend: true, jobCategory: '', tip: '确认你的兴趣,为您推荐更多合适的岗位' }; let comd = { recommend: true, jobCategory: '', tip: '确认你的兴趣,为您推荐更多合适的岗位' };
$api.createRequest('/app/job/recommend', params).then((resData) => { $api.createRequest('/app/job/recommend', params).then((resData) => {
@@ -1218,6 +1262,18 @@ function getJobList(type = 'add') {
params.order = 0; params.order = 0;
} }
// 判断用户类型求职者只显示已上架的岗位jobStatus=0
// 优先从store获取如果为空则从缓存获取
const storeIsCompanyUser = userInfo.value?.isCompanyUser;
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const cachedIsCompanyUser = cachedUserInfo.isCompanyUser;
const userType = storeIsCompanyUser !== undefined ? Number(storeIsCompanyUser) : Number(cachedIsCompanyUser);
// 如果不是企业用户(求职者),只显示已上架的岗位
if (userType !== 0) {
params.jobStatus = 0;
}
$api.createRequest('/app/job/list', params).then((resData) => { $api.createRequest('/app/job/list', params).then((resData) => {
const { rows, total } = resData; const { rows, total } = resData;
if (type === 'add') { if (type === 'add') {
@@ -1240,6 +1296,93 @@ function getJobList(type = 'add') {
} }
}); });
} }
// 上架岗位
const jobUp = (jobId) => {
if (!checkLogin()) return;
uni.showLoading({
title: '处理中...',
mask: true
});
$api.createRequest(`/app/job/jobUp/${jobId}`, {}, 'PUT', true).then((res) => {
uni.hideLoading();
$api.msg('上架成功');
// 刷新数据
if (state.tabIndex === 'all') {
getJobRecommend('refresh');
} else {
getJobList('refresh');
}
}).catch((err) => {
uni.hideLoading();
console.error('上架失败:', err);
$api.msg('上架失败,请重试');
});
};
// 下架岗位
const jobDown = (jobId) => {
if (!checkLogin()) return;
uni.showLoading({
title: '处理中...',
mask: true
});
$api.createRequest(`/app/job/jobDown/${jobId}`, {}, 'PUT', true).then((res) => {
uni.hideLoading();
$api.msg('下架成功');
// 刷新数据
if (state.tabIndex === 'all') {
getJobRecommend('refresh');
} else {
getJobList('refresh');
}
}).catch((err) => {
uni.hideLoading();
console.error('下架失败:', err);
$api.msg('下架失败,请重试');
});
};
// 切换岗位状态(上架/下架)
const toggleJobStatus = (job) => {
if (!checkLogin()) return;
uni.showLoading({
title: '处理中...',
mask: true
});
// 根据当前状态决定调用哪个接口
const isCurrentlyUp = Number(job.jobStatus) === 0; // 0: 已上架, 1: 已下架
const apiUrl = isCurrentlyUp ? `/app/job/jobDown/${job.jobId}` : `/app/job/jobUp/${job.jobId}`;
$api.createRequest(apiUrl, {}, 'PUT', true).then((res) => {
uni.hideLoading();
$api.msg(isCurrentlyUp ? '下架成功' : '上架成功');
// 更新本地数据状态,避免立即刷新整个列表
const jobIndex = list.value.findIndex(item => item.jobId === job.jobId);
if (jobIndex !== -1) {
// 更新状态
list.value[jobIndex].jobStatus = isCurrentlyUp ? 1 : 0;
}
// 也可以选择刷新数据
// if (state.tabIndex === 'all') {
// getJobRecommend('refresh');
// } else {
// getJobList('refresh');
// }
}).catch((err) => {
uni.hideLoading();
console.error('操作失败:', err);
$api.msg(isCurrentlyUp ? '下架失败,请重试' : '上架失败,请重试');
});
};
const isFourLevelLinkagePurview=ref(false) const isFourLevelLinkagePurview=ref(false)
const getIsFourLevelLinkagePurview=()=>{ const getIsFourLevelLinkagePurview=()=>{
let userInfo = uni.getStorageSync('userInfo') let userInfo = uni.getStorageSync('userInfo')
@@ -2273,4 +2416,54 @@ defineExpose({ loadData });
color: #FFFFFF color: #FFFFFF
text-align: center text-align: center
white-space: nowrap white-space: nowrap
// 上下架开关样式
.falls-card-actions
margin-top: 20rpx
.job-status-switch
display: flex
align-items: center
justify-content: space-between
padding: 8rpx 0
.switch-track
width: 80rpx
height: 40rpx
background: #e0e0e0
border-radius: 20rpx
position: relative
transition: all 0.3s ease
cursor: pointer
&.active
background: #52c41a
.switch-thumb
position: absolute
top: 4rpx
left: 4rpx
width: 32rpx
height: 32rpx
background: #ffffff
border-radius: 50%
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2)
transition: all 0.3s ease
&.active
left: 44rpx
.switch-label
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif
font-weight: 500
font-size: 24rpx
color: #666666
margin-left: 16rpx
min-width: 80rpx
text-align: center
// 下架后卡片置灰样式
.disabled-card
opacity: 0.6
filter: grayscale(50%)
background: #f8f8f8 !important
.falls-card-title,
.falls-card-company,
.falls-card-pepleNumber,
.falls-card-company2
color: #999999 !important
</style> </style>