Compare commits
4 Commits
yxl
...
bfdc358c24
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfdc358c24 | ||
|
|
78a61ef42a | ||
|
|
ed7ef9acfe | ||
|
|
030183ceb6 |
@@ -50,9 +50,11 @@
|
||||
<view class="label">最小薪资 (元/月)</view>
|
||||
<input
|
||||
class="input"
|
||||
placeholder="请输入最小薪资"
|
||||
placeholder="请输入最小薪资(最低2000元)"
|
||||
type="number"
|
||||
v-model="formData.minSalary"
|
||||
@input="handleMinSalaryInput"
|
||||
@blur="handleMinSalaryBlur"
|
||||
/>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
@@ -285,7 +287,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, onUnmounted } from 'vue';
|
||||
import { ref, reactive, onMounted, onUnmounted, watch } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { createRequest } from '@/utils/request';
|
||||
@@ -393,6 +395,15 @@ onShow(() => {
|
||||
getCompanyInfo();
|
||||
});
|
||||
|
||||
// 监听最小薪资变化
|
||||
watch(() => formData.minSalary, (newValue) => {
|
||||
console.log('minSalary changed to:', newValue);
|
||||
if (newValue && parseFloat(newValue) < 2000) {
|
||||
console.log('setting minSalary to 2000 via watch');
|
||||
formData.minSalary = '2000';
|
||||
}
|
||||
});
|
||||
|
||||
// 获取企业信息(参考首页方法)
|
||||
const getCompanyInfo = () => {
|
||||
try {
|
||||
@@ -704,6 +715,32 @@ const handleCompanySelected = (company) => {
|
||||
formData.companyId = company.id;
|
||||
};
|
||||
|
||||
// 处理最小薪资输入
|
||||
const handleMinSalaryInput = (e) => {
|
||||
let value = e.detail.value;
|
||||
if (value && parseFloat(value) < 2000) {
|
||||
formData.minSalary = '2000';
|
||||
uni.showToast({
|
||||
title: '最小薪资最低为2000元',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 处理最小薪资失去焦点
|
||||
const handleMinSalaryBlur = () => {
|
||||
console.log('blur event triggered');
|
||||
console.log('current minSalary:', formData.minSalary);
|
||||
let value = formData.minSalary;
|
||||
if (value && parseFloat(value) < 2000) {
|
||||
console.log('setting minSalary to 2000');
|
||||
formData.minSalary = '2000';
|
||||
uni.showToast({
|
||||
title: '最小薪资最低为2000元',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 发布岗位
|
||||
const publishJob = async () => {
|
||||
@@ -824,6 +861,14 @@ const validateForm = () => {
|
||||
const minSalary = parseFloat(formData.minSalary);
|
||||
const maxSalary = parseFloat(formData.maxSalary);
|
||||
|
||||
if (minSalary < 2000) {
|
||||
uni.showToast({
|
||||
title: '最小薪资最低为2000元',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (minSalary >= maxSalary) {
|
||||
uni.showToast({
|
||||
title: '最大薪资必须大于最小薪资',
|
||||
|
||||
@@ -698,7 +698,7 @@ const changePoliticalAffiliation = () => {
|
||||
};
|
||||
|
||||
|
||||
function generateDatePickerArrays(startYear = 1975, endYear = new Date().getFullYear()) {
|
||||
function generateDatePickerArrays(startYear = 1950, endYear = new Date().getFullYear()) {
|
||||
const years = [];
|
||||
const months = [];
|
||||
const days = [];
|
||||
|
||||
@@ -206,6 +206,14 @@
|
||||
{{detailObj.politicalAffiliation}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flexBox detail-item1" v-if="detailObj.resumePicPath">
|
||||
<view class="label">简历图片:</view>
|
||||
<view class="value">
|
||||
<view class="previewResume" @click="previewResume(detailObj.resumePicPath)">
|
||||
查看简历图片
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<button type="default" @click="closeResumeDetailPopup">关闭</button>
|
||||
@@ -302,6 +310,7 @@
|
||||
$api
|
||||
} = inject("globalFunction");
|
||||
const imgBaseUrl = config.imgBaseUrl;
|
||||
const trainVideoImgUrl = config.trainVideoImgUrl;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const interviewPopup = ref(null);
|
||||
@@ -311,7 +320,15 @@
|
||||
const jobFairId = ref("");
|
||||
const userInfo = ref({});
|
||||
const isExpanded = ref(false);
|
||||
|
||||
//预览简历照片
|
||||
const previewResume = (url) => {
|
||||
if(url){
|
||||
uni.previewImage({
|
||||
urls: [trainVideoImgUrl+url],
|
||||
current: 0
|
||||
});
|
||||
}
|
||||
};
|
||||
const publicUrl = config.LCBaseUrl;
|
||||
onLoad((option) => {
|
||||
jobFairId.value = option.jobFairId;
|
||||
@@ -940,6 +957,9 @@
|
||||
height: 80%;
|
||||
.flexBox{
|
||||
display: flex;
|
||||
.previewResume{
|
||||
color:#0088ff
|
||||
}
|
||||
}
|
||||
.detail-item1 {
|
||||
// display: flex;
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
<template>
|
||||
<view class="chat-container">
|
||||
<!-- Tab切换 -->
|
||||
<view class="tab-container">
|
||||
<view
|
||||
class="tab-item"
|
||||
:class="{ active: activeTab === 'policy' }"
|
||||
@click="switchTab('policy')"
|
||||
>
|
||||
政策查询
|
||||
</view>
|
||||
<view
|
||||
class="tab-item"
|
||||
:class="{ active: activeTab === 'job' }"
|
||||
@click="switchTab('job')"
|
||||
>
|
||||
岗位推荐
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="chat-background" v-if="!messages.length">
|
||||
<image class="backlogo" src="/static/icon/backAI.png"></image>
|
||||
@@ -51,6 +69,7 @@
|
||||
<!-- #endif -->
|
||||
<view
|
||||
v-for="(msg, index) in messages"
|
||||
v-show="shouldShowMessage(msg)"
|
||||
:key="index"
|
||||
:id="'msg-' + index"
|
||||
class="chat-item"
|
||||
@@ -352,6 +371,7 @@ const { speak, pause, resume, isSpeaking, isPaused, cancelAudio } = useTTSPlayer
|
||||
const instance = getCurrentInstance();
|
||||
|
||||
// state
|
||||
const activeTab = ref('policy'); // 'policy' or 'job'
|
||||
const queries = ref([]);
|
||||
const guessList = ref([]);
|
||||
const scrollTop = ref(0);
|
||||
@@ -571,11 +591,12 @@ const delfile = (file) => {
|
||||
const scrollToBottom = throttle(function () {
|
||||
nextTick(() => {
|
||||
try {
|
||||
let query;
|
||||
// #ifdef MP-WEIXIN
|
||||
const query = uni.createSelectorQuery().in(instance);
|
||||
query = uni.createSelectorQuery().in(instance);
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
const query = uni.createSelectorQuery();
|
||||
query = uni.createSelectorQuery();
|
||||
// #endif
|
||||
|
||||
query.select('.scrollView').boundingClientRect();
|
||||
@@ -886,7 +907,42 @@ function getRandomJobQueries(queries, count = 2) {
|
||||
return shuffled.slice(0, count); // 取前 count 条
|
||||
}
|
||||
|
||||
defineExpose({ scrollToBottom, closeGuess, closeFile, changeQueries, handleTouchCancel });
|
||||
// 切换tab
|
||||
function switchTab(tab) {
|
||||
activeTab.value = tab;
|
||||
}
|
||||
|
||||
// 检查消息是否应该显示在当前tab
|
||||
function shouldShowMessage(msg) {
|
||||
if (msg.self) {
|
||||
return true; // 用户自己的消息总是显示
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ scrollToBottom, closeGuess, closeFile, changeQueries, handleTouchCancel, switchTab });
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@@ -1373,4 +1429,48 @@ image-margin-top = 40rpx
|
||||
.ai-loading view:nth-child(3) {
|
||||
animation-delay: 0s;
|
||||
}
|
||||
|
||||
/* Tab切换样式 */
|
||||
.tab-container {
|
||||
display: flex;
|
||||
background: #FFFFFF;
|
||||
border-bottom: 2rpx solid #F4F4F4;
|
||||
padding: 0 44rpx;
|
||||
height: 88rpx;
|
||||
align-items: center;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #666666;
|
||||
line-height: 88rpx;
|
||||
height: 88rpx;
|
||||
position: relative;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
color: #256BFA;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tab-item.active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 60rpx;
|
||||
height: 4rpx;
|
||||
background: #256BFA;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
|
||||
.tab-item:active {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user