Compare commits
6 Commits
yxl
...
5f85f6cd2a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f85f6cd2a | ||
|
|
58a113b34d | ||
|
|
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: '最大薪资必须大于最小薪资',
|
||||
|
||||
@@ -110,6 +110,10 @@
|
||||
</scroll-view>
|
||||
<!-- 筛选 -->
|
||||
<select-filter ref="selectFilterModel"></select-filter>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<selectPopup ref="selectPopupRef"></selectPopup>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -117,7 +121,28 @@
|
||||
import { reactive, inject, watch, ref, onMounted, onBeforeUnmount } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, debounce, customSystem } = inject('globalFunction');
|
||||
const openSelectPopup = inject('openSelectPopup');
|
||||
// #ifdef H5
|
||||
const injectedOpenSelectPopup = inject('openSelectPopup', null);
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
const selectPopupRef = ref();
|
||||
// #endif
|
||||
|
||||
// 创建本地的 openSelectPopup 函数,兼容 H5 和微信小程序
|
||||
const openSelectPopup = (config) => {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (selectPopupRef.value) {
|
||||
selectPopupRef.value.open(config);
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
if (injectedOpenSelectPopup) {
|
||||
injectedOpenSelectPopup(config);
|
||||
}
|
||||
// #endif
|
||||
};
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useLocationStore from '@/stores/useLocationStore';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
@@ -128,6 +153,9 @@ const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
||||
import point2 from '@/static/icon/point2.png';
|
||||
import LocationPng from '@/static/icon/Location.png';
|
||||
import selectFilter from '@/components/selectFilter/selectFilter.vue';
|
||||
// #ifdef MP-WEIXIN
|
||||
import selectPopup from '@/components/selectPopup/selectPopup.vue';
|
||||
// #endif
|
||||
const emit = defineEmits(['onFilter']);
|
||||
// status
|
||||
const showFiltersubway = ref(false);
|
||||
@@ -205,18 +233,21 @@ function openFilter() {
|
||||
}
|
||||
|
||||
function openFilterSubway() {
|
||||
showFiltersubway.value = true;
|
||||
const diti = state.subwayList.map((item) => ({ ...item, label: item.lineName, value: item.lineId }));
|
||||
openSelectPopup({
|
||||
title: '地铁',
|
||||
maskClick: true,
|
||||
data: [diti],
|
||||
success: (_, [value]) => {
|
||||
showFiltersubway.value = false;
|
||||
if (!value) return;
|
||||
subwayCurrent.value = value;
|
||||
state.subwayId = value.value;
|
||||
state.value = value.value;
|
||||
const points = value.subwayStationList;
|
||||
state.downup = true;
|
||||
if (points.length) {
|
||||
if (points && points.length) {
|
||||
state.dont = 0;
|
||||
state.dontObj = points[0];
|
||||
state.subwayStart = points[0];
|
||||
@@ -224,6 +255,9 @@ function openFilterSubway() {
|
||||
getJobList('refresh');
|
||||
}
|
||||
},
|
||||
cancel: () => {
|
||||
showFiltersubway.value = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -251,8 +285,8 @@ function selectSubwayStation(point, index) {
|
||||
|
||||
function inputText(id) {
|
||||
if (id) {
|
||||
const text = range.value.filter((item) => item.value === id)[0].text;
|
||||
return text;
|
||||
const foundItem = range.value.filter((item) => item.value === id)[0];
|
||||
return foundItem ? foundItem.text : '';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
@@ -260,13 +294,15 @@ function inputText(id) {
|
||||
|
||||
function bindPickerChange(e) {
|
||||
const lineId = range.value[e.detail.value];
|
||||
if (!lineId) return;
|
||||
const value = state.subwayList.filter((iv) => iv.lineId === lineId.value)[0];
|
||||
if (!value) return;
|
||||
subwayCurrent.value = value;
|
||||
state.value = e.detail.value;
|
||||
state.subwayId = value.lineId;
|
||||
const points = value.subwayStationList;
|
||||
state.downup = true;
|
||||
if (points.length) {
|
||||
if (points && points.length) {
|
||||
state.dont = 0;
|
||||
state.dontObj = points[0];
|
||||
state.subwayStart = points[0];
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -680,7 +680,7 @@ const rangeOptions = ref([
|
||||
{ value: 0, text: '推荐' },
|
||||
{ value: 1, text: '最热' },
|
||||
{ value: 2, text: '最新发布' },
|
||||
{ value: 3, text: '疆外' },
|
||||
// { value: 3, text: '疆外' },
|
||||
{ value: 4, text: '零工市场' }
|
||||
]);
|
||||
const isLoaded = ref(false);
|
||||
|
||||
Reference in New Issue
Block a user