2 Commits

Author SHA1 Message Date
Apcallover
43eb458c6a flat:1 2026-07-02 16:19:08 +08:00
Apcallover
809e57347a =【首页】岗位筛选 - 新增按薪资筛选条件(minSalary/maxSalary)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-01 14:57:27 +08:00
3 changed files with 444 additions and 435 deletions

View File

@@ -53,6 +53,24 @@
</radio-group>
</view>
<!-- 薪资 -->
<view v-if="activeTab === 'salary'" class="content-section">
<radio-group @change="(e) => handleSelect('salary', e)">
<label
v-for="option in salaryOptions"
:key="option.value"
class="radio-item"
:class="{ checked: selectedValues['salary'] === String(option.value) }"
>
<radio
:value="String(option.value)"
:checked="selectedValues['salary'] === 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)">
@@ -143,6 +161,7 @@ const getJobTypeData = () => {
const tabs = [
{ key: 'education', label: '学历要求' },
{ key: 'experience', label: '工作经验' },
{ key: 'salary', label: '薪资' },
{ key: 'scale', label: '公司规模' },
{ key: 'jobType', label: '岗位类型' },
{ key: 'area', label: '地区' }
@@ -155,6 +174,7 @@ const activeTab = ref('education');
const selectedValues = reactive({
education: '',
experience: '',
salary: '',
scale: '',
area: '',
jobType: ''
@@ -167,6 +187,16 @@ const scaleOptions = ref([]);
const areaOptions = ref([]);
const jobTypeOptions = 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);
@@ -202,8 +232,23 @@ const handleClear = () => {
// 确认筛选
const handleConfirm = () => {
console.log('selectedValues:', selectedValues);
emit('confirm', selectedValues);
const payload = { ...selectedValues };
// 将选中的薪资区间转换为 minSalary / maxSalary 参数
// 始终带上 minSalary / maxSalary含空值便于父组件在清除时移除旧值
let minSalary = '';
let maxSalary = '';
if (payload.salary) {
const selected = salaryOptions.value.find((item) => item.value === payload.salary);
if (selected) {
minSalary = selected.min;
maxSalary = selected.max;
}
}
payload.minSalary = minSalary;
payload.maxSalary = maxSalary;
delete payload.salary;
console.log('selectedValues:', payload);
emit('confirm', payload);
handleClose();
};

50
package-lock.json generated
View File

@@ -1,11 +1,13 @@
{
"name": "ks-app-employment-service",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"@dcloudio/uni-ui": "^1.5.11",
"crypto-js": "^3.3.0",
"dayjs": "^1.11.19",
"mp-html": "^2.5.2",
"sm-crypto": "^0.3.13"
},
"devDependencies": {
@@ -13,40 +15,36 @@
}
},
"node_modules/@dcloudio/uni-ui": {
"lockfileVersion": 1,
"dependencies": {
"@dcloudio/uni-ui": {
"version": "1.5.11",
"resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz",
"integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw=="
"version": "1.5.12",
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.12.tgz",
"integrity": "sha512-mGDl2OZSz7D8xcUAzJegWDHOqB4MEFBSW9Esb/oJiu2/3Gk9+P/Z4bA4JZ9jv9VWBYbMrYwaTfK1Z728kABdYg==",
"license": "Apache-2.0"
},
"node_modules/crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==",
"dev": true
"dev": true,
"license": "MIT"
},
"node_modules/dayjs": {
"crypto-js": {
"version": "3.3.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-3.3.0.tgz",
"integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q=="
"version": "1.11.21",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.21.tgz",
"integrity": "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==",
"license": "MIT"
},
"dayjs": {
"version": "1.11.19",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.19.tgz",
"integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
},
"jsbn": {
"node_modules/jsbn": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==",
"license": "MIT"
},
"sm-crypto": {
"version": "0.3.13",
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
"requires": {
"node_modules/sm-crypto": {
"version": "0.3.14",
"resolved": "https://registry.npmjs.org/sm-crypto/-/sm-crypto-0.3.14.tgz",
"integrity": "sha512-sR7NuGAJH93Om8keAF2/rj1EqFzEiUey4aKGyDo3nQ2BiVqhgq8UkiIoIp5qhV9w4pG7qArhfqyewcG8AbhXbg==",
"license": "MIT",
"dependencies": {
"jsbn": "^1.1.0"
}
}

File diff suppressed because it is too large Load Diff