Compare commits
18 Commits
e6e1b6ada1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45aa4e7351 | ||
|
|
4c8f79555d | ||
|
|
8d44d5b351 | ||
|
|
5a1ee392a9 | ||
|
|
dee3d7d9be | ||
|
|
2c29c2a792 | ||
|
|
4d69389c99 | ||
|
|
21dd282943 | ||
|
|
5d08291ef6 | ||
|
|
9ce22a7949 | ||
|
|
9a5ac849a0 | ||
|
|
d7b7f8d111 | ||
|
|
3980aecd56 | ||
|
|
805122c23f | ||
|
|
ba9e1d279d | ||
|
|
4ea7b8abb4 | ||
|
|
43eb458c6a | ||
|
|
809e57347a |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -24,3 +24,4 @@ pnpm-debug.log*
|
|||||||
/hs_err_pid*
|
/hs_err_pid*
|
||||||
*.local
|
*.local
|
||||||
yarn.lock
|
yarn.lock
|
||||||
|
.codegraph
|
||||||
@@ -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
|
||||||
@@ -17,6 +26,24 @@
|
|||||||
<view class="filter-right">
|
<view class="filter-right">
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<view class="filter-content">
|
<view class="filter-content">
|
||||||
|
<!-- 薪资 -->
|
||||||
|
<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 === 'education'" class="content-section">
|
<view v-if="activeTab === 'education'" class="content-section">
|
||||||
<radio-group @change="(e) => handleSelect('education', e)">
|
<radio-group @change="(e) => handleSelect('education', e)">
|
||||||
@@ -71,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>
|
||||||
|
|
||||||
<!-- 岗位类型 -->
|
<!-- 岗位类型 -->
|
||||||
@@ -114,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>
|
||||||
|
|
||||||
@@ -141,6 +169,7 @@ const getJobTypeData = () => {
|
|||||||
|
|
||||||
// 标签页数据
|
// 标签页数据
|
||||||
const tabs = [
|
const tabs = [
|
||||||
|
{ key: 'salary', label: '薪资' },
|
||||||
{ key: 'education', label: '学历要求' },
|
{ key: 'education', label: '学历要求' },
|
||||||
{ key: 'experience', label: '工作经验' },
|
{ key: 'experience', label: '工作经验' },
|
||||||
{ key: 'scale', label: '公司规模' },
|
{ key: 'scale', label: '公司规模' },
|
||||||
@@ -149,14 +178,15 @@ const tabs = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
// 当前激活的标签
|
// 当前激活的标签
|
||||||
const activeTab = ref('education');
|
const activeTab = ref('salary');
|
||||||
|
|
||||||
// 存储已选中的值
|
// 存储已选中的值
|
||||||
const selectedValues = reactive({
|
const selectedValues = reactive({
|
||||||
education: '',
|
education: '',
|
||||||
experience: '',
|
experience: '',
|
||||||
|
salary: '',
|
||||||
scale: '',
|
scale: '',
|
||||||
area: '',
|
area: [],
|
||||||
jobType: ''
|
jobType: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -167,6 +197,16 @@ const scaleOptions = ref([]);
|
|||||||
const areaOptions = ref([]);
|
const areaOptions = ref([]);
|
||||||
const jobTypeOptions = 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);
|
const loading = ref(true);
|
||||||
|
|
||||||
@@ -188,22 +228,76 @@ 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') {
|
||||||
|
selectedValues[key] = val ? val.split(',').map((s) => s.trim()) : [];
|
||||||
|
} else if (Array.isArray(val)) {
|
||||||
|
selectedValues[key] = val.map((v) => String(v));
|
||||||
|
} else {
|
||||||
|
selectedValues[key] = [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 判断地区选项是否被选中(兼容数组和字符串)
|
||||||
|
const isAreaSelected = (value) => {
|
||||||
|
const areaVal = selectedValues.area;
|
||||||
|
if (Array.isArray(areaVal)) {
|
||||||
|
return areaVal.includes(value);
|
||||||
|
}
|
||||||
|
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 = () => {
|
||||||
console.log('selectedValues:', selectedValues);
|
const payload = { ...selectedValues };
|
||||||
emit('confirm', selectedValues);
|
// 将多选的地区数组转为逗号分隔字符串(兼容各种格式)
|
||||||
|
if (Array.isArray(payload.area) && payload.area.length > 0) {
|
||||||
|
payload.area = payload.area.map((v) => String(v)).join(',');
|
||||||
|
} else if (typeof payload.area === 'string' && payload.area) {
|
||||||
|
// 如果已经是逗号分隔字符串,保持原样
|
||||||
|
payload.area = payload.area;
|
||||||
|
} else {
|
||||||
|
payload.area = '';
|
||||||
|
}
|
||||||
|
console.log('[new-filter-page] area value to emit:', payload.area);
|
||||||
|
// 将选中的薪资区间转换为 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();
|
handleClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -224,22 +318,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;
|
||||||
@@ -250,15 +355,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>
|
||||||
|
|||||||
50
package-lock.json
generated
50
package-lock.json
generated
@@ -1,11 +1,13 @@
|
|||||||
{
|
{
|
||||||
|
"name": "ks-app-employment-service",
|
||||||
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dcloudio/uni-ui": "^1.5.11",
|
"@dcloudio/uni-ui": "^1.5.11",
|
||||||
|
"crypto-js": "^3.3.0",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.19",
|
||||||
"mp-html": "^2.5.2",
|
|
||||||
"sm-crypto": "^0.3.13"
|
"sm-crypto": "^0.3.13"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -13,40 +15,36 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@dcloudio/uni-ui": {
|
"node_modules/@dcloudio/uni-ui": {
|
||||||
"lockfileVersion": 1,
|
"version": "1.5.12",
|
||||||
"dependencies": {
|
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.12.tgz",
|
||||||
"@dcloudio/uni-ui": {
|
"integrity": "sha512-mGDl2OZSz7D8xcUAzJegWDHOqB4MEFBSW9Esb/oJiu2/3Gk9+P/Z4bA4JZ9jv9VWBYbMrYwaTfK1Z728kABdYg==",
|
||||||
"version": "1.5.11",
|
"license": "Apache-2.0"
|
||||||
"resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz",
|
|
||||||
"integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw=="
|
|
||||||
},
|
},
|
||||||
"node_modules/crypto-js": {
|
"node_modules/crypto-js": {
|
||||||
"version": "4.2.0",
|
"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==",
|
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/dayjs": {
|
"node_modules/dayjs": {
|
||||||
"crypto-js": {
|
"version": "1.11.21",
|
||||||
"version": "3.3.0",
|
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.21.tgz",
|
||||||
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-3.3.0.tgz",
|
"integrity": "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==",
|
||||||
"integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q=="
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"dayjs": {
|
"node_modules/jsbn": {
|
||||||
"version": "1.11.19",
|
|
||||||
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.19.tgz",
|
|
||||||
"integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
|
|
||||||
},
|
|
||||||
"jsbn": {
|
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz",
|
||||||
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
|
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==",
|
||||||
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"sm-crypto": {
|
"node_modules/sm-crypto": {
|
||||||
"version": "0.3.13",
|
"version": "0.3.14",
|
||||||
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
|
"resolved": "https://registry.npmjs.org/sm-crypto/-/sm-crypto-0.3.14.tgz",
|
||||||
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
|
"integrity": "sha512-sR7NuGAJH93Om8keAF2/rj1EqFzEiUey4aKGyDo3nQ2BiVqhgq8UkiIoIp5qhV9w4pG7qArhfqyewcG8AbhXbg==",
|
||||||
"requires": {
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
"jsbn": "^1.1.0"
|
"jsbn": "^1.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,8 +63,9 @@
|
|||||||
<header class="head">
|
<header class="head">
|
||||||
<view class="main-header">
|
<view class="main-header">
|
||||||
<image src="/static/icon/Hamburger-button.png" @click="toggleDrawer"></image>
|
<image src="/static/icon/Hamburger-button.png" @click="toggleDrawer"></image>
|
||||||
<!-- <view class="title">{{ config.appInfo.areaName }}岗位推荐</view> -->
|
<view class="back-home-btn" @click="navTo('/pages/index/index')">
|
||||||
<!-- <view class="title">{{ config.appInfo.areaName }}岗位推荐</view> -->
|
<text class="back-home-text">返回</text>
|
||||||
|
</view>
|
||||||
<image src="/static/icon/Comment-one.png" @click="addNewDialogue"></image>
|
<image src="/static/icon/Comment-one.png" @click="addNewDialogue"></image>
|
||||||
</view>
|
</view>
|
||||||
</header>
|
</header>
|
||||||
@@ -375,6 +376,19 @@ footer-height = 98rpx
|
|||||||
image
|
image
|
||||||
width: 36rpx;
|
width: 36rpx;
|
||||||
height: 37rpx;
|
height: 37rpx;
|
||||||
|
.back-home-btn
|
||||||
|
display: flex
|
||||||
|
align-items: center
|
||||||
|
justify-content: center
|
||||||
|
padding: 0 20rpx
|
||||||
|
height: 60rpx
|
||||||
|
border-radius: 12rpx
|
||||||
|
&:active
|
||||||
|
background: rgba(0, 0, 0, 0.05)
|
||||||
|
.back-home-text
|
||||||
|
font-size: 30rpx
|
||||||
|
color: #333
|
||||||
|
font-weight: 500
|
||||||
|
|
||||||
.chatmain-warpper
|
.chatmain-warpper
|
||||||
height: 'calc(100% - %s)' %( header-height + footer-height)
|
height: 'calc(100% - %s)' %( header-height + footer-height)
|
||||||
|
|||||||
@@ -227,8 +227,12 @@
|
|||||||
placeholder-class="inputplaceholder"
|
placeholder-class="inputplaceholder"
|
||||||
class="input"
|
class="input"
|
||||||
@confirm="sendMessage"
|
@confirm="sendMessage"
|
||||||
|
@click="handleInputClick"
|
||||||
|
@focus="handleInputFocus"
|
||||||
:disabled="isTyping"
|
:disabled="isTyping"
|
||||||
:adjust-position="true"
|
:adjust-position="true"
|
||||||
|
:focus="inputFocused"
|
||||||
|
cursor-spacing="20"
|
||||||
placeholder="请输入您想找的岗位信息或就政策信息【比如:设计师、10000-12000、广州】【比如:今年喀什地区高校毕业生有什么就业政策】"
|
placeholder="请输入您想找的岗位信息或就政策信息【比如:设计师、10000-12000、广州】【比如:今年喀什地区高校毕业生有什么就业政策】"
|
||||||
v-show="!isVoice"
|
v-show="!isVoice"
|
||||||
/>
|
/>
|
||||||
@@ -421,6 +425,7 @@ const { speak, pause, resume, isSpeaking, isPaused, cancelAudio } = useTTSPlayer
|
|||||||
const instance = getCurrentInstance();
|
const instance = getCurrentInstance();
|
||||||
|
|
||||||
// state
|
// state
|
||||||
|
const ACTIVE_TAB_KEY = 'chat_active_tab';
|
||||||
const activeTab = ref('policy'); // 'policy' or 'job'
|
const activeTab = ref('policy'); // 'policy' or 'job'
|
||||||
const queries = ref([]);
|
const queries = ref([]);
|
||||||
const guessList = ref([]);
|
const guessList = ref([]);
|
||||||
@@ -439,6 +444,7 @@ const feebackData = ref(null);
|
|||||||
// 删除功能相关状态
|
// 删除功能相关状态
|
||||||
const isSelectMode = ref(false);
|
const isSelectMode = ref(false);
|
||||||
const selectedMessages = ref([]);
|
const selectedMessages = ref([]);
|
||||||
|
const inputFocused = ref(false);
|
||||||
// ref for DOM element
|
// ref for DOM element
|
||||||
const voiceBtn = ref(null);
|
const voiceBtn = ref(null);
|
||||||
const feeback = ref(null);
|
const feeback = ref(null);
|
||||||
@@ -466,7 +472,16 @@ const audiowaveStyle = computed(() => {
|
|||||||
: '#f1f1f1';
|
: '#f1f1f1';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function setActiveTab(tab) {
|
||||||
|
activeTab.value = tab;
|
||||||
|
uni.setStorageSync(ACTIVE_TAB_KEY, tab);
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
const cachedActiveTab = uni.getStorageSync(ACTIVE_TAB_KEY);
|
||||||
|
if (cachedActiveTab === 'policy' || cachedActiveTab === 'job') {
|
||||||
|
activeTab.value = cachedActiveTab;
|
||||||
|
}
|
||||||
changeQueries();
|
changeQueries();
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
isAudioPermission.value = await requestMicPermission();
|
isAudioPermission.value = await requestMicPermission();
|
||||||
@@ -541,10 +556,13 @@ const sendMessage = (text) => {
|
|||||||
if (speechIndex.value !== index) {
|
if (speechIndex.value !== index) {
|
||||||
// 延迟TTS,等待内容更完整
|
// 延迟TTS,等待内容更完整
|
||||||
// 只有在内容长度超过50个字符或者包含岗位信息时才开始朗读
|
// 只有在内容长度超过50个字符或者包含岗位信息时才开始朗读
|
||||||
const hasJobInfo = message.displayText.includes('```job-json') ||
|
const hasJobInfo = isJobCardMessage(message) ||
|
||||||
message.displayText.includes('岗位') ||
|
message.displayText.includes('岗位') ||
|
||||||
message.displayText.includes('公司') ||
|
message.displayText.includes('公司') ||
|
||||||
message.displayText.includes('薪资');
|
message.displayText.includes('薪资');
|
||||||
|
if (hasJobInfo) {
|
||||||
|
setActiveTab('job');
|
||||||
|
}
|
||||||
|
|
||||||
if (message.displayText.length > 50 || hasJobInfo) {
|
if (message.displayText.length > 50 || hasJobInfo) {
|
||||||
console.log('🎵 Starting streaming TTS for message index:', index);
|
console.log('🎵 Starting streaming TTS for message index:', index);
|
||||||
@@ -573,6 +591,9 @@ const sendMessage = (text) => {
|
|||||||
const lastMessageIndex = messages.value.length - 1;
|
const lastMessageIndex = messages.value.length - 1;
|
||||||
if (lastMessageIndex >= 0) {
|
if (lastMessageIndex >= 0) {
|
||||||
const lastMessage = messages.value[lastMessageIndex];
|
const lastMessage = messages.value[lastMessageIndex];
|
||||||
|
if (isJobCardMessage(lastMessage)) {
|
||||||
|
setActiveTab('job');
|
||||||
|
}
|
||||||
if (!lastMessage.self && lastMessage.displayText && lastMessage.displayText.trim()) {
|
if (!lastMessage.self && lastMessage.displayText && lastMessage.displayText.trim()) {
|
||||||
console.log('🎵 Final TTS for complete message');
|
console.log('🎵 Final TTS for complete message');
|
||||||
console.log('📝 Final text length:', lastMessage.displayText.length);
|
console.log('📝 Final text length:', lastMessage.displayText.length);
|
||||||
@@ -1357,6 +1378,22 @@ function closeFile() {
|
|||||||
showfile.value = false;
|
showfile.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleInputClick() {
|
||||||
|
inputFocused.value = false;
|
||||||
|
nextTick(() => {
|
||||||
|
inputFocused.value = true;
|
||||||
|
});
|
||||||
|
console.log('[键盘] 点击输入框,尝试唤起键盘');
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleInputFocus() {
|
||||||
|
console.log('[键盘] 输入框已获得焦点,键盘应已弹出');
|
||||||
|
$api.msg('输入框已激活');
|
||||||
|
nextTick(() => {
|
||||||
|
scrollToBottom();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function copyMarkdown(value) {
|
function copyMarkdown(value) {
|
||||||
$api.copyText(value);
|
$api.copyText(value);
|
||||||
}
|
}
|
||||||
@@ -1481,7 +1518,18 @@ function getRandomJobQueries(queries, count = 2) {
|
|||||||
|
|
||||||
// 切换tab
|
// 切换tab
|
||||||
function switchTab(tab) {
|
function switchTab(tab) {
|
||||||
activeTab.value = tab;
|
setActiveTab(tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isJobCardMessage(msg) {
|
||||||
|
const content = msg?.displayText || '';
|
||||||
|
return (
|
||||||
|
/```\s*job-json/.test(content) ||
|
||||||
|
content.includes('岗位推荐') ||
|
||||||
|
content.includes('推荐岗位') ||
|
||||||
|
content.includes('岗位信息') ||
|
||||||
|
(content.includes('```') && content.includes('公司') && content.includes('薪资'))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查消息是否应该显示在当前tab
|
// 检查消息是否应该显示在当前tab
|
||||||
@@ -1490,26 +1538,10 @@ function shouldShowMessage(msg) {
|
|||||||
return true; // 用户自己的消息总是显示
|
return true; // 用户自己的消息总是显示
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isJobCard = isJobCardMessage(msg);
|
||||||
if (activeTab.value === 'policy') {
|
if (activeTab.value === 'policy') {
|
||||||
// 政策查询tab:显示除了岗位卡片以外的所有内容
|
|
||||||
// 岗位卡片通常包含特定的标记,如```job-json或岗位推荐等关键词
|
|
||||||
const isJobCard = msg.displayText && (
|
|
||||||
msg.displayText.includes('```job-json') ||
|
|
||||||
msg.displayText.includes('岗位推荐') ||
|
|
||||||
msg.displayText.includes('推荐岗位') ||
|
|
||||||
msg.displayText.includes('岗位信息') ||
|
|
||||||
(msg.displayText.includes('```') && msg.displayText.includes('公司') && msg.displayText.includes('薪资'))
|
|
||||||
);
|
|
||||||
return !isJobCard;
|
return !isJobCard;
|
||||||
} else {
|
} else {
|
||||||
// 岗位推荐tab:只显示岗位卡片内容
|
|
||||||
const isJobCard = msg.displayText && (
|
|
||||||
msg.displayText.includes('```job-json') ||
|
|
||||||
msg.displayText.includes('岗位推荐') ||
|
|
||||||
msg.displayText.includes('推荐岗位') ||
|
|
||||||
msg.displayText.includes('岗位信息') ||
|
|
||||||
(msg.displayText.includes('```') && msg.displayText.includes('公司') && msg.displayText.includes('薪资'))
|
|
||||||
);
|
|
||||||
return isJobCard;
|
return isJobCard;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container safe-area-top">
|
<view class="container safe-area-top">
|
||||||
<!-- 自定义头部搜索框 -->
|
<!-- 自定义头部搜索框 -->
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
|
<view class="custom-header" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef H5 -->
|
||||||
<view class="custom-header">
|
<view class="custom-header">
|
||||||
|
<!-- #endif -->
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<!-- <image class="btnback button-click" src="@/static/icon/back.png" @click="navBack"></image> -->
|
<!-- #ifdef H5 -->
|
||||||
|
<image class="btnback button-click" src="@/static/icon/back.png" @click="navBack"></image>
|
||||||
|
<!-- #endif -->
|
||||||
<view class="search-box">
|
<view class="search-box">
|
||||||
<uni-icons
|
<uni-icons
|
||||||
class="iconsearch"
|
class="iconsearch"
|
||||||
@@ -55,6 +62,11 @@ import { storeToRefs } from 'pinia';
|
|||||||
import { useColumnCount } from '@/hook/useColumnCount';
|
import { useColumnCount } from '@/hook/useColumnCount';
|
||||||
import img from '@/static/icon/filter.png';
|
import img from '@/static/icon/filter.png';
|
||||||
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
||||||
|
const statusBarHeight = ref(0);
|
||||||
|
// #ifdef H5
|
||||||
|
const sysInfo = uni.getSystemInfoSync();
|
||||||
|
statusBarHeight.value = sysInfo.statusBarHeight || 0;
|
||||||
|
// #endif
|
||||||
const searchValue = ref('');
|
const searchValue = ref('');
|
||||||
const historyList = ref([]);
|
const historyList = ref([]);
|
||||||
const searchParams = ref({});
|
const searchParams = ref({});
|
||||||
@@ -79,7 +91,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 +182,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;
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import {
|
|||||||
|
|
||||||
// 静态树 O(1) 超快查询!!!!!
|
// 静态树 O(1) 超快查询!!!!!
|
||||||
let IndustryMap = null
|
let IndustryMap = null
|
||||||
|
// 复用同一批字典请求,避免 App 启动和页面组件同时初始化时产生竞态。
|
||||||
|
let dictDataPromise = null
|
||||||
// 构建索引
|
// 构建索引
|
||||||
function buildIndex(tree) {
|
function buildIndex(tree) {
|
||||||
const map = new Map();
|
const map = new Map();
|
||||||
@@ -50,46 +52,54 @@ const useDictStore = defineStore("dict", () => {
|
|||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (complete.value) return
|
if (complete.value) return Promise.resolve()
|
||||||
if (dictLoading.value) return
|
// App.vue 会在启动时加载字典,页面组件也可能同时加载。
|
||||||
dictLoading.value = true
|
// 不能在请求进行中直接 return,否则调用方会把当时的空 state 复制下来。
|
||||||
try {
|
if (dictDataPromise) return dictDataPromise
|
||||||
const [education, experience, area, scale, sex, affiliation, nature, noticeType] =
|
|
||||||
await Promise.all([
|
|
||||||
getDictSelectOption('education'),
|
|
||||||
getDictSelectOption('experience'),
|
|
||||||
getDictSelectOption('area', true),
|
|
||||||
getDictSelectOption('scale'),
|
|
||||||
getDictSelectOption('app_sex'),
|
|
||||||
getDictSelectOption('political_affiliation'),
|
|
||||||
getDictSelectOption('company_nature'),
|
|
||||||
getDictSelectOption('sys_notice_type'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
state.education = education;
|
dictLoading.value = true
|
||||||
state.experience = experience;
|
dictDataPromise = (async () => {
|
||||||
state.area = area;
|
try {
|
||||||
state.scale = scale;
|
const [education, experience, area, scale, sex, affiliation, nature, noticeType] =
|
||||||
state.sex = sex;
|
await Promise.all([
|
||||||
state.affiliation = affiliation;
|
getDictSelectOption('education'),
|
||||||
state.nature = nature
|
getDictSelectOption('experience'),
|
||||||
state.noticeType = noticeType
|
getDictSelectOption('area', true),
|
||||||
complete.value = true
|
getDictSelectOption('scale'),
|
||||||
getIndustryDict() // 获取行业
|
getDictSelectOption('app_sex'),
|
||||||
} catch (error) {
|
getDictSelectOption('political_affiliation'),
|
||||||
console.error('Error fetching dictionary data:', error);
|
getDictSelectOption('company_nature'),
|
||||||
// 确保即使出错也能返回空数组
|
getDictSelectOption('sys_notice_type'),
|
||||||
state.education = [];
|
]);
|
||||||
state.experience = [];
|
|
||||||
state.area = [];
|
state.education = education;
|
||||||
state.scale = [];
|
state.experience = experience;
|
||||||
state.sex = [];
|
state.area = area;
|
||||||
state.affiliation = [];
|
state.scale = scale;
|
||||||
state.nature = [];
|
state.sex = sex;
|
||||||
state.noticeType = [];
|
state.affiliation = affiliation;
|
||||||
} finally {
|
state.nature = nature
|
||||||
dictLoading.value = false
|
state.noticeType = noticeType
|
||||||
}
|
complete.value = true
|
||||||
|
getIndustryDict() // 获取行业
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching dictionary data:', error);
|
||||||
|
// 确保即使出错也能返回空数组
|
||||||
|
state.education = [];
|
||||||
|
state.experience = [];
|
||||||
|
state.area = [];
|
||||||
|
state.scale = [];
|
||||||
|
state.sex = [];
|
||||||
|
state.affiliation = [];
|
||||||
|
state.nature = [];
|
||||||
|
state.noticeType = [];
|
||||||
|
} finally {
|
||||||
|
dictLoading.value = false
|
||||||
|
dictDataPromise = null
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
|
return dictDataPromise
|
||||||
};
|
};
|
||||||
|
|
||||||
async function getIndustryDict() {
|
async function getIndustryDict() {
|
||||||
|
|||||||
Reference in New Issue
Block a user