bug修复
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -23,4 +23,5 @@ pnpm-debug.log*
|
|||||||
/output/
|
/output/
|
||||||
/hs_err_pid*
|
/hs_err_pid*
|
||||||
*.local
|
*.local
|
||||||
yarn.lock
|
yarn.lock
|
||||||
|
.codegraph
|
||||||
@@ -135,6 +135,97 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 内容区域 -->
|
||||||
|
<view class="filter-content">
|
||||||
|
<!-- 学历要求 -->
|
||||||
|
<view v-if="activeTab === 'education'" class="content-section">
|
||||||
|
<radio-group @change="(e) => handleSelect('education', e)">
|
||||||
|
<label
|
||||||
|
v-for="option in educationOptions"
|
||||||
|
:key="option.value"
|
||||||
|
class="radio-item"
|
||||||
|
:class="{ checked: selectedValues['education'] === String(option.value) }"
|
||||||
|
>
|
||||||
|
<radio
|
||||||
|
:value="String(option.value)"
|
||||||
|
:checked="selectedValues['education'] === String(option.value)"
|
||||||
|
/>
|
||||||
|
<text class="option-label">{{ option.label }}</text>
|
||||||
|
</label>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 工作经验 -->
|
||||||
|
<view v-if="activeTab === 'experience'" class="content-section">
|
||||||
|
<radio-group @change="(e) => handleSelect('experience', e)">
|
||||||
|
<label
|
||||||
|
v-for="option in experienceOptions"
|
||||||
|
:key="option.value"
|
||||||
|
class="radio-item"
|
||||||
|
:class="{ checked: selectedValues['experience'] === String(option.value) }"
|
||||||
|
>
|
||||||
|
<radio
|
||||||
|
:value="String(option.value)"
|
||||||
|
:checked="selectedValues['experience'] === String(option.value)"
|
||||||
|
/>
|
||||||
|
<text class="option-label">{{ option.label }}</text>
|
||||||
|
</label>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 公司规模 -->
|
||||||
|
<view v-if="activeTab === 'scale'" class="content-section">
|
||||||
|
<radio-group @change="(e) => handleSelect('scale', e)">
|
||||||
|
<label
|
||||||
|
v-for="option in scaleOptions"
|
||||||
|
:key="option.value"
|
||||||
|
class="radio-item"
|
||||||
|
:class="{ checked: selectedValues['scale'] === String(option.value) }"
|
||||||
|
>
|
||||||
|
<radio
|
||||||
|
:value="String(option.value)"
|
||||||
|
:checked="selectedValues['scale'] === String(option.value)"
|
||||||
|
/>
|
||||||
|
<text class="option-label">{{ option.label }}</text>
|
||||||
|
</label>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 岗位类型 -->
|
||||||
|
<view v-if="activeTab === 'jobType'" class="content-section">
|
||||||
|
<radio-group @change="(e) => handleSelect('jobType', e)">
|
||||||
|
<label
|
||||||
|
v-for="option in jobTypeOptions"
|
||||||
|
:key="option.value"
|
||||||
|
class="radio-item"
|
||||||
|
:class="{ checked: selectedValues['jobType'] === String(option.value) }"
|
||||||
|
>
|
||||||
|
<radio
|
||||||
|
:value="String(option.value)"
|
||||||
|
:checked="selectedValues['jobType'] === String(option.value)"
|
||||||
|
/>
|
||||||
|
<text class="option-label">{{ option.label }}</text>
|
||||||
|
</label>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 地区(多选) -->
|
||||||
|
<view v-if="activeTab === 'area'" class="content-section">
|
||||||
|
<checkbox-group @change="(e) => handleAreaSelect(e)">
|
||||||
|
<label
|
||||||
|
v-for="option in areaOptions"
|
||||||
|
:key="option.value"
|
||||||
|
class="radio-item"
|
||||||
|
:class="{ checked: selectedValues['area'].includes(String(option.value)) }"
|
||||||
|
>
|
||||||
|
<checkbox
|
||||||
|
:value="String(option.value)"
|
||||||
|
:checked="selectedValues['area'].includes(String(option.value))"
|
||||||
|
/>
|
||||||
|
<text class="option-label">{{ option.label }}</text>
|
||||||
|
</label>
|
||||||
|
</checkbox-group>
|
||||||
|
</view>
|
||||||
<!-- 底部按钮 -->
|
<!-- 底部按钮 -->
|
||||||
<view class="filter-footer">
|
<view class="filter-footer">
|
||||||
<button class="footer-btn clear-btn" @click="handleClear">清除</button>
|
<button class="footer-btn clear-btn" @click="handleClear">清除</button>
|
||||||
@@ -146,10 +237,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onBeforeMount } from 'vue';
|
import { ref, reactive, onBeforeMount, watch } from 'vue';
|
||||||
import useDictStore from '@/stores/useDictStore';
|
import useDictStore from '@/stores/useDictStore';
|
||||||
const dictStore = useDictStore();
|
const { getTransformChildren } = useDictStore();
|
||||||
const { getTransformChildren } = dictStore;
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
@@ -171,7 +261,6 @@ const getJobTypeData = () => {
|
|||||||
const tabs = [
|
const tabs = [
|
||||||
{ key: 'education', label: '学历要求' },
|
{ key: 'education', label: '学历要求' },
|
||||||
{ key: 'experience', label: '工作经验' },
|
{ key: 'experience', label: '工作经验' },
|
||||||
{ key: 'salary', label: '薪资' },
|
|
||||||
{ key: 'scale', label: '公司规模' },
|
{ key: 'scale', label: '公司规模' },
|
||||||
{ key: 'jobType', label: '岗位类型' },
|
{ key: 'jobType', label: '岗位类型' },
|
||||||
{ key: 'area', label: '地区' }
|
{ key: 'area', label: '地区' }
|
||||||
@@ -184,47 +273,36 @@ const activeTab = ref('education');
|
|||||||
const selectedValues = reactive({
|
const selectedValues = reactive({
|
||||||
education: '',
|
education: '',
|
||||||
experience: '',
|
experience: '',
|
||||||
salary: '',
|
|
||||||
scale: '',
|
scale: '',
|
||||||
area: '',
|
jobType: '',
|
||||||
jobType: ''
|
area: []
|
||||||
});
|
});
|
||||||
|
|
||||||
// 从字典获取的选项数据
|
// 从字典获取的选项数据
|
||||||
const educationOptions = ref([]);
|
const educationOptions = ref([]);
|
||||||
const experienceOptions = ref([]);
|
const experienceOptions = ref([]);
|
||||||
const scaleOptions = ref([]);
|
const scaleOptions = ref([]);
|
||||||
const areaOptions = ref([]);
|
|
||||||
const jobTypeOptions = ref([]);
|
const jobTypeOptions = ref([]);
|
||||||
|
const areaOptions = ref([]);
|
||||||
// 薪资区间数据(单位:元/月),min/max 为空表示该侧不设限
|
|
||||||
const salaryOptions = ref([
|
|
||||||
{ label: '3K以下', value: '0-3000', min: '', max: 3000 },
|
|
||||||
{ label: '3-5K', value: '3000-5000', min: 3000, max: 5000 },
|
|
||||||
{ label: '5-10K', value: '5000-10000', min: 5000, max: 10000 },
|
|
||||||
{ label: '10-20K', value: '10000-20000', min: 10000, max: 20000 },
|
|
||||||
{ label: '20-50K', value: '20000-50000', min: 20000, max: 50000 },
|
|
||||||
{ label: '50K以上', value: '50000-0', min: 50000, max: '' },
|
|
||||||
]);
|
|
||||||
|
|
||||||
// 加载状态
|
|
||||||
const loading = ref(true);
|
|
||||||
|
|
||||||
// 初始化获取数据
|
// 初始化获取数据
|
||||||
onBeforeMount(async () => {
|
const initData = () => {
|
||||||
try {
|
educationOptions.value = getTransformChildren('education', '学历要求').options || [];
|
||||||
// 先获取字典数据
|
experienceOptions.value = getTransformChildren('experience', '工作经验').options || [];
|
||||||
await dictStore.getDictData();
|
scaleOptions.value = getTransformChildren('scale', '公司规模').options || [];
|
||||||
// 再初始化选项数据
|
jobTypeOptions.value = getJobTypeData();
|
||||||
educationOptions.value = getTransformChildren('education', '学历要求').options || [];
|
areaOptions.value = getTransformChildren('area', '地区').options || [];
|
||||||
experienceOptions.value = getTransformChildren('experience', '工作经验').options || [];
|
};
|
||||||
scaleOptions.value = getTransformChildren('scale', '公司规模').options || [];
|
|
||||||
areaOptions.value = getTransformChildren('area', '地区').options || [];
|
// 组件挂载时初始化数据
|
||||||
jobTypeOptions.value = getJobTypeData();
|
onBeforeMount(() => {
|
||||||
} catch (error) {
|
initData();
|
||||||
console.error('获取字典数据失败:', error);
|
});
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
// 监听组件显示状态,当显示时重新初始化数据
|
||||||
|
watch(() => props.show, (newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
initData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -313,7 +391,7 @@ const handleClose = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.filter-header {
|
.filter-header {
|
||||||
height: 96rpx;
|
height: 88rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -373,6 +451,33 @@ const handleClose = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header-close-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8rpx;
|
||||||
|
padding: 12rpx 24rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
border: 1rpx solid #256BFA;
|
||||||
|
background: rgba(37, 107, 250, 0.08);
|
||||||
|
|
||||||
|
.close-text {
|
||||||
|
font-size: 39rpx;
|
||||||
|
color: #256BFA;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background: rgba(37, 107, 250, 0.18);
|
||||||
|
transform: scale(0.96);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-body {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-body {
|
.filter-body {
|
||||||
@@ -383,35 +488,40 @@ const handleClose = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.filter-tabs {
|
.filter-tabs {
|
||||||
width: 200rpx;
|
|
||||||
border-right: 1rpx solid #eee;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
width: 250rpx;
|
||||||
|
border-right: 1rpx solid #eee;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
box-shadow: 3rpx 0 15rpx rgba(0, 0, 0, 0.05);
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
.tab-item {
|
.tab-item {
|
||||||
height: 100rpx;
|
height: 130rpx;
|
||||||
line-height: 100rpx;
|
line-height: 130rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 28rpx;
|
font-size: 42rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
position: relative;
|
position: relative;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
color: #256BFA;
|
color: #256BFA;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
box-shadow: 3rpx 0 10rpx rgba(37, 107, 250, 0.1);
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
right: 0;
|
||||||
top: 25%;
|
top: 25%;
|
||||||
width: 4rpx;
|
width: 6rpx;
|
||||||
height: 50%;
|
height: 50%;
|
||||||
background-color: #256BFA;
|
background-color: #256BFA;
|
||||||
border-radius: 2rpx;
|
border-radius: 3rpx 0 0 3rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,24 +531,23 @@ const handleClose = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-right {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-content {
|
.filter-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 40rpx 32rpx;
|
padding: 30rpx 0rpx;
|
||||||
overflow-y: auto;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding-bottom: 160rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-section {
|
.content-section {
|
||||||
|
padding: 0 4%;
|
||||||
|
overflow-y: auto;
|
||||||
|
flex: 12;
|
||||||
.radio-item {
|
.radio-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 30rpx 0;
|
padding: 45rpx 0;
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -452,9 +561,9 @@ const handleClose = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
radio {
|
radio {
|
||||||
width: 28rpx;
|
width: 42rpx;
|
||||||
height: 28rpx;
|
height: 42rpx;
|
||||||
margin-right: 24rpx;
|
margin-right: 36rpx;
|
||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -462,10 +571,10 @@ const handleClose = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
radio .wx-radio-input {
|
radio .wx-radio-input {
|
||||||
width: 28rpx;
|
width: 42rpx;
|
||||||
height: 28rpx;
|
height: 42rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 2rpx solid #ccc;
|
border: 3rpx solid #ccc;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -475,11 +584,11 @@ const handleClose = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
radio .wx-radio-input::before {
|
radio .wx-radio-input::before {
|
||||||
width: 16rpx;
|
width: 24rpx;
|
||||||
height: 16rpx;
|
height: 24rpx;
|
||||||
line-height: 16rpx;
|
line-height: 24rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 12rpx;
|
font-size: 18rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
transform: translate(-50%, -50%) scale(0);
|
transform: translate(-50%, -50%) scale(0);
|
||||||
@@ -492,38 +601,40 @@ const handleClose = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.option-label {
|
.option-label {
|
||||||
font-size: 30rpx;
|
font-size: 45rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 40rpx;
|
line-height: 60rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-footer {
|
.filter-footer {
|
||||||
height: 160rpx;
|
height: 200rpx;
|
||||||
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
border-top: 1rpx solid #eee;
|
border-top: 1rpx solid #eee;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0 -3rpx 15rpx rgba(0, 0, 0, 0.05);
|
||||||
padding: 20rpx 32rpx 100rpx;
|
padding: 30rpx 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
position: relative;
|
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
margin-top: auto;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
.footer-btn {
|
.footer-btn {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin: 0;
|
margin: 0 40rpx;
|
||||||
border-radius: 16rpx;
|
border-radius: 24rpx;
|
||||||
height: 80rpx;
|
height: 100rpx;
|
||||||
line-height: 80rpx;
|
line-height: 100rpx;
|
||||||
font-size: 32rpx;
|
font-size: 45rpx;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
margin-right: 20rpx;
|
margin-right: 30rpx;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
color: #666;
|
color: #666;
|
||||||
border: 1rpx solid #e0e0e0;
|
border: 1rpx solid #e0e0e0;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { inject, computed, toRaw } from 'vue';
|
import { inject, computed, toRaw } from 'vue';
|
||||||
|
import config from '@/config.js';
|
||||||
const { insertSortData, navTo, vacanciesTo } = inject('globalFunction');
|
const { insertSortData, navTo, vacanciesTo } = inject('globalFunction');
|
||||||
import { useRecommedIndexedDBStore } from '@/stores/useRecommedIndexedDBStore.js';
|
import { useRecommedIndexedDBStore } from '@/stores/useRecommedIndexedDBStore.js';
|
||||||
const recommedIndexDb = useRecommedIndexedDBStore();
|
const recommedIndexDb = useRecommedIndexedDBStore();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user