Compare commits
18 Commits
21dd282943
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
446882b5a1 | ||
|
|
847704f6ff | ||
|
|
980cad4e54 | ||
|
|
45aa4e7351 | ||
|
|
4c8f79555d | ||
|
|
8d44d5b351 | ||
|
|
5a1ee392a9 | ||
|
|
dee3d7d9be | ||
|
|
2c29c2a792 | ||
|
|
4d69389c99 | ||
|
|
5d08291ef6 | ||
|
|
9ce22a7949 | ||
|
|
9a5ac849a0 | ||
|
|
d7b7f8d111 | ||
|
|
3980aecd56 | ||
|
|
805122c23f | ||
|
|
ba9e1d279d | ||
|
|
4ea7b8abb4 |
@@ -1,5 +1,14 @@
|
||||
<template>
|
||||
<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
|
||||
@@ -17,6 +26,24 @@
|
||||
<view class="filter-right">
|
||||
<!-- 内容区域 -->
|
||||
<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">
|
||||
<radio-group @change="(e) => handleSelect('education', e)">
|
||||
@@ -53,24 +80,6 @@
|
||||
</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)">
|
||||
@@ -89,22 +98,22 @@
|
||||
</radio-group>
|
||||
</view>
|
||||
|
||||
<!-- 地区 -->
|
||||
<!-- 地区(多选) -->
|
||||
<view v-if="activeTab === 'area'" class="content-section">
|
||||
<radio-group @change="(e) => handleSelect('area', e)">
|
||||
<checkbox-group @change="(e) => handleCheckboxSelect('area', e)">
|
||||
<label
|
||||
v-for="option in areaOptions"
|
||||
:key="option.value"
|
||||
class="radio-item"
|
||||
:class="{ checked: selectedValues['area'] === String(option.value) }"
|
||||
:class="{ checked: isAreaSelected(String(option.value)) }"
|
||||
>
|
||||
<radio
|
||||
<checkbox
|
||||
:value="String(option.value)"
|
||||
:checked="selectedValues['area'] === String(option.value)"
|
||||
:checked="isAreaSelected(String(option.value))"
|
||||
/>
|
||||
<text class="option-label">{{ option.label }}</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
|
||||
<!-- 岗位类型 -->
|
||||
@@ -132,6 +141,7 @@
|
||||
<button class="footer-btn confirm-btn" @click="handleConfirm">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</view><!-- end filter-body -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -159,16 +169,16 @@ const getJobTypeData = () => {
|
||||
|
||||
// 标签页数据
|
||||
const tabs = [
|
||||
{ key: 'salary', label: '薪资' },
|
||||
{ key: 'education', label: '学历要求' },
|
||||
{ key: 'experience', label: '工作经验' },
|
||||
{ key: 'salary', label: '薪资' },
|
||||
{ key: 'scale', label: '公司规模' },
|
||||
{ key: 'jobType', label: '岗位类型' },
|
||||
{ key: 'area', label: '地区' }
|
||||
];
|
||||
|
||||
// 当前激活的标签
|
||||
const activeTab = ref('education');
|
||||
const activeTab = ref('salary');
|
||||
|
||||
// 存储已选中的值
|
||||
const selectedValues = reactive({
|
||||
@@ -176,7 +186,7 @@ const selectedValues = reactive({
|
||||
experience: '',
|
||||
salary: '',
|
||||
scale: '',
|
||||
area: '',
|
||||
area: [],
|
||||
jobType: ''
|
||||
});
|
||||
|
||||
@@ -218,21 +228,60 @@ onBeforeMount(async () => {
|
||||
}
|
||||
});
|
||||
|
||||
// 处理选项选择
|
||||
// 处理单选选项选择
|
||||
const handleSelect = (key, e) => {
|
||||
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 = () => {
|
||||
Object.keys(selectedValues).forEach((key) => {
|
||||
selectedValues[key] = '';
|
||||
if (key === 'area') {
|
||||
selectedValues[key] = [];
|
||||
} else {
|
||||
selectedValues[key] = '';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 确认筛选
|
||||
const handleConfirm = () => {
|
||||
const payload = { ...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 = '';
|
||||
@@ -269,22 +318,33 @@ const handleClose = () => {
|
||||
background-color: #fff;
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.filter-header {
|
||||
height: 96rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
justify-content: center;
|
||||
padding: 0 32rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
|
||||
.back-btn {
|
||||
font-size: 36rpx;
|
||||
.header-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.header-close {
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -295,15 +355,42 @@ const handleClose = () => {
|
||||
&:active {
|
||||
background-color: rgba(37, 107, 250, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.filter-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
.close-icon {
|
||||
position: relative;
|
||||
width: 28rpx;
|
||||
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 {
|
||||
width: 200rpx;
|
||||
border-right: 1rpx solid #eee;
|
||||
|
||||
@@ -21,14 +21,8 @@
|
||||
</view>
|
||||
<view class="card-bottom">
|
||||
<view>{{ job.postingDate }}</view>
|
||||
<view>
|
||||
<convert-distance
|
||||
: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 class="card-bottom-right">
|
||||
<text v-if="job.regionName">地区:{{ job.regionName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -97,8 +97,8 @@
|
||||
"sdkConfigs" : {
|
||||
"maps" : {
|
||||
"amap" : {
|
||||
"key" : "9cfc9370bd8a941951da1cea0308e9e3",
|
||||
"securityJsCode" : "7b16386c7f744c3ca05595965f2b037f",
|
||||
"key" : "b79ea14cb17704ab1a1a32c12d72f634",
|
||||
"securityJsCode" : "04795ef5b20919d34cadc2e33e01d609",
|
||||
"serviceHost" : ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,9 +42,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import SelectJobs from '@/components/selectJobs/selectJobs.vue';
|
||||
import { reactive, inject, ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
|
||||
const { $api, navTo, navBack, config } = inject('globalFunction');
|
||||
@@ -76,6 +75,7 @@
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '', // 工作经历ID(编辑时使用)
|
||||
companyName: '',
|
||||
position: '',
|
||||
userId: '', // 将在确认时动态获取
|
||||
@@ -93,15 +93,17 @@
|
||||
pageType.value = options.type;
|
||||
}
|
||||
|
||||
// 如果是编辑模式,解析传递的数据
|
||||
if (options.type === 'edit' && options.data) {
|
||||
// 如果是编辑模式,从本地存储获取数据(避免URL长度限制)
|
||||
if (options.type === 'edit') {
|
||||
try {
|
||||
editData.value = JSON.parse(decodeURIComponent(options.data));
|
||||
console.log('编辑数据:', editData.value);
|
||||
const storedData = uni.getStorageSync('editWorkExperienceData');
|
||||
if (storedData) {
|
||||
editData.value = storedData;
|
||||
console.log('编辑数据:', editData.value);
|
||||
|
||||
// 回显数据到表单
|
||||
if (editData.value) {
|
||||
// 回显数据到表单
|
||||
formData.companyName = editData.value.companyName || '';
|
||||
formData.id = editData.value.id || '';
|
||||
formData.position = editData.value.position || '';
|
||||
formData.startDate = editData.value.startDate || '';
|
||||
formData.endDate = editData.value.endDate || '至今';
|
||||
@@ -110,6 +112,9 @@
|
||||
// 同步日期选择器的显示
|
||||
startDate.value = editData.value.startDate || '';
|
||||
endDate.value = editData.value.endDate || '至今';
|
||||
|
||||
// 使用完后清除存储
|
||||
uni.removeStorageSync('editWorkExperienceData');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('解析编辑数据失败:', error);
|
||||
@@ -196,13 +201,16 @@
|
||||
};
|
||||
|
||||
console.log('请求参数:', params);
|
||||
if (pageType.value === 'edit') {
|
||||
params.id = formData.id;
|
||||
}
|
||||
console.log('页面类型:', pageType.value);
|
||||
|
||||
let resData;
|
||||
// 根据页面类型调用不同的接口
|
||||
if (pageType.value === 'edit' && editData.value?.id) {
|
||||
if (pageType.value === 'edit' && formData.id) {
|
||||
// 编辑模式:调用更新接口
|
||||
resData = await $api.createRequest(`/app/userworkexperiences/edit`, {...params, id: editData.value.id}, 'put');
|
||||
resData = await $api.createRequest(`/app/userworkexperiences/edit`, params, 'put');
|
||||
console.log('编辑接口响应:', resData);
|
||||
} else {
|
||||
// 添加模式:调用新增接口
|
||||
|
||||
@@ -63,8 +63,9 @@
|
||||
<header class="head">
|
||||
<view class="main-header">
|
||||
<image src="/static/icon/Hamburger-button.png" @click="toggleDrawer"></image>
|
||||
<!-- <view class="title">{{ config.appInfo.areaName }}岗位推荐</view> -->
|
||||
<!-- <view class="title">{{ config.appInfo.areaName }}岗位推荐</view> -->
|
||||
<view class="back-home-btn" @click="navTo('/pages/index/index')">
|
||||
<text class="back-home-text">返回</text>
|
||||
</view>
|
||||
<image src="/static/icon/Comment-one.png" @click="addNewDialogue"></image>
|
||||
</view>
|
||||
</header>
|
||||
@@ -375,6 +376,19 @@ footer-height = 98rpx
|
||||
image
|
||||
width: 36rpx;
|
||||
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
|
||||
height: 'calc(100% - %s)' %( header-height + footer-height)
|
||||
|
||||
@@ -227,8 +227,12 @@
|
||||
placeholder-class="inputplaceholder"
|
||||
class="input"
|
||||
@confirm="sendMessage"
|
||||
@click="handleInputClick"
|
||||
@focus="handleInputFocus"
|
||||
:disabled="isTyping"
|
||||
:adjust-position="true"
|
||||
:focus="inputFocused"
|
||||
cursor-spacing="20"
|
||||
placeholder="请输入您想找的岗位信息或就政策信息【比如:设计师、10000-12000、广州】【比如:今年喀什地区高校毕业生有什么就业政策】"
|
||||
v-show="!isVoice"
|
||||
/>
|
||||
@@ -421,6 +425,7 @@ const { speak, pause, resume, isSpeaking, isPaused, cancelAudio } = useTTSPlayer
|
||||
const instance = getCurrentInstance();
|
||||
|
||||
// state
|
||||
const ACTIVE_TAB_KEY = 'chat_active_tab';
|
||||
const activeTab = ref('policy'); // 'policy' or 'job'
|
||||
const queries = ref([]);
|
||||
const guessList = ref([]);
|
||||
@@ -439,6 +444,7 @@ const feebackData = ref(null);
|
||||
// 删除功能相关状态
|
||||
const isSelectMode = ref(false);
|
||||
const selectedMessages = ref([]);
|
||||
const inputFocused = ref(false);
|
||||
// ref for DOM element
|
||||
const voiceBtn = ref(null);
|
||||
const feeback = ref(null);
|
||||
@@ -466,7 +472,16 @@ const audiowaveStyle = computed(() => {
|
||||
: '#f1f1f1';
|
||||
});
|
||||
|
||||
function setActiveTab(tab) {
|
||||
activeTab.value = tab;
|
||||
uni.setStorageSync(ACTIVE_TAB_KEY, tab);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const cachedActiveTab = uni.getStorageSync(ACTIVE_TAB_KEY);
|
||||
if (cachedActiveTab === 'policy' || cachedActiveTab === 'job') {
|
||||
activeTab.value = cachedActiveTab;
|
||||
}
|
||||
changeQueries();
|
||||
scrollToBottom();
|
||||
isAudioPermission.value = await requestMicPermission();
|
||||
@@ -541,10 +556,13 @@ const sendMessage = (text) => {
|
||||
if (speechIndex.value !== index) {
|
||||
// 延迟TTS,等待内容更完整
|
||||
// 只有在内容长度超过50个字符或者包含岗位信息时才开始朗读
|
||||
const hasJobInfo = message.displayText.includes('```job-json') ||
|
||||
const hasJobInfo = isJobCardMessage(message) ||
|
||||
message.displayText.includes('岗位') ||
|
||||
message.displayText.includes('公司') ||
|
||||
message.displayText.includes('薪资');
|
||||
if (hasJobInfo) {
|
||||
setActiveTab('job');
|
||||
}
|
||||
|
||||
if (message.displayText.length > 50 || hasJobInfo) {
|
||||
console.log('🎵 Starting streaming TTS for message index:', index);
|
||||
@@ -573,6 +591,9 @@ const sendMessage = (text) => {
|
||||
const lastMessageIndex = messages.value.length - 1;
|
||||
if (lastMessageIndex >= 0) {
|
||||
const lastMessage = messages.value[lastMessageIndex];
|
||||
if (isJobCardMessage(lastMessage)) {
|
||||
setActiveTab('job');
|
||||
}
|
||||
if (!lastMessage.self && lastMessage.displayText && lastMessage.displayText.trim()) {
|
||||
console.log('🎵 Final TTS for complete message');
|
||||
console.log('📝 Final text length:', lastMessage.displayText.length);
|
||||
@@ -1357,6 +1378,22 @@ function closeFile() {
|
||||
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) {
|
||||
$api.copyText(value);
|
||||
}
|
||||
@@ -1481,7 +1518,18 @@ function getRandomJobQueries(queries, count = 2) {
|
||||
|
||||
// 切换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
|
||||
@@ -1490,26 +1538,10 @@ function shouldShowMessage(msg) {
|
||||
return true; // 用户自己的消息总是显示
|
||||
}
|
||||
|
||||
const isJobCard = isJobCardMessage(msg);
|
||||
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;
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<dict-Label dictType="area" :value="Number(userInfo.area)"></dict-Label>
|
||||
</view>
|
||||
<view class="mys-list">
|
||||
<view class="cards button-click" v-for="(title, index) in userInfo.jobTitle" :key="index">
|
||||
<view class="cards button-click" v-for="(title, index) in (userInfo.jobTitle || [])" :key="index">
|
||||
{{ title }}
|
||||
</view>
|
||||
</view>
|
||||
@@ -236,9 +236,9 @@ const handleEditOrAdd = () => {
|
||||
|
||||
// 编辑单个经历
|
||||
const handleEditItem = (item) => {
|
||||
// 跳转到编辑页面,传递编辑标识和数据
|
||||
const itemData = encodeURIComponent(JSON.stringify(item));
|
||||
navTo(`/packageA/pages/addWorkExperience/addWorkExperience?type=edit&data=${itemData}`);
|
||||
// 使用本地存储传递数据,避免URL长度限制导致小程序框架报错
|
||||
uni.setStorageSync('editWorkExperienceData', item);
|
||||
navTo('/packageA/pages/addWorkExperience/addWorkExperience?type=edit');
|
||||
};
|
||||
|
||||
// 删除单个经历(带确认弹窗)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<view class="nav-hidden hidden-animation" :class="{ 'hidden-height': shouldHideTop }">
|
||||
<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>
|
||||
<text class="inpute">职位名称、薪资要求等</text>
|
||||
</view>
|
||||
@@ -263,9 +263,14 @@
|
||||
{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="btm-right button-click" @click="openFilter">
|
||||
筛选
|
||||
<image class="right-sx" :class="{ active: showFilter }" src="@/static/icon/shaixun.png"></image>
|
||||
<view class="btm-right-wrap">
|
||||
<view class="button-click clear-btn" v-if="hasFilterConditions" @click="clearFilter">
|
||||
清除筛选
|
||||
</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>
|
||||
@@ -564,6 +569,12 @@ const shouldShowCompanyContent = computed(() => {
|
||||
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(() => {
|
||||
if (!hasLogin.value) {
|
||||
@@ -836,6 +847,28 @@ onUnmounted(() => {
|
||||
uni.$off('citySelected');
|
||||
});
|
||||
|
||||
const isFourLevelLinkagePurview = ref(false);
|
||||
const getIsFourLevelLinkagePurview = () => {
|
||||
let userInfo = uni.getStorageSync('userInfo');
|
||||
if (userInfo) {
|
||||
$api.myRequest(
|
||||
'/auth/login2/ks',
|
||||
{ userid: userInfo.dwUserid, idcardno: userInfo.idCard },
|
||||
'POST',
|
||||
9100,
|
||||
{}
|
||||
).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.setStorageSync('fourLevelLinkage-token', res.data.access_token);
|
||||
let roleIdList = ['103', '106', '107'];
|
||||
if (res.data.roleIdList.some((item) => roleIdList.includes(item))) {
|
||||
isFourLevelLinkagePurview.value = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onShow(() => {
|
||||
// 页面显示时获取最新的企业信息
|
||||
getCompanyInfo();
|
||||
@@ -1067,6 +1100,38 @@ function openFilter() {
|
||||
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) {
|
||||
pageState.search = {
|
||||
...pageState.search,
|
||||
@@ -1415,27 +1480,6 @@ const toggleJobStatus = (job) => {
|
||||
$api.msg(isCurrentlyUp ? '下架失败,请重试' : '上架失败,请重试');
|
||||
});
|
||||
};
|
||||
const isFourLevelLinkagePurview = ref(false);
|
||||
const getIsFourLevelLinkagePurview = () => {
|
||||
let userInfo = uni.getStorageSync('userInfo');
|
||||
if (userInfo) {
|
||||
$api.myRequest(
|
||||
'/auth/login2/ks',
|
||||
{ userid: userInfo.dwUserid, idcardno: userInfo.idCard },
|
||||
'POST',
|
||||
9100,
|
||||
{}
|
||||
).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.setStorageSync('fourLevelLinkage-token', res.data.access_token);
|
||||
let roleIdList = ['103', '106', '107'];
|
||||
if (res.data.roleIdList.some((item) => roleIdList.includes(item))) {
|
||||
isFourLevelLinkagePurview.value = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
function dataToImg(data) {
|
||||
const result = data.map((item) => ({
|
||||
...item,
|
||||
@@ -1993,16 +2037,26 @@ defineExpose({ loadData });
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #256BFA;
|
||||
.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)
|
||||
.btm-right-wrap
|
||||
display: flex
|
||||
align-items: center
|
||||
.clear-btn
|
||||
font-family: 'PingFangSC-Regular', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-right: 20rpx;
|
||||
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
|
||||
background: #F4F4F4
|
||||
flex: 1
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
<template>
|
||||
<view class="container safe-area-top">
|
||||
<!-- 自定义头部搜索框 -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="custom-header" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef H5 -->
|
||||
<view class="custom-header">
|
||||
<!-- #endif -->
|
||||
<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">
|
||||
<uni-icons
|
||||
class="iconsearch"
|
||||
@@ -55,6 +62,11 @@ import { storeToRefs } from 'pinia';
|
||||
import { useColumnCount } from '@/hook/useColumnCount';
|
||||
import img from '@/static/icon/filter.png';
|
||||
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 historyList = ref([]);
|
||||
const searchParams = ref({});
|
||||
@@ -79,7 +91,16 @@ onLoad((query) => {
|
||||
if (arr) {
|
||||
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) {
|
||||
searchValue.value = job;
|
||||
searchBtn();
|
||||
@@ -161,6 +182,7 @@ function getJobList(type = 'add') {
|
||||
...pageState.search,
|
||||
jobTitle: searchValue.value,
|
||||
};
|
||||
console.log('[search-page] getJobList params:', JSON.stringify(params));
|
||||
|
||||
$api.createRequest('/app/job/list', params, 'GET', true).then((resData) => {
|
||||
const { rows, total } = resData;
|
||||
|
||||
@@ -11,6 +11,8 @@ import {
|
||||
|
||||
// 静态树 O(1) 超快查询!!!!!
|
||||
let IndustryMap = null
|
||||
// 复用同一批字典请求,避免 App 启动和页面组件同时初始化时产生竞态。
|
||||
let dictDataPromise = null
|
||||
// 构建索引
|
||||
function buildIndex(tree) {
|
||||
const map = new Map();
|
||||
@@ -50,46 +52,54 @@ const useDictStore = defineStore("dict", () => {
|
||||
return data
|
||||
})
|
||||
}
|
||||
if (complete.value) return
|
||||
if (dictLoading.value) return
|
||||
dictLoading.value = true
|
||||
try {
|
||||
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'),
|
||||
]);
|
||||
if (complete.value) return Promise.resolve()
|
||||
// App.vue 会在启动时加载字典,页面组件也可能同时加载。
|
||||
// 不能在请求进行中直接 return,否则调用方会把当时的空 state 复制下来。
|
||||
if (dictDataPromise) return dictDataPromise
|
||||
|
||||
state.education = education;
|
||||
state.experience = experience;
|
||||
state.area = area;
|
||||
state.scale = scale;
|
||||
state.sex = sex;
|
||||
state.affiliation = affiliation;
|
||||
state.nature = nature
|
||||
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
|
||||
}
|
||||
dictLoading.value = true
|
||||
dictDataPromise = (async () => {
|
||||
try {
|
||||
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;
|
||||
state.experience = experience;
|
||||
state.area = area;
|
||||
state.scale = scale;
|
||||
state.sex = sex;
|
||||
state.affiliation = affiliation;
|
||||
state.nature = nature
|
||||
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() {
|
||||
|
||||
Reference in New Issue
Block a user