16 changed files with 1518 additions and 25 deletions
@ -0,0 +1,207 @@ |
|||||
|
// subpages/index/recruitment/detail/detail.js
|
||||
|
import { recruitmentDetail } from '../../../../api/index' |
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
info: null, |
||||
|
id: '', |
||||
|
statusHeight: 0, |
||||
|
navigationHeight: 44, |
||||
|
otherJobs: [], // 其他职位列表
|
||||
|
currentPage: 1, |
||||
|
totalPages: 1 |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad(options) { |
||||
|
// 获取系统信息
|
||||
|
const systemInfo = wx.getSystemInfoSync() |
||||
|
this.setData({ |
||||
|
statusHeight: systemInfo.statusBarHeight, |
||||
|
navigationHeight: 44 |
||||
|
}) |
||||
|
|
||||
|
if(options.id){ |
||||
|
this.setData({ |
||||
|
id: options.id |
||||
|
}) |
||||
|
this.recruitmentDetail(options.id) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 获取招聘详情 |
||||
|
*/ |
||||
|
recruitmentDetail(id){ |
||||
|
wx.showLoading({ |
||||
|
title: '加载中...', |
||||
|
}) |
||||
|
|
||||
|
recruitmentDetail({ id: id }).then(res=>{ |
||||
|
wx.hideLoading() |
||||
|
if(res.code === 200){ |
||||
|
this.setData({ |
||||
|
info: res.data |
||||
|
}) |
||||
|
// 获取其他职位
|
||||
|
// this.getOtherJobs()
|
||||
|
} else { |
||||
|
wx.showToast({ |
||||
|
title: res.message || '获取详情失败', |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
wx.hideLoading() |
||||
|
wx.showToast({ |
||||
|
title: '网络错误', |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 返回上一页 |
||||
|
*/ |
||||
|
handleGoToBack() { |
||||
|
wx.navigateBack() |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 获取其他职位 |
||||
|
*/ |
||||
|
getOtherJobs() { |
||||
|
// 模拟其他职位数据
|
||||
|
// const mockOtherJobs = [
|
||||
|
// {
|
||||
|
// id: 1001,
|
||||
|
// position: '质量工程师',
|
||||
|
// minWage: '9',
|
||||
|
// maxWage: '12',
|
||||
|
// publishTime: '2025-08-13',
|
||||
|
// minEdu: '本科',
|
||||
|
// workExp: '不限'
|
||||
|
// },
|
||||
|
// {
|
||||
|
// id: 1002,
|
||||
|
// position: '销售工程师',
|
||||
|
// minWage: '10',
|
||||
|
// maxWage: '18',
|
||||
|
// publishTime: '2025-08-13',
|
||||
|
// minEdu: '本科',
|
||||
|
// workExp: '不限'
|
||||
|
// },
|
||||
|
// {
|
||||
|
// id: 1003,
|
||||
|
// position: '光学工程师',
|
||||
|
// minWage: '7',
|
||||
|
// maxWage: '9',
|
||||
|
// publishTime: '2025-08-13',
|
||||
|
// minEdu: '本科',
|
||||
|
// workExp: '不限'
|
||||
|
// }
|
||||
|
// ]
|
||||
|
|
||||
|
// this.setData({
|
||||
|
// otherJobs: mockOtherJobs,
|
||||
|
// totalPages: 1
|
||||
|
// })
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 点击其他职位 |
||||
|
*/ |
||||
|
onOtherJobTap(e) { |
||||
|
const item = e.currentTarget.dataset.item |
||||
|
wx.navigateTo({ |
||||
|
url: `/subpages/index/recruitment/detail/detail?id=${item.id}` |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 上一页 |
||||
|
*/ |
||||
|
onPrevPage() { |
||||
|
if (this.data.currentPage > 1) { |
||||
|
this.setData({ |
||||
|
currentPage: this.data.currentPage - 1 |
||||
|
}) |
||||
|
// 这里可以调用API获取对应页面的数据
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 下一页 |
||||
|
*/ |
||||
|
onNextPage() { |
||||
|
if (this.data.currentPage < this.data.totalPages) { |
||||
|
this.setData({ |
||||
|
currentPage: this.data.currentPage + 1 |
||||
|
}) |
||||
|
// 这里可以调用API获取对应页面的数据
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 申请职位 |
||||
|
*/ |
||||
|
onApply() { |
||||
|
wx.showToast({ |
||||
|
title: '申请成功', |
||||
|
icon: 'success' |
||||
|
}) |
||||
|
}, |
||||
|
/** |
||||
|
* 生命周期函数--监听页面初次渲染完成 |
||||
|
*/ |
||||
|
onReady() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面显示 |
||||
|
*/ |
||||
|
onShow() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面隐藏 |
||||
|
*/ |
||||
|
onHide() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面卸载 |
||||
|
*/ |
||||
|
onUnload() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面相关事件处理函数--监听用户下拉动作 |
||||
|
*/ |
||||
|
onPullDownRefresh() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面上拉触底事件的处理函数 |
||||
|
*/ |
||||
|
onReachBottom() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 用户点击右上角分享 |
||||
|
*/ |
||||
|
onShareAppMessage() { |
||||
|
|
||||
|
} |
||||
|
}) |
@ -0,0 +1,8 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"van-icon": "@vant/weapp/icon/index", |
||||
|
"van-button": "@vant/weapp/button/index", |
||||
|
"van-loading": "@vant/weapp/loading/index" |
||||
|
}, |
||||
|
"navigationStyle": "custom" |
||||
|
} |
@ -0,0 +1,111 @@ |
|||||
|
<!-- subpages/index/recruitment/detail/detail.wxml --> |
||||
|
<view class="detail-container" style="background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.8) 80%, rgba(255,255,255,1) 100%),linear-gradient(to right, #befeed 0%, #d5eefe 50%, #ebe9fb 100%);background-size: 100% 400rpx, 100% 400rpx;background-repeat: no-repeat;"> |
||||
|
<!-- 头部 --> |
||||
|
<view class="header"> |
||||
|
<view class="navigation-back" bind:tap="handleGoToBack" style="top: {{statusHeight}}px;"> |
||||
|
<van-icon name="arrow-left" size="50rpx" color="#333333" /> |
||||
|
</view> |
||||
|
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;line-height:{{navigationHeight}}px;text-align: center;"> |
||||
|
职位详情 |
||||
|
</view> |
||||
|
</view> |
||||
|
<!-- 内容区域 --> |
||||
|
<view class="content-body" wx:if="{{info}}"> |
||||
|
<!-- 职位基本信息 --> |
||||
|
<view class="job-basic-info"> |
||||
|
<view class="flex flex-sb"> |
||||
|
<view class="job-title">{{info.positionCategory || ''}}</view> |
||||
|
<view class="job-salary" style="color: #0fb3a2;"> |
||||
|
{{info.minWage || ''}}-{{info.maxWage || ''}}k |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="job-meta"> |
||||
|
<text class="meta-item" wx:if="{{info.minEdu}}">{{info.minEdu || ''}}</text> |
||||
|
<text class="meta-item" wx:if="{{info.workExp}}">{{info.workExp || ''}}</text> |
||||
|
<text class="meta-item" wx:if="{{info.recruitingNumbers}}">{{info.recruitingNumbers }}人</text> |
||||
|
</view> |
||||
|
<view class="job-time"> |
||||
|
<text>招聘时间: {{info.startTime || ''}}至{{info.endTime || ''}}</text> |
||||
|
<text >发布: {{info.releaseTime || ''}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
<!-- 职位详情 --> |
||||
|
<view class="job-detail-section"> |
||||
|
<view class="section-title">职位详情</view> |
||||
|
<view class="detail-content"> |
||||
|
<!-- <view class="detail-item"> |
||||
|
<text class="item-title">任职要求:</text> |
||||
|
<view class="item-content"> |
||||
|
<text>1. 统招本科学历,1年及以上Java开发经验,人在青岛,不接受外地人员;</text> |
||||
|
<text>2. 掌握Java基础,掌握Mysql等主流数据库的使用;</text> |
||||
|
<text>3. 精通Spring、Spring Boot、Mybatis等主流框架;</text> |
||||
|
<text>4. 熟悉SpringCloud微服务开发,熟练使用相关组件;</text> |
||||
|
<text>5. 熟悉分布式系统开发,熟悉Nginx、Redis、MQ、ES等中间件技术;</text> |
||||
|
<text>6. 具备良好的沟通能力,团队合作精神,责任心强;</text> |
||||
|
</view> |
||||
|
</view> --> |
||||
|
<view class="detail-item"> |
||||
|
<text class="item-title">岗位描述:</text> |
||||
|
<view class="item-content"> |
||||
|
<text>{{info.jobDescription || '无'}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
<!-- <view class="detail-item"> |
||||
|
<text class="item-title">其他描述:</text> |
||||
|
<view class="item-content"> |
||||
|
<text>无</text> |
||||
|
</view> |
||||
|
</view> --> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 公司详情 --> |
||||
|
<view class="company-detail-section"> |
||||
|
<view class="section-title">公司详情</view> |
||||
|
<view class="company-info-card"> |
||||
|
<view class="company-header"> |
||||
|
<view class="flex "> |
||||
|
<view class="company-basic"> |
||||
|
<view class="company-name">{{info.companyName || ''}}</view> |
||||
|
<view class="company-tags"> |
||||
|
<text class="tag">{{info.area || ''}}</text> |
||||
|
<text class="tag">{{info.companyType || ''}}</text> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="company-contact"> |
||||
|
<van-icon name="location-o" /><text class="contact-item"> {{info.companyAddr || ''}}</text> |
||||
|
</view> |
||||
|
<view class="company-contact mt-10"> |
||||
|
<van-icon name="phone-o" /><text class="contact-item"> {{info.contactPerson}}{{info.contactPhone || ''}}</text> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="company-description"> |
||||
|
<text>{{info.companyProfile || ''}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 其他职位 --> |
||||
|
<!-- <view class="other-jobs-section"> |
||||
|
<view class="section-title">其他职位</view> |
||||
|
<view class="job-item" wx:for="{{otherJobs}}" wx:key="id" bind:tap="onOtherJobTap" data-item="{{item}}"> |
||||
|
<view class="job-header"> |
||||
|
<view class="job-title-small">{{item.position}}</view> |
||||
|
<view class="job-salary-small" style="color: #0fb3a2;">{{item.minWage}}-{{item.maxWage}}k</view> |
||||
|
</view> |
||||
|
<view class="job-meta-small"> |
||||
|
<text class="meta-small">{{item.publishTime}}</text> |
||||
|
<text class="meta-small">{{item.minEdu}}</text> |
||||
|
<text class="meta-small">{{item.workExp}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> --> |
||||
|
</view> |
||||
|
<!-- 加载状态 --> |
||||
|
<view class="loading-section" wx:if="{{!info}}"> |
||||
|
<van-loading size="40rpx" text="加载中..." /> |
||||
|
</view> |
||||
|
</view> |
@ -0,0 +1,311 @@ |
|||||
|
/* subpages/index/recruitment/detail/detail.wxss */ |
||||
|
|
||||
|
.detail-container { |
||||
|
background-color: #f8f8f8; |
||||
|
min-height: 100vh; |
||||
|
} |
||||
|
|
||||
|
/* 头部样式 - 继承自recruitment页面 */ |
||||
|
.header { |
||||
|
width: 100%; |
||||
|
position: relative; |
||||
|
} |
||||
|
|
||||
|
.navigation { |
||||
|
width: 100%; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
color: #333333; |
||||
|
font-size: 30rpx; |
||||
|
position: relative; |
||||
|
z-index: 10; |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
|
||||
|
.navigation-back { |
||||
|
position: absolute; |
||||
|
left: 0rpx; |
||||
|
z-index: 1000; |
||||
|
width: 80rpx; |
||||
|
height: 80rpx; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
border-radius: 50%; |
||||
|
} |
||||
|
|
||||
|
/* 通用flex样式 */ |
||||
|
.flex { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.flex-sb { |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
/* 内容区域 */ |
||||
|
.content-body { |
||||
|
padding: 20rpx; |
||||
|
margin-top: 50rpx; |
||||
|
} |
||||
|
|
||||
|
/* 职位基本信息卡片 */ |
||||
|
.job-basic-info { |
||||
|
border-radius: 12rpx; |
||||
|
padding: 30rpx; |
||||
|
margin-bottom: 20rpx; |
||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
|
||||
|
.job-title { |
||||
|
font-size: 36rpx; |
||||
|
font-weight: bold; |
||||
|
color: #333; |
||||
|
margin-bottom: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.job-salary { |
||||
|
font-size: 32rpx; |
||||
|
font-weight: bold; |
||||
|
margin-bottom: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.job-meta { |
||||
|
display: flex; |
||||
|
gap: 20rpx; |
||||
|
margin-bottom: 20rpx; |
||||
|
flex-wrap: wrap; |
||||
|
} |
||||
|
|
||||
|
.meta-item { |
||||
|
font-size: 26rpx; |
||||
|
color: #666; |
||||
|
background-color: #f5f5f5; |
||||
|
padding: 8rpx 16rpx; |
||||
|
border-radius: 4rpx; |
||||
|
} |
||||
|
|
||||
|
.job-time { |
||||
|
font-size: 24rpx; |
||||
|
color: #999; |
||||
|
border-top: 1rpx solid #f0f0f0; |
||||
|
padding-top: 20rpx; |
||||
|
line-height: 1.6; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
/* 职位详情部分 */ |
||||
|
.job-detail-section { |
||||
|
background-color: #fff; |
||||
|
border-radius: 12rpx; |
||||
|
padding: 30rpx; |
||||
|
margin-bottom: 50rpx; |
||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
|
||||
|
.section-title { |
||||
|
font-size: 32rpx; |
||||
|
font-weight: bold; |
||||
|
color: #333; |
||||
|
margin-bottom: 20rpx; |
||||
|
padding-bottom: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.detail-content { |
||||
|
line-height: 1.6; |
||||
|
} |
||||
|
|
||||
|
.detail-item { |
||||
|
margin-bottom: 30rpx; |
||||
|
} |
||||
|
|
||||
|
.item-title { |
||||
|
font-size: 28rpx; |
||||
|
font-weight: 600; |
||||
|
color: #333; |
||||
|
display: block; |
||||
|
margin-bottom: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.item-content { |
||||
|
font-size: 26rpx; |
||||
|
color: #666; |
||||
|
line-height: 1.8; |
||||
|
} |
||||
|
|
||||
|
.item-content text { |
||||
|
display: block; |
||||
|
margin-bottom: 8rpx; |
||||
|
} |
||||
|
|
||||
|
/* 底部操作按钮 */ |
||||
|
.action-buttons { |
||||
|
position: fixed; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
right: 0; |
||||
|
background-color: #fff; |
||||
|
padding: 20rpx 30rpx; |
||||
|
box-shadow: 0 -2rpx 8rpx rgba(0, 0, 0, 0.1); |
||||
|
z-index: 100; |
||||
|
} |
||||
|
|
||||
|
/* 公司详情部分 */ |
||||
|
.company-detail-section { |
||||
|
background-color: #fff; |
||||
|
border-radius: 12rpx; |
||||
|
padding: 30rpx; |
||||
|
margin-bottom: 20rpx; |
||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
|
||||
|
.company-info-card { |
||||
|
border-radius: 8rpx; |
||||
|
} |
||||
|
|
||||
|
.company-header { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
margin-bottom: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.company-logo { |
||||
|
width: 120rpx; |
||||
|
height: 120rpx; |
||||
|
margin-right: 20rpx; |
||||
|
border-radius: 8rpx; |
||||
|
overflow: hidden; |
||||
|
background-color: #f5f5f5; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
} |
||||
|
|
||||
|
.logo-image { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
border-radius: 8rpx; |
||||
|
} |
||||
|
|
||||
|
.company-basic { |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.company-name { |
||||
|
font-size: 32rpx; |
||||
|
font-weight: bold; |
||||
|
color: #333; |
||||
|
margin-bottom: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.company-tags { |
||||
|
display: flex; |
||||
|
gap: 12rpx; |
||||
|
margin-bottom: 15rpx; |
||||
|
} |
||||
|
|
||||
|
.tag { |
||||
|
font-size: 24rpx; |
||||
|
color: #666; |
||||
|
background-color: #f5f5f5; |
||||
|
padding: 4rpx 12rpx; |
||||
|
border-radius: 4rpx; |
||||
|
} |
||||
|
|
||||
|
.company-contact { |
||||
|
display: flex; |
||||
|
/* flex-direction: column; */ |
||||
|
gap: 8rpx; |
||||
|
} |
||||
|
|
||||
|
.contact-item { |
||||
|
font-size: 24rpx; |
||||
|
color: #666; |
||||
|
line-height: 1.4; |
||||
|
} |
||||
|
|
||||
|
.company-description { |
||||
|
font-size: 26rpx; |
||||
|
color: #666; |
||||
|
line-height: 1.8; |
||||
|
text-align: justify; |
||||
|
} |
||||
|
|
||||
|
/* 其他职位部分 */ |
||||
|
.other-jobs-section { |
||||
|
background-color: #fff; |
||||
|
border-radius: 12rpx; |
||||
|
padding: 30rpx; |
||||
|
margin-bottom: 20rpx; |
||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
|
||||
|
.other-jobs-section .job-item { |
||||
|
border: 1rpx solid #f0f0f0; |
||||
|
border-radius: 8rpx; |
||||
|
padding: 20rpx; |
||||
|
margin-bottom: 15rpx; |
||||
|
background-color: #fafafa; |
||||
|
} |
||||
|
|
||||
|
.other-jobs-section .job-item:last-child { |
||||
|
margin-bottom: 0; |
||||
|
} |
||||
|
|
||||
|
.job-title-small { |
||||
|
font-size: 28rpx; |
||||
|
font-weight: 600; |
||||
|
color: #333; |
||||
|
} |
||||
|
|
||||
|
.job-salary-small { |
||||
|
font-size: 26rpx; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
|
||||
|
.job-meta-small { |
||||
|
display: flex; |
||||
|
gap: 15rpx; |
||||
|
margin-top: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.meta-small { |
||||
|
font-size: 22rpx; |
||||
|
color: #999; |
||||
|
background-color: #f0f0f0; |
||||
|
padding: 4rpx 8rpx; |
||||
|
border-radius: 4rpx; |
||||
|
} |
||||
|
|
||||
|
/* 分页导航 */ |
||||
|
.pagination { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
gap: 30rpx; |
||||
|
padding: 20rpx; |
||||
|
background-color: #fff; |
||||
|
border-radius: 12rpx; |
||||
|
margin-bottom: 100rpx; |
||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
|
||||
|
.page-info { |
||||
|
font-size: 26rpx; |
||||
|
color: #666; |
||||
|
min-width: 80rpx; |
||||
|
text-align: center; |
||||
|
} |
||||
|
|
||||
|
/* 加载状态 */ |
||||
|
.loading-section { |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
padding: 100rpx 40rpx; |
||||
|
min-height: 50vh; |
||||
|
} |
@ -0,0 +1,276 @@ |
|||||
|
// subpages/index/recruitment/recruitment.js
|
||||
|
import { recruitmentList,dictDataList,getDetailByGraduateId,getPostListByType } from "../../../api/index" |
||||
|
const app = getApp(); |
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
searchValue: '', |
||||
|
areaValue: '', |
||||
|
industryValue: '', |
||||
|
positionValue: '', // 默认选中"岗位"
|
||||
|
salaryValue: '', |
||||
|
showTip: true, |
||||
|
loading: false, |
||||
|
navigationHeight: 44, |
||||
|
statusHeight: 20, |
||||
|
jobList: [], |
||||
|
// 筛选选项
|
||||
|
areaOptions: [], |
||||
|
industryOptions: [], |
||||
|
positionOptions: [ |
||||
|
{ text: '岗位', value: '' }, |
||||
|
], |
||||
|
salaryOptions: [], |
||||
|
userInfo: {}, |
||||
|
recommendShow: true |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad(options) { |
||||
|
// 获取系统信息,设置导航栏高度
|
||||
|
const systemInfo = wx.getSystemInfoSync(); |
||||
|
const navigationHeight = systemInfo.platform === 'ios' ? 44 : 48; |
||||
|
this.setData({ |
||||
|
navigationHeight: navigationHeight, |
||||
|
statusHeight: systemInfo.statusBarHeight |
||||
|
}); |
||||
|
this.getDictData(); |
||||
|
if(options.recommendShow){ |
||||
|
this.setData({ |
||||
|
recommendShow:false |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
async getDetailByGraduateId() { |
||||
|
try { |
||||
|
const res = await getDetailByGraduateId({ graduateId: app.globalData.userInfo.graduateId }); |
||||
|
if (res.code === 200) { |
||||
|
this.setData({ |
||||
|
userInfo: res.data || {}, |
||||
|
showTip: res.data.hopeWorkAddress && res.data.hopeCareer && res.data.hopeSalary&&res.data.hopePosition, |
||||
|
areaValue:this.data.areaOptions.find(item => item.dictValue == res.data.hopeWorkAddress)?.text || '', |
||||
|
industryValue:this.data.industryOptions.find(item => item.dictValue == res.data.hopeCareer)?.text || '', |
||||
|
salaryValue:this.data.salaryOptions.find(item => item.dictValue == res.data.hopeSalary)?.text || '', |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} catch (error) { |
||||
|
if(error.data){ |
||||
|
this.setData({ |
||||
|
userInfo: error.data || {}, |
||||
|
showTip: error.data.hopeWorkAddress && error.data.hopeCareer && error.data.hopeSalary&&error.data.hopePosition, |
||||
|
areaValue:this.data.areaOptions.find(item => item.dictValue == error.data.hopeWorkAddress)?.text || '', |
||||
|
industryValue:this.data.industryOptions.find(item => item.dictValue == error.data.hopeCareer)?.text || '', |
||||
|
salaryValue:this.data.salaryOptions.find(item => item.dictValue == error.data.hopeSalary)?.text || '', |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} finally { |
||||
|
this.getPostListByType() |
||||
|
this.loadJobList(); |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
async getDictData() { |
||||
|
try { |
||||
|
const res1 = await dictDataList({ dictType: 'sys_career' }); |
||||
|
if (res1.code === 200) { |
||||
|
this.setData({ |
||||
|
industryOptions: [ |
||||
|
{ text: '行业', value: '' }, |
||||
|
...res1.rows.map(item => ({ |
||||
|
text: item.dictLabel, |
||||
|
value:item.dictLabel, |
||||
|
...item |
||||
|
})) |
||||
|
] |
||||
|
}); |
||||
|
} |
||||
|
const res2 = await dictDataList({ dictType: 'sys_salary' }); |
||||
|
if (res2.code === 200) { |
||||
|
this.setData({ |
||||
|
salaryOptions: [ |
||||
|
{ text: '薪资', value: '' }, |
||||
|
...res2.rows.map(item => ({ |
||||
|
text: item.dictLabel, |
||||
|
value:item.dictLabel, |
||||
|
...item |
||||
|
})) |
||||
|
] |
||||
|
}); |
||||
|
} |
||||
|
const res3 = await dictDataList({ dictType: 'working_place' }); |
||||
|
if (res3.code === 200) { |
||||
|
this.setData({ |
||||
|
areaOptions: [ |
||||
|
{ text: '区域', value: '' }, |
||||
|
...res3.rows.map(item => ({ |
||||
|
text: item.dictLabel, |
||||
|
value:item.dictLabel, |
||||
|
...item |
||||
|
})) |
||||
|
] |
||||
|
}); |
||||
|
} |
||||
|
this.getDetailByGraduateId(); |
||||
|
} catch (error) { |
||||
|
console.error('获取字典数据失败:', error); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 搜索 |
||||
|
*/ |
||||
|
onSearch() { |
||||
|
console.log('搜索关键词:', this.data.searchValue); |
||||
|
this.loadJobList(); |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 城区筛选 |
||||
|
*/ |
||||
|
onAreaChange(event) { |
||||
|
this.setData({ |
||||
|
areaValue: event.detail |
||||
|
}); |
||||
|
this.loadJobList(); |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 行业筛选 |
||||
|
*/ |
||||
|
onIndustryChange(event) { |
||||
|
this.setData({ |
||||
|
industryValue: event.detail, |
||||
|
}); |
||||
|
this.getPostListByType(true); |
||||
|
this.loadJobList(); |
||||
|
}, |
||||
|
async getPostListByType(change) { |
||||
|
const res = await getPostListByType({ type: this.data.industryValue }); |
||||
|
if (res.code === 200) { |
||||
|
// 重置岗位选项,确保"岗位"选项在最前面
|
||||
|
const basePositionOptions = [{ text: '岗位', value: '' }]; |
||||
|
const newPositionOptions = res.data.map(item => ({ |
||||
|
text: item, |
||||
|
value: item, |
||||
|
})); |
||||
|
this.setData({ |
||||
|
positionOptions: [ |
||||
|
...basePositionOptions, |
||||
|
...newPositionOptions |
||||
|
], |
||||
|
positionValue:change?'':this.data.userInfo.hopePosition?this.data.userInfo.hopePosition:'' // 设置为空字符串,对应"岗位"选项的value
|
||||
|
}); |
||||
|
console.log(this.data.positionOptions,this.data.positionValue); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 岗位筛选 |
||||
|
*/ |
||||
|
onPositionChange(event) { |
||||
|
this.setData({ |
||||
|
positionValue: event.detail |
||||
|
}); |
||||
|
this.loadJobList(); |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 薪资筛选 |
||||
|
*/ |
||||
|
onSalaryChange(event) { |
||||
|
this.setData({ |
||||
|
salaryValue: event.detail |
||||
|
}); |
||||
|
this.loadJobList(); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 去完善信息 |
||||
|
*/ |
||||
|
goComplete() { |
||||
|
wx.navigateTo({ |
||||
|
url: '/subpages/mine/editUser/editUser' |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 点击职位 |
||||
|
*/ |
||||
|
onJobTap(event) { |
||||
|
const item = event.currentTarget.dataset.item; |
||||
|
wx.navigateTo({ |
||||
|
url: `/subpages/index/recruitment/detail/detail?id=${item.id}` |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 加载职位列表 |
||||
|
*/ |
||||
|
async loadJobList() { |
||||
|
this.setData({ |
||||
|
loading: true |
||||
|
}); |
||||
|
|
||||
|
try { |
||||
|
const res = await recruitmentList({ |
||||
|
position:this.data.positionValue, |
||||
|
positionCategory: this.data.industryValue, |
||||
|
workAddr: this.data.areaValue, |
||||
|
hopeWage: this.data.salaryValue, |
||||
|
searchKeyword: this.data.searchValue, |
||||
|
}); |
||||
|
|
||||
|
if (res.code === 200) { |
||||
|
this.setData({ |
||||
|
jobList: res.rows || [], |
||||
|
loading: false |
||||
|
}); |
||||
|
} else { |
||||
|
this.setData({ |
||||
|
loading: false |
||||
|
}); |
||||
|
wx.showToast({ |
||||
|
title: '加载失败', |
||||
|
icon: 'none' |
||||
|
}); |
||||
|
} |
||||
|
} catch (error) { |
||||
|
console.error('加载招聘列表失败:', error); |
||||
|
this.setData({ |
||||
|
loading: false |
||||
|
}); |
||||
|
wx.showToast({ |
||||
|
title: '网络错误', |
||||
|
icon: 'none' |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面上拉触底事件的处理函数 |
||||
|
*/ |
||||
|
onReachBottom() { |
||||
|
// this.loadJobList();
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面相关事件处理函数--监听用户下拉动作 |
||||
|
*/ |
||||
|
onPullDownRefresh() { |
||||
|
this.loadJobList(); |
||||
|
wx.stopPullDownRefresh(); |
||||
|
}, |
||||
|
handleGoToBack() { |
||||
|
wx.navigateBack({ |
||||
|
delta: 1 |
||||
|
}); |
||||
|
} |
||||
|
}) |
@ -0,0 +1,11 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"van-search": "@vant/weapp/search/index", |
||||
|
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index", |
||||
|
"van-dropdown-item": "@vant/weapp/dropdown-item/index", |
||||
|
"van-tag": "@vant/weapp/tag/index", |
||||
|
"van-button": "@vant/weapp/button/index", |
||||
|
"van-icon": "@vant/weapp/icon/index" |
||||
|
}, |
||||
|
"navigationStyle": "custom" |
||||
|
} |
@ -0,0 +1,105 @@ |
|||||
|
<!--subpages/index/recruitment/recruitment.wxml--> |
||||
|
<view class="recruitment-container" > |
||||
|
<!-- 头部 --> |
||||
|
<view class="header"> |
||||
|
<view class="navigation-back" bind:tap="handleGoToBack" style="top: {{statusHeight + 10}}px;"> |
||||
|
<van-icon name="arrow-left" size="50rpx" color="#333333" /> |
||||
|
</view> |
||||
|
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;line-height:{{navigationHeight}}px;text-align: center;"> |
||||
|
{{recommendShow ? '招聘信息' : '推荐岗位'}} |
||||
|
</view> |
||||
|
<!-- 搜索框 --> |
||||
|
<view class="search-section" style="margin-top: {{statusHeight}}px;" wx:if="{{recommendShow}}"> |
||||
|
<van-search |
||||
|
model:value="{{ searchValue }}" |
||||
|
placeholder="请输入职位/公司" |
||||
|
bind:search="onSearch" |
||||
|
shape="round" |
||||
|
background="transparent" |
||||
|
field-style="background: #fff; border-radius: 50rpx;" |
||||
|
> |
||||
|
</van-search> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 内容区域 --> |
||||
|
<view class="content-body"> |
||||
|
<!-- 筛选下拉菜单 --> |
||||
|
<view class="filter-section" wx:if="{{recommendShow}}"> |
||||
|
<van-dropdown-menu active-color="#01bbaf"> |
||||
|
<van-dropdown-item |
||||
|
model:value="{{ areaValue }}" |
||||
|
options="{{ areaOptions }}" |
||||
|
bind:change="onAreaChange" |
||||
|
/> |
||||
|
<van-dropdown-item |
||||
|
model:value="{{ industryValue }}" |
||||
|
options="{{ industryOptions }}" |
||||
|
bind:change="onIndustryChange" |
||||
|
/> |
||||
|
<van-dropdown-item |
||||
|
model:value="{{ positionValue }}" |
||||
|
options="{{ positionOptions }}" |
||||
|
bind:change="onPositionChange" |
||||
|
/> |
||||
|
<van-dropdown-item |
||||
|
model:value="{{ salaryValue }}" |
||||
|
options="{{ salaryOptions }}" |
||||
|
bind:change="onSalaryChange" |
||||
|
/> |
||||
|
</van-dropdown-menu> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 温馨提示 --> |
||||
|
<view class="tip-section" wx:if="{{ !showTip }}"> |
||||
|
<view class="tip-content"> |
||||
|
<van-icon name="warning" size="32rpx" color="#ff9500" /> |
||||
|
<text class="tip-text">您尚未填写意向岗位,请补充完善信息。</text> |
||||
|
<van-button size="mini" round color="#f1a113" bind:click="goComplete">去完善</van-button> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 职位列表 --> |
||||
|
<view class="job-list"> |
||||
|
|
||||
|
<view class="job-item" wx:for="{{ jobList }}" wx:key="id" bind:tap="onJobTap" data-item="{{ item }}"> |
||||
|
<view class="job-header"> |
||||
|
<view class="job-title">{{ item.positionCategory }}</view> |
||||
|
<view class="job-salary" style="color: #0fb3a2;">{{ item.minWage }}-{{ item.maxWage }}</view> |
||||
|
</view> |
||||
|
<view class="job-info"> |
||||
|
<text class="job-date" wx:if="{{item.startTime}}">{{ item.startTime ||''}}</text> |
||||
|
<text class="job-degree" wx:if="{{item.minEdu}}">{{ item.minEdu||'' }}</text> |
||||
|
<text class="job-experience" wx:if="{{item.workExp}}">{{ item.workExp ||''}}</text> |
||||
|
</view> |
||||
|
<view class="company-info"> |
||||
|
<text class="company-name">{{ item.companyName ||'' }}</text> |
||||
|
<text class="company-source">来源: 招聘e站</text> |
||||
|
</view> |
||||
|
<!-- <view class="job-tags" wx:if="{{ item.benefits && item.benefits.length > 0 }}"> |
||||
|
<van-tag |
||||
|
wx:for="{{ item.benefits }}" |
||||
|
wx:for-item="benefits" |
||||
|
wx:key="*this" |
||||
|
size="small" |
||||
|
type="primary" |
||||
|
plain |
||||
|
> |
||||
|
{{ tag.benefits }} |
||||
|
</van-tag> |
||||
|
</view> --> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 加载更多 --> |
||||
|
<view class="loading-section" wx:if="{{ loading }}"> |
||||
|
<text>加载中...</text> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 暂无数据 --> |
||||
|
<view class="empty-section" wx:if="{{ !loading && jobList.length === 0 }}"> |
||||
|
<image src="../../../images/icon/zwsj.png" class="empty-image" /> |
||||
|
<text class="empty-text">暂无招聘信息</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
@ -0,0 +1,195 @@ |
|||||
|
/* subpages/index/recruitment/recruitment.wxss */ |
||||
|
|
||||
|
.recruitment-container { |
||||
|
background-color: #f8f8f8; |
||||
|
min-height: 100vh; |
||||
|
} |
||||
|
|
||||
|
/* 头部样式 */ |
||||
|
.header { |
||||
|
width: 100%; |
||||
|
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.8) 80%, rgba(255,255,255,1) 100%),linear-gradient(to right, #befeed 0%, #d5eefe 50%, #ebe9fb 100%);background-size: 100% 300rpx, 100% 300rpx;background-repeat: no-repeat; |
||||
|
position: relative; |
||||
|
height: 240rpx; |
||||
|
} |
||||
|
.content-body{ |
||||
|
margin-top: 40rpx; |
||||
|
} |
||||
|
.navigation { |
||||
|
width: 100%; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
color: #333333; |
||||
|
font-size: 30rpx; |
||||
|
position: relative; |
||||
|
z-index: 10; |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
|
||||
|
/* 搜索框样式 */ |
||||
|
.search-section { |
||||
|
padding:0 30rpx ; |
||||
|
} |
||||
|
|
||||
|
/* 自定义搜索框内部样式 */ |
||||
|
.van-search__content { |
||||
|
background: #fff !important; |
||||
|
border-radius: 50rpx !important; |
||||
|
border: 1rpx solid #e5e5e5 !important; |
||||
|
} |
||||
|
|
||||
|
.van-search__field { |
||||
|
background: #fff !important; |
||||
|
border-radius: 50rpx !important; |
||||
|
} |
||||
|
|
||||
|
.van-field__input { |
||||
|
border-radius: 50rpx !important; |
||||
|
} |
||||
|
|
||||
|
/* 筛选区域样式 */ |
||||
|
.filter-section { |
||||
|
background-color: #fff; |
||||
|
border-top: 1rpx solid #eee; |
||||
|
} |
||||
|
|
||||
|
/* 温馨提示样式 */ |
||||
|
.tip-section { |
||||
|
background-color: #fff5e6; |
||||
|
border: 1rpx solid #ffcc99; |
||||
|
margin: 20rpx; |
||||
|
border-radius: 8rpx; |
||||
|
} |
||||
|
|
||||
|
.tip-content { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
padding: 20rpx; |
||||
|
} |
||||
|
.navigation-back{ |
||||
|
position: absolute; |
||||
|
left: 0rpx; |
||||
|
z-index: 1000; |
||||
|
width: 80rpx; |
||||
|
height: 80rpx; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
border-radius: 50%; |
||||
|
} |
||||
|
.tip-text { |
||||
|
flex: 1; |
||||
|
margin-left: 12rpx; |
||||
|
font-size: 28rpx; |
||||
|
} |
||||
|
|
||||
|
/* 职位列表样式 */ |
||||
|
.job-list { |
||||
|
padding: 0 20rpx; |
||||
|
} |
||||
|
|
||||
|
.job-item { |
||||
|
background-color: #fff; |
||||
|
border-radius: 12rpx; |
||||
|
padding: 30rpx; |
||||
|
margin-bottom: 20rpx; |
||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
|
||||
|
.job-header { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
margin-bottom: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.job-title { |
||||
|
font-size: 32rpx; |
||||
|
font-weight: bold; |
||||
|
color: #333; |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.job-salary { |
||||
|
font-size: 32rpx; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
|
||||
|
.job-info { |
||||
|
display: flex; |
||||
|
gap: 20rpx; |
||||
|
margin-bottom: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.job-date, |
||||
|
.job-degree, |
||||
|
.job-experience { |
||||
|
font-size: 26rpx; |
||||
|
color: #666; |
||||
|
background-color: #f5f5f5; |
||||
|
padding: 8rpx 16rpx; |
||||
|
border-radius: 4rpx; |
||||
|
} |
||||
|
|
||||
|
.company-info { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
margin-bottom: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.company-name { |
||||
|
font-size: 28rpx; |
||||
|
color: #333; |
||||
|
font-weight: 500; |
||||
|
} |
||||
|
|
||||
|
.company-source { |
||||
|
font-size: 24rpx; |
||||
|
color: #999; |
||||
|
} |
||||
|
|
||||
|
.job-tags { |
||||
|
display: flex; |
||||
|
gap: 12rpx; |
||||
|
flex-wrap: wrap; |
||||
|
} |
||||
|
|
||||
|
/* 加载状态样式 */ |
||||
|
.loading-section { |
||||
|
text-align: center; |
||||
|
padding: 40rpx; |
||||
|
color: #999; |
||||
|
font-size: 28rpx; |
||||
|
} |
||||
|
|
||||
|
/* 空状态样式 */ |
||||
|
.empty-section { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
padding: 100rpx 40rpx; |
||||
|
} |
||||
|
|
||||
|
.empty-image { |
||||
|
width: 200rpx; |
||||
|
height: 150rpx; |
||||
|
margin-bottom: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.empty-text { |
||||
|
font-size: 28rpx; |
||||
|
color: #999; |
||||
|
} |
||||
|
|
||||
|
/* 下拉菜单自定义样式 */ |
||||
|
.van-dropdown-menu { |
||||
|
box-shadow: none; |
||||
|
border-bottom: 1rpx solid #eee; |
||||
|
} |
||||
|
|
||||
|
.van-dropdown-menu__title { |
||||
|
font-size: 28rpx; |
||||
|
} |
Loading…
Reference in new issue