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,
text: '',
path: '/pages/chat/chat',
path: '/packageA/pages/chat/chat',
iconPath: '/static/tabbar/robot2.png',
selectedIconPath: '/static/tabbar/robot2.png',
centerItem: true,

View File

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

View File

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

View File

@@ -1,16 +1,11 @@
<template>
<AppLayout title="" :use-scroll-view="false">
<AppLayout title="单位详情" :use-scroll-view="false">
<template #headerleft>
<view class="btnback">
<image src="@/static/icon/back.png" @click="navBack"></image>
</view>
</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-top">
<view class="companyinfo-left">
@@ -22,6 +17,10 @@
{{ getScaleLabel(companyInfo?.scale) }}
</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 class="conetent-info" :class="{ expanded: isExpanded }">
<view class="info-title">公司介绍</view>
@@ -372,6 +371,37 @@
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>
<style lang="stylus" scoped>
@@ -399,33 +429,47 @@
flex-direction: column;
.content-top {
padding: 28rpx;
padding-top: 50rpx;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
padding: 28rpx;
padding-top: 50rpx;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
.companyinfo-left {
width: 96rpx;
height: 96rpx;
margin-right: 24rpx;
}
.companyinfo-right {
.row1 {
font-weight: 500;
font-size: 32rpx;
color: #333333;
.companyinfo-left {
width: 96rpx;
height: 96rpx;
margin-right: 24rpx;
}
.row2 {
font-weight: 400;
font-size: 28rpx;
color: #6C7282;
line-height: 45rpx;
.companyinfo-right {
flex: 1;
.row1 {
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
.row2 {
font-weight: 400;
font-size: 28rpx;
color: #6C7282;
line-height: 45rpx;
}
}
.companyinfo-collect {
width: 52rpx;
height: 52rpx;
margin-left: 20rpx;
image {
width: 100%;
height: 100%;
}
}
}
}
.conetent-info {
padding: 0 28rpx;

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -36,15 +36,6 @@
"navigationBarTitleText": "搜索职位"
}
},
{
"path": "pages/chat/chat",
"style": {
"navigationBarTitleText": "智能客服",
"navigationBarBackgroundColor": "#4778EC",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},
{
"path": "pages/service/career-planning",
"style": {
@@ -331,6 +322,15 @@
"style": {
"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 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="pay-text">
<Salary-Expectation
@@ -350,6 +350,17 @@
{{ job.companyName }}
</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=""><matchingDegree :job="job"></matchingDegree></view>
<uni-icons type="star" size="30"></uni-icons>
@@ -382,7 +393,7 @@
>
<template v-slot:default="job">
<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="pay-text">
<Salary-Expectation
@@ -427,6 +438,17 @@
{{ job.companyName }}
</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=""><matchingDegree :job="job"></matchingDegree></view>
<uni-icons type="star" size="30"></uni-icons>
@@ -556,6 +578,25 @@ const shouldShowCompanyContent = computed(() => {
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';
const { getTransformChildren, oneDictData, dictLabel: getDictLabel, industryLabel } = useDictStore();
import useLocationStore from '@/stores/useLocationStore';
@@ -1024,7 +1065,7 @@ function navToService(serviceType) {
// 'skill-evaluation': '/pages/service/skill-evaluation',
'question-bank': '/pages/service/question-bank',
// 'quality-assessment': '/packageCa/search/search',
// 'ai-interview': '/pages/chat/chat',
// 'ai-interview': '/packageA/pages/chat/chat',
'job-search': '/pages/search/search',
'career-planning': '/pages/service/career-planning',
'salary-query': '/pages/service/salary-query',
@@ -1144,6 +1185,9 @@ function getJobRecommend(type = 'add') {
// 只有企业用户(isCompanyUser=0)才添加current字段
if (userType === 0) {
params.current = pageNull.value;
} else {
// 求职者只显示已上架的岗位jobStatus=0
params.jobStatus = 0;
}
let comd = { recommend: true, jobCategory: '', tip: '确认你的兴趣,为您推荐更多合适的岗位' };
$api.createRequest('/app/job/recommend', params).then((resData) => {
@@ -1217,6 +1261,18 @@ function getJobList(type = 'add') {
if (pageState.search.order === 3 || pageState.search.order === 4) {
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) => {
const { rows, total } = resData;
@@ -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 getIsFourLevelLinkagePurview=()=>{
let userInfo = uni.getStorageSync('userInfo')
@@ -2273,4 +2416,54 @@ defineExpose({ loadData });
color: #FFFFFF
text-align: center
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>