3 Commits

Author SHA1 Message Date
francis-fh
76b1a65f9f bug修复 2026-07-16 12:10:52 +08:00
francis-fh
4e649401cd bug修复 2026-07-16 12:06:02 +08:00
francis-fh
a804e443f3 11 2026-07-16 01:06:02 +08:00
12 changed files with 830 additions and 771 deletions

16
.codegraph/.gitignore vendored Normal file
View 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
View File

@@ -0,0 +1,6 @@
{
"pid": 37252,
"version": "0.9.9",
"socketPath": "\\\\.\\pipe\\codegraph-27b009ff71560217",
"startedAt": 1784169684502
}

View File

@@ -26,24 +26,6 @@
<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)">
@@ -80,6 +62,24 @@
</radio-group> </radio-group>
</view> </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"> <view v-if="activeTab === 'scale'" class="content-section">
<radio-group @change="(e) => handleSelect('scale', e)"> <radio-group @change="(e) => handleSelect('scale', e)">
@@ -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,
@@ -169,7 +259,6 @@ 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: '公司规模' },
@@ -178,53 +267,42 @@ const tabs = [
]; ];
// 当前激活的标签 // 当前激活的标签
const activeTab = ref('salary'); 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();
} }
}); });
@@ -234,24 +312,23 @@ const handleSelect = (key, e) => {
}; };
// 处理多选选项选择(地区) // 处理多选选项选择(地区)
// 兼容不同平台H5 可能返回逗号分隔字符串,小程序返回数组 // 兼容不同平台H5 返回逗号分隔字符串,小程序返回数组,统一规范化为逗号分隔字符串
const handleCheckboxSelect = (key, e) => { const handleCheckboxSelect = (key, e) => {
let val = e.detail.value; let val = e.detail.value;
if (typeof val === 'string') { if (typeof val === 'string') {
selectedValues[key] = val ? val.split(',').map((s) => s.trim()) : []; // H5 平台返回逗号分隔字符串,直接使用
selectedValues[key] = val || '';
} else if (Array.isArray(val)) { } else if (Array.isArray(val)) {
selectedValues[key] = val.map((v) => String(v)); // 小程序返回数组,转为逗号分隔字符串
selectedValues[key] = val ? val.join(',') : '';
} else { } else {
selectedValues[key] = []; selectedValues[key] = '';
} }
}; };
// 判断地区选项是否被选中(兼容数组和字符串) // 判断地区选项是否被选中(area 统一为逗号分隔字符串)
const isAreaSelected = (value) => { const isAreaSelected = (value) => {
const areaVal = selectedValues.area; const areaVal = selectedValues.area;
if (Array.isArray(areaVal)) {
return areaVal.includes(value);
}
if (typeof areaVal === 'string' && areaVal) { if (typeof areaVal === 'string' && areaVal) {
return areaVal.split(',').includes(value); return areaVal.split(',').includes(value);
} }
@@ -262,7 +339,7 @@ const isAreaSelected = (value) => {
const handleClear = () => { const handleClear = () => {
Object.keys(selectedValues).forEach((key) => { Object.keys(selectedValues).forEach((key) => {
if (key === 'area') { if (key === 'area') {
selectedValues[key] = []; selectedValues[key] = '';
} else { } else {
selectedValues[key] = ''; selectedValues[key] = '';
} }
@@ -272,15 +349,7 @@ const handleClear = () => {
// 确认筛选 // 确认筛选
const handleConfirm = () => { const handleConfirm = () => {
const payload = { ...selectedValues }; const payload = { ...selectedValues };
// 将多选的地区数组转为逗号分隔字符串(兼容各种格式) // area 已统一为逗号分隔字符串,无需额外转换
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); console.log('[new-filter-page] area value to emit:', payload.area);
// 将选中的薪资区间转换为 minSalary / maxSalary 参数 // 将选中的薪资区间转换为 minSalary / maxSalary 参数
// 始终带上 minSalary / maxSalary含空值便于父组件在清除时移除旧值 // 始终带上 minSalary / maxSalary含空值便于父组件在清除时移除旧值
@@ -322,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;
@@ -382,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 {
@@ -392,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;
} }
} }
@@ -430,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;
@@ -461,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;
@@ -471,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;
} }
@@ -484,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);
@@ -501,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;

View File

@@ -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();

View File

@@ -97,8 +97,8 @@
"sdkConfigs" : { "sdkConfigs" : {
"maps" : { "maps" : {
"amap" : { "amap" : {
"key" : "b79ea14cb17704ab1a1a32c12d72f634", "key" : "9cfc9370bd8a941951da1cea0308e9e3",
"securityJsCode" : "04795ef5b20919d34cadc2e33e01d609", "securityJsCode" : "7b16386c7f744c3ca05595965f2b037f",
"serviceHost" : "" "serviceHost" : ""
} }
} }

View File

@@ -42,8 +42,9 @@
</template> </template>
<script setup> <script setup>
import { reactive, inject, ref } from 'vue'; import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
import { onLoad } from '@dcloudio/uni-app'; import { onLoad, onShow } from '@dcloudio/uni-app';
import SelectJobs from '@/components/selectJobs/selectJobs.vue';
import useUserStore from '@/stores/useUserStore'; import useUserStore from '@/stores/useUserStore';
const { $api, navTo, navBack, config } = inject('globalFunction'); const { $api, navTo, navBack, config } = inject('globalFunction');
@@ -75,7 +76,6 @@
// 表单数据 // 表单数据
const formData = reactive({ const formData = reactive({
id: '', // 工作经历ID编辑时使用
companyName: '', companyName: '',
position: '', position: '',
userId: '', // 将在确认时动态获取 userId: '', // 将在确认时动态获取
@@ -93,17 +93,15 @@
pageType.value = options.type; pageType.value = options.type;
} }
// 如果是编辑模式,从本地存储获取数据避免URL长度限制 // 如果是编辑模式,解析传递的数据
if (options.type === 'edit') { if (options.type === 'edit' && options.data) {
try { try {
const storedData = uni.getStorageSync('editWorkExperienceData'); editData.value = JSON.parse(decodeURIComponent(options.data));
if (storedData) { console.log('编辑数据:', editData.value);
editData.value = storedData;
console.log('编辑数据:', editData.value);
// 回显数据到表单 // 回显数据到表单
if (editData.value) {
formData.companyName = editData.value.companyName || ''; formData.companyName = editData.value.companyName || '';
formData.id = editData.value.id || '';
formData.position = editData.value.position || ''; formData.position = editData.value.position || '';
formData.startDate = editData.value.startDate || ''; formData.startDate = editData.value.startDate || '';
formData.endDate = editData.value.endDate || '至今'; formData.endDate = editData.value.endDate || '至今';
@@ -112,9 +110,6 @@
// 同步日期选择器的显示 // 同步日期选择器的显示
startDate.value = editData.value.startDate || ''; startDate.value = editData.value.startDate || '';
endDate.value = editData.value.endDate || '至今'; endDate.value = editData.value.endDate || '至今';
// 使用完后清除存储
uni.removeStorageSync('editWorkExperienceData');
} }
} catch (error) { } catch (error) {
console.error('解析编辑数据失败:', error); console.error('解析编辑数据失败:', error);
@@ -201,16 +196,13 @@
}; };
console.log('请求参数:', params); console.log('请求参数:', params);
if (pageType.value === 'edit') {
params.id = formData.id;
}
console.log('页面类型:', pageType.value); console.log('页面类型:', pageType.value);
let resData; let resData;
// 根据页面类型调用不同的接口 // 根据页面类型调用不同的接口
if (pageType.value === 'edit' && formData.id) { if (pageType.value === 'edit' && editData.value?.id) {
// 编辑模式:调用更新接口 // 编辑模式:调用更新接口
resData = await $api.createRequest(`/app/userworkexperiences/edit`, params, 'put'); resData = await $api.createRequest(`/app/userworkexperiences/edit`, {...params, id: editData.value.id}, 'put');
console.log('编辑接口响应:', resData); console.log('编辑接口响应:', resData);
} else { } else {
// 添加模式:调用新增接口 // 添加模式:调用新增接口

View File

@@ -63,9 +63,8 @@
<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="back-home-btn" @click="navTo('/pages/index/index')"> <!-- <view class="title">{{ config.appInfo.areaName }}岗位推荐</view> -->
<text class="back-home-text">返回</text> <!-- <view class="title">{{ config.appInfo.areaName }}岗位推荐</view> -->
</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>
@@ -376,19 +375,6 @@ 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)

View File

@@ -227,12 +227,8 @@
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"
/> />
@@ -425,7 +421,6 @@ 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([]);
@@ -444,7 +439,6 @@ 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);
@@ -472,16 +466,7 @@ 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();
@@ -556,13 +541,10 @@ const sendMessage = (text) => {
if (speechIndex.value !== index) { if (speechIndex.value !== index) {
// 延迟TTS等待内容更完整 // 延迟TTS等待内容更完整
// 只有在内容长度超过50个字符或者包含岗位信息时才开始朗读 // 只有在内容长度超过50个字符或者包含岗位信息时才开始朗读
const hasJobInfo = isJobCardMessage(message) || const hasJobInfo = message.displayText.includes('```job-json') ||
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);
@@ -591,9 +573,6 @@ 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);
@@ -1378,22 +1357,6 @@ 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);
} }
@@ -1518,18 +1481,7 @@ function getRandomJobQueries(queries, count = 2) {
// 切换tab // 切换tab
function switchTab(tab) { function switchTab(tab) {
setActiveTab(tab); activeTab.value = 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
@@ -1538,10 +1490,26 @@ 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;
} }
} }

View File

@@ -59,7 +59,7 @@
<dict-Label dictType="area" :value="Number(userInfo.area)"></dict-Label> <dict-Label dictType="area" :value="Number(userInfo.area)"></dict-Label>
</view> </view>
<view class="mys-list"> <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 }} {{ title }}
</view> </view>
</view> </view>
@@ -236,9 +236,9 @@ const handleEditOrAdd = () => {
// 编辑单个经历 // 编辑单个经历
const handleEditItem = (item) => { const handleEditItem = (item) => {
// 使用本地存储传递数据避免URL长度限制导致小程序框架报错 // 跳转到编辑页面,传递编辑标识和数据
uni.setStorageSync('editWorkExperienceData', item); const itemData = encodeURIComponent(JSON.stringify(item));
navTo('/packageA/pages/addWorkExperience/addWorkExperience?type=edit'); navTo(`/packageA/pages/addWorkExperience/addWorkExperience?type=edit&data=${itemData}`);
}; };
// 删除单个经历(带确认弹窗) // 删除单个经历(带确认弹窗)

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,9 @@
<template> <template>
<view class="container safe-area-top"> <view class="container safe-area-top">
<!-- 自定义头部搜索框 --> <!-- 自定义头部搜索框 -->
<!-- #ifdef H5 -->
<view class="custom-header" :style="{ paddingTop: statusBarHeight + 'px' }"> <view class="custom-header" :style="{ paddingTop: statusBarHeight + 'px' }">
<!-- #endif -->
<!-- #ifndef H5 -->
<view class="custom-header">
<!-- #endif -->
<view class="top"> <view class="top">
<!-- #ifdef H5 -->
<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>
<!-- #endif -->
<view class="search-box"> <view class="search-box">
<uni-icons <uni-icons
class="iconsearch" class="iconsearch"
@@ -62,11 +55,6 @@ 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({});

View File

@@ -11,8 +11,6 @@ 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();
@@ -52,54 +50,46 @@ const useDictStore = defineStore("dict", () => {
return data return data
}) })
} }
if (complete.value) return Promise.resolve() if (complete.value) return
// App.vue 会在启动时加载字典,页面组件也可能同时加载。 if (dictLoading.value) return
// 不能在请求进行中直接 return否则调用方会把当时的空 state 复制下来。
if (dictDataPromise) return dictDataPromise
dictLoading.value = true dictLoading.value = true
dictDataPromise = (async () => { try {
try { const [education, experience, area, scale, sex, affiliation, nature, noticeType] =
const [education, experience, area, scale, sex, affiliation, nature, noticeType] = await Promise.all([
await Promise.all([ getDictSelectOption('education'),
getDictSelectOption('education'), getDictSelectOption('experience'),
getDictSelectOption('experience'), getDictSelectOption('area', true),
getDictSelectOption('area', true), getDictSelectOption('scale'),
getDictSelectOption('scale'), getDictSelectOption('app_sex'),
getDictSelectOption('app_sex'), getDictSelectOption('political_affiliation'),
getDictSelectOption('political_affiliation'), getDictSelectOption('company_nature'),
getDictSelectOption('company_nature'), getDictSelectOption('sys_notice_type'),
getDictSelectOption('sys_notice_type'), ]);
]);
state.education = education; state.education = education;
state.experience = experience; state.experience = experience;
state.area = area; state.area = area;
state.scale = scale; state.scale = scale;
state.sex = sex; state.sex = sex;
state.affiliation = affiliation; state.affiliation = affiliation;
state.nature = nature state.nature = nature
state.noticeType = noticeType state.noticeType = noticeType
complete.value = true complete.value = true
getIndustryDict() // 获取行业 getIndustryDict() // 获取行业
} catch (error) { } catch (error) {
console.error('Error fetching dictionary data:', error); console.error('Error fetching dictionary data:', error);
// 确保即使出错也能返回空数组 // 确保即使出错也能返回空数组
state.education = []; state.education = [];
state.experience = []; state.experience = [];
state.area = []; state.area = [];
state.scale = []; state.scale = [];
state.sex = []; state.sex = [];
state.affiliation = []; state.affiliation = [];
state.nature = []; state.nature = [];
state.noticeType = []; state.noticeType = [];
} finally { } finally {
dictLoading.value = false dictLoading.value = false
dictDataPromise = null }
}
})()
return dictDataPromise
}; };
async function getIndustryDict() { async function getIndustryDict() {