Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d44d5b351 | ||
|
|
5a1ee392a9 | ||
|
|
dee3d7d9be | ||
|
|
4d69389c99 | ||
|
|
21dd282943 |
@@ -26,24 +26,6 @@
|
||||
<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)">
|
||||
@@ -80,6 +62,24 @@
|
||||
</radio-group>
|
||||
</view>
|
||||
|
||||
<!-- 薪资 -->
|
||||
<view v-if="activeTab === 'salary'" class="content-section">
|
||||
<radio-group @change="(e) => handleSelect('salary', e)">
|
||||
<label
|
||||
v-for="option in salaryOptions"
|
||||
:key="option.value"
|
||||
class="radio-item"
|
||||
:class="{ checked: selectedValues['salary'] === String(option.value) }"
|
||||
>
|
||||
<radio
|
||||
:value="String(option.value)"
|
||||
:checked="selectedValues['salary'] === String(option.value)"
|
||||
/>
|
||||
<text class="option-label">{{ option.label }}</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
|
||||
<!-- 公司规模 -->
|
||||
<view v-if="activeTab === 'scale'" class="content-section">
|
||||
<radio-group @change="(e) => handleSelect('scale', e)">
|
||||
@@ -169,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('salary');
|
||||
const activeTab = ref('education');
|
||||
|
||||
// 存储已选中的值
|
||||
const selectedValues = reactive({
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -847,28 +847,6 @@ 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();
|
||||
@@ -1480,6 +1458,27 @@ 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,
|
||||
|
||||
@@ -11,8 +11,6 @@ import {
|
||||
|
||||
// 静态树 O(1) 超快查询!!!!!
|
||||
let IndustryMap = null
|
||||
// 复用同一批字典请求,避免 App 启动和页面组件同时初始化时产生竞态。
|
||||
let dictDataPromise = null
|
||||
// 构建索引
|
||||
function buildIndex(tree) {
|
||||
const map = new Map();
|
||||
@@ -52,13 +50,9 @@ const useDictStore = defineStore("dict", () => {
|
||||
return data
|
||||
})
|
||||
}
|
||||
if (complete.value) return Promise.resolve()
|
||||
// App.vue 会在启动时加载字典,页面组件也可能同时加载。
|
||||
// 不能在请求进行中直接 return,否则调用方会把当时的空 state 复制下来。
|
||||
if (dictDataPromise) return dictDataPromise
|
||||
|
||||
if (complete.value) return
|
||||
if (dictLoading.value) return
|
||||
dictLoading.value = true
|
||||
dictDataPromise = (async () => {
|
||||
try {
|
||||
const [education, experience, area, scale, sex, affiliation, nature, noticeType] =
|
||||
await Promise.all([
|
||||
@@ -95,11 +89,7 @@ const useDictStore = defineStore("dict", () => {
|
||||
state.noticeType = [];
|
||||
} finally {
|
||||
dictLoading.value = false
|
||||
dictDataPromise = null
|
||||
}
|
||||
})()
|
||||
|
||||
return dictDataPromise
|
||||
};
|
||||
|
||||
async function getIndustryDict() {
|
||||
|
||||
Reference in New Issue
Block a user