7 Commits

Author SHA1 Message Date
francis-fh
446882b5a1 11 2026-07-27 18:32:03 +08:00
francis-fh
847704f6ff 111 2026-07-27 17:47:38 +08:00
francis-fh
980cad4e54 简历编辑功能bug修复 2026-07-27 17:22:49 +08:00
francis-fh
45aa4e7351 Merge branch 'main' 2026-07-23 21:57:56 +08:00
Apcallover
4c8f79555d 修复筛选字典数据加载竞态 2026-07-23 21:29:45 +08:00
8d44d5b351 vear:修改数据消失问题 2026-07-16 17:28:29 +08:00
5a1ee392a9 vear:添加返回按钮,唤醒键盘 2026-07-16 14:36:20 +08:00
8 changed files with 184 additions and 119 deletions

View File

@@ -26,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)">
@@ -62,24 +80,6 @@
</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)">
@@ -169,16 +169,16 @@ const getJobTypeData = () => {
// 标签页数据 // 标签页数据
const tabs = [ const tabs = [
{ key: 'salary', label: '薪资' },
{ key: 'education', label: '学历要求' }, { key: 'education', label: '学历要求' },
{ key: 'experience', label: '工作经验' }, { key: 'experience', label: '工作经验' },
{ key: 'salary', label: '薪资' },
{ key: 'scale', label: '公司规模' }, { key: 'scale', label: '公司规模' },
{ key: 'jobType', label: '岗位类型' }, { key: 'jobType', label: '岗位类型' },
{ key: 'area', label: '地区' } { key: 'area', label: '地区' }
]; ];
// 当前激活的标签 // 当前激活的标签
const activeTab = ref('education'); const activeTab = ref('salary');
// 存储已选中的值 // 存储已选中的值
const selectedValues = reactive({ const selectedValues = reactive({

View File

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

View File

@@ -42,9 +42,8 @@
</template> </template>
<script setup> <script setup>
import { reactive, inject, watch, ref, onMounted, computed } from 'vue'; import { reactive, inject, ref } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app'; import { onLoad } 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');
@@ -76,6 +75,7 @@
// 表单数据 // 表单数据
const formData = reactive({ const formData = reactive({
id: '', // 工作经历ID编辑时使用
companyName: '', companyName: '',
position: '', position: '',
userId: '', // 将在确认时动态获取 userId: '', // 将在确认时动态获取
@@ -93,15 +93,17 @@
pageType.value = options.type; pageType.value = options.type;
} }
// 如果是编辑模式,解析传递的数据 // 如果是编辑模式,从本地存储获取数据避免URL长度限制
if (options.type === 'edit' && options.data) { if (options.type === 'edit') {
try { try {
editData.value = JSON.parse(decodeURIComponent(options.data)); const storedData = uni.getStorageSync('editWorkExperienceData');
console.log('编辑数据:', editData.value); if (storedData) {
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 || '至今';
@@ -110,6 +112,9 @@
// 同步日期选择器的显示 // 同步日期选择器的显示
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);
@@ -196,13 +201,16 @@
}; };
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' && 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); console.log('编辑接口响应:', resData);
} else { } else {
// 添加模式:调用新增接口 // 添加模式:调用新增接口

View File

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

View File

@@ -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;
} }
} }

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长度限制导致小程序框架报错
const itemData = encodeURIComponent(JSON.stringify(item)); uni.setStorageSync('editWorkExperienceData', item);
navTo(`/packageA/pages/addWorkExperience/addWorkExperience?type=edit&data=${itemData}`); navTo('/packageA/pages/addWorkExperience/addWorkExperience?type=edit');
}; };
// 删除单个经历(带确认弹窗) // 删除单个经历(带确认弹窗)

View File

@@ -847,6 +847,28 @@ onUnmounted(() => {
uni.$off('citySelected'); 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(() => { onShow(() => {
// 页面显示时获取最新的企业信息 // 页面显示时获取最新的企业信息
getCompanyInfo(); getCompanyInfo();
@@ -1458,27 +1480,6 @@ const toggleJobStatus = (job) => {
$api.msg(isCurrentlyUp ? '下架失败,请重试' : '上架失败,请重试'); $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) { function dataToImg(data) {
const result = data.map((item) => ({ const result = data.map((item) => ({
...item, ...item,

View File

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