删除部分代码

This commit is contained in:
2025-11-19 17:59:15 +08:00
parent cf79092298
commit fba4723dda
165 changed files with 334 additions and 62442 deletions

View File

@@ -1,85 +0,0 @@
<template>
<view class="collection-content">
<renderJobs
seeDate="applyTime"
v-if="pageState.list.length"
:list="pageState.list"
:longitude="longitudeVal"
:latitude="latitudeVal"
></renderJobs>
<empty v-else pdTop="200"></empty>
</view>
</template>
<script setup>
import dictLabel from '@/components/dict-Label/dict-Label.vue';
import { reactive, inject, watch, ref, onMounted } from 'vue';
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
import useUserStore from '@/stores/useUserStore';
const { $api, navTo, vacanciesTo } = inject('globalFunction');
import { storeToRefs } from 'pinia';
import useLocationStore from '@/stores/useLocationStore';
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const userStore = useUserStore();
const state = reactive({});
const pageState = reactive({
page: 0,
list: [],
total: 0,
maxPage: 1,
pageSize: 10,
});
onLoad(() => {
console.log('onLoad');
// $api.sleep(2000).then(() => {
// navTo('/pages/complete-info/complete-info');
// });
getJobList();
});
onReachBottom(() => {
getJobList();
});
function navToPost(jobId) {
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(jobId)}`);
}
function getJobList(type = 'add') {
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 1;
}
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
};
$api.createRequest('/app/user/apply/job', params).then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = pageState.list.length;
const reslist = rows;
pageState.list.splice(str, end, ...reslist);
} else {
pageState.list = rows;
}
// pageState.list = resData.rows;
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
console.log(pageState.list);
});
}
</script>
<style lang="stylus" scoped>
.collection-content{
padding: 1rpx 28rpx 20rpx 28rpx;
background: #F4F4F4;
height: 100%
min-height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
}
</style>

View File

@@ -1,402 +0,0 @@
<template>
<view class="page-container">
<view class="content">
<view class="content-input">
<view class="input-titile">公司名称</view>
<input class="input-con" v-model="formData.companyName" maxlength="200" placeholder-style="font-size: 16px" placeholder="请输入公司名称" />
</view>
<view class="content-input">
<view class="input-titile">职位名称</view>
<input class="input-con" v-model="formData.position" maxlength="100" placeholder-style="font-size: 16px" placeholder="请输入职位名称" />
</view>
<view class="content-input">
<view class="input-titile">工作时间</view>
<view class="date-range-container">
<picker mode="date" :value="startDate === '至今' ? currentDate : startDate" :start="minDate" :end="currentDate" @change="bindStartDateChange">
<view class="date-picker-item">
<text class="date-label">开始时间</text>
<view class="date-display" :class="{ 'current-text': startDate === '至今' }">{{startDate || '请选择开始时间'}}</view>
</view>
</picker>
<view class="date-separator"></view>
<picker mode="date" :value="endDate === '至今' ? currentDate : endDate" :start="startDate === '至今' ? minDate : startDate" :end="currentDate" @change="bindEndDateChange">
<view class="date-picker-item">
<text class="date-label">结束时间</text>
<view class="date-display" :class="{ 'current-text': endDate === '至今' }">{{endDate}}</view>
</view>
</picker>
</view>
</view>
<view class="content-input">
<view class="input-titile">工作描述</view>
<!-- <input class="input-con" placeholder="请输入工作描述" /> -->
<textarea class="textarea-con" v-model="formData.description" placeholder-style="font-size: 16px" maxlength="500" placeholder="请输入工作描述"/>
</view>
</view>
<!-- 底部确认按钮 -->
<view class="bottom-confirm-btn">
<view class="confirm-btn" @click="handleConfirm">确认</view>
</view>
</view>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import SelectJobs from '@/components/selectJobs/selectJobs.vue';
import useUserStore from '@/stores/useUserStore';
const { $api, navTo, navBack, config } = inject('globalFunction');
const { userInfo } = useUserStore();
// 页面参数
const pageType = ref('add'); // add: 添加, edit: 编辑
const editData = ref(null); // 编辑时的数据
// 获取当前日期
const getDate = (options = {}) => {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
if (options.format) {
return `${year}-${month}-${day}`;
}
return date;
};
const currentDate = getDate({ format: true });
const minDate = '1990-01-01'; // 开始时间最早只能选择到1990年
// 定义响应式数据
const startDate = ref(''); // 开始时间需要选择
const endDate = ref('至今'); // 结束时间默认为"至今"
// 表单数据
const formData = reactive({
companyName: '',
position: '',
userId: '', // 将在确认时动态获取
startDate: '',
endDate: '至今', // 设置默认值为"至今"
description: ''
});
// 页面加载时解析参数
onLoad((options) => {
console.log('页面参数:', options);
// 解析页面类型
if (options.type) {
pageType.value = options.type;
}
// 如果是编辑模式,解析传递的数据
if (options.type === 'edit' && options.data) {
try {
editData.value = JSON.parse(decodeURIComponent(options.data));
console.log('编辑数据:', editData.value);
// 回显数据到表单
if (editData.value) {
formData.companyName = editData.value.companyName || '';
formData.position = editData.value.position || '';
formData.startDate = editData.value.startDate || '';
formData.endDate = editData.value.endDate || '至今';
formData.description = editData.value.description || '';
// 同步日期选择器的显示
startDate.value = editData.value.startDate || '';
endDate.value = editData.value.endDate || '至今';
}
} catch (error) {
console.error('解析编辑数据失败:', error);
$api.msg('数据解析失败');
}
}
});
const state = reactive({
lfsalay: [2, 5, 10, 15, 20, 25, 30, 50],
risalay: [2, 5, 10, 15, 20, 25, 30, 50], // 修复未定义的salay变量
salayText: '',
areaText: '',
jobsText: []
});
// 开始日期选择器变化事件
const bindStartDateChange = (e) => {
const selectedDate = e.detail.value;
if (selectedDate === currentDate) {
// 如果选择的是今天,设置为"至今"
startDate.value = '至今';
formData.startDate = '至今';
} else {
startDate.value = selectedDate;
formData.startDate = selectedDate;
}
// 如果结束日期早于开始日期且结束日期不是"至今",清空结束日期
if (endDate.value && endDate.value !== '至今' && endDate.value < startDate.value) {
endDate.value = '至今';
formData.endDate = '至今';
}
};
// 结束日期选择器变化事件
const bindEndDateChange = (e) => {
const selectedDate = e.detail.value;
if (selectedDate === currentDate) {
// 如果选择的是今天,设置为"至今"
endDate.value = '至今';
formData.endDate = '至今';
} else {
endDate.value = selectedDate;
formData.endDate = selectedDate;
}
};
// 确认保存工作经历
const handleConfirm = async () => {
// 表单验证
if (!formData.companyName.trim()) {
$api.msg('请输入公司名称');
return;
}
if (!formData.position.trim()) {
$api.msg('请输入职位名称');
return;
}
if (!formData.startDate) {
$api.msg('请选择开始时间');
return;
}
if (!formData.description.trim()) {
$api.msg('请输入工作描述');
return;
}
console.log(userInfo.userId)
// 调试:打印表单数据
console.log('表单数据:', formData);
console.log('结束时间:', formData.endDate);
try {
// 处理结束时间:如果是"至今",则使用当前日期
const endDateValue = formData.endDate === '至今' ? currentDate : formData.endDate;
console.log('处理后的结束时间:', endDateValue);
// 准备请求参数不包含userId让后端通过token获取
const params = {
companyName: formData.companyName.trim(),
position: formData.position.trim(),
startDate: formData.startDate,
endDate: endDateValue, // 使用处理后的结束时间
description: formData.description.trim()
};
console.log('请求参数:', params);
console.log('页面类型:', pageType.value);
let resData;
// 根据页面类型调用不同的接口
if (pageType.value === 'edit' && editData.value?.id) {
// 编辑模式:调用更新接口
resData = await $api.createRequest(`/app/userworkexperiences/edit`, {...params, id: editData.value.id}, 'put');
console.log('编辑接口响应:', resData);
} else {
// 添加模式:调用新增接口
resData = await $api.createRequest('/app/userworkexperiences/add', params, 'post');
console.log('新增接口响应:', resData);
}
if (resData.code === 200) {
$api.msg(pageType.value === 'edit' ? '工作经历更新成功' : '工作经历保存成功');
// 返回上一页
navBack();
} else {
$api.msg(resData.msg || '操作失败');
}
} catch (error) {
console.error('保存工作经历失败:', error);
$api.msg('保存失败,请重试');
}
};
</script>
<style lang="stylus" scoped>
.page-container {
min-height: 100vh;
background-color: #ffffff;
position: relative;
}
.content{
padding: 28rpx;
display: flex;
flex-direction: column;
justify-content: flex-start;
padding-bottom: 120rpx;
}
.content-input
margin-bottom: 52rpx
.input-titile
font-weight: 400;
font-size: 28rpx;
color: #6A6A6A;
.input-con
font-weight: 400;
font-size: 32rpx;
color: #333333;
line-height: 80rpx;
height: 80rpx;
border-bottom: 2rpx solid #EBEBEB
position: relative;
.triangle::before
position: absolute;
right: 20rpx;
top: calc(50% - 2rpx);
content: '';
width: 4rpx;
height: 18rpx;
border-radius: 2rpx
background: #697279;
transform: translate(0, -50%) rotate(-45deg) ;
.triangle::after
position: absolute;
right: 20rpx;
top: 50%;
content: '';
width: 4rpx;
height: 18rpx;
border-radius: 2rpx
background: #697279;
transform: rotate(45deg)
.textarea-con
border: 2rpx solid #EBEBEB
width: 95%
height: 400rpx
margin-top: 20rpx
padding: 15rpx
.date-range-container
display: flex
align-items: flex-end
justify-content: space-between
margin-top: 20rpx
position: relative
border-bottom: 2rpx solid #EBEBEB
.date-picker-item
flex: 1
display: flex
flex-direction: column
align-items: center
.date-label
font-size: 24rpx
color: #999999
margin-bottom: 10rpx
.date-display
width: 100%
height: 80rpx
line-height: 80rpx
font-size: 32rpx
color: #333333
text-align: center
position: relative
&.current-text
color: #256BFA
font-weight: 500
.date-separator
position: absolute
left: 50%
bottom: 40rpx
transform: translateX(-50%)
font-size: 28rpx
color: #666666
background-color: #ffffff
padding: 0 10rpx
z-index: 2
height: 20rpx
line-height: 20rpx
display: flex
align-items: center
// 底部确认按钮样式
.bottom-confirm-btn
position: fixed
bottom: 0
left: 0
right: 0
background-color: #ffffff
padding: 20rpx 28rpx
border-top: 2rpx solid #EBEBEB
z-index: 999
.confirm-btn
width: 100%
height: 90rpx
background: #256BFA
border-radius: 12rpx
font-weight: 500
font-size: 32rpx
color: #FFFFFF
text-align: center
line-height: 90rpx
button-click: true
// .content-sex
// height: 110rpx;
// display: flex
// justify-content: space-between;
// align-items: flex-start;
// border-bottom: 2rpx solid #EBEBEB
// margin-bottom: 52rpx
// .sex-titile
// line-height: 80rpx;
// .sext-ri
// display: flex
// align-items: center;
// .sext-box
// height: 76rpx;
// width: 152rpx;
// text-align: center;
// line-height: 80rpx;
// border-radius: 12rpx 12rpx 12rpx 12rpx
// border: 2rpx solid #E8EAEE;
// margin-left: 28rpx
// font-weight: 400;
// font-size: 28rpx;
// .sext-boxactive
// color: #256BFA
// background: rgba(37,107,250,0.1);
// border: 2rpx solid #256BFA;
// .next-btn
// width: 100%;
// height: 90rpx;
// background: #256BFA;
// border-radius: 12rpx 12rpx 12rpx 12rpx;
// font-weight: 500;
// font-size: 32rpx;
// color: #FFFFFF;
// text-align: center;
// line-height: 90rpx
// .input-nx
// position: relative
// border-bottom: 2rpx solid #EBEBEB
// padding-bottom: 30rpx
// display: flex
// flex-wrap: wrap
// .nx-item
// padding: 20rpx 28rpx
// width: fit-content
// border-radius: 12rpx 12rpx 12rpx 12rpx;
// border: 2rpx solid #E8EAEE;
// margin-right: 24rpx
// margin-top: 24rpx
</style>

View File

@@ -1,219 +0,0 @@
<template>
<AppLayout title="我的浏览" :show-bg-image="false" :use-scroll-view="false">
<view class="collection-content">
<view class="collection-search">
<view class="search-content">
<view class="header-input button-click">
<uni-icons class="iconsearch" color="#6A6A6A" type="search" size="22"></uni-icons>
<input
class="input"
@confirm="searchCollection"
placeholder="招聘会"
placeholder-class="inputplace"
/>
</view>
<view class="data-all">
<image class="allimg button-click" @click="toSelectDate" src="/static/icon/date1.png"></image>
</view>
</view>
</view>
<scroll-view scroll-y class="main-scroll" @scrolltolower="getJobList('add')">
<view class="one-cards">
<view class="mian">
<renderJobs
:list="pageState.list"
v-if="pageState.list.length"
:longitude="longitudeVal"
:latitude="latitudeVal"
></renderJobs>
<empty v-else pdTop="200"></empty>
<!-- <loadmore ref="loadmoreRef"></loadmore> -->
</view>
</view>
</scroll-view>
</view>
</AppLayout>
</template>
<script setup>
import dictLabel from '@/components/dict-Label/dict-Label.vue';
import { reactive, inject, watch, ref, onMounted } from 'vue';
import { storeToRefs } from 'pinia';
import { onLoad, onShow } from '@dcloudio/uni-app';
import useUserStore from '@/stores/useUserStore';
const { $api, navTo, navBack } = inject('globalFunction');
import useLocationStore from '@/stores/useLocationStore';
const { userInfo } = storeToRefs(useUserStore());
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const userStore = useUserStore();
const browseDate = ref('');
const weekday = ref([]);
const monthDay = ref([]);
const currentDay = ref('');
const pageState = reactive({
page: 0,
list: [],
total: 0,
maxPage: 1,
pageSize: 10,
search: {},
lastDate: '',
});
const currentDate = ref('');
onLoad(() => {
getBrowseDate();
getJobList('refresh');
// const today = new Date().toISOString().split('T')[0];
// currentDate.value = today;
});
function toSelectDate() {
navTo('/packageA/pages/selectDate/selectDate', {
query: {
date: currentDate.value,
record: true,
},
onBack: (res) => {
currentDate.value = res.date;
pageState.search.startDate = getPreviousDay(res.date);
pageState.search.endDate = res.date;
getJobList('refresh');
},
});
}
function navToPost(jobId) {
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(jobId)}`);
}
function searchCollection(e) {
const value = e.detail.value;
pageState.search.jobTitle = value;
getJobList('refresh');
}
function getBrowseDate() {
$api.createRequest('/app/user/review/array').then((res) => {
browseDate.value = res.data.join(',');
});
}
function getJobList(type = 'add', loading = true) {
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 1;
}
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
...pageState.search,
};
$api.createRequest('/app/user/review', params, 'GET', loading).then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = pageState.list.length;
const [reslist, lastDate] = $api.insertSortData(rows, 'reviewDate');
if (reslist.length) {
// 日期监测是否一致
if (reslist[0].title === pageState.lastDate) {
reslist.shift();
}
}
pageState.list.splice(str, end, ...reslist);
pageState.lastDate = lastDate;
} else {
const [reslist, lastDate] = $api.insertSortData(rows, 'reviewDate');
pageState.list = reslist;
pageState.lastDate = lastDate;
}
// pageState.list = resData.rows;
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
});
}
function getPreviousDay(dateStr) {
const date = new Date(dateStr);
date.setDate(date.getDate() - 1); // 减去一天
// 格式化成 YYYY-MM-DD
return date.toISOString().split('T')[0];
}
</script>
<style lang="stylus" scoped>
.btnback{
width: 64rpx;
height: 64rpx;
}
.btn {
display: flex;
justify-content: space-between;
align-items: center;
width: 52rpx;
height: 52rpx;
}
image {
height: 100%;
width: 100%;
}
.collection-content
height: 100%
display: flex
flex-direction: column
.collection-search
padding: 10rpx 20rpx;
.search-content
position: relative
display: flex
align-items: center
padding: 14rpx 0
.header-input{
padding: 0
width: calc(100% - 48rpx);
position: relative
.iconsearch{
position: absolute
left: 30rpx;
top: 50%
transform: translate(0, -50%)
}
.input{
padding: 0 30rpx 0 80rpx
height: 80rpx;
background: #FFFFFF;
border-radius: 75rpx 75rpx 75rpx 75rpx;
border: 2rpx solid #ECECEC
font-size: 28rpx;
}
.inputplace{
font-weight: 400;
font-size: 28rpx;
color: #B5B5B5;
}
}
.data-all{
width: 66rpx;
height: 66rpx;
margin-left: 18rpx
.allimg{
width: 100%;
height: 100%
}
}
.main-scroll{
flex: 1
overflow: hidden
}
.one-cards{
padding: 0 20rpx 20rpx 20rpx;
background: #f4f4f4
}
</style>

View File

@@ -1,152 +0,0 @@
<template>
<AppLayout title="精选企业">
<template #headerleft>
<view class="btn">
<image src="@/static/icon/back.png" @click="navBack"></image>
</view>
</template>
<view class="main">
<view class="main-header">
<view class="header-title btn-feel">企业推荐站</view>
<view class="header-text btn-feel">AI智联{{ config.appInfo.areaName }}岗位触手可</view>
<image class="header-img btn-shaky" src="/static/icon/companyBG.png"></image>
</view>
<view class="main-content">
<view class="cards btn-feel" v-for="item in list" :key="item.companyCardId" @click="seeDetail(item)">
<view class="card-title">{{ item.name }}</view>
<view class="card-text">{{ item.description }}</view>
</view>
</view>
</view>
</AppLayout>
</template>
<script setup>
import { inject, ref, reactive } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navBack, navTo, config } = inject('globalFunction');
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
const { getUserResume } = useUserStore();
const { userInfo } = storeToRefs(useUserStore());
const list = ref([]);
onLoad(() => {
getPremiumList();
});
function CollectionCard(item) {
$api.createRequest(`/app/company/card/collection/${item.companyCardId}`, {}, 'PUT').then((resData) => {
getPremiumList();
$api.msg('关注成功');
});
}
function delCollectionCard(item) {
$api.createRequest(`/app/company/card/collection/${item.companyCardId}`, {}, 'DELETE').then((resData) => {
getPremiumList();
$api.msg('取消关注');
});
}
function getPremiumList() {
$api.createRequest('/app/company/card').then((resData) => {
const { rows, total } = resData;
list.value = rows;
});
}
function seeDetail(item) {
uni.setStorageSync('jinxuan', item);
navTo('/packageA/pages/choicenessList/choicenessList');
}
</script>
<style lang="stylus" scoped>
.btn {
display: flex;
justify-content: space-between;
align-items: center;
width: 60rpx;
height: 60rpx;
image {
height: 100%;
width: 100%;
}
}
.main{
.main-content{
padding: 28rpx
.cards{
padding: 32rpx
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 2rpx solid #DCDCDC;
margin-bottom: 36rpx;
position: relative;
.card-title{
font-family: PingFang SC, PingFang SC;
font-weight: 600;
font-size: 32rpx;
color: #333333;
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
}
.card-text{
margin-top: 16rpx
width: 502rpx;
height: 80rpx;
font-weight: 400;
font-size: 28rpx;
color: #6C7282;
}
}
.cards::before{
position: absolute;
right: 40rpx;
top: 50%;
content: '';
width: 4rpx;
height: 18rpx;
border-radius: 2rpx
background: #6C7282;
transform: translate(0, -50%) rotate(-45deg) ;
}
.cards::after{
position: absolute;
right: 40rpx;
top: calc(50% + 1rpx);
content: '';
width: 4rpx;
height: 18rpx;
border-radius: 2rpx
background: #6C7282;
transform: rotate(45deg)
}
}
.main-header{
padding: 80rpx 40rpx
position: relative
.header-title{
font-weight: 400;
font-size: 56rpx;
color: #333333;
font-family: DingTalk JinBuTi;
}
.header-text{
font-weight: 400;
font-size: 32rpx;
color: rgba(3,3,3,0.5);
margin-top: 10rpx
}
.header-img{
position: absolute
right: 0
bottom: 0
// transform: translate(0, -50%)
width: 280rpx;
height: 272rpx;
}
}
}
</style>

View File

@@ -1,156 +0,0 @@
<template>
<AppLayout :title="title" :show-bg-image="false" @onScrollBottom="getDataList('add')">
<template #headerleft>
<view class="btnback">
<image src="@/static/icon/back.png" @click="navBack"></image>
</view>
</template>
<template #headContent>
<view class="collection-search">
<view class="search-content">
<view class="header-input button-click">
<uni-icons class="iconsearch" color="#6A6A6A" type="search" size="22"></uni-icons>
<input
class="input"
@confirm="searchCollection"
placeholder="输入企业名称"
placeholder-class="inputplace"
/>
</view>
</view>
</view>
</template>
<view class="main-list">
<renderCompanys
v-if="pageState.list.length"
:list="pageState.list"
:longitude="longitudeVal"
:latitude="latitudeVal"
></renderCompanys>
<empty v-else pdTop="200"></empty>
</view>
</AppLayout>
</template>
<script setup>
import { inject, ref, reactive } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { storeToRefs } from 'pinia';
const { $api, navTo, navBack } = inject('globalFunction');
import useLocationStore from '@/stores/useLocationStore';
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
// state
const title = ref('事业单位');
const cardInfo = ref({});
const pageState = reactive({
page: 0,
list: [],
total: 0,
maxPage: 1,
pageSize: 10,
search: {},
});
onLoad(() => {
const options = uni.getStorageSync('jinxuan');
if (options) {
cardInfo.value = options;
title.value = options.name;
} else {
$api.msg('请传入精选企业参数');
}
getDataList('refresh');
});
// search
function searchCollection(e) {
const value = e.detail.value;
pageState.search.companyName = value;
getDataList('refresh');
}
// list
function getDataList(type = 'add') {
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 1;
}
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
cardId: cardInfo.value.companyCardId,
...pageState.search,
};
$api.createRequest('/app/company/label', params).then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = pageState.list.length;
const reslist = rows;
pageState.list.splice(str, end, ...reslist);
} else {
pageState.list = rows;
}
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
});
}
</script>
<style lang="stylus" scoped>
.btnback{
width: 64rpx;
height: 64rpx;
}
.btn {
display: flex;
justify-content: space-between;
align-items: center;
width: 52rpx;
height: 52rpx;
}
image {
height: 100%;
width: 100%;
}
.collection-search{
padding: 10rpx 20rpx;
.search-content{
position: relative
display: flex
align-items: center
padding: 14rpx 0
.header-input{
padding: 0
width: calc(100%);
position: relative
.iconsearch{
position: absolute
left: 30rpx;
top: 50%
transform: translate(0, -50%)
}
.input{
padding: 0 30rpx 0 80rpx
height: 80rpx;
background: #FFFFFF;
border-radius: 75rpx 75rpx 75rpx 75rpx;
border: 2rpx solid #ECECEC
font-size: 28rpx;
}
.inputplace{
font-weight: 400;
font-size: 28rpx;
color: #B5B5B5;
}
}
}
}
.main-list{
background-color: #F4F4F4;
padding: 1rpx 28rpx 28rpx 28rpx
}
</style>

View File

@@ -1,257 +0,0 @@
<template>
<AppLayout title="我的收藏" :show-bg-image="false" :use-scroll-view="false">
<view class="collection-content">
<view class="header">
<view class="button-click" :class="{ active: type === 0 }" @click="changeType(0)">工作职位</view>
<view class="button-click" :class="{ active: type === 1 }" @click="changeType(1)">公司企业</view>
</view>
<view class="coll-main">
<swiper class="swiper" :current="type" @change="changeSwiperType">
<swiper-item class="list">
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
<view class="mian">
<renderJobsCheckBox
ref="jobListRef"
:list="pageState.list"
v-if="pageState.list.length"
:longitude="longitudeVal"
:latitude="latitudeVal"
@update:selected="updateSelectedCount"
></renderJobsCheckBox>
<empty v-else pdTop="200"></empty>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="list">
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLowerCompany">
<view class="mian">
<renderCompanys
:list="pageCompanyState.list"
v-if="pageCompanyState.list.length"
:longitude="longitudeVal"
:latitude="latitudeVal"
></renderCompanys>
<empty v-else pdTop="200"></empty>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</view>
<template #footer>
<view v-if="selectedJobCount > 0 && type === 0" class="compare-bar">
<view class="selected-count">已选中 {{ selectedJobCount }} 个岗位</view>
<button class="compare-btn" @click="handleCompare">岗位对比</button>
</view>
</template>
</AppLayout>
</template>
<script setup>
import { inject, ref, reactive, nextTick } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { storeToRefs } from 'pinia';
import useLocationStore from '@/stores/useLocationStore';
import renderJobsCheckBox from '@/components/renderJobs/renderJobsCheckBox.vue';
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const { $api, navBack, navTo } = inject('globalFunction');
const type = ref(0);
// 新增获取renderJobs组件实例
const jobListRef = ref(null);
// 新增:选中的岗位数量
const selectedJobCount = ref(0);
const pageState = reactive({
page: 0,
list: [],
total: 0,
maxPage: 1,
pageSize: 10,
});
const pageCompanyState = reactive({
page: 0,
list: [],
total: 0,
maxPage: 1,
pageSize: 10,
});
onShow(() => {
getJobList();
getCompanyList();
});
function changeSwiperType(e) {
const current = e.detail.current;
type.value = current;
}
function changeType(e) {
type.value = e;
}
// 监听选中数量变化
function updateSelectedCount() {
nextTick(() => {
if (jobListRef.value) {
selectedJobCount.value = jobListRef.value.selectedJobs.length;
}
});
}
// 新增:对比按钮点击事件
function handleCompare() {
if (selectedJobCount.value < 2) {
uni.showToast({
title: '请至少选择2个岗位进行对比',
icon: 'none',
});
return;
}
// 获取选中的岗位数据
const selectedJobs = jobListRef.value.selectedJobs;
const selectedJobData = pageState.list.filter((job) => selectedJobs.includes(job.jobId));
uni.setStorageSync('compare', selectedJobData);
// 跳转到对比页面(假设已创建对比页面)
navTo('/packageA/pages/collection/compare');
}
function handleScrollToLower() {
getJobList();
}
function handleScrollToLowerCompany() {
getCompanyList();
}
function getJobList(type = 'add') {
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 1;
}
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
};
$api.createRequest('/app/user/collection/job', params).then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = pageState.list.length;
const reslist = rows;
pageState.list.splice(str, end, ...reslist);
} else {
pageState.list = rows;
}
// pageState.list = resData.rows;
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
});
}
function getCompanyList(type = 'add') {
if (type === 'refresh') {
pageCompanyState.page = 1;
pageCompanyState.maxPage = 1;
}
if (type === 'add' && pageCompanyState.page < pageCompanyState.maxPage) {
pageCompanyState.page += 1;
}
let params = {
current: pageCompanyState.page,
pageSize: pageCompanyState.pageSize,
};
$api.createRequest('/app/user/collection/company', params).then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageCompanyState.pageSize * (pageCompanyState.page - 1);
const end = pageCompanyState.list.length;
const reslist = rows;
pageCompanyState.list.splice(str, end, ...reslist);
} else {
pageCompanyState.list = rows;
}
// pageCompanyState.list = resData.rows;
pageCompanyState.total = resData.total;
pageCompanyState.maxPage = Math.ceil(pageCompanyState.total / pageCompanyState.pageSize);
});
}
</script>
<style lang="stylus" scoped>
// 新增底部对比栏样式
.compare-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 30rpx;
background-color: #fff;
border-top: 1rpx solid #eee;
box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05);
.selected-count {
font-size: 28rpx;
color: #333;
}
.compare-btn {
width: 200rpx;
height: 60rpx;
line-height: 60rpx;
background-color: #4C6EFB;
color: #fff;
border-radius: 30rpx;
font-size: 28rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 0
}
}
.btn {
display: flex;
justify-content: space-between;
align-items: center;
width: 60rpx;
height: 60rpx;
image {
height: 100%;
width: 100%;
}
}
.collection-content{
background: #F4F4F4;
height: 100%
display: flex
flex-direction: column
.header{
background: #FFFFFF;
display: flex
justify-content: space-evenly;
align-items: center
padding: 28rpx 100rpx
font-weight: 400;
font-size: 32rpx;
color: #666D7F;
.active {
font-weight: 500;
font-size: 32rpx;
color: #000000;
}
}
.coll-main{
flex: 1
overflow: hidden
.main-scroll,
.swiper{
height: 100%
.mian{
padding: 0 28rpx 28rpx 28rpx
}
}
}
}
</style>

View File

@@ -1,208 +0,0 @@
<template>
<view class="job-comparison-container">
<scroll-view class="horizontal-scroll" scroll-x="true">
<view class="comparison-table">
<view class="table-row table-header">
<view class="table-cell fixed-column"></view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell job-title-cell">
<text>{{ job.jobTitle }}</text>
<text class="company">{{ job.company }}</text>
</view>
</view>
<view class="table-row">
<view class="table-cell fixed-column detail-label">
<text>薪资</text>
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view>
<Salary-Expectation
:max-salary="job.maxSalary"
:min-salary="job.minSalary"
:is-month="true"
></Salary-Expectation>
</view>
</view>
</view>
<view class="table-row">
<view class="table-cell fixed-column detail-label">
<text>公司名称</text>
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view>{{ job.companyName }}</view>
</view>
</view>
<view class="table-row">
<view class="table-cell fixed-column detail-label">
<text>学历</text>
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view><dict-Label dictType="education" :value="job.education"></dict-Label></view>
</view>
</view>
<view class="table-row">
<view class="table-cell fixed-column detail-label">
<text>经验</text>
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view><dict-Label dictType="experience" :value="job.experience"></dict-Label></view>
</view>
</view>
<view class="table-row">
<view class="table-cell fixed-column detail-label">
<text>工作地点</text>
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view>{{ job.jobLocation }}</view>
</view>
</view>
<view class="table-row">
<view class="table-cell fixed-column detail-label">
<text>来源</text>
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view>{{ job.dataSource }}</view>
</view>
</view>
<view class="table-row">
<view class="table-cell fixed-column detail-label">
<text>职位描述</text>
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view>{{ job.description }}</view>
</view>
</view>
<view class="table-row">
<view class="table-cell fixed-column detail-label">
<text>工业</text>
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view>
<dict-tree-Label
v-if="jobInfo.company && jobInfo.company.industry"
dictType="industry"
:value="jobInfo.company.industry"
></dict-tree-Label>
</view>
</view>
</view>
<view class="table-row">
<view class="table-cell fixed-column detail-label">
<text>企业规模</text>
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view>
<dict-Label dictType="scale" :value="jobInfo.company?.scale"></dict-Label>
</view>
</view>
</view>
<view class="table-row">
<view class="table-cell fixed-column detail-label">
<text>热门</text>
</view>
<view v-for="(job, index) in jobs" :key="index" class="table-cell detail-content">
<view>
{{ job.isHot ? '是' : '否' }}
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script setup>
import { inject, ref, computed, nextTick } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import useDictStore from '@/stores/useDictStore';
const jobs = ref([]);
onLoad(() => {
let compareData = uni.getStorageSync('compare');
jobs.value = compareData;
});
</script>
<style scoped>
.job-comparison-container {
padding: 10px;
background-color: #f8f8f8;
}
.horizontal-scroll {
width: 100%;
white-space: nowrap; /* 保持 flex 子项在同一行 */
}
.comparison-table {
display: flex;
flex-direction: column;
width: fit-content;
}
.table-row {
display: flex;
border-bottom: 1px solid #e0e0e0;
}
.table-row:first-child {
border-bottom: 2px solid #ccc;
}
.table-cell {
flex-shrink: 0;
padding: 15px 10px;
border-right: 1px solid #e0e0e0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 150px;
white-space: normal;
word-break: break-all;
}
.table-cell:last-child {
border-right: none;
}
.fixed-column {
position: sticky;
left: 0;
z-index: 10;
background-color: #fff;
border-right: 2px solid #ccc;
width: 120px; /* 固定左侧列的宽度 */
text-align: left;
}
.table-header {
background-color: #f1f1f1;
font-weight: bold;
}
.job-title-cell {
text-align: center;
}
.company {
font-weight: normal;
font-size: 12px;
color: #666;
}
.detail-label {
font-weight: bold;
color: #333;
}
.detail-content {
text-align: center;
}
</style>

View File

@@ -1,769 +0,0 @@
<template>
<AppLayout title="" :use-scroll-view="false">
<template #headerleft>
<view class="btnback">
<image src="@/static/icon/back.png" @click="navBack"></image>
</view>
</template>
<view class="content">
<view class="content-top">
<view class="companyinfo-left">
<image src="@/static/icon/companyIcon.png" mode=""></image>
</view>
<view class="companyinfo-right">
<view class="row1 line_2">{{ fairInfo?.jobFairTitle }}</view>
<view class="row2">
<text>{{ fairInfo?.jobFairAddress }}</text>
<convert-distance :alat="fairInfo?.latitude" :along="fairInfo?.longitude" :blat="latitudeVal"
:blong="longitudeVal"></convert-distance>
</view>
</view>
</view>
<view class="locations">
<image class="location-img" src="/static/icon/mapLine.png"></image>
<view class="location-info">
<view class="info">
<text class="info-title">{{ fairInfo?.jobFairAddress }}</text>
<text class="info-text">位置</text>
</view>
</view>
</view>
<view class="conetent-info" :class="{ expanded: isExpanded }">
<view class="info-title">内容描述</view>
<view class="info-desirption">{{ fairInfo?.jobFairIntroduction }}</view>
<!-- <view class="info-title title2">公司地址</view>
<view class="locationCompany"></view> -->
<view class="company-times">
<view class="info-title">内容描述</view>
<view class="card-times">
<view class="time-left">
<view class="left-date">{{ parseDateTime(fairInfo.jobFairStartTime).time }}</view>
<view class="left-dateDay">{{ parseDateTime(fairInfo.jobFairStartTime).date }}</view>
</view>
<view class="line"></view>
<view class="time-center">
<view class="center-date">
{{ getTimeStatus(fairInfo.jobFairStartTime, fairInfo.jobFairEndTime).statusText }}
</view>
<view class="center-dateDay">
{{ getHoursBetween(fairInfo.jobFairStartTime, fairInfo.jobFairEndTime) }}小时
</view>
</view>
<view class="line"></view>
<view class="time-right">
<view class="left-date">{{ parseDateTime(fairInfo.jobFairEndTime).time }}</view>
<view class="left-dateDay">{{ parseDateTime(fairInfo.jobFairEndTime).date }}</view>
</view>
</view>
</view>
</view>
<view class="expand" @click="expand">
<text>{{ isExpanded ? '收起' : '展开' }}</text>
<image class="expand-img" :class="{ 'expand-img-active': !isExpanded }" src="@/static/icon/downs.png">
</image>
</view>
<scroll-view scroll-y class="Detailscroll-view">
<view class="views">
<view class="Detail-title">
<text class="title">参会单位{{ companyList.length }}</text>
</view>
<view v-for="job in companyList" :key="job.id">
<view class="cards" :style="getItemBackgroundStyle('bj.png')"
@click="navTo('/packageA/pages/UnitDetails/UnitDetails?job='+JSON.stringify(job))">
<view class="card-company">
<view class="company line_1">
<image :src="`${baseUrl}/jobfair/mc.png`" mode=""></image>
{{ job.companyName }}
</view>
<view class="ris">
<text class="fs_14">
在招职位
{{ job.jobInfoList.length || '-' }}
</text>
</view>
</view>
<view class="card-bottom">
<view class="fl_box fs_14">
{{ job.scale }}
</view>
</view>
<view class="card-tags">
<view class="tag" v-if="job.industry">
<image :src="`${baseUrl}/jobfair/hy.png`" mode=""></image>
{{ job.industry }}
</view>
<view class="tag">
<image :src="`${baseUrl}/jobfair/lx.png`" mode=""></image>
{{ job.companyType }}
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<template #footer>
<view class="footer" v-if="hasnext">
<view class="btn-wq button-click" :class="{ 'btn-desbel': fairInfo.isSignUp==1 }"
@click="applyExhibitors">
{{ fairInfo.isSignUp==1 ? '已报名' : '报名招聘会' }}
</view>
</view>
</template>
<uni-popup ref="CompanySignPopup" background-color="#fff" :mask-click="false">
<view class="popup-content">
<signDialog v-if="signDialogisshow" :signType="signType" :signRole="signRole"
:jobFairId="fairInfo.jobFairId" @closePopup="closePopup"></signDialog>
</view>
</uni-popup>
</AppLayout>
</template>
<script setup>
import signDialog from '@/components/jobfair/signDialog.vue';
import config from "@/config.js"
import {
reactive,
inject,
watch,
ref,
onMounted,
computed
} from 'vue';
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
import useLocationStore from '@/stores/useLocationStore';
const {
$api,
navTo,
vacanciesTo,
navBack
} = inject('globalFunction');
import {
storeToRefs
} from 'pinia';
const {
longitudeVal,
latitudeVal
} = storeToRefs(useLocationStore());
const isExpanded = ref(false);
const fairInfo = ref({});
const companyList = ref([]);
const hasnext = ref(true);
const userInfo = ref({});
const signDialogisshow = ref(false)
// 弹窗
const signType = ref(1);
// person个人 ent企业
const signRole = ref('ent');
const CompanySignPopup = ref(null)
const jobFairId = ref(null)
const baseUrl = config.imgBaseUrl
const getItemBackgroundStyle = (imageName) => ({
backgroundImage: `url(${baseUrl}/jobfair/${imageName})`,
backgroundSize: '100% 100%', // 覆盖整个容器
backgroundPosition: 'center', // 居中
backgroundRepeat: 'no-repeat'
});
onLoad((options) => {
jobFairId.value=options.jobFairId
const raw = uni.getStorageSync("Padmin-Token");
const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? {
Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`
} : {};
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (resData.code == 200) {
$api.myRequest("/system/user/login/user/info", {}, "GET", 10100, {
Authorization: `Bearer ${uni.getStorageSync("Padmin-Token")}`
}).then((userinfo) => {
userInfo.value = userinfo
getCompanyInfo(userInfo.value.info.userId, options.jobFairId);
});
} else {
getCompanyInfo('', options.jobFairId);
}
});
});
function closePopup() {
CompanySignPopup.value.close()
getCompanyInfo(userInfo.value.info.userId, jobFairId.value)
}
function getCompanyInfo(userId, id) {
let data={}
if (userInfo.value&&userInfo.value.userType == 'ent') {
data={
jobFairId: id,
enterpriseId: userId,
code:userInfo.value.info.entCreditCode
}
}else if(userInfo.value&&userInfo.value.userType == 'ent'){
data={
jobFairId: id,
personId: userId,
idCard:userInfo.value.info.personCardNo
}
}else{
data={
jobFairId: id,
personId: userId
}
}
$api.myRequest('/jobfair/public/jobfair/detail', data).then((resData) => {
fairInfo.value = resData.data;
});
$api.myRequest('/jobfair/public/jobfair/enterprises-with-jobs-by-job-fair-id', {
jobFairId: id
}).then((resData) => {
companyList.value = resData.data;
});
};
const hasAppointment = () => {
const isTimePassed = (timeStr) => {
const targetTime = new Date(timeStr.replace(/-/g, '/')).getTime(); // 兼容格式
const now = Date.now();
return now < targetTime;
};
hasnext.value = isTimePassed(fairInfo.value.startTime);
};
function openMap(lat, lng, name = '位置') {
const isConfirmed = window.confirm('是否打开地图查看位置?');
if (!isConfirmed) return;
// 使用高德地图或百度地图的 H5 链接打开
const url = `https://uri.amap.com/marker?position=${lng},${lat}&name=${encodeURIComponent(name)}`;
window.location.href = url;
}
function expand() {
isExpanded.value = !isExpanded.value;
}
// 报名招聘会
function applyExhibitors() {
if (fairInfo.value.isSignUp == 1) {
$api.msg('请勿重复报名');
return
}
const raw = uni.getStorageSync("Padmin-Token");
const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? {
Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`
} : {};
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (resData.code == 200) {
if (userInfo.value.userType == 'ent') {
// 企业
signType.value = fairInfo.value.jobFairType;
signRole.value = userInfo.userType;
signDialogisshow.value = true
CompanySignPopup.value.open()
}else{
$api.myRequest("/jobfair/public/job-fair-sign-up-person/sign-up", {
personId: userInfo.value.info.userId,
jobFairId: jobFairId.value,
idCard:userInfo.value.info.personCardNo
}, "POST", 9100, { "Content-Type": "application/json",...headers }).then((res) => {
if (res.code === 200) {
uni.showToast({
title: '报名成功',
icon: 'success'
});
getCompanyInfo(userInfo.value.info.userId, jobFairId.value)
} else {
uni.showToast({
title: res.msg || '报名失败',
icon: 'none'
});
}
})
}
} else {
$api.msg('请先登录');
setTimeout(() => {
uni.redirectTo({
url: '/packageB/login'
})
}, 1000)
}
});
}
function parseDateTime(datetimeStr) {
if (!datetimeStr) return {
time: '',
date: ''
};
const dateObj = new Date(datetimeStr);
if (isNaN(dateObj.getTime())) return {
time: '',
date: ''
}; // 无效时间
const year = dateObj.getFullYear();
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
const day = String(dateObj.getDate()).padStart(2, '0');
const hours = String(dateObj.getHours()).padStart(2, '0');
const minutes = String(dateObj.getMinutes()).padStart(2, '0');
return {
time: `${hours}:${minutes}`,
date: `${year}${month}${day}`,
};
}
function getTimeStatus(startTimeStr, endTimeStr) {
const now = new Date();
const startTime = new Date(startTimeStr);
const endTime = new Date(endTimeStr);
// 判断状态0 开始中1 过期2 待开始
let status = 0;
let statusText = '开始中';
let color = '#13C57C'; // 进行中 - 绿色
if (now < startTime) {
status = 2; // 待开始
statusText = '待开始';
color = '#015EEA'; // 未开始 - 蓝色
} else if (now > endTime) {
status = 1; // 已过期
statusText = '已过期';
color = '#999999'; // 已过期 - 灰色
} else {
status = 0; // 进行中
statusText = '进行中';
color = '#13C57C'; // 进行中 - 绿色
}
return {
status, // 0: 进行中1: 已过期2: 待开始
statusText,
color
};
}
function getHoursBetween(startTimeStr, endTimeStr) {
const start = new Date(startTimeStr);
const end = new Date(endTimeStr);
const diffMs = end - start;
const diffHours = diffMs / (1000 * 60 * 60);
return +diffHours.toFixed(2); // 保留 2 位小数
}
</script>
<style lang="stylus" scoped>
.popup-content {
width: 90vw;
height: 80vh;
position: relative;
}
.btnback {
width: 64rpx;
height: 64rpx;
}
.btn {
display: flex;
justify-content: space-between;
align-items: center;
width: 52rpx;
height: 52rpx;
}
image {
height: 100%;
width: 100%;
}
.content {
height: 100%;
display: flex;
flex-direction: column;
.content-top {
padding: 28rpx;
padding-top: 50rpx;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
.companyinfo-left {
width: 96rpx;
height: 96rpx;
margin-right: 24rpx;
}
.companyinfo-right {
flex: 1;
.row1 {
font-weight: 500;
font-size: 32rpx;
color: #333333;
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
}
.row2 {
font-weight: 400;
font-size: 28rpx;
color: #6C7282;
line-height: 45rpx;
display: flex;
justify-content: space-between;
}
}
}
.locations {
padding: 0 28rpx;
height: 86rpx;
position: relative;
margin-bottom: 36rpx;
.location-img {
border-radius: 8rpx 8rpx 8rpx 8rpx;
border: 2rpx solid #EFEFEF;
}
.location-info {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.info {
padding: 0 60rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
white-space: nowrap;
.info-title {
font-weight: 600;
font-size: 28rpx;
color: #333333;
}
.info-text {
font-weight: 400;
font-size: 28rpx;
color: #9B9B9B;
position: relative;
padding-right: 20rpx
}
.info-text::before {
position: absolute;
right: 0;
top: 50%;
content: '';
width: 4rpx;
height: 16rpx;
border-radius: 2rpx;
background: #9B9B9B;
transform: translate(0, -75%) rotate(-45deg)
}
.info-text::after {
position: absolute;
right: 0;
top: 50%;
content: '';
width: 4rpx;
height: 16rpx;
border-radius: 2rpx;
background: #9B9B9B;
transform: translate(0, -25%) rotate(45deg)
}
}
}
}
.conetent-info {
padding: 0 28rpx;
overflow: hidden;
max-height: 0rpx;
transition: max-height 0.3s ease;
.info-title {
font-weight: 600;
font-size: 28rpx;
color: #000000;
}
.info-desirption {
margin-top: 12rpx;
font-weight: 400;
font-size: 28rpx;
color: #495265;
text-align: justify;
}
.title2 {
margin-top: 48rpx
}
}
.company-times {
padding-top: 40rpx;
.info-title {
font-weight: 600;
font-size: 28rpx;
color: #000000;
}
}
.expanded {
max-height: 1000rpx; // 足够显示完整内容
}
.expand {
display: flex;
flex-wrap: nowrap;
white-space: nowrap;
justify-content: center;
margin-bottom: 46rpx;
font-weight: 400;
font-size: 28rpx;
color: #256BFA;
.expand-img {
width: 40rpx;
height: 40rpx;
}
.expand-img-active {
transform: rotate(180deg)
}
}
}
.Detailscroll-view {
flex: 1;
overflow: hidden;
background: #F4F4F4;
.views {
padding: 28rpx;
.Detail-title {
font-weight: 600;
font-size: 32rpx;
color: #000000;
position: relative;
display: flex;
justify-content: space-between;
.title {
position: relative;
z-index: 2;
}
}
.Detail-title::before {
position: absolute;
content: '';
left: -14rpx;
bottom: 0;
height: 16rpx;
width: 108rpx;
background: linear-gradient(to right, #CBDEFF, #FFFFFF);
border-radius: 8rpx;
z-index: 1;
}
.cards {
padding: 32rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.04);
border-radius: 20rpx 20rpx 20rpx 20rpx;
margin-top: 22rpx;
.card-company {
display: flex;
justify-content: space-between;
align-items: flex-start;
.company {
font-weight: 600;
font-size: 32rpx;
color: #333333;
display: flex;
align-items: center;
image {
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
}
.salary {
font-weight: 500;
font-size: 28rpx;
white-space: nowrap;
line-height: 48rpx;
}
.ris {
background: #53ACFF;
color: #fff;
padding: 7rpx 20rpx;
border-radius: 8rpx;
}
}
.card-companyName {
font-weight: 400;
font-size: 28rpx;
color: #6C7282;
}
.card-tags {
display: flex;
flex-wrap: wrap;
.tag {
width: fit-content;
height: 30rpx;
background: #E0F0FF;
border-radius: 4rpx;
padding: 6rpx 26rpx;
line-height: 30rpx;
font-weight: 400;
font-size: 24rpx;
color: #595959;
text-align: center;
margin-top: 14rpx;
white-space: nowrap;
display: flex;
align-items: center;
margin-right: 20rpx;
image {
width: 22rpx;
height: 22rpx;
margin-right: 8rpx;
}
}
}
.card-bottom {
margin-top: 15rpx;
display: flex;
justify-content: space-between;
font-size: 28rpx;
color: #6C7282;
}
}
}
}
.card-times {
display: flex;
justify-content: space-between;
align-items: center;
padding: 24rpx 30rpx 10rpx 30rpx;
.time-left,
.time-right {
text-align: center;
.left-date {
font-weight: 500;
font-size: 48rpx;
color: #333333;
}
.left-dateDay {
font-weight: 400;
font-size: 24rpx;
color: #333333;
margin-top: 12rpx;
}
}
.line {
width: 40rpx;
height: 0rpx;
border: 2rpx solid #D4D4D4;
margin-top: 64rpx;
}
.time-center {
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.center-date {
font-weight: 400;
font-size: 28rpx;
color: #FF881A;
}
.center-dateDay {
font-weight: 400;
font-size: 24rpx;
color: #333333;
margin-top: 6rpx;
line-height: 48rpx;
width: 104rpx;
height: 48rpx;
background: #F9F9F9;
border-radius: 8rpx 8rpx 8rpx 8rpx;
}
}
}
.footer {
background: #FFFFFF;
box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11, 44, 112, 0.12);
border-radius: 0rpx 0rpx 0rpx 0rpx;
padding: 40rpx 28rpx 20rpx 28rpx;
.btn-wq {
height: 90rpx;
background: #256BFA;
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 90rpx
}
.btn-desbel {
background: #6697FB;
box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11, 44, 112, 0.12);
}
}
</style>

View File

@@ -1,294 +0,0 @@
<template>
<AppLayout
title="求职期望"
:sub-title="`完成度${percent}`"
border
back-gorund-color="#ffffff"
:show-bg-image="false"
>
<template #headerleft>
<view class="btn mar_le20 button-click" @click="navBack">取消</view>
</template>
<template #headerright>
<view class="btn mar_ri20 button-click" @click="confirm">确认</view>
</template>
<view class="content">
<view class="content-input" @click="changeSalary">
<view class="input-titile">期望薪资</view>
<input class="input-con triangle" v-model="state.salayText" disabled placeholder="请选择您的期望薪资" />
</view>
<view class="content-input" @click="changeArea">
<view class="input-titile">期望工作地</view>
<input
class="input-con triangle"
v-model="state.areaText"
disabled
placeholder="请选择您的期望工作地"
/>
</view>
<view class="content-input" @click="changeJobs">
<view class="input-titile">求职岗位</view>
<input
class="input-con triangle"
disabled
v-if="!state.jobsText || !state.jobsText.length"
placeholder="请选择您的求职岗位"
/>
<view class="input-nx" @click="changeJobs" v-else>
<view class="nx-item button-click" v-for="item in state.jobsText">{{ item }}</view>
</view>
</view>
</view>
<SelectJobs ref="selectJobsModel"></SelectJobs>
<SelectPopup ref="selectPopupRef"></SelectPopup>
</AppLayout>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import SelectJobs from '@/components/selectJobs/selectJobs.vue';
import SelectPopup from '@/components/selectPopup/selectPopup.vue';
const { $api, navTo, navBack, config } = inject('globalFunction');
// 创建本地的 openSelectPopup 函数
const openSelectPopup = (config) => {
if (selectPopupRef.value) {
selectPopupRef.value.open(config);
}
};
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
import useDictStore from '@/stores/useDictStore';
const { userInfo } = storeToRefs(useUserStore());
const { getUserResume } = useUserStore();
const { dictLabel, oneDictData, getDictData } = useDictStore();
const selectJobsModel = ref();
const selectPopupRef = ref();
const percent = ref('0%');
const salay = [2, 5, 10, 15, 20, 25, 30, 50, 80, 100];
const state = reactive({
lfsalay: [2, 5, 10, 15, 20, 25, 30, 50],
risalay: JSON.parse(JSON.stringify(salay)),
salayText: '',
areaText: '',
jobsText: [],
});
const fromValue = reactive({
salaryMin: 0,
salaryMax: 0,
area: '',
jobTitleId: [],
});
onLoad(async () => {
// 初始化字典数据
await getDictData();
initLoad();
});
const confirm = () => {
if (!fromValue.jobTitleId) {
return $api.msg('请选择您的求职岗位');
}
$api.createRequest('/app/user/resume', fromValue, 'post').then((resData) => {
$api.msg('完成');
state.disbleDate = true;
getUserResume().then(() => {
navBack();
});
});
};
watch(userInfo, (newValue, oldValue) => {
initLoad();
});
function initLoad() {
fromValue.salaryMin = userInfo.value.salaryMin;
fromValue.salaryMax = userInfo.value.salaryMax;
fromValue.area = userInfo.value.area;
fromValue.jobTitleId = userInfo.value.jobTitleId;
// 回显
state.areaText = dictLabel('area', Number(userInfo.value.area));
if (userInfo.value.salaryMin && userInfo.value.salaryMax) {
state.salayText = `${userInfo.value.salaryMin}-${userInfo.value.salaryMax}`;
} else {
state.salayText = '';
}
state.jobsText = userInfo.value.jobTitle || [];
const result = getFormCompletionPercent(fromValue);
percent.value = result;
}
const changeSalary = () => {
let leftIndex = 0;
openSelectPopup({
title: '薪资',
maskClick: true,
data: [state.lfsalay, state.risalay],
unit: 'k',
success: (_, [min, max]) => {
fromValue.salaryMin = min.value * 1000;
fromValue.salaryMax = max.value * 1000;
state.salayText = `${fromValue.salaryMin}-${fromValue.salaryMax}`;
},
change(e) {
const salayData = e.detail.value;
if (leftIndex !== salayData[0]) {
const copyri = JSON.parse(JSON.stringify(salay));
const [lf, ri] = e.detail.value;
const risalay = copyri.slice(lf, copyri.length);
// 更新右侧选项
state.risalay = risalay;
leftIndex = salayData[0];
}
},
});
};
function changeArea() {
openSelectPopup({
title: '区域',
maskClick: true,
data: [oneDictData('area')],
success: (_, [value]) => {
fromValue.area = value.value;
state.areaText = config.appInfo.areaName + '-' + value.label;
},
});
}
function changeJobs() {
selectJobsModel.value?.open({
title: '添加岗位',
defaultId: fromValue.jobTitleId,
success: (ids, labels) => {
console.log(ids, labels);
fromValue.jobTitleId = ids;
state.jobsText = labels.split(',');
},
cancel: (ids, labels) => {
console.log(ids, labels);
// fromValue.jobTitleId = ids;
// state.jobsText = labels.split(',');
},
});
}
function getFormCompletionPercent(form) {
let total = Object.keys(form).length;
let filled = 0;
for (const key in form) {
const value = form[key];
if (value !== '' && value !== null && value !== undefined) {
if (typeof value === 'number') {
filled += 1;
} else if (typeof value === 'string' && value.trim() !== '') {
filled += 1;
}
}
}
if (total === 0) return '0%';
const percent = (filled / total) * 100;
return percent.toFixed(0) + '%'; // 取整,不要小数点
}
</script>
<style lang="stylus" scoped>
.btn{
margin-top: -30rpx
}
.content{
padding: 28rpx;
display: flex;
flex-direction: column;
justify-content: flex-start
height: calc(100% - 120rpx)
}
.content-input
margin-bottom: 52rpx
.input-titile
font-weight: 400;
font-size: 28rpx;
color: #6A6A6A;
.input-con
font-weight: 400;
font-size: 32rpx;
color: #333333;
line-height: 80rpx;
height: 80rpx;
border-bottom: 2rpx solid #EBEBEB
position: relative;
.triangle::before
position: absolute;
right: 20rpx;
top: calc(50% - 2rpx);
content: '';
width: 4rpx;
height: 18rpx;
border-radius: 2rpx
background: #697279;
transform: translate(0, -50%) rotate(-45deg) ;
.triangle::after
position: absolute;
right: 20rpx;
top: 50%;
content: '';
width: 4rpx;
height: 18rpx;
border-radius: 2rpx
background: #697279;
transform: rotate(45deg)
.content-sex
height: 110rpx;
display: flex
justify-content: space-between;
align-items: flex-start;
border-bottom: 2rpx solid #EBEBEB
margin-bottom: 52rpx
.sex-titile
line-height: 80rpx;
.sext-ri
display: flex
align-items: center;
.sext-box
height: 76rpx;
width: 152rpx;
text-align: center;
line-height: 80rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx
border: 2rpx solid #E8EAEE;
margin-left: 28rpx
font-weight: 400;
font-size: 28rpx;
.sext-boxactive
color: #256BFA
background: rgba(37,107,250,0.1);
border: 2rpx solid #256BFA;
.next-btn
width: 100%;
height: 90rpx;
background: #256BFA;
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 90rpx
.input-nx
position: relative
border-bottom: 2rpx solid #EBEBEB
padding-bottom: 30rpx
display: flex
flex-wrap: wrap
.nx-item
padding: 20rpx 28rpx
width: fit-content
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 2rpx solid #E8EAEE;
margin-right: 24rpx
margin-top: 24rpx
</style>

View File

@@ -1,73 +0,0 @@
<template>
<view class="collection-content">
<renderJobs :list="list" :longitude="longitudeVal" :latitude="latitudeVal"></renderJobs>
<loadmore ref="loadmoreRef"></loadmore>
</view>
</template>
<script setup>
import dictLabel from '@/components/dict-Label/dict-Label.vue';
import { reactive, inject, watch, ref, onMounted } from 'vue';
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
import useUserStore from '@/stores/useUserStore';
const { $api, navTo, navBack, vacanciesTo } = inject('globalFunction');
import { storeToRefs } from 'pinia';
import useLocationStore from '@/stores/useLocationStore';
import { usePagination } from '@/packageA/hook/usePagination';
import { jobMoreMap } from '@/utils/markdownParser';
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const loadmoreRef = ref(null);
// 响应式搜索条件(可以被修改)
const searchParams = ref({});
const pageSize = ref(10);
const { list, loading, refresh, loadMore } = usePagination(
(params) => $api.createRequest('/app/job/list', params, 'GET', true),
null, // 转换函数
{
pageSize: pageSize,
search: searchParams,
autoWatchSearch: true,
onBeforeRequest: () => {
loadmoreRef.value?.change('loading');
},
onAfterRequest: () => {
loadmoreRef.value?.change('more');
},
}
);
onLoad((options) => {
let params = jobMoreMap.get(options.jobId);
if (params) {
uni.setStorageSync('jobMoreMap', params);
} else {
params = uni.getStorageSync('jobMoreMap');
}
const objs = removeNullProperties(params);
searchParams.value = objs;
refresh();
});
function removeNullProperties(obj) {
for (const key in obj) {
if (obj.hasOwnProperty(key) && obj[key] === null) {
delete obj[key]; // 删除值为 null 的属性
}
}
return obj;
}
onReachBottom(() => {
loadMore();
});
</script>
<style lang="stylus" scoped>
.collection-content{
padding: 1rpx 28rpx 20rpx 28rpx;
background: #F4F4F4;
height: 100%
min-height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
}
</style>

View File

@@ -1,97 +0,0 @@
<template>
<view class="container">
<view class="info-card">
<view class="card-title">企业基本信息</view>
<view class="info-item">
<text class="label">企业名称</text>
<text class="value">泰科电子(上海)有限公司</text>
</view>
<view class="info-item">
<text class="label">法人名称</text>
<text class="value">李某</text>
</view>
<view class="info-item">
<text class="label">统一社会信用代码</text>
<text class="value">913100007504791552</text>
</view>
</view>
<view class="info-card">
<view class="card-title">营业执照</view>
<view class="info-item">
<text class="label">营业执照图片</text>
<image class="license-image" src="/static/business-license.png" mode="aspectFit"></image>
</view>
</view>
<view class="info-card">
<view class="card-title">企业联系人</view>
<view class="info-item">
<text class="label">联系人</text>
<text class="value">张三</text>
</view>
<view class="info-item">
<text class="label">联系人电话</text>
<text class="value">13812345678</text>
</view>
</view>
</view>
</template>
<style scoped>
.container {
padding: 20rpx; /* 使用 rpx 适配不同屏幕 */
background-color: #f5f5f5; /* 页面背景色 */
min-height: 100vh;
}
.info-card {
background-color: #fff;
border-radius: 12rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
margin-bottom: 24rpx;
padding: 30rpx;
}
.card-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
margin-bottom: 30rpx;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #eee;
}
.info-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.info-item:last-child {
border-bottom: none;
}
.label {
font-size: 30rpx;
color: #666;
flex-shrink: 0;
margin-right: 20rpx;
}
.value {
font-size: 30rpx;
color: #333;
text-align: right;
word-break: break-all;
}
.license-image {
width: 100%;
height: auto;
min-height: 300rpx; /* 设置最小高度以保证布局 */
margin-top: 20rpx;
}
</style>

View File

@@ -1,782 +0,0 @@
<template>
<view class="mys-container">
<!-- 个人信息 -->
<view class="mys-tops btn-feel">
<view class="tops-left">
<view class="name">
<text>{{ userInfo.name || '编辑用户名' }}</text>
<view class="edit-icon mar_le10">
<image
class="button-click"
src="@/static/icon/edit1.png"
@click="navTo('/packageA/pages/personalInfo/personalInfo')"
></image>
</view>
</view>
<view class="subName">
<dict-Label class="mar_ri10" dictType="sex" :value="userInfo.sex"></dict-Label>
<text class="mar_ri10">{{ userInfo.age }}</text>
<dict-Label class="mar_ri10" dictType="education" :value="userInfo.education"></dict-Label>
<dict-Label
class="mar_ri10"
dictType="affiliation"
:value="userInfo.politicalAffiliation"
></dict-Label>
</view>
<view class="subName">{{ userInfo.phone }}</view>
</view>
<view class="tops-right">
<view class="right-imghead">
<image v-if="userInfo.sex === '0'" src="@/static/icon/boy.png"></image>
<image v-else src="@/static/icon/girl.png"></image>
</view>
<view class="right-sex">
<image v-if="userInfo.sex === '0'" src="@/static/icon/boy1.png"></image>
<image v-else src="@/static/icon/girl1.png"></image>
</view>
</view>
</view>
<!-- 求职期望 -->
<view class="mys-line"></view>
<view class="mys-info">
<view class="mys-h4">
<text>求职期望</text>
<view class="mys-edit-icon">
<image
class="button-click"
src="@/static/icon/edit1.png"
@click="navTo('/packageA/pages/jobExpect/jobExpect')"
></image>
</view>
</view>
<view class="mys-text">
<text>期望薪资</text>
<text>{{ userInfo.salaryMin / 1000 }}k-{{ userInfo.salaryMax / 1000 }}k</text>
</view>
<view class="mys-text">
<text>期望工作地</text>
<text>{{ config.appInfo.areaName }}-</text>
<dict-Label dictType="area" :value="Number(userInfo.area)"></dict-Label>
</view>
<view class="mys-list">
<view class="cards button-click" v-for="(title, index) in userInfo.jobTitle" :key="index">
{{ title }}
</view>
</view>
</view>
<!-- 工作经历 -->
<view class="work-experience-container">
<!-- 标题栏标题 + 编辑/添加按钮 -->
<view class="exp-header">
<text class="exp-title">工作经历</text>
<button class="exp-edit-btn" @click="handleEditOrAdd" size="mini" type="primary">
<!-- <text> {{ workExperiences.length > 0 ? '编辑' : '添加经历' }}</text> -->
添加经历
</button>
</view>
<!-- 工作经历列表 -->
<view class="exp-list" v-if="workExperiences.length > 0">
<view class="exp-item" v-for="(item, index) in workExperiences" :key="item.id">
<!-- 公司名称 + 职位 -->
<view class="exp-company-row">
<text class="exp-company">{{ item.companyName }}</text>
<text class="exp-position">{{ item.position }}</text>
</view>
<!-- 工作时间 -->
<view class="exp-date-row">
<text class="exp-label">工作时间</text>
<text class="exp-date">{{ item.startDate }} - {{ item.endDate || '至今' }}</text>
</view>
<!-- 工作描述支持多行 -->
<view class="exp-desc-row" v-if="item.description">
<text class="exp-label">工作描述</text>
<text class="exp-desc">{{ item.description }}</text>
</view>
<!-- 操作按钮编辑/删除 -->
<view class="exp-op-btn-row">
<button class="exp-op-btn edit-btn" size="mini" @click.stop="handleEditItem(item)">编辑</button>
<button
class="exp-op-btn delete-btn"
size="mini"
type="warn"
@click.stop="handleDeleteItem(item,index)"
>
删除
</button>
</view>
<!-- 分隔线最后一项不显示 -->
<view class="exp-divider" v-if="index !== workExperiences.length - 1"></view>
</view>
</view>
<!-- 空状态提示无工作经历时显示 -->
<view class="exp-empty" v-else>
<image class="empty-img" src="/static/icons/empty-work.png" mode="widthFix"></image>
<text class="empty-text">暂无工作经历点击"添加经历"完善信息</text>
</view>
</view>
<!-- 4. 新增简历上传区域固定在页面底部 -->
<view class="resume-upload-section">
<button class="upload-btn" @click="handleResumeUpload" :loading="isUploading" :disabled="isUploading">
<uni-icons type="cloud-upload" size="20"></uni-icons>
<text class="upload-text">
{{ uploadedResumeName || '上传简历' }}
</text>
<text class="reupload-text" v-if="uploadedResumeName">重新上传</text>
</button>
<text class="upload-tip">支持 PDFWord 格式文件大小不超过 20MB</text>
<view class="uploaded-file-info" v-if="uploadedResumeName">
<image class="file-icon" src="/static/icons/file-icon.png" mode="widthFix"></image>
<text class="file-name">{{ uploadedResumeName }}</text>
<button class="delete-file-btn" size="mini" @click.stop="handleDeleteResume">删除</button>
</view>
</view>
</view>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
const { $api, navTo, config } = inject('globalFunction');
import { onLoad, onShow } from '@dcloudio/uni-app';
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
import useDictStore from '@/stores/useDictStore';
const { userInfo } = storeToRefs(useUserStore());
const { getUserResume } = useUserStore();
const { getDictData, oneDictData } = useDictStore();
const isUploading = ref(false); // 上传中状态
const uploadedResumeName = ref(''); // 已上传简历文件名
const uploadedResumeUrl = ref(''); // 已上传
const workExperiences = ref([]); // 工作经历列表
const isLoading = ref(false); // 加载状态
// 获取工作经历列表
const getWorkExperiences = async () => {
try {
isLoading.value = true;
console.log('完整用户信息:', userInfo.value);
// 获取用户ID - 使用可选链操作符避免错误
const userId = userInfo.value?.userId;
console.log('用户ID:', userId);
if (!userId) {
console.log('用户ID为空等待用户信息加载...');
// 如果用户ID为空不执行任何操作避免触发退出登录
return;
}
// 只传递userId参数
console.log('请求参数:', { userId });
// 使用try-catch包装请求避免自动退出登录
try {
// 参数拼接到URL后面
const resData = await $api.createRequest(`/app/userworkexperiences/list?userId=${userId}`, {}, 'get');
console.log('工作经历列表响应:', resData);
if (resData.code === 200 && resData.rows) {
workExperiences.value = resData.rows;
console.log('工作经历数据设置成功:', resData.rows);
console.log('总数量:', resData.total);
} else {
console.log('接口返回非200状态或无数据:', resData);
// 如果接口返回错误,不显示错误提示,避免用户困惑
workExperiences.value = []; // 设置为空数组
}
} catch (requestError) {
console.error('接口请求失败:', requestError);
// 接口请求失败时,不显示错误提示,静默处理
workExperiences.value = []; // 设置为空数组
}
} catch (error) {
console.error('获取工作经历失败:', error);
// 静默处理错误,不显示错误提示
workExperiences.value = [];
} finally {
isLoading.value = false;
}
};
// 页面加载时获取数据
onLoad(() => {
// 延迟获取数据,确保用户信息完全加载
setTimeout(() => {
if (userInfo.value?.userId) {
getWorkExperiences();
}
}, 1000);
});
// 页面显示时刷新数据
onShow(() => {
// 延迟获取数据,确保用户信息完全加载
setTimeout(() => {
if (userInfo.value?.userId) {
getWorkExperiences();
}
}, 1000);
});
// 整体编辑/添加(跳转编辑页)
const handleEditOrAdd = () => {
// 跳转到添加经历页面,传递添加标识
navTo('/packageA/pages/addWorkExperience/addWorkExperience?type=add');
};
// 编辑单个经历
const handleEditItem = (item) => {
// 跳转到编辑页面,传递编辑标识和数据
const itemData = encodeURIComponent(JSON.stringify(item));
navTo(`/packageA/pages/addWorkExperience/addWorkExperience?type=edit&data=${itemData}`);
};
// 删除单个经历(带确认弹窗)
const handleDeleteItem = async (item, index) => {
uni.showModal({
title: '确认删除',
content: '此操作将删除该工作经历,是否继续?',
success: async (res) => {
if (res.confirm) {
try {
// 调用删除接口
const deleteRes = await $api.createRequest(`/app/userworkexperiences/${item.id}`, {}, 'delete');
if (deleteRes.code === 200) {
workExperiences.value.splice(index, 1); // 删除本地数据
$api.msg('删除成功');
} else {
$api.msg(deleteRes.msg || '删除失败');
}
} catch (error) {
console.error('删除工作经历失败:', error);
$api.msg('删除失败,请重试');
}
}
},
});
};
// 简历上传核心逻辑
const handleResumeUpload = () => {
// 从缓存获取用户ID参考首页实现方式
// 优先从store获取如果为空则从缓存获取
const storeUserId = userInfo.value?.userId;
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const cachedUserId = cachedUserInfo.userId;
// 获取用户ID优先使用store中的userId如果store中没有使用缓存中的userId
const userId = storeUserId || cachedUserId;
if (!userId) {
$api.msg('请先登录');
return;
}
// 检查是否正在上传
if (isUploading.value) {
return;
}
// 选择文件(微信小程序使用 wx.chooseMessageFileuni-app 中对应 uni.chooseMessageFile
uni.chooseMessageFile({
count: 1, // 只能选择一个文件
type: 'file', // 选择任意文件类型
success: (res) => {
// 注意:文件路径在 res.tempFiles[0].path
const file = res.tempFiles[0];
const tempFilePath = file.path; // 获取临时文件路径
const fileName = file.name; // 获取文件名
// 检查文件大小20MB = 20 * 1024 * 1024 字节)
const maxSize = 20 * 1024 * 1024;
if (file.size > maxSize) {
$api.msg('文件大小不能超过 20MB');
return;
}
// 检查文件类型
const allowedTypes = ['pdf', 'doc', 'docx'];
const fileExtension = fileName.split('.').pop()?.toLowerCase();
if (!fileExtension || !allowedTypes.includes(fileExtension)) {
$api.msg('仅支持 PDF、Word 格式');
return;
}
// 开始上传
uploadResumeFile(tempFilePath, fileName, userId);
},
fail: (err) => {
console.error('选择文件失败:', err);
// 用户取消选择不提示错误
if (err.errMsg && !err.errMsg.includes('cancel')) {
$api.msg('选择文件失败,请重试');
}
}
});
};
// 上传简历文件到服务器(使用 wx.uploadFileuni-app 中对应 uni.uploadFile
const uploadResumeFile = (filePath, fileName, userId) => {
// 确保 userId 存在且有效
if (!userId) {
// 如果传入的userId为空尝试从缓存再次获取
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const cachedUserId = cachedUserInfo.userId;
if (!cachedUserId) {
$api.msg('用户ID不存在无法上传');
return;
}
// 使用缓存中的userId
userId = cachedUserId;
}
isUploading.value = true;
// 获取token从缓存获取参考首页实现方式
let Authorization = '';
const tokenValue = uni.getStorageSync('token') || '';
if (tokenValue) {
Authorization = tokenValue;
} else {
// 如果缓存中没有token尝试从store获取
const userStore = useUserStore();
if (userStore.token) {
Authorization = userStore.token;
}
}
// 根据接口文档bussinessId 应该作为 Query 参数传递,而不是 formData
// 将 bussinessId 拼接到 URL 上作为查询参数
const uploadUrl = `${config.baseUrl}/app/file/upload?bussinessId=${encodeURIComponent(String(userId))}`;
// 打印调试信息
console.log('上传文件参数:', {
url: uploadUrl,
fileName: fileName,
bussinessId: userId,
userId: userId,
token: Authorization ? '已获取' : '未获取'
});
// 上传文件(参考微信小程序 wx.uploadFile API
uni.uploadFile({
url: uploadUrl, // 开发者服务器的上传接口(必须是 HTTPSbussinessId 作为 Query 参数
filePath: filePath, // 本地文件路径(临时路径)
name: 'file', // 服务器端接收文件的字段名(需与后端一致)
// 注意根据接口文档bussinessId 通过 Query 参数传递,不需要 formData
header: {
'Authorization': encodeURIComponent(Authorization)
},
success: (uploadRes) => {
try {
// 注意res.data 是字符串,需转为 JSON如果后端返回 JSON
// 参考方案const result = JSON.parse(data);
let resData;
if (typeof uploadRes.data === 'string') {
resData = JSON.parse(uploadRes.data);
} else {
resData = uploadRes.data;
}
// 判断上传是否成功
if (uploadRes.statusCode === 200 && resData.code === 200) {
// 上传成功,处理返回结果
uploadedResumeName.value = fileName;
uploadedResumeUrl.value = resData.data || resData.msg || resData.url || '';
$api.msg('简历上传成功');
console.log('上传成功', resData);
// 可以在这里保存简历信息到后端(如果需要)
// saveResumeInfo(userId, uploadedResumeUrl.value, fileName);
} else {
// 上传失败
const errorMsg = resData.msg || resData.message || '上传失败,请重试';
$api.msg(errorMsg);
console.error('上传失败:', resData);
}
} catch (error) {
// 解析响应数据失败
console.error('解析上传响应失败:', error);
console.error('原始响应数据:', uploadRes.data);
$api.msg('上传失败,请重试');
}
},
fail: (err) => {
// 上传失败
console.error('上传文件失败:', err);
$api.msg('上传失败,请检查网络连接');
},
// 上传进度监听(可选)
progress: (res) => {
const progress = res.progress; // 上传进度0-100
console.log('上传进度:', progress + '%');
// 可以在这里更新进度条 UI如果需要
},
complete: () => {
// 上传完成(无论成功或失败)
isUploading.value = false;
}
});
};
// 删除已上传的简历
const handleDeleteResume = () => {
if (!uploadedResumeName.value) {
return;
}
uni.showModal({
title: '确认删除',
content: '确定要删除已上传的简历吗?',
success: (res) => {
if (res.confirm) {
// 清除本地数据
uploadedResumeName.value = '';
uploadedResumeUrl.value = '';
$api.msg('已删除');
// 如果需要,可以调用后端接口删除服务器上的文件
// deleteResumeFile(userId);
}
}
});
};
</script>
<style lang="stylus">
/* 修复页面滚动问题:覆盖全局的 overflow: hidden */
page {
overflow-y: auto !important;
overflow-x: hidden;
}
</style>
<style lang="stylus" scoped>
image{
width: 100%;
height: 100%
}
.mys-container{
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.mys-tops{
display: flex
justify-content: space-between
padding: 52rpx 48rpx
.tops-left{
.name{
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
font-weight: 600;
font-size: 44rpx;
color: #333333;
display: flex
align-items: center
justify-content: flex-start
.edit-icon{
display: inline-block
width: 40rpx;
height: 40rpx
padding-bottom: 10rpx
}
}
.subName{
margin-top: 12rpx
font-weight: 400;
font-size: 32rpx;
color: #333333;
}
}
.tops-right{
position: relative
.right-imghead{
width: 136rpx;
height: 136rpx;
border-radius: 50%;
background: #e8e8e8
overflow: hidden
}
.right-sex{
position: absolute
right: -10rpx
top: -10rpx
width: 50rpx
height: 50rpx
}
}
}
.mys-line{
margin: 0 28rpx
height: 0rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
border: 2rpx dashed #000000;
opacity: 0.16;
}
.mys-info{
padding: 28rpx
.mys-h4{
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
font-weight: 600;
font-size: 32rpx;
color: #000000;
margin-bottom: 8rpx
display: flex;
justify-content: space-between
align-items: center
.mys-edit-icon{
display: inline-block
width: 40rpx;
height: 40rpx
}
}
.mys-text{
font-weight: 400;
font-size: 28rpx;
color: #333333;
margin-top: 16rpx
}
.mys-list{
display: flex
align-items: center
flex-wrap: wrap;
.cards{
margin: 28rpx 28rpx 0 0
height: 80rpx;
padding: 0 38rpx;
width: fit-content
display: flex
align-items: center
justify-content: center
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 2rpx solid #E8EAEE;
}
}
}
}
/* 容器样式适配多端用rpx做单位 */
.work-experience-container {
padding: 20rpx 30rpx;
background-color: #fff;
border-radius: 16rpx;
margin: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}
/* 标题栏:两端对齐 */
.exp-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 25rpx;
}
.exp-title {
font-size: 32rpx;
font-weight: 600;
color: #333;
}
/* 编辑/添加按钮UniApp按钮样式重置 */
.exp-edit-btn {
padding: 0 20rpx;
height: 44rpx;
line-height: 44rpx;
font-size: 24rpx;
margin: 0
}
/* 经历列表容器 */
.exp-list {
margin-top: 10rpx;
}
/* 单个经历卡片 */
.exp-item {
padding: 20rpx 0;
}
/* 公司名称 + 职位(横向排列,职位右对齐) */
.exp-company-row {
display: flex;
justify-content: space-between;
margin-bottom: 15rpx;
}
.exp-company {
font-size: 28rpx;
font-weight: 500;
color: #333;
}
.exp-position {
font-size: 26rpx;
color: #666;
}
/* 工作时间/描述:标签+内容横向排列 */
.exp-date-row, .exp-desc-row {
display: flex;
margin-bottom: 12rpx;
line-height: 1.6;
}
/* 标签样式(固定宽度,统一对齐) */
.exp-label {
font-size: 26rpx;
color: #999;
min-width: 160rpx;
}
/* 内容样式 */
.exp-date, .exp-desc {
font-size: 26rpx;
color: #333;
flex: 1; /* 内容占满剩余宽度,支持换行 */
}
/* 工作描述(支持多行换行) */
.exp-desc {
word-break: break-all;
}
/* 操作按钮行(编辑+删除) */
.exp-op-btn-row {
display: flex;
gap: 15rpx;
margin-top: 15rpx;
justify-content: flex-end;
}
.exp-op-btn {
padding: 0 15rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 22rpx;
margin: 0
}
.edit-btn {
background-color: #e8f3ff;
color: #1677ff;
}
/* 分隔线 */
.exp-divider {
height: 1rpx;
background-color: #f5f5f5;
margin-top: 20rpx;
}
/* 空状态样式 */
.exp-empty {
display: flex;
flex-direction: column;
align-items: center;
padding: 80rpx 0;
color: #999;
}
.empty-img {
width: 140rpx;
height: auto;
margin-bottom: 25rpx;
opacity: 0.6;
}
.empty-text {
font-size: 26rpx;
text-align: center;
line-height: 1.5;
}
/* 新增:简历上传区域样式 */
.resume-upload-section {
margin-top: 30rpx;
padding-top: 25rpx;
border-top: 1px dashed #eee; /* 分隔线区分内容区域 */
display: flex;
flex-direction: column;
gap: 15rpx;
align-items: center;
}
/* 上传按钮 */
.upload-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 10rpx;
padding: 0 30rpx;
background-color: #f5f7fa;
color: #1677ff;
border-radius: 8rpx;
font-size: 26rpx;
}
.upload-icon {
width: 30rpx;
height: 30rpx;
}
.reupload-text {
font-size: 22rpx;
color: #666;
}
/* 上传说明文字 */
.upload-tip {
font-size: 20rpx;
color: #999;
text-align: center;
line-height: 1.4;
}
/* 已上传文件信息 */
.uploaded-file-info {
display: flex;
align-items: center;
gap: 15rpx;
padding: 15rpx 20rpx;
background-color: #fafafa;
border-radius: 8rpx;
margin-top: 10rpx;
}
.file-icon {
width: 36rpx;
height: 36rpx;
}
.file-name {
font-size: 24rpx;
color: #333;
max-width: 400rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.delete-file-btn {
padding: 0 15rpx;
height: 36rpx;
line-height: 36rpx;
font-size: 22rpx;
color: #ff4d4f;
background-color: transparent;
}
</style>

View File

@@ -1,147 +0,0 @@
<template>
<view class="reser-content">
<scroll-view :scroll-x="true" :show-scrollbar="false" class="tab-scroll">
<view class="content-top">
<view
class="top-item button-click"
:class="{ active: state.tabIndex === 'all' }"
@click="changeOption('all')"
>
全部
</view>
<view
class="top-item button-click"
:class="{ active: state.tabIndex === index }"
v-for="(item, index) in userInfo.jobTitle"
:key="index"
@click="changeOption(index)"
>
{{ item }}
</view>
</view>
</scroll-view>
<view class="main">
<scroll-view class="scroll-view" scroll-y @scrolltolower="scrollBottom">
<view class="list">
<renderJobs
:list="pageState.list"
v-if="pageState.list.length"
:longitude="longitudeVal"
:latitude="latitudeVal"
></renderJobs>
<empty v-else pdTop="200"></empty>
</view>
</scroll-view>
</view>
</view>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted, onBeforeUnmount } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navTo, debounce, customSystem } = inject('globalFunction');
import { storeToRefs } from 'pinia';
import useLocationStore from '@/stores/useLocationStore';
import useUserStore from '@/stores/useUserStore';
const { userInfo } = storeToRefs(useUserStore());
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const pageState = reactive({
page: 0,
list: [],
total: 0,
maxPage: 1,
pageSize: 10,
search: {},
lastDate: '',
});
const state = reactive({
tabIndex: 'all',
});
onLoad(() => {
getList('refresh');
});
function scrollBottom() {
getList();
}
function changeOption(index) {
state.tabIndex = index;
if (index === 'all') {
pageState.search = {};
getList('refresh');
} else {
pageState.search.jobTitle = userInfo.value.jobTitle[index];
getList('refresh');
}
}
function getList(type = 'add', loading = true) {
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 1;
}
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
...pageState.search,
};
$api.createRequest('/app/notice/recommend', params).then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = pageState.list.length;
const reslist = rows;
pageState.list.splice(str, end, ...reslist);
} else {
pageState.list = rows;
}
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
});
}
</script>
<style lang="stylus" scoped>
.reser-content{
width: 100%;
height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
display: flex;
flex-direction: column;
.content-top{
display: flex
padding: 28rpx
.top-item{
font-weight: 400;
font-size: 32rpx;
margin-right: 48rpx
color: #666D7F;
white-space: nowrap
}
.top-item:last-child{
padding-right: 38rpx
}
.active{
font-weight: 500;
font-size: 32rpx;
color: #000000;
}
}
.main{
flex: 1
overflow: hidden
background: #F4F4F4
.scroll-view{
height: 100%
.list{
padding: 0 28rpx 28rpx 28rpx
}
}
}
}
</style>

View File

@@ -1,947 +0,0 @@
<template>
<AppLayout
title="个人信息"
:sub-title="`完成度${percent}`"
border
back-gorund-color="#ffffff"
:show-bg-image="false"
>
<template #headerleft>
<view class="btn mar_le20 button-click" @click="navBack">取消</view>
</template>
<template #headerright>
<view class="btn mar_ri20 button-click" @click="confirm">确认</view>
</template>
<view class="content">
<view class="content-input">
<view class="input-titile">姓名</view>
<input class="input-con" v-model="fromValue.name" placeholder="请输入您的姓名" />
</view>
<view class="content-sex">
<view class="sex-titile">性别</view>
<view class="sext-ri">
<view class="sext-box" :class="{ 'sext-boxactive': fromValue.sex === 0 }" @click="changeSex(0)">
</view>
<view class="sext-box" :class="{ 'sext-boxactive': fromValue.sex === 1 }" @click="changeSex(1)">
</view>
</view>
</view>
<view class="content-input" @click="changeDateBirt">
<view class="input-titile">出生年月</view>
<input
class="input-con triangle"
v-model="fromValue.birthDate"
disabled
placeholder="请选择您的出生年月"
/>
</view>
<view class="content-input" @click="changeEducation">
<view class="input-titile">学历</view>
<input class="input-con triangle" v-model="state.educationText" disabled placeholder="请选择您的学历" />
</view>
<view class="content-input" @click="changePoliticalAffiliation">
<view class="input-titile">政治面貌</view>
<input
class="input-con triangle"
v-model="state.politicalAffiliationText"
disabled
placeholder="请选择您的政治面貌"
/>
</view>
<view class="content-input">
<view class="input-titile">身份证</view>
<input class="input-con" v-model="fromValue.idCard" placeholder="请输入身份证号码" />
</view>
<view class="content-input">
<view class="input-titile">手机号码</view>
<input class="input-con" v-model="fromValue.phone" placeholder="请输入您的手机号码" />
</view>
<view class="content-skills">
<view class="skills-header">
<view class="input-titile">技能信息</view>
<view
class="add-skill-btn"
@click="addSkill"
:class="{ 'disabled': state.skills.length >= 3 }"
>
+ 添加技能
</view>
</view>
<view class="skills-list">
<view class="skill-item" v-for="(skill, index) in state.skills" :key="index">
<view class="skill-header">
<view class="skill-number">技能 {{ index + 1 }}</view>
<view class="skill-actions" v-if="state.skills.length > 1">
<view class="action-btn delete-btn" @click="removeSkill(index)">删除</view>
</view>
</view>
<view class="skill-fields">
<view class="skill-field" @click="changeSkillName(index)">
<view class="field-label">技能名称</view>
<input
class="field-input triangle"
disabled
:value="skill.name"
placeholder="请选择技能名称"
/>
</view>
<view class="skill-field" @click="changeSkillLevel(index)">
<view class="field-label">技能等级</view>
<input
class="field-input triangle"
disabled
:value="getSkillLevelText(skill.level)"
placeholder="请选择技能等级"
/>
</view>
</view>
</view>
<view class="empty-skills" v-if="state.skills.length === 0">
<text class="empty-text">暂无技能信息点击上方按钮添加</text>
</view>
</view>
</view>
</view>
<SelectPopup ref="selectPopupRef"></SelectPopup>
</AppLayout>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted, onUnmounted } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navTo, navBack, checkingPhoneRegExp } = inject('globalFunction');
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
import useDictStore from '@/stores/useDictStore';
import SelectPopup from '@/components/selectPopup/selectPopup.vue';
const { userInfo } = storeToRefs(useUserStore());
const { getUserResume } = useUserStore();
const dictStore = useDictStore();
const { dictLabel, oneDictData, complete: dictComplete, getDictSelectOption } = dictStore;
// #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
};
const percent = ref('0%');
const state = reactive({
educationText: '',
politicalAffiliationText: '',
skills: [], // 新的技能数据结构包含id字段
currentEditingSkillIndex: -1 // 当前正在编辑的技能索引
});
const fromValue = reactive({
name: '',
sex: 0,
birthDate: '',
education: '',
politicalAffiliation: '',
idCard: '',
phone: ''
});
// 移除重复的onLoad定义已在上方实现
// 在onLoad中初始化数据确保页面加载时就能获取技能信息
onLoad(() => {
// 初始化页面数据
initLoad();
});
// 监听页面显示,接收从技能查询页面返回的数据
onShow(() => {
// 通过事件总线接收技能选择结果
uni.$on('skillSelected', handleSkillSelected);
});
// 页面卸载时移除事件监听
onUnmounted(() => {
uni.$off('skillSelected', handleSkillSelected);
});
// 监听 userInfo 变化,确保数据及时更新
watch(() => userInfo.value, (newVal) => {
if (newVal && Object.keys(newVal).length > 0) {
initLoad();
}
}, { deep: true, immediate: false });
// 监听字典数据加载完成,自动更新学历显示
watch(() => dictComplete.value, (newVal) => {
if (newVal) {
console.log('字典数据加载完成,更新学历显示');
// 确保有学历值(如果没有则使用默认值"4"本科)
if (!fromValue.education) {
fromValue.education = '4';
}
// 直接遍历字典数据查找对应标签
const eduValue = String(fromValue.education);
const eduItem = dictStore.state.education.find(item => String(item.value) === eduValue);
if (eduItem && eduItem.label) {
console.log('从字典数据中找到学历标签:', eduItem.label);
state.educationText = eduItem.label;
}
}
});
// 监听学历字典数据变化
watch(() => dictStore.state.education, (newVal) => {
if (newVal && newVal.length > 0) {
console.log('学历字典数据变化,更新显示');
// 确保有学历值(如果没有则使用默认值"4"本科)
if (!fromValue.education) {
fromValue.education = '4';
}
// 直接遍历字典数据查找对应标签
const eduValue = String(fromValue.education);
const eduItem = newVal.find(item => String(item.value) === eduValue);
if (eduItem && eduItem.label) {
console.log('从字典数据中找到学历标签:', eduItem.label);
state.educationText = eduItem.label;
}
}
}, { deep: true });
function initLoad() {
// 优先从 store 获取,如果没有则从本地缓存获取
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const currentUserInfo = userInfo.value && Object.keys(userInfo.value).length > 0 ? userInfo.value : cachedUserInfo;
fromValue.name = currentUserInfo.name || '';
fromValue.sex = currentUserInfo.sex !== undefined ? Number(currentUserInfo.sex) : 0;
fromValue.phone = currentUserInfo.phone || '';
fromValue.birthDate = currentUserInfo.birthDate || '';
// 将学历转换为字符串类型,确保类型一致
// 如果没有学历值,默认设置为本科(值为"4"
fromValue.education = currentUserInfo.education ? String(currentUserInfo.education) : '4';
fromValue.politicalAffiliation = currentUserInfo.politicalAffiliation || '';
fromValue.idCard = currentUserInfo.idCard || '';
// 初始化技能数据 - 从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转换为新的技能数据结构保留原始id
state.skills = validSkills.map(skill => ({
id: skill.id, // 保留服务器返回的原始id
name: skill.name,
level: skill.levels || ''
}));
} else {
state.skills = [];
}
} else {
state.skills = [];
}
// 初始化学历显示文本(需要等待字典数据加载完成)
initEducationText();
// 回显政治面貌
if (currentUserInfo.politicalAffiliation) {
state.politicalAffiliationText = dictLabel('affiliation', currentUserInfo.politicalAffiliation);
}
const result = getFormCompletionPercent(fromValue);
percent.value = result;
}
// 初始化学历显示文本
function initEducationText() {
// 确保有学历值(如果没有则使用默认值"4"本科)
if (!fromValue.education) {
fromValue.education = '4';
}
console.log('初始化学历显示,当前学历值:', fromValue.education);
// 直接遍历字典数据查找对应标签不依赖dictLabel函数确保准确性
const findLabelFromDict = () => {
if (dictStore.state.education && dictStore.state.education.length > 0) {
const eduValue = String(fromValue.education);
const eduItem = dictStore.state.education.find(item => String(item.value) === eduValue);
if (eduItem && eduItem.label) {
console.log('从字典数据中找到学历标签:', eduItem.label);
state.educationText = eduItem.label;
return true;
} else {
console.log('字典数据中未找到匹配的学历标签');
}
}
return false;
};
// 立即尝试查找
if (!findLabelFromDict() && dictComplete.value) {
// 如果字典数据已加载完成但未找到标签,尝试重新获取字典数据
loadEducationDictAndUpdate();
}
// 等待字典数据加载完成
const checkDictData = () => {
if (dictComplete.value && dictStore.state.education && dictStore.state.education.length > 0) {
findLabelFromDict();
} else {
// 如果字典数据未加载,等待一段时间后重试
setTimeout(() => {
if (dictComplete.value && dictStore.state.education && dictStore.state.education.length > 0) {
findLabelFromDict();
} else {
// 尝试主动加载字典数据
loadEducationDictAndUpdate();
}
}, 500);
}
};
// 主动加载学历字典数据并更新显示
function loadEducationDictAndUpdate() {
getDictSelectOption('education').then((data) => {
console.log('主动加载学历字典数据:', data);
dictStore.state.education = data;
findLabelFromDict();
}).catch((error) => {
console.error('加载学历字典数据失败:', error);
});
}
checkDictData();
}
const confirm = () => {
if (!fromValue.name) {
return $api.msg('请输入姓名');
}
if (!fromValue.birthDate) {
return $api.msg('请选择出生年月');
}
if (!fromValue.education) {
return $api.msg('请选择学历');
}
if (!fromValue.politicalAffiliation) {
return $api.msg('请选择政治面貌');
}
if (!checkingPhoneRegExp(fromValue.phone)) {
return $api.msg('请输入正确手机号');
}
// 构建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 || ''
}));
const params = {
...fromValue,
age: calculateAge(fromValue.birthDate),
appSkillsList: appSkillsList
};
$api.createRequest('/app/user/resume', params, 'post').then((resData) => {
$api.msg('完成');
getUserResume().then(() => {
navBack();
});
});
};
// 添加技能
function addSkill() {
if (state.skills.length >= 3) {
$api.msg('最多只能添加3个技能');
return;
}
// 添加新的技能对象新增技能不需要id后端会自动生成
state.skills.push({
name: '',
level: ''
});
// 更新完成度
const result = getFormCompletionPercent(fromValue);
percent.value = result;
}
// 删除技能
function removeSkill(index) {
state.skills.splice(index, 1);
// 更新完成度
const result = getFormCompletionPercent(fromValue);
percent.value = result;
}
// 获取技能等级文本
function getSkillLevelText(level) {
const levelMap = {
'1': '初级',
'2': '中级',
'3': '高级'
};
return levelMap[level] || '';
}
// 选择技能名称
function changeSkillName(index) {
state.currentEditingSkillIndex = index;
// 将当前已选中的技能名称传递给查询页面
const selectedSkills = state.skills.map(skill => skill.name).filter(name => name);
uni.navigateTo({
url: `/pages/complete-info/skill-search?selected=${encodeURIComponent(JSON.stringify(selectedSkills))}`
});
}
// 选择技能等级
function changeSkillLevel(index) {
const skillLevels = [
{ label: '初级', value: '1' },
{ label: '中级', value: '2' },
{ label: '高级', value: '3' }
];
// 查找当前技能等级在数据中的索引
let defaultIndex = [0];
const currentSkill = state.skills[index];
if (currentSkill && currentSkill.level) {
const index = skillLevels.findIndex(item => item.value === currentSkill.level);
if (index >= 0) {
defaultIndex = [index];
}
}
openSelectPopup({
title: '技能等级',
maskClick: true,
data: [skillLevels],
defaultIndex: defaultIndex,
success: (_, [value]) => {
state.skills[index].level = value.value;
// 更新完成度
const result = getFormCompletionPercent(fromValue);
percent.value = result;
},
});
}
// 技能选择回调函数
const handleSkillSelected = (skillName) => {
if (skillName && state.currentEditingSkillIndex >= 0) {
// 更新当前编辑的技能名称
state.skills[state.currentEditingSkillIndex].name = skillName;
// 重置当前编辑索引
state.currentEditingSkillIndex = -1;
// 更新完成度
const result = getFormCompletionPercent(fromValue);
percent.value = result;
}
};
const changeDateBirt = () => {
const datearray = generateDatePickerArrays();
const defaultIndex = getDatePickerIndexes(fromValue.birthDate);
openSelectPopup({
title: '年龄段',
maskClick: true,
data: datearray,
defaultIndex,
success: (_, value) => {
const [year, month, day] = value;
const dateStr = `${year.value}-${month.value}-${day.value}`;
if (isValidDate(dateStr)) {
fromValue.birthDate = dateStr;
} else {
$api.msg('没有这一天');
}
},
});
};
async function changeEducation() {
// 确保字典数据已加载
if (!dictComplete.value || !dictStore.state.education || dictStore.state.education.length === 0) {
// 如果字典数据未加载,先加载数据
try {
await getDictSelectOption('education').then((data) => {
dictStore.state.education = data;
});
} catch (error) {
console.error('加载学历字典数据失败:', error);
}
}
// 等待数据加载完成后再获取数据
let educationData = oneDictData('education');
// 如果数据还是为空,等待一下再试
if (!educationData || educationData.length === 0) {
await new Promise(resolve => setTimeout(resolve, 100));
educationData = oneDictData('education');
if (!educationData || educationData.length === 0) {
$api.msg('学历数据加载中,请稍后再试');
return;
}
}
// 确保有默认值
if (!fromValue.education) {
fromValue.education = '4'; // 默认设置为本科
}
// 将当前学历值转换为字符串,用于查找默认索引
const currentEducation = String(fromValue.education);
// 查找当前学历在数据中的索引
let defaultIndex = [0];
if (currentEducation && educationData && educationData.length > 0) {
// 同时支持字符串和数字类型的匹配
const index = educationData.findIndex(item => {
const itemValue = String(item.value);
return itemValue === currentEducation;
});
if (index >= 0) {
defaultIndex = [index];
console.log('找到学历默认索引:', index, '当前值:', currentEducation);
} else {
// 如果字符串匹配失败,尝试数字匹配
const currentNum = Number(currentEducation);
if (!isNaN(currentNum)) {
const numIndex = educationData.findIndex(item => {
const itemValue = Number(item.value);
return !isNaN(itemValue) && itemValue === currentNum;
});
if (numIndex >= 0) {
defaultIndex = [numIndex];
console.log('通过数字匹配找到学历默认索引:', numIndex, '当前值:', currentNum);
} else {
console.warn('未找到匹配的学历值:', currentEducation, '可用值:', educationData.map(item => item.value));
}
}
}
}
openSelectPopup({
title: '学历',
maskClick: true,
data: [educationData],
defaultIndex: defaultIndex,
success: (_, [value]) => {
console.log('切换学历选择,新值:', value.value);
fromValue.education = String(value.value); // 确保存储为字符串
// 使用相同的字典数据查找逻辑
const eduValue = String(value.value);
const eduItem = dictStore.state.education.find(item => String(item.value) === eduValue);
if (eduItem && eduItem.label) {
console.log('从字典数据中找到学历标签:', eduItem.label);
state.educationText = eduItem.label;
} else {
// 如果没找到,尝试重新加载字典数据
console.log('字典中未找到对应标签,尝试重新加载字典数据');
getDictSelectOption('education').then((data) => {
dictStore.state.education = data;
const newEduItem = data.find(item => String(item.value) === eduValue);
if (newEduItem && newEduItem.label) {
state.educationText = newEduItem.label;
}
});
}
},
});
}
const changeSex = (sex) => {
fromValue.sex = sex;
};
const changePoliticalAffiliation = () => {
openSelectPopup({
title: '政治面貌',
maskClick: true,
data: [oneDictData('affiliation')],
success: (_, [value]) => {
fromValue.politicalAffiliation = value.value;
state.politicalAffiliationText = value.label;
},
});
};
function generateDatePickerArrays(startYear = 1975, endYear = new Date().getFullYear()) {
const years = [];
const months = [];
const days = [];
for (let y = startYear; y <= endYear; y++) {
years.push(y.toString());
}
for (let m = 1; m <= 12; m++) {
months.push(m.toString().padStart(2, '0'));
}
for (let d = 1; d <= 31; d++) {
days.push(d.toString().padStart(2, '0'));
}
return [years, months, days];
}
function isValidDate(dateString) {
// 添加空值检查
if (!dateString || typeof dateString !== 'string' || dateString.trim() === '') {
return false;
}
const dateParts = dateString.split('-');
if (dateParts.length !== 3) {
return false;
}
const [year, month, day] = dateParts.map(Number);
// 检查是否为有效数字
if (isNaN(year) || isNaN(month) || isNaN(day)) {
return false;
}
const date = new Date(year, month - 1, day); // 月份从0开始
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day;
}
const calculateAge = (birthDate) => {
// 添加空值检查
if (!birthDate) {
return '';
}
const birth = new Date(birthDate);
// 检查日期是否有效
if (isNaN(birth.getTime())) {
return '';
}
const today = new Date();
let age = today.getFullYear() - birth.getFullYear();
const monthDiff = today.getMonth() - birth.getMonth();
const dayDiff = today.getDate() - birth.getDate();
// 如果生日的月份还没到,或者刚到生日月份但当天还没过,则年龄减 1
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
age--;
}
return age;
};
function getFormCompletionPercent(form) {
let total = Object.keys(form).length;
let filled = 0;
for (const key in form) {
const value = form[key];
if (value !== '' && value !== null && value !== undefined) {
if (typeof value === 'number') {
filled += 1;
} else if (typeof value === 'string' && value.trim() !== '') {
filled += 1;
}
}
}
if (total === 0) return '0%';
const percent = (filled / total) * 100;
return percent.toFixed(0) + '%'; // 取整,不要小数点
}
// 主函数
function getDatePickerIndexes(dateStr) {
// 添加空值检查如果dateStr为空或null返回默认值当前日期
if (!dateStr || typeof dateStr !== 'string' || dateStr.trim() === '') {
const today = new Date();
const year = today.getFullYear().toString();
const month = (today.getMonth() + 1).toString().padStart(2, '0');
const day = today.getDate().toString().padStart(2, '0');
dateStr = `${year}-${month}-${day}`;
}
let dateParts = dateStr.split('-');
if (dateParts.length !== 3) {
// 如果分割后不是3部分使用当前日期作为默认值
const today = new Date();
const year = today.getFullYear().toString();
const month = (today.getMonth() + 1).toString().padStart(2, '0');
const day = today.getDate().toString().padStart(2, '0');
dateStr = `${year}-${month}-${day}`;
dateParts = dateStr.split('-');
}
const [year, month, day] = dateParts;
const [years, months, days] = generateDatePickerArrays();
const yearIndex = years.indexOf(year) >= 0 ? years.indexOf(year) : 0;
const monthIndex = months.indexOf(month) >= 0 ? months.indexOf(month) : 0;
const dayIndex = days.indexOf(day) >= 0 ? days.indexOf(day) : 0;
return [yearIndex, monthIndex, dayIndex];
}
</script>
<style lang="stylus" scoped>
.btn{
margin-top: -30rpx
}
.content{
padding: 28rpx;
display: flex;
flex-direction: column;
justify-content: flex-start
height: calc(100% - 120rpx)
}
.content-input
margin-bottom: 52rpx
.input-titile
font-weight: 400;
font-size: 28rpx;
color: #6A6A6A;
.input-con
font-weight: 400;
font-size: 32rpx;
color: #333333;
line-height: 80rpx;
height: 80rpx;
border-bottom: 2rpx solid #EBEBEB
position: relative;
.triangle::before
position: absolute;
right: 20rpx;
top: calc(50% - 2rpx);
content: '';
width: 4rpx;
height: 18rpx;
border-radius: 2rpx
background: #697279;
transform: translate(0, -50%) rotate(-45deg) ;
.triangle::after
position: absolute;
right: 20rpx;
top: 50%;
content: '';
width: 4rpx;
height: 18rpx;
border-radius: 2rpx
background: #697279;
transform: rotate(45deg)
.input-nx
position: relative
border-bottom: 2rpx solid #EBEBEB
padding-bottom: 30rpx
display: flex
flex-wrap: wrap
.nx-item
padding: 16rpx 24rpx
width: fit-content
border-radius: 20rpx
border: 2rpx solid #E8EAEE
background-color: #f8f9fa
margin-right: 16rpx
margin-top: 16rpx
font-size: 28rpx
color: #333333
transition: all 0.2s ease
&:hover
background-color: #e9ecef
border-color: #256bfa
color: #256bfa
.content-sex
height: 110rpx;
display: flex
justify-content: space-between;
align-items: flex-start;
border-bottom: 2rpx solid #EBEBEB
margin-bottom: 52rpx
.sex-titile
line-height: 80rpx;
.sext-ri
display: flex
align-items: center;
.sext-box
height: 76rpx;
width: 152rpx;
text-align: center;
line-height: 80rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx
border: 2rpx solid #E8EAEE;
margin-left: 28rpx
font-weight: 400;
font-size: 28rpx;
.sext-boxactive
color: #256BFA
background: rgba(37,107,250,0.1);
border: 2rpx solid #256BFA;
.next-btn
width: 100%;
height: 90rpx;
background: #256BFA;
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 90rpx
// 技能信息样式
.content-skills
margin-bottom: 52rpx
.skills-header
display: flex
justify-content: space-between
align-items: center
margin-bottom: 32rpx
.input-titile
font-weight: 400
font-size: 28rpx
color: #6A6A6A
.add-skill-btn
padding: 16rpx 32rpx
background: #256BFA
color: #FFFFFF
border-radius: 8rpx
font-size: 26rpx
font-weight: 500
transition: all 0.3s ease
&:active
background: #1a5cd9
transform: scale(0.98)
&.disabled
background: #CCCCCC
color: #999999
cursor: not-allowed
&:active
background: #CCCCCC
transform: none
.skills-list
.skill-item
background: #FFFFFF
border: 2rpx solid #E8EAEE
border-radius: 12rpx
padding: 24rpx
margin-bottom: 24rpx
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05)
transition: all 0.3s ease
&:hover
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1)
border-color: #256BFA
.skill-header
display: flex
justify-content: space-between
align-items: center
margin-bottom: 20rpx
.skill-number
font-weight: 500
font-size: 28rpx
color: #333333
.skill-actions
.action-btn
padding: 8rpx 16rpx
border-radius: 6rpx
font-size: 24rpx
font-weight: 400
transition: all 0.2s ease
&.delete-btn
background: #FF4D4F
color: #FFFFFF
&:active
background: #D9363E
transform: scale(0.95)
.skill-fields
display: flex
flex-direction: column
gap: 20rpx
.skill-field
.field-label
font-weight: 400
font-size: 26rpx
color: #6A6A6A
margin-bottom: 8rpx
.field-input
font-weight: 400
font-size: 28rpx
color: #333333
line-height: 72rpx
height: 72rpx
border: 2rpx solid #E8EAEE
border-radius: 8rpx
padding: 0 20rpx
background: #F8F9FA
transition: all 0.3s ease
&:focus
border-color: #256BFA
background: #FFFFFF
&.triangle::before
right: 30rpx
top: calc(50% - 2rpx)
&.triangle::after
right: 30rpx
top: 50%
.empty-skills
text-align: center
padding: 60rpx 0
background: #F8F9FA
border-radius: 12rpx
border: 2rpx dashed #E8EAEE
.empty-text
font-size: 28rpx
color: #999999
font-weight: 400
</style>

View File

@@ -1,162 +0,0 @@
<template>
<div class="countdown-wrapper" style="width: 100%">
<template v-if="isNotStarted">
<view class="fl_box fl_nowarp fl_justbet" style="width: 100%">
<view class="fl_box">
<span class="colon">距离开始还剩</span>
<div class="time-block">{{ days }}</div>
<span class="colon"></span>
</view>
<view style="color: #ff881a">待开始</view>
</view>
</template>
<template v-else-if="isEnd">
<view class="fl_box fl_nowarp fl_justbet" style="width: 100%">
<view class="fl_box">
<span class="colon hui">距离结束还剩</span>
<div class="time-block huibg">00</div>
<span class="colon hui">:</span>
<div class="time-block huibg">00</div>
<span class="colon hui">:</span>
<div class="time-block huibg">00</div>
</view>
<view class="hui">已结束</view>
</view>
</template>
<template v-else>
<template v-if="showDays">
<view class="fl_box fl_nowarp fl_justbet" style="width: 100%">
<view class="fl_box">
<span class="colon">距离结束还剩</span>
<div class="time-block">{{ days }}</div>
<span class="colon"></span>
</view>
<view style="color: #18a14f">进行中</view>
</view>
</template>
<template v-else>
<view class="fl_box fl_nowarp fl_justbet" style="width: 100%">
<view class="fl_box">
<span class="colon">距离结束还剩</span>
<div class="time-block">{{ hours }}</div>
<span class="colon">:</span>
<div class="time-block">{{ minutes }}</div>
<span class="colon">:</span>
<div class="time-block">{{ seconds }}</div>
</view>
<view style="color: #18a14f">进行中</view>
</view>
</template>
</template>
</div>
</template>
<script setup>
import { ref, computed, onMounted, onUnmounted } from 'vue';
const props = defineProps({
startTime: { type: [String, Number, Date], required: true },
endTime: { type: [String, Number, Date], required: true },
interval: { type: Number, default: 1000 },
});
const now = ref(Date.now());
let timer = null;
const startTimestamp = computed(() => new Date(props.startTime).getTime());
const endTimestamp = computed(() => new Date(props.endTime).getTime());
const isEnd = computed(() => now.value >= endTimestamp.value);
const isNotStarted = computed(() => now.value < startTimestamp.value);
const targetTimestamp = computed(() => {
if (isNotStarted.value) return startTimestamp.value;
if (!isEnd.value) return endTimestamp.value;
return now.value;
});
const remainingMs = computed(() => Math.max(0, targetTimestamp.value - now.value));
const secondsTotal = computed(() => Math.floor(remainingMs.value / 1000));
const showDays = computed(() => secondsTotal.value >= 86400);
const days = computed(() => Math.ceil(secondsTotal.value / 86400));
const hours = computed(() => {
const h = Math.floor(secondsTotal.value / 3600) % 24;
return h.toString().padStart(2, '0');
});
const minutes = computed(() => {
const m = Math.floor((secondsTotal.value % 3600) / 60);
return m.toString().padStart(2, '0');
});
const seconds = computed(() => {
const s = secondsTotal.value % 60;
return s.toString().padStart(2, '0');
});
const startTimer = () => {
timer = setInterval(() => {
now.value = Date.now();
}, props.interval);
};
const stopTimer = () => {
if (timer) {
clearInterval(timer);
timer = null;
}
};
onMounted(() => {
startTimer();
});
onUnmounted(() => {
stopTimer();
});
</script>
<style scoped>
.countdown-wrapper {
display: flex;
align-items: center;
}
.time-block {
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
text-align: center;
font-weight: 500;
font-size: 28rpx;
color: #ffffff;
height: 44rpx;
line-height: 44rpx;
padding: 0 14rpx;
background: #256bfa;
border-radius: 8rpx 8rpx 8rpx 8rpx;
margin: 0 10rpx;
}
.colon {
font-family: PingFang SC, PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #256bfa;
}
.day-text {
font-size: 18px;
color: #333;
}
.hui {
color: #b6b6b6;
}
.huibg {
background-color: #b6b6b6;
}
.lan {
color: #256bfa;
}
</style>

View File

@@ -1,195 +0,0 @@
<template>
<view class="reser-content">
<view class="content-top">
<view
class="top-item"
:class="{ active: ranItem.value === item.value }"
v-for="(item, index) in ranOptions"
:key="index"
@click="chnageRanOption(item)"
>
{{ item.label }}
</view>
</view>
<view class="main">
<scroll-view scroll-y>
<view v-if="pageState.list.length">
<view class="card" v-for="(item, index) in pageState.list" :key="index">
<view @click="navTo('/packageA/pages/exhibitors/exhibitors?jobFairId=' + item.jobFairId)">
<view class="card-row">
<Countdown startTime="item.startTime" :endTime="item.endTime" />
</view>
<view class="card-Title">{{ item.name }}</view>
<view class="card-row">
<view class="rowleft">{{ item.location }}</view>
<view class="rowright">
<convert-distance
:alat="item.latitude"
:along="item.longitude"
:blat="latitudeVal"
:blong="longitudeVal"
></convert-distance>
</view>
</view>
</view>
<view class="footer" v-if="isTimePassed(item.startTime)">
<view class="card_cancel" @click="updateCancel(item)">取消预约</view>
</view>
</view>
</view>
<empty v-else pdTop="200"></empty>
</scroll-view>
</view>
</view>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted, onBeforeUnmount } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navTo, debounce, customSystem } = inject('globalFunction');
import Countdown from './component/countdown.vue';
import { storeToRefs } from 'pinia';
import useLocationStore from '@/stores/useLocationStore';
import useUserStore from '@/stores/useUserStore';
const { userInfo } = storeToRefs(useUserStore());
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const pageState = reactive({
page: 0,
list: [],
total: 0,
maxPage: 1,
pageSize: 10,
search: {},
lastDate: '',
});
const ranItem = ref({});
const ranOptions = ref([
{ label: '全部', value: 0 },
{ label: '待开始', value: 1 },
{ label: '进行中', value: 2 },
{ label: '已结束', value: 3 },
]);
function isTimePassed(timeStr) {
const targetTime = new Date(timeStr.replace(/-/g, '/')).getTime(); // 兼容格式
const now = Date.now();
return now < targetTime;
}
onLoad(() => {
ranItem.value = ranOptions.value[0];
getList();
});
function chnageRanOption(item) {
ranItem.value = item;
getList();
}
function updateCancel(item) {
const fairId = item.jobFairId;
$api.createRequest(`/app/fair/collection/${fairId}`, {}, 'DELETE').then((resData) => {
getList('refresh');
$api.msg('取消预约成功');
});
}
function getList(type = 'add', loading = true) {
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 1;
}
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
type: ranItem.value.value,
};
$api.createRequest('/app/user/collection/fair', params).then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = pageState.list.length;
const reslist = rows;
pageState.list.splice(str, end, ...reslist);
} else {
pageState.list = rows;
}
// pageState.list = resData.rows;
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
});
}
</script>
<style lang="stylus" scoped>
.reser-content{
width: 100%;
height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
display: flex;
flex-direction: column;
.content-top{
display: flex
padding: 28rpx
.top-item{
font-weight: 400;
font-size: 32rpx;
margin-right: 48rpx
color: #666D7F;
}
.active{
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
font-weight: 500;
font-size: 32rpx;
color: #000000;
}
}
.main{
flex: 1
overflow: hidden
background: #F4F4F4
padding: 28rpx
.card{
padding: 30rpx
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.04);
border-radius: 20rpx 20rpx 20rpx 20rpx;
color: #495264
margin-bottom: 28rpx
.card-row{
display: flex
justify-content: space-between
.rowleft{
display: flex
align-items: center
}
}
.card-Title{
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
font-weight: 500;
font-size: 32rpx;
line-height: 70rpx
color: #333333;
}
.footer{
display: flex
align-items: center
justify-content: flex-end
}
.card_cancel{
width: 228rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 2rpx solid #E8EAEE;
margin-top: 32rpx
}
}
}
}
</style>

View File

@@ -1,311 +0,0 @@
<template>
<AppLayout title="选择日期" :use-scroll-view="false" back-gorund-color="#FAFAFA">
<template #headerleft>
<view class="btn">
<image src="@/static/icon/back.png" @click="navBack"></image>
</view>
</template>
<template #headerright>
<view class="btn mar_ri10 button-click" @click="backParams">确认</view>
</template>
<view class="content">
<view class="top-date">
<view
class="weekText"
:class="{ color_256BFA: item === '日' || item === '六' }"
v-for="(item, index) in weekMap"
:key="index"
>
{{ item }}
</view>
</view>
<scroll-view scroll-y class="main-scroll" @scrolltolower="onScrollBottom">
<view class="date-list" v-for="(vItem, vIndex) in calendarData" :key="vIndex">
<view class="list-title">{{ vItem.title }}</view>
<view class="list-item">
<view
class="item button-click"
:class="{
noOptional: !item.isThisMonth,
active: current.date === item.date && item.isThisMonth,
}"
v-for="(item, index) in vItem.list"
:key="index"
@click="selectDay(item)"
>
<view class="item-top">{{ item.day }}</view>
<view class="item-nong">{{ item.nl }}</view>
</view>
</view>
</view>
</scroll-view>
</view>
</AppLayout>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navTo, navBack } = inject('globalFunction');
const weekMap = ['日', '一', '二', '三', '四', '五', '六'];
const calendarData = ref([]);
const current = ref({});
import { Solar, Lunar } from '@/packageA/lib/lunar-javascript@1.7.2.js';
const isRecord = ref(false);
const recordNum = ref(4);
const pages = reactive({
year: 0,
month: 0,
});
onLoad((options) => {
if (options.date) {
current.value = {
date: options?.date || null,
};
}
if (options.record) {
isRecord.value = true;
initOldPagesDate();
new Array(recordNum.value + 1).fill(null).map(() => {
addMonth();
});
} else {
initPagesDate();
new Array(recordNum.value).fill(null).map(() => {
addMonth();
});
}
});
function backParams() {
if (isValidDateString(current.value.date)) {
navBack({
data: current.value,
});
} else {
$api.msg('请选择日期');
}
}
function isValidDateString(dateStr) {
const regex = /^\d{4}-\d{2}-\d{2}$/;
if (!regex.test(dateStr)) return false;
const date = new Date(dateStr);
if (isNaN(date.getTime())) return false;
// 检查日期部分是否一致(防止 "2020-02-31" 这种被 Date 自动修正)
const [year, month, day] = dateStr.split('-').map(Number);
return date.getFullYear() === year && date.getMonth() + 1 === month && date.getDate() === day;
}
function onScrollBottom() {
if (isRecord.value) return;
addMonth();
}
function selectDay(item) {
current.value = item;
}
function initOldPagesDate() {
const d = new Date();
const yue = d.getMonth();
if (yue < recordNum.value) {
pages.month = 12 + (yue - recordNum.value);
pages.year = d.getFullYear() - 1;
} else {
pages.month = yue - recordNum.value;
pages.year = d.getFullYear();
}
}
function initPagesDate() {
const d = new Date();
pages.month = d.getMonth();
pages.year = d.getFullYear();
}
function addMonth() {
if (pages.month >= 12) {
pages.year += 1;
pages.month = 1;
} else {
pages.month += 1;
}
const month = getMonthCalendarData(pages);
calendarData.value.push(month);
}
/**
*
* @param {Array<string>} selectedDates - 选中的日期数组 ['2025-04-21', ...]
* @returns {Array<Object>} 六个月日历数据
*/
function getMonthCalendarData({ year, month, selectableDates = [] }) {
const todayStr = new Date().toISOString().split('T')[0];
const isSelected = (y, m, d) =>
selectableDates.includes(`${y}-${String(m).padStart(2, '0')}-${String(d).padStart(2, '0')}`);
const list = [];
const firstDay = new Date(year, month - 1, 1);
const firstWeekday = firstDay.getDay(); // 0 是周日
const lastDate = new Date(year, month, 0).getDate();
// 补全前一月天数(上月最后几天)
if (firstWeekday !== 0) {
const prevLastDate = new Date(year, month - 1, 0).getDate();
for (let i = firstWeekday - 1; i >= 0; i--) {
const d = prevLastDate - i;
const prevMonth = month - 1 <= 0 ? 12 : month - 1;
const prevYear = month - 1 <= 0 ? year - 1 : year;
const solar = Solar.fromYmd(prevYear, prevMonth, d);
const lunar = Lunar.fromSolar(solar);
const dateStr = `${prevYear}-${String(prevMonth).padStart(2, '0')}-${String(d).padStart(2, '0')}`;
list.push({
day: d,
nl: lunar.getDayInChinese(),
isThisMonth: false,
isToday: dateStr === todayStr,
isSelectable: isSelected(prevYear, prevMonth, d),
week: weekMap[new Date(prevYear, prevMonth - 1, d).getDay()],
date: dateStr,
});
}
}
// 当前月天数
for (let d = 1; d <= lastDate; d++) {
const solar = Solar.fromYmd(year, month, d);
const lunar = Lunar.fromSolar(solar);
const dateStr = `${year}-${String(month).padStart(2, '0')}-${String(d).padStart(2, '0')}`;
list.push({
day: d,
nl: lunar.getDayInChinese(),
isThisMonth: true,
isToday: dateStr === todayStr,
isSelectable: isSelected(year, month, d),
week: weekMap[new Date(year, month - 1, d).getDay()],
date: dateStr,
});
}
// 补全下个月天数(让最后一行完整 7 个)
const remaining = 7 - (list.length % 7);
if (remaining < 7) {
for (let d = 1; d <= remaining; d++) {
const nextMonth = month + 1 > 12 ? 1 : month + 1;
const nextYear = month + 1 > 12 ? year + 1 : year;
const solar = Solar.fromYmd(nextYear, nextMonth, d);
const lunar = Lunar.fromSolar(solar);
const dateStr = `${nextYear}-${String(nextMonth).padStart(2, '0')}-${String(d).padStart(2, '0')}`;
list.push({
day: d,
nl: lunar.getDayInChinese(),
isThisMonth: false,
isToday: dateStr === todayStr,
isSelectable: isSelected(nextYear, nextMonth, d),
week: weekMap[new Date(nextYear, nextMonth - 1, d).getDay()],
date: dateStr,
});
}
}
return {
title: `${year}${month}`,
list,
};
}
</script>
<style lang="stylus" scoped>
.btn {
display: flex;
justify-content: space-between;
align-items: center;
white-space: nowrap
width: 60rpx;
height: 60rpx;
image {
height: 100%;
width: 100%;
}
}
.content{
height: 100%
display: flex
flex-direction: column
border-radius: 40rpx 40rpx 0 0
background: #FFFFFF;
overflow: hidden
margin-top: 20rpx
.top-date{
display: flex
justify-content: space-between
padding: 28rpx
.weekText{
text-align: center
width: 99rpx;
}
}
.main-scroll{
flex: 1
overflow: hidden
}
.date-list{
.list-title{
height: 84rpx;
line-height: 84rpx
background: #FAFAFA;
font-weight: 600;
font-size: 32rpx;
color: #1A1A1A;
padding: 0 28rpx;
box-sizing: border-box
}
.list-item{
padding: 16rpx 28rpx 20rpx 28rpx;
display: grid
grid-template-columns: repeat(7, 1fr)
grid-gap: 0rpx
.item{
display: flex
flex-direction: column
align-items: center
justify-content: center
border-radius: 20rpx 20rpx 20rpx 20rpx;
padding: 16rpx 0
margin-bottom: 20rpx
.item-top{
font-weight: 600;
font-size: 32rpx;
}
.item-nong{
font-size: 16rpx;
color: #666666
margin-top: 2rpx
}
}
.optional{
// height: 96rpx;
border: 2rpx solid #92B5FC;
}
.noOptional{
color: #B8B8B8;
}
.active{
background: linear-gradient( 225deg, #9E74FD 0%, #256BFA 100%);
color: #FFFFFF
.item-nong{
font-size: 16rpx;
color: #FFFFFF
margin-top: 2rpx
}
}
}
}
}
</style>

View File

@@ -1,138 +0,0 @@
<template>
<view class="notifi-content">
<scroll-view class="scroll-view" scroll-y @scrolltolower="scrollBottom">
<view class="list">
<view class="card btn-light" v-for="(item, index) in pageState.list" :key="index">
<view class="card-Date">{{ item.date }}</view>
<view class="card-Title">{{ item.title }}</view>
<view class="card-subTitle">{{ item.subTitle }}</view>
<view class="card-btns" v-if="item.noticeType === '2'" @click="seeBussiness(item)">
<view class="btns-text">立即查看</view>
<view class="btns-text"><uni-icons type="forward" color="#256bfa" size="18"></uni-icons></view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted, onBeforeUnmount } from 'vue';
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
const { $api, navTo, debounce, customSystem } = inject('globalFunction');
const pageState = reactive({
page: 0,
list: [],
total: 0,
maxPage: 1,
pageSize: 10,
search: {},
lastDate: '',
});
onLoad(() => {
getList('refresh');
});
function scrollBottom() {
getList();
}
function seeBussiness(item) {
if (item.bussinessId) {
navTo(`/packageA/pages/UnitDetails/UnitDetails?bussinessId=${item.bussinessId}`);
}
}
function setRead(row) {
const ids = row
.filter((item) => !item.isRead)
.map((item) => item.noticeId)
.join(',');
if (ids) {
$api.createRequest(`/app/notice/read/sysNotice?id=${ids}`, {}, 'POST').then((resData) => {
console.log('设置已读');
});
}
}
function getList(type = 'add', loading = true) {
if (type === 'refresh') {
pageState.page = 1;
pageState.maxPage = 1;
}
if (type === 'add' && pageState.page < pageState.maxPage) {
pageState.page += 1;
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
...pageState.search,
};
$api.createRequest('/app/notice/sysNotice', params).then((resData) => {
const { rows, total } = resData;
if (type === 'add') {
const str = pageState.pageSize * (pageState.page - 1);
const end = pageState.list.length;
const reslist = rows;
pageState.list.splice(str, end, ...reslist);
} else {
pageState.list = rows;
}
setRead(rows);
pageState.total = resData.total;
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
});
}
</script>
<style lang="scss" scoped>
.notifi-content {
background-color: #f4f4f4;
height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
.scroll-view {
height: 100%;
}
.list {
padding: 28rpx;
.card {
background: #ffffff;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.04);
border-radius: 20rpx 20rpx 20rpx 20rpx;
padding: 32rpx;
margin-bottom: 28rpx;
.card-Date {
font-weight: 400;
font-size: 28rpx;
color: #6c7282;
}
.card-Title {
margin-top: 24rpx;
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
.card-subTitle {
margin-top: 16rpx;
font-weight: 400;
font-size: 28rpx;
color: #495265;
}
.card-btns {
font-weight: 400;
font-size: 28rpx;
color: #256bfa;
line-height: 45rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 2rpx solid #efefef;
width: 630rpx;
margin-top: 28rpx;
padding-top: 28rpx;
}
}
}
}
</style>

View File

@@ -1,136 +0,0 @@
<template>
<div class="video-container">
<view class="back-box">
<view class="btn">
<uni-icons type="left" size="26" color="#FFFFFF" @click="navBack"></uni-icons>
</view>
</view>
<mTikTok :video-list="state.videoList" :pause-type="1" :controls="false" @loadMore="loadMore" @change="change">
<template v-slot="data">
<view class="video-layer">
<view class="title line_1">{{ currentItem.companyName }}</view>
<view class="discription">
<text class="line_1">
{{ currentItem.jobTitle }}
</text>
<view class="seedetail" @click="nextDetail">
查看详情
<uni-icons type="right" color="#FFFFFF" size="14"></uni-icons>
</view>
</view>
</view>
</template>
</mTikTok>
</div>
</template>
<script setup>
import { inject, ref, reactive } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navBack, navTo } = inject('globalFunction');
import mTikTok from '@/components/TikTok/TikTok.vue';
import useUserStore from '@/stores/useUserStore';
import { useRecommedIndexedDBStore } from '@/stores/useRecommedIndexedDBStore.js';
const recommedIndexDb = useRecommedIndexedDBStore();
const state = reactive({
videoList: [],
});
const currentItem = ref(null);
onLoad(() => {
const jobInfo = uni.getStorageSync(`job-Info`);
if (jobInfo) {
currentItem.value = jobInfo;
state.videoList.push(jobInfo);
}
getNextVideoSrc(2);
});
function nextDetail() {
const job = currentItem.value;
// 记录岗位类型,用作数据分析
if (job.jobCategory) {
const recordData = recommedIndexDb.JobParameter(job);
recommedIndexDb.addRecord(recordData);
}
console.log(job.jobId);
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}`);
}
function getNextVideoSrc(num) {
let params = {
uuid: useUserStore().seesionId,
count: num || 1,
};
$api.createRequest('/app/job/littleVideo/random', params).then((resData) => {
const { data, code } = resData;
state.videoList.push(...data);
});
}
const loadMore = () => {
// 触发加载更多
console.log('加载更多');
getNextVideoSrc();
};
const change = (e) => {
currentItem.value = e.detail;
console.log('🚀 ~ file: index.vue:53 ~ change ~ data:', e);
};
</script>
<style lang="stylus" scoped>
.video-container{
width: 100%;
height: 100vh;
position: relative
.back-box{
position: absolute;
left: 20rpx;
top: 20rpx
color: #FFFFFF
z-index: 2
}
}
.video-layer {
position: absolute;
left: 24rpx;
right: 24rpx;
bottom: 30rpx;
color: #fff;
.title{
font-weight: 500;
font-size: 30rpx;
line-height: 100%;
letter-spacing: 0%;
}
.discription{
font-weight: 400;
font-size: 28rpx;
letter-spacing: 0%;
margin-top: 20rpx
display: flex
align-items: center
.seedetail{
font-weight: 500;
font-size: 32rpx;
line-height: 100%;
letter-spacing: 0%;
white-space: nowrap
padding-left: 20rpx
}
}
}
.btn {
display: flex;
justify-content: space-between;
align-items: center;
width: 60rpx;
height: 60rpx;
image {
height: 100%;
width: 100%;
}
}
</style>