bug修复
This commit is contained in:
16
.codegraph/.gitignore
vendored
Normal file
16
.codegraph/.gitignore
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# CodeGraph data files
|
||||||
|
# These are local to each machine and should not be committed
|
||||||
|
|
||||||
|
# Database
|
||||||
|
*.db
|
||||||
|
*.db-wal
|
||||||
|
*.db-shm
|
||||||
|
|
||||||
|
# Cache
|
||||||
|
cache/
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Hook markers
|
||||||
|
.dirty
|
||||||
6
.codegraph/daemon.pid
Normal file
6
.codegraph/daemon.pid
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"pid": 37252,
|
||||||
|
"version": "0.9.9",
|
||||||
|
"socketPath": "\\\\.\\pipe\\codegraph-27b009ff71560217",
|
||||||
|
"startedAt": 1784169684502
|
||||||
|
}
|
||||||
@@ -1,5 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<view v-if="show" class="filter-container">
|
<view v-if="show" class="filter-container">
|
||||||
|
<!-- 头部 -->
|
||||||
|
<view class="filter-header">
|
||||||
|
<view class="header-title">筛选</view>
|
||||||
|
<view class="header-close" @click="handleClose">
|
||||||
|
<view class="close-icon"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 主体内容 -->
|
||||||
|
<view class="filter-body">
|
||||||
<!-- 左侧标签页 -->
|
<!-- 左侧标签页 -->
|
||||||
<view class="filter-tabs">
|
<view class="filter-tabs">
|
||||||
<view
|
<view
|
||||||
@@ -89,22 +98,22 @@
|
|||||||
</radio-group>
|
</radio-group>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 地区 -->
|
<!-- 地区(多选) -->
|
||||||
<view v-if="activeTab === 'area'" class="content-section">
|
<view v-if="activeTab === 'area'" class="content-section">
|
||||||
<radio-group @change="(e) => handleSelect('area', e)">
|
<checkbox-group @change="(e) => handleCheckboxSelect('area', e)">
|
||||||
<label
|
<label
|
||||||
v-for="option in areaOptions"
|
v-for="option in areaOptions"
|
||||||
:key="option.value"
|
:key="option.value"
|
||||||
class="radio-item"
|
class="radio-item"
|
||||||
:class="{ checked: selectedValues['area'] === String(option.value) }"
|
:class="{ checked: isAreaSelected(String(option.value)) }"
|
||||||
>
|
>
|
||||||
<radio
|
<checkbox
|
||||||
:value="String(option.value)"
|
:value="String(option.value)"
|
||||||
:checked="selectedValues['area'] === String(option.value)"
|
:checked="isAreaSelected(String(option.value))"
|
||||||
/>
|
/>
|
||||||
<text class="option-label">{{ option.label }}</text>
|
<text class="option-label">{{ option.label }}</text>
|
||||||
</label>
|
</label>
|
||||||
</radio-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 岗位类型 -->
|
<!-- 岗位类型 -->
|
||||||
@@ -132,6 +141,7 @@
|
|||||||
<button class="footer-btn confirm-btn" @click="handleConfirm">确认</button>
|
<button class="footer-btn confirm-btn" @click="handleConfirm">确认</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view><!-- end filter-body -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -218,21 +228,51 @@ onBeforeMount(async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 处理选项选择
|
// 处理单选选项选择
|
||||||
const handleSelect = (key, e) => {
|
const handleSelect = (key, e) => {
|
||||||
selectedValues[key] = e.detail.value;
|
selectedValues[key] = e.detail.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 处理多选选项选择(地区)
|
||||||
|
// 兼容不同平台:H5 返回逗号分隔字符串,小程序返回数组,统一规范化为逗号分隔字符串
|
||||||
|
const handleCheckboxSelect = (key, e) => {
|
||||||
|
let val = e.detail.value;
|
||||||
|
if (typeof val === 'string') {
|
||||||
|
// H5 平台返回逗号分隔字符串,直接使用
|
||||||
|
selectedValues[key] = val || '';
|
||||||
|
} else if (Array.isArray(val)) {
|
||||||
|
// 小程序返回数组,转为逗号分隔字符串
|
||||||
|
selectedValues[key] = val ? val.join(',') : '';
|
||||||
|
} else {
|
||||||
|
selectedValues[key] = '';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 判断地区选项是否被选中(area 统一为逗号分隔字符串)
|
||||||
|
const isAreaSelected = (value) => {
|
||||||
|
const areaVal = selectedValues.area;
|
||||||
|
if (typeof areaVal === 'string' && areaVal) {
|
||||||
|
return areaVal.split(',').includes(value);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
// 清除所有选择
|
// 清除所有选择
|
||||||
const handleClear = () => {
|
const handleClear = () => {
|
||||||
Object.keys(selectedValues).forEach((key) => {
|
Object.keys(selectedValues).forEach((key) => {
|
||||||
selectedValues[key] = '';
|
if (key === 'area') {
|
||||||
|
selectedValues[key] = '';
|
||||||
|
} else {
|
||||||
|
selectedValues[key] = '';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 确认筛选
|
// 确认筛选
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
const payload = { ...selectedValues };
|
const payload = { ...selectedValues };
|
||||||
|
// area 已统一为逗号分隔字符串,无需额外转换
|
||||||
|
console.log('[new-filter-page] area value to emit:', payload.area);
|
||||||
// 将选中的薪资区间转换为 minSalary / maxSalary 参数
|
// 将选中的薪资区间转换为 minSalary / maxSalary 参数
|
||||||
// 始终带上 minSalary / maxSalary(含空值),便于父组件在清除时移除旧值
|
// 始终带上 minSalary / maxSalary(含空值),便于父组件在清除时移除旧值
|
||||||
let minSalary = '';
|
let minSalary = '';
|
||||||
@@ -269,22 +309,33 @@ const handleClose = () => {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-header {
|
.filter-header {
|
||||||
height: 96rpx;
|
height: 96rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: center;
|
||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
border-bottom: 1rpx solid #eee;
|
border-bottom: 1rpx solid #eee;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
flex-shrink: 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
.back-btn {
|
.header-title {
|
||||||
font-size: 36rpx;
|
font-size: 34rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-close {
|
||||||
|
position: absolute;
|
||||||
|
right: 32rpx;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
width: 48rpx;
|
width: 48rpx;
|
||||||
|
height: 48rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -295,15 +346,42 @@ const handleClose = () => {
|
|||||||
&:active {
|
&:active {
|
||||||
background-color: rgba(37, 107, 250, 0.1);
|
background-color: rgba(37, 107, 250, 0.1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.filter-title {
|
.close-icon {
|
||||||
font-size: 34rpx;
|
position: relative;
|
||||||
font-weight: 600;
|
width: 28rpx;
|
||||||
color: #333;
|
height: 28rpx;
|
||||||
|
|
||||||
|
&::before,
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
width: 4rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
border-radius: 2rpx;
|
||||||
|
background: #5A5A68;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
transform: translate(-50%, -50%) rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
transform: translate(-50%, -50%) rotate(-45deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filter-body {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.filter-tabs {
|
.filter-tabs {
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
border-right: 1rpx solid #eee;
|
border-right: 1rpx solid #eee;
|
||||||
|
|||||||
@@ -21,14 +21,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="card-bottom">
|
<view class="card-bottom">
|
||||||
<view>{{ job.postingDate }}</view>
|
<view>{{ job.postingDate }}</view>
|
||||||
<view>
|
<view class="card-bottom-right">
|
||||||
<convert-distance
|
<text v-if="job.regionName">地区:{{ job.regionName }}</text>
|
||||||
:alat="job.latitude"
|
|
||||||
:along="job.longitude"
|
|
||||||
:blat="latitude"
|
|
||||||
:blong="longitude"
|
|
||||||
></convert-distance>
|
|
||||||
<dict-Label class="mar_le10" dictType="area" :value="job.jobLocationAreaCode"></dict-Label>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
<view class="nav-hidden hidden-animation" :class="{ 'hidden-height': shouldHideTop }">
|
<view class="nav-hidden hidden-animation" :class="{ 'hidden-height': shouldHideTop }">
|
||||||
<view class="container-search" v-if="shouldShowJobSeekerContent">
|
<view class="container-search" v-if="shouldShowJobSeekerContent">
|
||||||
<view class="search-input button-click" @click="navTo('/pages/search/search')">
|
<view class="search-input button-click" @click="navToSearch">
|
||||||
<uni-icons class="iconsearch" color="#666666" type="search" size="18"></uni-icons>
|
<uni-icons class="iconsearch" color="#666666" type="search" size="18"></uni-icons>
|
||||||
<text class="inpute">职位名称、薪资要求等</text>
|
<text class="inpute">职位名称、薪资要求等</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -263,9 +263,14 @@
|
|||||||
{{ item.text }}
|
{{ item.text }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btm-right button-click" @click="openFilter">
|
<view class="btm-right-wrap">
|
||||||
筛选
|
<view class="button-click clear-btn" v-if="hasFilterConditions" @click="clearFilter">
|
||||||
<image class="right-sx" :class="{ active: showFilter }" src="@/static/icon/shaixun.png"></image>
|
清除筛选
|
||||||
|
</view>
|
||||||
|
<view class="btm-right button-click" @click="openFilter">
|
||||||
|
筛选
|
||||||
|
<image class="right-sx" :class="{ active: showFilter }" src="@/static/icon/shaixun.png"></image>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -564,6 +569,12 @@ const shouldShowCompanyContent = computed(() => {
|
|||||||
return userType === 0;
|
return userType === 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 判断是否有筛选条件(用于显示/隐藏清除按钮)
|
||||||
|
const hasFilterConditions = computed(() => {
|
||||||
|
const searchKeys = Object.keys(pageState.search).filter((k) => k !== 'order' && pageState.search[k]);
|
||||||
|
return searchKeys.length > 0 || Object.keys(conditionSearch.value).length > 0 || Boolean(selectedCity.value.code);
|
||||||
|
});
|
||||||
|
|
||||||
// 判断当前用户是否为招聘者(企业用户)
|
// 判断当前用户是否为招聘者(企业用户)
|
||||||
const isRecruiter = computed(() => {
|
const isRecruiter = computed(() => {
|
||||||
if (!hasLogin.value) {
|
if (!hasLogin.value) {
|
||||||
@@ -1067,6 +1078,38 @@ function openFilter() {
|
|||||||
emits('onShowTabbar', false);
|
emits('onShowTabbar', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 跳转到搜索页,并携带筛选条件
|
||||||
|
function navToSearch() {
|
||||||
|
const query = {};
|
||||||
|
// 携带筛选弹窗中选择的地区(确保是逗号分隔字符串)
|
||||||
|
const areaVal = pageState.search.area;
|
||||||
|
if (areaVal && String(areaVal)) {
|
||||||
|
query.area = String(areaVal);
|
||||||
|
}
|
||||||
|
// 携带城市选择器中选择的regionCode
|
||||||
|
if (conditionSearch.value.regionCode) {
|
||||||
|
query.regionCode = String(conditionSearch.value.regionCode);
|
||||||
|
}
|
||||||
|
console.log('[navToSearch] query params:', query);
|
||||||
|
navTo('/pages/search/search', { query });
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清除所有筛选条件
|
||||||
|
function clearFilter() {
|
||||||
|
// 保留 order 排序方式
|
||||||
|
const currentOrder = pageState.search.order;
|
||||||
|
pageState.search = { order: currentOrder };
|
||||||
|
// 清除城市选择
|
||||||
|
conditionSearch.value = {};
|
||||||
|
selectedCity.value = { code: '', name: '' };
|
||||||
|
// 刷新列表
|
||||||
|
if (state.tabIndex === 'all') {
|
||||||
|
getJobRecommend('refresh');
|
||||||
|
} else {
|
||||||
|
getJobList('refresh');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handleNewFilterConfirm(values) {
|
function handleNewFilterConfirm(values) {
|
||||||
pageState.search = {
|
pageState.search = {
|
||||||
...pageState.search,
|
...pageState.search,
|
||||||
@@ -1993,16 +2036,26 @@ defineExpose({ loadData });
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #256BFA;
|
color: #256BFA;
|
||||||
.btm-right
|
.btm-right-wrap
|
||||||
font-family: 'PingFangSC-Regular', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
display: flex
|
||||||
font-weight: 400;
|
align-items: center
|
||||||
font-size: 32rpx;
|
.clear-btn
|
||||||
color: #6C7282;
|
font-family: 'PingFangSC-Regular', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||||
.right-sx
|
font-weight: 400;
|
||||||
width: 26rpx;
|
font-size: 28rpx;
|
||||||
height: 26rpx;
|
color: #999;
|
||||||
.active
|
margin-right: 20rpx;
|
||||||
transform: rotate(180deg)
|
white-space: nowrap;
|
||||||
|
.btm-right
|
||||||
|
font-family: 'PingFangSC-Regular', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #6C7282;
|
||||||
|
.right-sx
|
||||||
|
width: 26rpx;
|
||||||
|
height: 26rpx;
|
||||||
|
.active
|
||||||
|
transform: rotate(180deg)
|
||||||
.table-list
|
.table-list
|
||||||
background: #F4F4F4
|
background: #F4F4F4
|
||||||
flex: 1
|
flex: 1
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container safe-area-top">
|
<view class="container safe-area-top">
|
||||||
<!-- 自定义头部搜索框 -->
|
<!-- 自定义头部搜索框 -->
|
||||||
<view class="custom-header">
|
<view class="custom-header" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<!-- <image class="btnback button-click" src="@/static/icon/back.png" @click="navBack"></image> -->
|
<image class="btnback button-click" src="@/static/icon/back.png" @click="navBack"></image>
|
||||||
<view class="search-box">
|
<view class="search-box">
|
||||||
<uni-icons
|
<uni-icons
|
||||||
class="iconsearch"
|
class="iconsearch"
|
||||||
@@ -79,7 +79,16 @@ onLoad((query) => {
|
|||||||
if (arr) {
|
if (arr) {
|
||||||
historyList.value = uni.getStorageSync('searchList');
|
historyList.value = uni.getStorageSync('searchList');
|
||||||
}
|
}
|
||||||
const {job} = query;
|
const {job, area, regionCode} = query;
|
||||||
|
// 从首页筛选条件传入的地区和区域编码
|
||||||
|
console.log('[search-page] onLoad query:', JSON.stringify(query));
|
||||||
|
if (area) {
|
||||||
|
pageState.search.area = String(area);
|
||||||
|
console.log('[search-page] set area:', pageState.search.area);
|
||||||
|
}
|
||||||
|
if (regionCode) {
|
||||||
|
pageState.search.regionCode = String(regionCode);
|
||||||
|
}
|
||||||
if (job) {
|
if (job) {
|
||||||
searchValue.value = job;
|
searchValue.value = job;
|
||||||
searchBtn();
|
searchBtn();
|
||||||
@@ -161,6 +170,7 @@ function getJobList(type = 'add') {
|
|||||||
...pageState.search,
|
...pageState.search,
|
||||||
jobTitle: searchValue.value,
|
jobTitle: searchValue.value,
|
||||||
};
|
};
|
||||||
|
console.log('[search-page] getJobList params:', JSON.stringify(params));
|
||||||
|
|
||||||
$api.createRequest('/app/job/list', params, 'GET', true).then((resData) => {
|
$api.createRequest('/app/job/list', params, 'GET', true).then((resData) => {
|
||||||
const { rows, total } = resData;
|
const { rows, total } = resData;
|
||||||
|
|||||||
Reference in New Issue
Block a user