Enhance job listing functionality and navigation styles

- Added education filter to job recommendation and listing APIs across multiple components.
- Updated policy list page with custom navigation for H5 and improved layout.
- Refactored policy detail handling to streamline error management and testing data injection.
This commit is contained in:
2026-05-07 11:22:47 +08:00
parent 2df9502640
commit c4054f2a4a
7 changed files with 656 additions and 45 deletions

View File

@@ -193,12 +193,13 @@ let jobList = ref([])
// 获取推荐岗位 // 获取推荐岗位
function getJobRecommed(){ function getJobRecommed(){
let params = { let params = {
pageSize: pageState.pageSize, education: '3,4,5,6',
sessionId: useUserStore().seesionId, pageSize: pageState.pageSize,
...pageState.search, sessionId: useUserStore().seesionId,
...conditionSearch.value, ...pageState.search,
isPublish: 1, ...conditionSearch.value,
type:pageState.type isPublish: 1,
type:pageState.type
}; };
$api.createRequest('/app/job/recommend', params).then((resData) => { $api.createRequest('/app/job/recommend', params).then((resData) => {
jobList.value = resData.data jobList.value = resData.data
@@ -209,12 +210,13 @@ function getJobRecommed(){
// 获取岗位列表 // 获取岗位列表
function getJobList(){ function getJobList(){
let params = { let params = {
current: pageState.page, education: '3,4,5,6',
pageSize: pageState.pageSize, current: pageState.page,
...pageState.search, pageSize: pageState.pageSize,
// ...conditionSearch.value, ...pageState.search,
type:pageState.type // ...conditionSearch.value,
}; type:pageState.type
};
$api.createRequest('/app/job/list', params).then((resData) => { $api.createRequest('/app/job/list', params).then((resData) => {
jobList.value = resData.rows jobList.value = resData.rows
pageState.total = 0; pageState.total = 0;

View File

@@ -211,6 +211,7 @@ let jobList = ref([])
// 获取推荐岗位 // 获取推荐岗位
function getJobRecommed(){ function getJobRecommed(){
let params = { let params = {
education: '3,4,5,6',
pageSize: pageState.pageSize, pageSize: pageState.pageSize,
sessionId: useUserStore().seesionId, sessionId: useUserStore().seesionId,
...pageState.search, ...pageState.search,
@@ -234,6 +235,7 @@ function getJobRecommed(){
// 获取岗位列表 // 获取岗位列表
function getJobList(){ function getJobList(){
let params = { let params = {
education: '3,4,5,6',
current: pageState.page, current: pageState.page,
pageSize: pageState.pageSize, pageSize: pageState.pageSize,
...pageState.search, ...pageState.search,

View File

@@ -983,6 +983,7 @@ function getJobRecommend(type = "add") {
if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh(); if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh();
} }
let params = { let params = {
education: '3,4,5,6',
pageSize: pageState.pageSize, pageSize: pageState.pageSize,
sessionId: useUserStore().seesionId, sessionId: useUserStore().seesionId,
...pageState.search, ...pageState.search,
@@ -1051,6 +1052,7 @@ function getJobList(type = "add") {
if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh(); if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh();
} }
let params = { let params = {
education: '3,4,5,6',
current: pageState.page, current: pageState.page,
pageSize: pageState.pageSize, pageSize: pageState.pageSize,
...pageState.search, ...pageState.search,

View File

@@ -983,6 +983,7 @@ function getJobRecommend(type = "add") {
if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh(); if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh();
} }
let params = { let params = {
education: '3,4,5,6',
pageSize: pageState.pageSize, pageSize: pageState.pageSize,
sessionId: useUserStore().seesionId, sessionId: useUserStore().seesionId,
...pageState.search, ...pageState.search,
@@ -1051,6 +1052,7 @@ function getJobList(type = "add") {
if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh(); if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh();
} }
let params = { let params = {
education: '3,4,5,6',
current: pageState.page, current: pageState.page,
pageSize: pageState.pageSize, pageSize: pageState.pageSize,
...pageState.search, ...pageState.search,

View File

@@ -119,23 +119,24 @@ import { getPolicyDetail } from "@/packageRc/apiRc/policy";
getPolicy(id) { getPolicy(id) {
getPolicyDetail({id}).then(res => { getPolicyDetail({id}).then(res => {
this.policyDetail = res.data this.policyDetail = res.data
}).catch(err => { // }).finally(err => {
// #ifdef H5 || APP-PLUS // console.log(342324)
// 仅在测试环境下,注入大段文本验证排版 // // #ifdef H5 || APP-PLUS
this.policyDetail = { // // 仅在测试环境下,注入大段文本验证排版
zcmc: '【条件编译测试】支持高校毕业生在本地创业就业的若干激励措施(接口失败模拟)', // this.policyDetail = {
zcLevel: '省级重点', // zcmc: '【条件编译测试】支持高校毕业生在本地创业就业的若干激励措施(接口失败模拟)',
sourceUnit: '人社测试局', // zcLevel: '省级重点',
publishTime: '2026-03-10', // sourceUnit: '人社测试局',
viewNum: 9999, // publishTime: '2026-03-10',
applicableObjects: '1. 本市户籍的高校毕业生;<br/>2. 创业青年群体。', // viewNum: 9999,
policyExplanation: '本政策旨在吸引更多高素质人才留在本市发展。', // applicableObjects: '1. 本市户籍的高校毕业生;<br/>2. 创业青年群体。',
applyCondition: '具有全日制本科及以上学历且毕业在5年内。', // policyExplanation: '本政策旨在吸引更多高素质人才留在本市发展。',
zczc: '最高50万元奖励办公场地免租3年。', // applyCondition: '具有全日制本科及以上学历且毕业在5年内。',
btbz: '本科5000元/月硕士10000元/月连续发放3年。', // zczc: '最高50万元奖励办公场地免租3年。',
jbqd: '政务中心2楼窗口、线上小程序入口。' // btbz: '本科5000元/月硕士10000元/月连续发放3年。',
} // jbqd: '政务中心2楼窗口、线上小程序入口。'
// #endif // }
// // #endif
}) })
}, },
getDictLabel(value, list) { getDictLabel(value, list) {

View File

@@ -1,4 +1,5 @@
<template> <template>
<!-- #ifdef MP-WEIXIN -->
<view <view
class="page" :class="{'h5-pc-page': isH5}" class="page" :class="{'h5-pc-page': isH5}"
style=" style="
@@ -102,14 +103,115 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view
class="page" :class="{'h5-pc-page': isH5}"
>
<view class="custom-nav" :style="{paddingTop: statusBarHeight + 'px'}">
<view class="nav-content">
<view class="nav-back" @click="back"><text class="iconfont"><</text></view>
<view class="nav-title">高校毕业生智慧就业</view>
<view class="nav-placeholder"></view>
</view>
</view>
<view
class="input-outer-part"
style="padding: 24rpx 32rpx 0; max-height: unset"
>
<view class="search-line">
<input
style="width: 100%"
placeholder="请输入政策名称进行搜索"
v-model="queryParams.searchValue"
border="none"
/>
<img
src="/packageRc/static/dmsc/ss.png"
class="search-icon"
@click="search()"
/>
</view>
<view
class="inner"
:style="{
width: 'calc(100% + 64rpx)',
marginLeft: '-32rpx',
height: zctopShow ? 'auto' : '122rpx',
position: 'relative',
zIndex: zctopShow ? 100 : 2,
}"
>
<PopupList
:checkData="checkData"
@searchCheck="search"
ref="PopupList"
@popupSearch="popupSearch"
/>
</view>
<view
v-if="total"
style="position: relative; padding: 32rpx 0; color: #000"
>
<!-- <view v-if="total" style="position: relative;padding-bottom: 16px;color: #000;"> -->
<text class="total-count"> {{ total }} </text>
</view>
<!-- <scroll-view :scroll-y="true" style="height: calc(100vh - 342rpx);position: relative;z-index: 1;" -->
<scroll-view
:scroll-y="true"
style="height: calc(100vh - 354rpx); position: relative; z-index: 1"
@scrolltolower="getBottomList"
:show-scrollbar="false"
>
<view v-for="(item, index) in tableData" :key="index" class="policy-list-card" @click="toPolicyDetail(item)">
<view class="card-left">
<image class="clock-icon" src="../../../packageRc/static/dmsc/sj.png" />
<view class="date-md">{{ formatMD(item.publishTime || item.createTime) }}</view>
<view class="date-year">{{ formatYear(item.publishTime || item.createTime) }}</view>
</view>
<view class="card-right">
<view class="card-title">{{ item.zcmc }}</view>
<view class="card-infos">
<view v-if="item.zcLevel" class="info-tag">{{ item.zcLevel }}</view>
<view v-if="item.sourceUnit" class="info-tag">{{ item.sourceUnit }}</view>
</view>
</view>
</view>
<view style="padding-bottom: 24px">
<img
v-if="!total && !loading"
src="https://rc.jinan.gov.cn/qcwjyH5/static/images/person/empty.png"
style="width: 100%; display: block; margin: 0 auto"
/>
<view v-if="loading">
<uni-load-more status="loading" :content-text="{contentrefresh: '加载中~'}"></uni-load-more>
</view>
<view
v-else-if="showMorePage"
style="text-align: center; color: #1a62ce; font-size: 24px"
>加载更多
</view>
<view
style="text-align: center; color: #8e8e8e; font-size: 24px"
v-else
>没有更多数据了~</view
> </view
>  
</scroll-view>
</view>
</view>
<!-- #endif -->
</template> </template>
<script> <script>
import PopupList from "/packageRc/components/PopupLists.vue"; import PopupList from "/packageRc/components/PopupLists.vue";
import { getPolicyList } from "@/packageRc/apiRc/policy"; import { getPolicyList } from "@/packageRc/apiRc/policy";
import { getDicts } from "@/packageRc/apiRc/system/dict"; import { getDicts } from "@/packageRc/apiRc/system/dict";
// import PolicyListYtjComp from "/packageRc/pages/policy/policyListYtj.vue";
export default { export default {
components: { components: {
PopupList, PopupList,
// PolicyListYtjComp
}, },
data() { data() {
return { return {
@@ -204,14 +306,23 @@ export default {
activeIndex: 0, activeIndex: 0,
hidden: true, hidden: true,
}, },
{ // {
name: "政策级别", // name: "政策级别",
type: "zcLevel", // type: "zcLevel",
data: [{ dictLabel: "全部", dictValue: "" }].concat(resLevel.data || []), // data: [{ dictLabel: "全部", dictValue: "" }].concat(resLevel.data || []),
activeIndex: 0, // activeIndex: 0,
}, // },
]; ];
}, },
back() {
// uni.navigateBack({
// delta: 1
// })
window.location.href='https://www.xjksly.cn/mechine-single-vue/'
// uni.reLaunch({
// url: '/pages/index/index'
// })
},
popupSearch(data) { popupSearch(data) {
// 获取此次提交前,旧的政策类型值 // 获取此次提交前,旧的政策类型值
const oldTypeL = this.queryParams.policyTypeL || ""; const oldTypeL = this.queryParams.policyTypeL || "";
@@ -291,25 +402,37 @@ export default {
this.total = res.total; this.total = res.total;
} else { } else {
this.loading = false; this.loading = false;
// #ifdef H5 || APP-PLUS
// 接口返回非 200 或失败时展示测试数据 (条件编译)
this.tableData = [
{ id: '1', zcmc: '测试政策001关于进一步支持人才发展的若干措施条件编译测试数据', publishTime: '2026-03-10', viewNum: 888, zcLevel: '省级', sourceUnit: '模拟测试部' },
{ id: '2', zcmc: '测试政策002高校毕业生创业补贴申请指南条件编译测试数据', publishTime: '2026-03-10', viewNum: 666, zcLevel: '市级', sourceUnit: '人力资源局' }
];
this.total = 2;
// #endif
uni.showToast({ uni.showToast({
title: res.msg || '获取列表失败', title: res.msg || '获取列表失败',
icon: "none", icon: "none",
}); });
} }
}, },
formatMD(dateStr) {
if (!dateStr) return '--';
const parts = dateStr.split('-').length > 1 ? dateStr.split('-') : dateStr.split(' ');
// 处理 YYYY-MM-DD 或 YYYY-MM-DD HH:mm:ss
let d = parts[0].includes('-') ? parts[0].split('-') : parts;
if (d.length >= 3) {
return `${d[1]}-${d[2].substring(0,2)}`;
}
return dateStr;
},
formatYear(dateStr) {
if (!dateStr) return '';
const parts = dateStr.split('-');
if (parts.length >= 1) {
return parts[0].substring(0, 4);
}
return '';
}
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// #ifdef MP-WEIXIN
/* 隐藏滚动条 */ /* 隐藏滚动条 */
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
@@ -599,6 +722,366 @@ export default {
width: 100%; width: 100%;
} }
.policy-list {
width: 100%;
margin: 0 auto;
color: #333333;
border-radius: 24rpx;
background: #ffffff;
padding: 32rpx;
margin-bottom: 24rpx;
box-sizing: border-box;
position: relative;
.sign {
position: absolute;
font-size: 24rpx;
right: 0;
top: 0;
padding: 4rpx 14rpx;
border: 1rpx solid #ec4827;
background: rgba(227, 79, 49, 0.09);
border-top-right-radius: 24rpx;
border-bottom-left-radius: 24rpx;
color: #ec4827;
}
.top-line {
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #a2a2a2;
margin-bottom: 16rpx;
.salary {
font-size: 32rpx;
color: #4c6efb;
font-weight: bold;
}
}
.title {
font-size: 32rpx;
font-weight: bold;
color: #282828;
margin-bottom: 16rpx;
display: flex;
image {
width: 46rpx;
height: 46rpx;
margin-right: 11rpx;
}
}
.infos {
display: flex;
flex-wrap: wrap;
font-size: 24rpx;
margin-bottom: 16rpx;
line-height: 42rpx;
view {
padding: 0 16rpx;
margin-right: 10rpx;
background: #f2f2f2;
}
}
.bottom-line {
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #a2a2a2;
margin-top: 12rpx;
}
}
// #endif
// #ifdef H5
/* 隐藏滚动条 */
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
.page {
background-color: #f4f4f4 !important;
height: 1920px;
background-repeat: no-repeat;
background-size: 100% auto;
}
.search-line {
border-radius: 19px;
background: #ffffff;
box-sizing: border-box;
border: 1px solid #107afd;
height: 72rpx;
border-radius: 19rpx;
padding: 0 19rpx;
display: flex;
align-items: center;
position: relative;
z-index: 110;
margin-top: 24rpx;
.search-icon {
width: 20px;
background: #107afd;
padding: 10px;border-radius: 20px;
height: 20px;
}
}
.job-item {
position: relative;
margin-bottom: 24rpx;
background: #fff;
border-radius: 16rpx;
.item_btn {
height: 100rpx;
border-top: 1px solid #e3e8ee;
}
.line {
position: absolute;
right: 50%;
bottom: 20rpx;
width: 1px;
height: 60rpx;
background-color: #e3e8ee;
}
.status-card {
position: absolute;
right: 0;
top: 0;
border-radius: 0 16rpx 0 16rpx;
width: 160rpx;
line-height: 40rpx;
text-align: center;
color: #fff;
background: #b2c0d1;
border: 1px solid #9ba9b9;
font-size: 24rpx;
&.in {
background: #29d297;
border: 1px solid #1bba83;
}
&.out {
background: #ecb83d;
border: 1px solid #d7892b;
}
&.far {
background: #ec7737;
border: 1px solid #c24f1a;
}
}
.top-container {
padding: 32rpx;
// margin-bottom: 24rpx;
.title-line {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 32rpx;
font-weight: bold;
margin-bottom: 16rpx;
.type-tag {
line-height: 40rpx;
width: 128rpx;
font-size: 24rpx;
color: #fff;
text-align: center;
&.qz {
background: #28cb5e;
}
&.yz {
background: #dd6728;
}
&.cy {
background: #23b5c5;
}
&.px {
background: #dda728;
}
&.qt {
background: #2870dd;
}
}
.title {
color: #3d3d3d;
width: calc(100% - 137rpx);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 40rpx;
}
.salary {
width: 33%;
color: #fa6553;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
}
}
.info {
color: #3d3d3d;
margin-bottom: 7rpx;
font-size: 28rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text {
color: #8e8e8e;
}
.not {
color: #ec7737;
font-weight: bold;
}
.ing {
color: #ecb83d;
font-weight: bold;
}
.finish {
color: #21c88d;
font-weight: bold;
}
}
}
.function-btn {
color: #bf5818;
border-top: 1px solid #e2e8ef;
padding-bottom: 6rpx;
line-height: 90rpx;
text-align: center;
}
}
.self-form {
padding: 32rpx;
.bordered {
border: 1rpx solid #dadbde;
padding: 9px;
border-radius: 4px;
}
}
.button-area {
padding: 24rpx 32rpx 68rpx;
background: #fff;
display: flex;
box-sizing: border-box;
border-radius: 16px 16px 0px 0px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
.btn {
line-height: 72rpx;
width: 176rpx;
margin-right: 16rpx;
font-size: 28rpx;
border: 1px solid #b8c5d4;
color: #282828;
text-align: center;
border-radius: 8rpx;
}
.reset {
background: #dce2e9;
}
.save {
background: linear-gradient(103deg, #1d64cf 0%, #1590d4 99%);
color: #fff;
border: 0;
flex-grow: 1;
}
}
.noValue {
color: rgb(192, 196, 204);
}
.addNeeds {
position: fixed;
right: 0;
bottom: 150rpx;
width: 150rpx;
overflow: hidden;
z-index: 10;
border-radius: 44rpx;
border-radius: 75rpx;
img {
display: block;
width: 100%;
}
}
.df_flex {
display: flex;
view {
flex-grow: 1;
text-align: center;
color: #4c6efb;
}
}
.df_flex_1 {
flex: 1;
}
.df__direction_column {
flex-direction: column;
}
.df_align_center {
align-items: center;
}
.df_justify_center {
justify-content: center;
}
.df_content_between {
justify-content: space-between;
}
.df_shrink_0 {
flex-shrink: 0;
}
/* 日期选择器样式 */
.date-picker-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
box-sizing: border-box;
padding: 0 24rpx;
height: 64rpx;
border: 1px solid #ddd;
border-radius: 4px;
background-color: #fff;
}
// .date-picker-wrapper.noValue {
// background-color: #f9f9f9;
// }
.date-value {
color: #333;
width: 100%;
}
.policy-list { .policy-list {
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
@@ -718,7 +1201,10 @@ export default {
height: 48px !important; height: 48px !important;
} }
.search-line { .search-line {
height: 80rpx !important; height: 60px !important;
border-radius: 40px;
padding: 0 20px!important;
input{font-size: 16px!important;}
} }
.policy-list .title image { .policy-list .title image {
width: 56rpx !important; width: 56rpx !important;
@@ -726,8 +1212,121 @@ export default {
margin-right: 16rpx !important; margin-right: 16rpx !important;
} }
.loading-text { .loading-text {
font-size: 20px !important; font-size: 26px !important;
} }
} }
/* #endif */ /* #endif */
/* 自定义导航栏 */
.custom-nav {
background: #107AFD;
width: 100%;
.nav-content {
height: 120rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24rpx;
.nav-back {
width: 72rpx;
height: 120rpx;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-weight: 300;
.iconfont{
font-size: 40px!important;
}
}
.nav-title {
color: #fff;
font-size: 43rpx;
font-weight: bold;
}
.nav-placeholder {
width: 72rpx;
}
}
}
.policy-list-card {
width: 100%;
margin: 0 auto;
color: #333333;
/* 政策卡片大边距与内边距 */
margin-bottom: 48rpx;
box-sizing: border-box;
display: flex;
background: linear-gradient(180deg, #F0F8FF 0%, #FFFFFF 100%);
padding: 64rpx 48rpx;
border-radius: 16rpx;
border: 1px solid #D1E5FF;
box-shadow: 0px 4rpx 12rpx 0px rgba(16, 122, 253, 0.05);
.card-left {
/* 加宽左侧保护不再折行 */
width: 220rpx;
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-right: 1px solid #E5EEFA;
/* 增大左右空隙 */
margin-right: 48rpx;
.clock-icon {
width: 52rpx;
height: 52rpx;
margin-bottom: 12rpx;
}
.date-md {
font-size: 60rpx;
font-weight: bold;
color: #107afd;
line-height: 1;
margin-bottom: 12rpx;
}
.date-year {
font-size: 40rpx;
color: #107afd;
line-height: 1;
}
}
.card-right {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
.card-title {
font-size: 64rpx;
font-weight: bold;
color: #333;
margin-bottom: 24rpx;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.card-infos {
display: flex;
flex-wrap: wrap;
.info-tag {
font-size: 48rpx;
color: #999;
margin-right: 24rpx;
}
}
}
}
// #endif
</style> </style>

View File

@@ -741,6 +741,9 @@
{ {
"path": "pages/policy/policyList", "path": "pages/policy/policyList",
"style": { "style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "政策专区" "navigationBarTitleText": "政策专区"
} }
}, },