From 4ab0bc2f6e8151ca2f435981e399d1a0dc8b98c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E8=BE=89?= <13935151924@163.com> Date: Thu, 13 Nov 2025 19:28:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=94=A8=E6=88=B7bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expected-station/expected-station.vue | 98 ++++++++++++++++++- components/selectJobs/selectJobs.vue | 12 ++- packageA/pages/personalInfo/personalInfo.vue | 12 ++- packageA/pages/post/post.vue | 11 ++- pages/complete-info/company-info.vue | 51 +++++----- pages/complete-info/complete-info.vue | 4 +- pages/index/components/index-one.vue | 46 ++++++++- pages/job/publishJob.vue | 34 ++++++- 8 files changed, 221 insertions(+), 47 deletions(-) diff --git a/components/expected-station/expected-station.vue b/components/expected-station/expected-station.vue index 3cd0f92..f6e3ce0 100644 --- a/components/expected-station/expected-station.vue +++ b/components/expected-station/expected-station.vue @@ -5,7 +5,7 @@ - + {{ item.label }} @@ -94,9 +95,104 @@ export default { this.leftValue = item; this.rightValue = item.children; this.scrollTop = 0; + + // 确保左侧列表滚动到正确位置,让当前选中的标签可见 + this.$nextTick(() => { + const index = this.copyTree.findIndex(i => i.id === item.id); + if (index !== -1 && this.$refs.leftScroll) { + // 计算需要滚动的距离(每个选项高度约160rpx) + const scrollTop = index * 160; + + // 获取左侧列表的可见高度(假设可见区域能显示约3-4个选项) + const visibleHeight = 4 * 160; // 约4个选项的高度 + + // 确保选中的标签在可见区域内 + let targetScrollTop = scrollTop; + + // 如果选中的标签在底部,确保它不会滚动出可见区域 + if (scrollTop > this.$refs.leftScroll.scrollHeight - visibleHeight) { + targetScrollTop = Math.max(0, this.$refs.leftScroll.scrollHeight - visibleHeight); + } + + this.$refs.leftScroll.scrollTo({ + top: targetScrollTop, + duration: 300 + }); + } + }); }, scrollTopBack(e) { this.scrollTop = e.detail.scrollTop; + + // 滚动时自动选中对应的左侧标签 + const scrollTop = e.detail.scrollTop; + let currentSection = null; + let minDistance = Infinity; + + // 遍历所有右侧的二级标题,找到当前最接近顶部的那个 + this.rightValue.forEach((section, index) => { + // 估算每个section的位置(假设每个section高度大约为 200rpx) + const sectionTop = index * 200; + const distance = Math.abs(sectionTop - scrollTop); + + if (distance < minDistance) { + minDistance = distance; + currentSection = section; + } + }); + + // 如果找到了对应的section,并且不是当前选中的左侧标签,则切换左侧标签 + if (currentSection && this.leftValue.id !== currentSection.parentId) { + const parentItem = this.copyTree.find(item => item.id === currentSection.parentId); + if (parentItem) { + this.leftValue = parentItem; + + // 确保左侧列表滚动到正确位置,让当前选中的标签可见 + this.$nextTick(() => { + const index = this.copyTree.findIndex(i => i.id === parentItem.id); + if (index !== -1 && this.$refs.leftScroll) { + // 计算需要滚动的距离(每个选项高度约160rpx) + const scrollTop = index * 160; + + // 获取左侧列表的可见高度(假设可见区域能显示约3-4个选项) + const visibleHeight = 4 * 160; // 约4个选项的高度 + + // 确保选中的标签在可见区域内 + let targetScrollTop = scrollTop; + + // 如果选中的标签在底部,确保它不会滚动出可见区域 + if (scrollTop > this.$refs.leftScroll.scrollHeight - visibleHeight) { + targetScrollTop = Math.max(0, this.$refs.leftScroll.scrollHeight - visibleHeight); + } + + this.$refs.leftScroll.scrollTo({ + top: targetScrollTop, + duration: 300 + }); + } + }); + } + } + }, + handleWheel(e) { + // 处理鼠标滚轮事件,让右侧内容可以滚动 + e.preventDefault(); + const delta = e.deltaY || e.wheelDelta; + + // 更平滑的滚动,根据滚轮速度调整滚动量 + const scrollAmount = Math.abs(delta) > 100 ? 80 : 40; + const direction = delta > 0 ? 1 : -1; + + // 更新scrollTop来模拟滚动 + this.scrollTop += scrollAmount * direction; + + // 确保scrollTop在合理范围内 + this.scrollTop = Math.max(0, this.scrollTop); + + // 触发scroll事件来更新左侧标签选中状态 + this.$nextTick(() => { + this.scrollTopBack({ detail: { scrollTop: this.scrollTop } }); + }); }, addItem(item) { let titiles = []; diff --git a/components/selectJobs/selectJobs.vue b/components/selectJobs/selectJobs.vue index 09cc886..bf438f2 100644 --- a/components/selectJobs/selectJobs.vue +++ b/components/selectJobs/selectJobs.vue @@ -125,6 +125,12 @@ const cleanup = () => { }; const changeJobTitleId = (e) => { + if (!e.ids) { + count.value = 0; + JobsIdsValue.value = ''; + JobsLabelValue.value = ''; + return; + } const ids = e.ids.split(',').map((id) => Number(id)); count.value = ids.length; JobsIdsValue.value = e.ids; @@ -147,9 +153,9 @@ function serchforIt(defaultId) { if (state.stations.length) { const ids = defaultId ? defaultId.split(',').map((id) => Number(id)) - : userInfo.value.jobTitleId.split(',').map((id) => Number(id)); + : (userInfo.value.jobTitleId ? userInfo.value.jobTitleId.split(',').map((id) => Number(id)) : []); count.value = ids.length; - state.jobTitleId = defaultId ? defaultId : userInfo.value.jobTitleId; + state.jobTitleId = defaultId ? defaultId : (userInfo.value.jobTitleId || ''); setCheckedNodes(state.stations, ids); state.visible = true; return; @@ -160,7 +166,7 @@ function serchforIt(defaultId) { count.value = ids.length; setCheckedNodes(resData.data, ids); } - state.jobTitleId = userInfo.value.jobTitleId; + state.jobTitleId = userInfo.value.jobTitleId || ''; state.stations = resData.data; state.visible = true; }); diff --git a/packageA/pages/personalInfo/personalInfo.vue b/packageA/pages/personalInfo/personalInfo.vue index 32cb0b9..7d75162 100644 --- a/packageA/pages/personalInfo/personalInfo.vue +++ b/packageA/pages/personalInfo/personalInfo.vue @@ -153,7 +153,7 @@ const percent = ref('0%'); const state = reactive({ educationText: '', politicalAffiliationText: '', - skills: [], // 新的技能数据结构 + skills: [], // 新的技能数据结构,包含id字段 currentEditingSkillIndex: -1 // 当前正在编辑的技能索引 }); const fromValue = reactive({ @@ -244,13 +244,14 @@ function initLoad() { fromValue.politicalAffiliation = currentUserInfo.politicalAffiliation || ''; fromValue.idCard = currentUserInfo.idCard || ''; - // 初始化技能数据 - 从appSkillsList获取 + // 初始化技能数据 - 从appSkillsList获取,保留原始id if (currentUserInfo.appSkillsList && Array.isArray(currentUserInfo.appSkillsList)) { // 过滤掉name为空的技能项 const validSkills = currentUserInfo.appSkillsList.filter(item => item.name && item.name.trim() !== ''); if (validSkills.length > 0) { - // 将appSkillsList转换为新的技能数据结构 + // 将appSkillsList转换为新的技能数据结构,保留原始id state.skills = validSkills.map(skill => ({ + id: skill.id, // 保留服务器返回的原始id name: skill.name, level: skill.levels || '' })); @@ -350,10 +351,11 @@ const confirm = () => { return $api.msg('请输入正确手机号'); } - // 构建appSkillsList数据结构 - 使用新的技能数据结构 + // 构建appSkillsList数据结构 - 使用新的技能数据结构,包含id字段 const appSkillsList = state.skills .filter(skill => skill.name && skill.name.trim() !== '') .map(skill => ({ + id: skill.id, // 包含技能id,用于更新操作 name: skill.name, levels: skill.level || '' })); @@ -379,7 +381,7 @@ function addSkill() { return; } - // 添加新的技能对象 + // 添加新的技能对象,新增技能不需要id,后端会自动生成 state.skills.push({ name: '', level: '' diff --git a/packageA/pages/post/post.vue b/packageA/pages/post/post.vue index 783df6c..8bf5225 100644 --- a/packageA/pages/post/post.vue +++ b/packageA/pages/post/post.vue @@ -35,10 +35,13 @@ - - 来源  - {{ jobInfo.dataSource }} - + + 来源  + {{ jobInfo.dataSource }} + + + {{ formatPublishTime(jobInfo.postingDate) }} + diff --git a/pages/complete-info/company-info.vue b/pages/complete-info/company-info.vue index 1ca7255..f9a1dc2 100644 --- a/pages/complete-info/company-info.vue +++ b/pages/complete-info/company-info.vue @@ -113,8 +113,8 @@ 本地重点发展产业 - - {{ formData.industryType || '请选择产业类型' }} + + {{ formData.industryTypeText || '请选择产业类型' }} @@ -255,7 +255,8 @@ const formData = reactive({ enterpriseType: null, // 是否是就业见习基地 (0=是, 1=否, null=未选择) legalIdCard: '', // 法人身份证号 legalPhone: '', // 法人联系方式 - industryType: '', // 是否是本地重点发展产业 + industryType: '', // 本地重点发展产业值 + industryTypeText: '', // 本地重点发展产业显示文本 isLocalCompany: null, // 是否是本地企业 (true/false/null) scale: '', // 企业规模 scaleText: '', // 企业规模显示文本 @@ -287,11 +288,17 @@ const openSelectPopup = (config) => { // 产业类型选项数据 const industryOptions = [ - '人工智能', - '生物医药', - '新能源', - '高端装备制造', - '其他' + { label: '粮油产业集群', value: '0' }, + { label: '绿色矿业产业集群', value: '1' }, + { label: '绿色有机果蔬产业集群', value: '2' }, + { label: '煤炭煤电化工产业集群', value: '3' }, + { label: '棉花和纺织服装产业集群', value: '4' }, + { label: '新能源新材料等战略性新兴产业产业集群', value: '5' }, + { label: '优质畜产品产业集群', value: '6' }, + { label: '油气生产加工产业集群', value: '7' }, + { label: '旅游', value: '8' }, + { label: '电子产品', value: '9' }, + { label: '现代商贸物流产业', value: '10' } ] // 备用企业类型选项(当字典数据加载失败时使用) @@ -394,10 +401,16 @@ const editCompanyIntro = () => { // 选择产业类型 const selectIndustry = () => { - uni.showActionSheet({ - itemList: industryOptions, - success: (res) => { - formData.industryType = industryOptions[res.tapIndex] + console.log('点击本地重点发展产业,当前选项:', industryOptions) + + openSelectPopup({ + title: '本地重点发展产业', + maskClick: true, + data: [industryOptions], + success: (_, [value]) => { + console.log('选择的产业类型:', value) + formData.industryType = value.value // 存储数字值用于传值 + formData.industryTypeText = value.label // 存储文字标签用于显示 updateCompletion() $api.msg('产业类型选择成功') } @@ -485,6 +498,7 @@ const scaleOptions = computed(() => { return scaleData }) + // 选择企业规模 const selectScale = () => { console.log('点击企业规模,当前数据:', scaleOptions.value) @@ -517,16 +531,6 @@ const selectScale = () => { showScaleSelector(options) } -// 备用企业规模选项(当字典数据加载失败时使用) -const fallbackScaleOptions = [ - { label: '1-10人', value: '1' }, - { label: '11-50人', value: '2' }, - { label: '51-100人', value: '3' }, - { label: '101-500人', value: '4' }, - { label: '501-1000人', value: '5' }, - { label: '1000人以上', value: '6' } -] - // 显示企业规模选择器 const showScaleSelector = (options) => { console.log('企业规模选项列表:', options) @@ -709,7 +713,7 @@ const confirm = () => { legalPhone: formData.legalPhone, industryType: formData.industryType, isLocalCompany: formData.isLocalCompany, - scale: formData.scaleText, + scale: formData.scale, // 改为提交数字值 companyContactList: formData.companyContactList.filter(contact => contact.contactPerson.trim() && contact.contactPersonPhone.trim()) } @@ -1008,4 +1012,3 @@ defineExpose({ button::after border: none - diff --git a/pages/complete-info/complete-info.vue b/pages/complete-info/complete-info.vue index f1c57c6..fbbc7e5 100644 --- a/pages/complete-info/complete-info.vue +++ b/pages/complete-info/complete-info.vue @@ -103,7 +103,7 @@ 学历 - + 身份证 @@ -279,7 +279,7 @@ const state = reactive({ workExperience: '', salayText: '', jobsText: [], - skills: [], // 新的技能数据结构 + skills: [], // 技能数据结构 { name, level } currentEditingSkillIndex: -1 // 当前正在编辑的技能索引 }); const fromValue = reactive({ diff --git a/pages/index/components/index-one.vue b/pages/index/components/index-one.vue index 9439c10..33c6bf9 100644 --- a/pages/index/components/index-one.vue +++ b/pages/index/components/index-one.vue @@ -30,6 +30,14 @@ {{ companyInfo.scale || '100-999人' }} + + + + + + + 直播 + @@ -1939,7 +1947,39 @@ defineExpose({ loadData }); color: #CCCCCC font-weight: 300 - .size - color: #666666 - font-weight: 400 + .size + color: #666666 + font-weight: 400 + + // 企业用户直播按钮样式 + .company-live-button + display: flex + align-items: center + justify-content: center + width: 100rpx + height: 48rpx + background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%) + border-radius: 40rpx + box-shadow: 0 4rpx 12rpx rgba(255, 107, 107, 0.3) + transition: all 0.2s ease + flex-shrink: 0 + margin-left: 20rpx + + &:active + transform: scale(0.95) + box-shadow: 0 2rpx 8rpx rgba(255, 107, 107, 0.4) + + .live-icon + margin-right: 6rpx + display: flex + align-items: center + justify-content: center + + .live-text + font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif + font-weight: 500 + font-size: 24rpx + color: #FFFFFF + text-align: center + white-space: nowrap diff --git a/pages/job/publishJob.vue b/pages/job/publishJob.vue index 4f60be8..47e8e67 100644 --- a/pages/job/publishJob.vue +++ b/pages/job/publishJob.vue @@ -253,6 +253,9 @@ const formData = reactive({ ] }); +// 是否是就业见习基地 +const isInternshipBase = ref(false); + // 字典存储 const dictStore = useDictStore(); @@ -322,6 +325,16 @@ const getCompanyInfo = () => { const company = cachedUserInfo.company; formData.companyName = company.name || ''; formData.companyId = company.companyId || ''; + + // 检查是否是就业见习基地:enterpriseType为0表示是,1表示否 + if (company.enterpriseType !== undefined) { + isInternshipBase.value = company.enterpriseType === '0'; + console.log('就业见习基地状态:', isInternshipBase.value ? '是' : '否', 'enterpriseType:', company.enterpriseType); + } else { + console.log('未找到enterpriseType字段,默认不是就业见习基地'); + isInternshipBase.value = false; + } + console.log('从缓存获取企业名称:', company.name); console.log('从缓存获取企业ID:', company.id); } else { @@ -336,6 +349,8 @@ const getCompanyInfo = () => { formData.companyId = cachedUserInfo.id; console.log('从用户ID获取企业ID:', cachedUserInfo.id); } + // 默认不是就业见习基地 + isInternshipBase.value = false; } } catch (error) { console.error('获取企业信息失败:', error); @@ -358,11 +373,20 @@ const initFormData = async () => { workDistricts.value = dictStore.state.area; // 设置岗位分类选项 - jobCategories.value = [ - { label: '普通', value: '1' }, - { label: '零工', value: '2' }, - { label: '实习实训', value: '3' } - ]; + // 只有就业见习基地才能选择"实习实训"选项 + if (isInternshipBase.value) { + jobCategories.value = [ + { label: '普通', value: '1' }, + { label: '零工', value: '2' }, + { label: '实习实训', value: '3' } + ]; + } else { + jobCategories.value = [ + { label: '普通', value: '1' }, + { label: '零工', value: '2' } + ]; + } + console.log('岗位分类选项:', jobCategories.value); // 设置企业ID(从用户信息获取) if (userStore.userInfo && userStore.userInfo.id) {