Commit 95b762d1 authored by 李明环(东信)'s avatar 李明环(东信)

完善推荐页面

parent fcbe0593
...@@ -9,3 +9,5 @@ export const getTreeListApi = params => instance.postForm("/dict/dictProvinceCit ...@@ -9,3 +9,5 @@ export const getTreeListApi = params => instance.postForm("/dict/dictProvinceCit
export const dictJobTypeApi = params => instance.post("/dict/dictJobType/getTree", params); export const dictJobTypeApi = params => instance.post("/dict/dictJobType/getTree", params);
// 获取岗位列表类型(1职位,2政策,3动态) // 获取岗位列表类型(1职位,2政策,3动态)
export const getBannerListApi = type => instance.post(`/banner/list/${type}`); export const getBannerListApi = type => instance.post(`/banner/list/${type}`);
//更具code码获取城市名称
export const getCityNameByCodeApi = code => instance.post(`/dict/dictProvinceCityDistrict/find/city/${code}`);
...@@ -9,26 +9,38 @@ export const updateJobApi = params => instance.post("/b/position/update", params ...@@ -9,26 +9,38 @@ export const updateJobApi = params => instance.post("/b/position/update", params
// 职位列表 // 职位列表
export const getJobListApi = params => instance.post("/company/job/list", params); export const getJobListApi = params => instance.post("/company/job/list", params);
// 获取简历推荐列表 // 获取推荐简历列表
export const getResumeRecommendListApi = params => instance.post("/company/job/getResumeRecommendList", params); export const getRecommendedResumeListApi = params => instance.post("/position/resume/recommend/list", params);
// 已投递简历列表
export const getResumeByUserId = userId => instance.post(`/position/resume/detail/${userId}`);
// 更具用户id查询简历
export const getApplicationListApi = params => instance.post("/position/application/list", params);
// 查询职位信息 // 查询职位信息
export const getJobByIdApi = id => instance.post(`/b/position/${id}`); export const getJobByIdApi = id => instance.post(`/b/position/${id}`);
// 统计职位投递信息 // 统计职位投递信息
export const getListStatisticsApi = params => instance.post("/b/position/statistics", params); export const getListStatisticsApi = params => instance.post("/b/position/statistics", params);
// 职位列表统计
export const getPositionListApi = params => instance.post("/b/position/list", params);
//获取投递信息通过id //获取投递信息通过id
export const getApplicationByIdApi = id => instance.post(`/company/job/getApplication/${id}`); export const getApplicationByIdApi = id => instance.post(`/position/application/${id}`);
//邀请面试 //邀请面试
export const inviteInterviewApi = params => instance.post(`/company/job/inviteInterview`, params); export const inviteInterviewApi = params => instance.post(`/position/application/interview`, params);
//获取投递列表/ //获取投递列表/
export const getApplicationListApi = params => instance.post("/company/job/getApplicationList", params); // export const getApplicationListApi = params => instance.post("/company/job/getApplicationList", params);
//获取投递列表 //获取投递列表
export const getUserResumeApi = params => instance.post(`/company/job/getUserResume`, params); // export const getUserResumeApi = params => instance.post(`/company/job/getUserResume`, params);
export const getUserResumeApi = id => instance.post(`/position/resume/detail/${id}`);
// 获取职位详情
export const getUserResumeByApplicationIdApi = id => instance.post(`/position/application/resume/${id}`);
// 职位发布(上线) // 职位发布(上线)
export const jobReleaseApi = id => instance.post(`/b/position/release/${id}`); export const jobReleaseApi = id => instance.post(`/b/position/release/${id}`);
...@@ -41,4 +53,7 @@ export const jobOfftopApi = id => instance.post(`/b/position/top/${id}`); ...@@ -41,4 +53,7 @@ export const jobOfftopApi = id => instance.post(`/b/position/top/${id}`);
export const jobOffuntopApi = id => instance.post(`/b/position/untop/${id}`); export const jobOffuntopApi = id => instance.post(`/b/position/untop/${id}`);
// 拒绝申请 // 拒绝申请
export const rejectApplicationApi = id => instance.post(`/company/job/rejectApplication/${id}`); export const rejectApplicationApi = id => instance.post(`/position/application/reject/${id}`);
// 拒绝推荐
export const resumeInappropriateApi = params => instance.post(`/position/resume/inappropriate`, params);
<template> <template>
<div class="filter"> <div class="filter" id="filter">
<div class="menu"> <div class="menu">
<p v-for="v in menuList" :class="{ active: v.active }" :key="v.name" @click="onClickMenu(v)">{{ v.name }}</p> <p v-for="v in menuList" :class="{ active: v.active }" :key="v.name" @click="onClickMenu(v)">{{ v.name }}</p>
</div> </div>
...@@ -90,7 +90,7 @@ const menuList = ref([]); ...@@ -90,7 +90,7 @@ const menuList = ref([]);
const onClickMenu = data => { const onClickMenu = data => {
menuList.value.forEach(v => (v.active = false)); menuList.value.forEach(v => (v.active = false));
data.active = true; data.active = true;
document.querySelector(".filter").querySelector(`.${data.className}`).scrollIntoView(); document.querySelector("#filter").querySelector(`.${data.className}`).scrollIntoView();
}; };
// 学历 // 学历
const educationList = ref([]); const educationList = ref([]);
...@@ -184,19 +184,18 @@ const onCancel = () => { ...@@ -184,19 +184,18 @@ const onCancel = () => {
}; };
// 1. 确认 接收数据 // 1. 确认 接收数据
const onConfirm = () => { const onConfirm = () => {
console.log( const [minAge, maxAge] = age.value;
educationList.value.find(v => v.active), const { min: minWorkYear, max: maxWorkYear } = workYearList.value.find(v => v.active) || { min: 0, max: 100 };
genderList.value.find(v => v.active), const education = educationList.value.find(v => v.active)?.code;
workYearList.value.find(v => v.active), const jobType = dictJobTypeList.value.find(v => v.active)?.id;
dictJobTypeList.value.find(v => v.active) const sex = genderList.value.find(v => v.active)?.code;
); emit("confirm", { minAge, maxAge, minWorkYear, maxWorkYear, education, jobType, sex });
emit("confirm");
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.filter { .filter {
position: absolute; position: fixed;
inset: 0; inset: 0;
z-index: 66666666; z-index: 66666666;
display: flex; display: flex;
...@@ -290,6 +289,7 @@ const onConfirm = () => { ...@@ -290,6 +289,7 @@ const onConfirm = () => {
width: 100%; width: 100%;
padding: 16rpx 64rpx; padding: 16rpx 64rpx;
background-color: #ffffff; background-color: #ffffff;
border-top: 1px solid #dae4e7;
button { button {
display: flex; display: flex;
align-items: center; align-items: center;
......
<template> <template>
<div> <div>
<view bind:tap="jumpResumeDetail" @click="jumpResumeDetail"> <view @click="jumpResumeDetail">
<view class="info felx-between"> <view class="info felx-between">
<view class="text-wrap"> <view class="text-wrap">
<view class="name"> {{ data.realName }} <text>· 今日活跃</text> </view> <view class="name">
<view class="other"> {{ data.workExperience }}年 | {{ educationLevelText }}{{ data.salary }} </view> {{ data.name || "名字" }}
<!-- <text>· 今日活跃</text> -->
</view>
<view class="other">
{{ data.workAge }}年 | {{ educationLevelText }}{{ data.minSalary + "~" + data.maxSalary }}
</view>
</view> </view>
<image v-if="data.avatarPath" :src="evn.APP_IMAGE_BASE_API + data.avatarPath" mode="" /> <image v-if="data.avatar" :src="evn.APP_IMAGE_BASE_API + data.avatar" mode="" />
<image v-else src="@/static/image/user/default-avatar.png" mode="" /> <image v-else src="@/static/image/user/default-avatar.png" mode="" />
</view> </view>
<view class="education" v-if="educationExperience"> <view class="education"> {{ data.schoolName || "无" }}·{{ data.major || "无" }} </view>
{{ educationExperience ? educationExperience.schoolName : null }}·{{
educationExperience ? educationExperience.major : null
}}
</view>
<view class="introduce"> <view class="introduce">
{{ data.personalAdvantage }} {{ data.personalAdvantages }}
</view> </view>
</view> </view>
</div> </div>
...@@ -26,40 +27,23 @@ import { defineProps, computed } from "vue"; ...@@ -26,40 +27,23 @@ import { defineProps, computed } from "vue";
import evn from "@/utils/config"; import evn from "@/utils/config";
import { getEnumText } from "@/utils/utils"; import { getEnumText } from "@/utils/utils";
import { useAsync } from "@/hooks/useAsync"; import { useAsync } from "@/hooks/useAsync";
let { data, jobId, type } = defineProps({ let { data, type } = defineProps({
data: { data: {
type: Object, type: Object,
default: () => ({}) default: () => ({})
}, },
jobId: {
type: String,
default: () => ""
},
type: { type: {
type: String, type: String,
default: () => "recommend" default: () => "recommend"
} }
}); });
const { data: educationLevelText } = useAsync(getEnumText("EnumEducation", data.educationLevel)); console.log(data);
console.log("data", data); const { data: educationLevelText } = useAsync(getEnumText("EnumEducation", data.education));
const educationExperience = computed(() => {
if (data.educationLevel) {
return JSON.parse(data?.educationExperience)[0] || {};
} else {
return null;
}
});
const jumpResumeDetail = () => { const jumpResumeDetail = () => {
console.log("data", data); console.log("data.positionId", data.positionId);
if (type == "recommend") {
jobId = data.jobId;
}
uni.navigateTo({ uni.navigateTo({
url: `/pages/user/resume/index?jobId=${jobId}&userId=${data.userId}&applicationId=${data.applicationId}&type=${type}` url: `/pages/user/resume/index?jobId=${data.positionId}&userId=${data.userId}&applicationId=${data.id}&type=${type}`
}); });
}; };
</script> </script>
......
...@@ -78,6 +78,7 @@ const list = ref([]); ...@@ -78,6 +78,7 @@ const list = ref([]);
let flag = true; let flag = true;
const getApplicationList = () => { const getApplicationList = () => {
if (!flag) return; if (!flag) return;
uni.showLoading({ title: "加载中..." });
getApplicationListApi(apiParams).then(res => { getApplicationListApi(apiParams).then(res => {
if (res.data?.length && flag) { if (res.data?.length && flag) {
list.value.push(...res.data); list.value.push(...res.data);
...@@ -85,6 +86,7 @@ const getApplicationList = () => { ...@@ -85,6 +86,7 @@ const getApplicationList = () => {
} else { } else {
flag = false; flag = false;
} }
uni.hideLoading();
}); });
}; };
</script> </script>
...@@ -122,10 +124,10 @@ scroll-view { ...@@ -122,10 +124,10 @@ scroll-view {
flex-grow: 1; flex-grow: 1;
height: 100%; height: 100%;
.item { .item {
padding: 16rpx 32rpx;
margin-top: 16rpx; margin-top: 16rpx;
background: #fff; background: #ffffff;
border-bottom: 16rpx solid #f3f4f8; border-bottom: 16rpx solid #f3f4f8;
padding: 16rpx 32rpx;
} }
} }
</style> </style>
This diff is collapsed.
...@@ -12,26 +12,42 @@ ...@@ -12,26 +12,42 @@
<view class="card"> <view class="card">
<image src="@/static/image/user/default-avatar.png" mode="" /> <image src="@/static/image/user/default-avatar.png" mode="" />
<view class="name">{{ data.realName || "无" }}</view> <view class="name">{{ userInfo.name || "无" }}</view>
<view class="school">贵州大学·心理学</view> <view class="school">{{ userInfo.schoolName || "无" }}·{{ userInfo.major || "无" }}</view>
<view class="info-list"> <view class="info-list">
<view class="info flex-between"> <view class="info flex-between">
<veiw class="label">面试时间</veiw> <veiw class="label">面试时间</veiw>
<wd-datetime-picker <wd-datetime-picker
v-model="date" v-model="date"
style="z-index: 999 !important"
:min-date="new Date(new Date().setHours(0, 0, 0, 0)).getTime()" :min-date="new Date(new Date().setHours(0, 0, 0, 0)).getTime()"
use-default-slot use-default-slot
label="日期选择"
@confirm="dateConfirm" @confirm="dateConfirm"
> >
<view class="data">{{ date ? dayjs(date).format("YYYY-MM-DD HH:mm") : "选择面试时间" }}</view> <view :class="{ data: 1, placeholder: !date }">{{
date ? dayjs(date).format("YYYY-MM-DD HH:mm") : "选择面试时间"
}}</view>
</wd-datetime-picker> </wd-datetime-picker>
<view class="arrow"></view> <view class="arrow"></view>
</view> </view>
<view class="info flex-between"> <view class="info flex-between">
<veiw class="label">面试职位</veiw> <veiw class="label">面试职位</veiw>
<view class="data">{{ data.jobName }}{{ data.salary }}</view> <!-- <view class="data">{{ data.positionName }}{{ data.salary }}</view> -->
<!-- 需要选择岗位 -->
<template v-if="jobIdTemp">
<view class="data">{{ data.positionName }}{{ data.salary }}</view>
</template>
<template v-else>
<wd-picker
:columns="jobListColumns"
value-key="id"
label-key="name"
@confirm="positionConfirm"
use-default-slot
>
<view class="data" v-if="data.positionName">{{ data.positionName }}{{ data.salary }}</view>
<view class="t2" v-else>请选择职位</view>
</wd-picker>
</template>
<view class="arrow"></view> <view class="arrow"></view>
</view> </view>
<view class="info flex-between"> <view class="info flex-between">
...@@ -46,11 +62,9 @@ ...@@ -46,11 +62,9 @@
</view> </view>
<view class="info flex-between"> <view class="info flex-between">
<veiw class="label">面试地址</veiw> <veiw class="label">面试地址</veiw>
<view class="data">{{ data.address }}</view> <view class="data">{{ data.interviewLocation }}</view>
<view class="arrow"></view> <view class="arrow"></view>
</view> </view>
<map id="mapId" class="map" :latitude="mapCenter.latitude" :longitude="mapCenter.longitude" :markers="markers">
</map>
</view> </view>
</view> </view>
...@@ -62,45 +76,79 @@ ...@@ -62,45 +76,79 @@
<script setup> <script setup>
import dayjs from "dayjs"; import dayjs from "dayjs";
import { getApplicationByIdApi, inviteInterviewApi } from "@/api/postion"; import { getApplicationByIdApi, inviteInterviewApi, getJobByIdApi, getPositionListApi, getResumeByUserId } from "@/api/postion";
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
const date = ref(""); const date = ref("");
const dateConfirm = e => { const dateConfirm = e => {
console.log(e); console.log(e);
}; };
const jobIdTemp = ref("");
let userIdTemp = "";
const data = ref({}); const data = ref({});
onLoad(({ id }) => { /* 获取职位列表 */
getApplicationByIdApi(id).then(res => { const jobListColumns = ref([]);
data.value = res.data; function getJobListApiFn() {
getPositionListApi({ status: 3 }).then(res => {
if (res.code == 200) {
jobListColumns.value = res.data;
}
}); });
}
getJobListApiFn();
const positionConfirm = ({ selectedItems }) => {
console.log(selectedItems);
data.value = selectedItems;
data.value.interviewLocation = selectedItems.address;
data.value.salary = selectedItems.minSalary + "~" + selectedItems.maxSalary;
data.value.positionName = selectedItems.name;
jobIdTemp.value = selectedItems.id;
};
onLoad(({ id, jobId, userId }) => {
userIdTemp = userId;
// 投递获取
if (Number(id)) {
getApplicationByIdApi(id).then(res => {
data.value = res.data;
data.value.applicationId = id;
});
} else if (Number(jobId)) {
getJobById(jobId);
}
console.log(1111);
// 查询用户信息
getUserinfo();
});
// 查询用户信息
const userInfo = reactive({
name: "",
schoolName: "",
major: ""
}); });
const getUserinfo = () => {
getResumeByUserId(userIdTemp).then(res => {
console.log(res);
userInfo.name = res.data.userInfo.name;
const educationExperience = JSON.parse(res.data.userResume.educationExperience || [{}])[0];
userInfo.schoolName = educationExperience.schoolName;
userInfo.major = educationExperience.major;
});
};
const getJobById = jobId => {
// 数据凭借
getJobByIdApi(jobId).then(res => {
res.data.salary = res.data.minSalary + "~" + res.data.maxSalary;
res.data.positionName = res.data.name;
res.data.interviewLocation = res.data.address;
jobIdTemp.value = jobId;
data.value = res.data;
console.log(res);
});
};
const back = () => { const back = () => {
uni.navigateBack(); uni.navigateBack();
}; };
let mapCenter = reactive({
latitude: 26.63,
longitude: 106.67
});
// 地图点
let markers = reactive([
{
id: 1,
latitude: 26.63,
longitude: 106.67,
width: 16,
height: 20,
iconPath: new URL("@/static/image/icon/markers.png", import.meta.url).href,
callout: {
content: "观山湖区高新区产业技术发展研究院",
borderRadius: 2,
padding: 7,
display: "ALWAYS",
textAlign: "center",
bgColor: "#fff",
color: "#000"
}
}
]);
const submit = () => { const submit = () => {
if (!date.value) { if (!date.value) {
...@@ -110,17 +158,27 @@ const submit = () => { ...@@ -110,17 +158,27 @@ const submit = () => {
}); });
return; return;
} }
if (!data.value.applicationId && !jobIdTemp.value) {
uni.showToast({
title: "请选择面试岗位",
icon: "none"
});
return;
}
inviteInterviewApi({ inviteInterviewApi({
...data.value, ...data.value,
interviewTime: date.value interviewTime: date.value,
userId: userIdTemp,
positionId: jobIdTemp.value
}).then(res => { }).then(res => {
console.log(res);
if (res.code === 200) { if (res.code === 200) {
uni.showToast({ uni.showToast({
title: "邀请成功", title: "邀请成功",
icon: "none" icon: "none"
}); });
uni.navigateBack(); uni.switchTab({
url: "/pages/recommend/index"
});
} }
}); });
}; };
...@@ -154,7 +212,7 @@ const submit = () => { ...@@ -154,7 +212,7 @@ const submit = () => {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
width: 686rpx; width: 686rpx;
height: 878rpx; height: 678rpx;
padding-top: 112rpx; padding-top: 112rpx;
margin: 100rpx auto 0; margin: 100rpx auto 0;
background: #ffffff; background: #ffffff;
...@@ -208,16 +266,14 @@ const submit = () => { ...@@ -208,16 +266,14 @@ const submit = () => {
line-height: 36rpx; line-height: 36rpx;
color: #1b2026; color: #1b2026;
} }
.placeholder {
color: #bfcacf;
}
.arrow { .arrow {
border-color: #77818f; border-color: #77818f;
} }
} }
} }
map {
width: 620rpx;
height: 176rpx;
border-radius: 12rpx;
}
} }
.btn-wrap { .btn-wrap {
position: fixed; position: fixed;
......
...@@ -10,7 +10,13 @@ ...@@ -10,7 +10,13 @@
>{{ v.text }}</view >{{ v.text }}</view
> >
</view> </view>
<scroll-view class="management-list" :scroll-y="true"> <scroll-view
class="management-list"
:scroll-y="true"
:refresher-triggered="refresherEnabled"
@refresherrefresh="onRefresherrefresh"
refresher-enabled
>
<view class="item" v-for="(v, i) in jobList" :key="i"> <view class="item" v-for="(v, i) in jobList" :key="i">
<view class="flex-between"> <view class="flex-between">
<view class="info"> <view class="info">
...@@ -94,6 +100,7 @@ const getJobList = (status = "") => { ...@@ -94,6 +100,7 @@ const getJobList = (status = "") => {
v.statusText = statusText; v.statusText = statusText;
}); });
jobList.value = [...res.data]; jobList.value = [...res.data];
refresherEnabled.value = false;
}); });
}; };
onLoad(() => { onLoad(() => {
...@@ -112,6 +119,7 @@ onShow(() => { ...@@ -112,6 +119,7 @@ onShow(() => {
getTopFilter(); getTopFilter();
getJobList(); getJobList();
}); });
/* 职位上下线 */ /* 职位上下线 */
const switchJobStatus = async v => { const switchJobStatus = async v => {
let res = null; let res = null;
...@@ -128,6 +136,7 @@ const switchJobStatus = async v => { ...@@ -128,6 +136,7 @@ const switchJobStatus = async v => {
}); });
} }
if (res && res.code === 200) { if (res && res.code === 200) {
v.statusText = await getEnumText("EnumJobStatus", v.status);
uni.showToast({ uni.showToast({
title: "操作成功", title: "操作成功",
icon: "none" icon: "none"
...@@ -235,6 +244,14 @@ function jobOffuntopApiFn(v) { ...@@ -235,6 +244,14 @@ function jobOffuntopApiFn(v) {
} }
}); });
} }
/* 下拉刷新 */
const refresherEnabled = ref(false);
const onRefresherrefresh = e => {
console.log(e);
refresherEnabled.value = true;
getJobList(activeTopFilter.value);
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<template>
<view class="item">
<view class="label">学校名称</view>
<input v-model="params.schoolName" placeholder="请输入用户名" border="{{ false }}" />
</view>
<view class="item">
<view class="label">专业名称</view>
<input v-model="params.major" placeholder="请输入用户名" border="{{ false }}" />
</view>
<view class="item">
<view class="label">开始时间</view>
<wd-datetime-picker
:default-value="new Date().getTime()"
:maxDate="new Date().getTime()"
:minDate="new Date('1960/01/01').getTime()"
type="year-month"
v-model="params.startDate"
use-default-slot
class="my-datetime-picker"
>
<view :class="`inner ${params.startDate ? '' : 'placeholder'}`">
{{ format(params.startDate) || "选择开始时间" }}
</view>
</wd-datetime-picker>
</view>
<view class="item">
<view class="label">结束时间</view>
<wd-datetime-picker
:default-value="new Date().getTime()"
:minDate="params.startDate"
:maxDate="new Date().getTime()"
type="year-month"
v-model="params.endDate"
use-default-slot
class="my-datetime-picker"
>
<view :class="`inner ${params.endDate ? '' : 'placeholder'}`">
{{ format(params.endDate) || "结束时间" }}
</view>
</wd-datetime-picker>
</view>
<view class="btn-wrap">
<button @click="submit">保存</button>
</view>
</template>
<script setup>
import { saveEducationExperienceApi } from "@/api/user";
import dayjs from "dayjs";
import { reactive } from "vue";
const params = reactive({ schoolName: "", startDate: 0, endDate: 0, major: "" });
const format = date => date && dayjs(date).format("YYYY-MM-DD");
const submit = () => {
saveEducationExperienceApi(JSON.stringify([params])).then(res => {
if (res.code === 200) {
uni.showToast({
title: "保存成功",
icon: "none"
});
setTimeout(() => {
uni.navigateBack();
}, 1000);
}
});
};
</script>
<style lang="scss" scoped>
.item {
display: flex;
align-items: center;
margin: 0 32rpx;
border-bottom: 2rpx solid #f3f4f8;
.label {
flex: 0 0 160rpx;
padding: 32rpx 0;
font-size: 24rpx;
font-weight: 500;
line-height: 24rpx;
color: #77818f;
}
.placeholder {
color: #77818f;
}
.inner {
height: 88rpx;
padding: 0 32rpx;
font-size: 28rpx;
line-height: 88rpx;
}
textarea {
box-sizing: border-box;
width: 100%;
height: 272rpx;
padding: 32rpx;
margin: 10rpx auto 32rpx;
background: #f2f5fb;
border-radius: 8rpx;
}
}
.btn-wrap {
position: fixed;
bottom: 0;
box-sizing: border-box;
width: 100%;
padding: 16rpx 64rpx;
border-top: 2rpx solid rgb(31 35 41 / 15%);
button {
font-size: 30rpx;
font-weight: 600;
color: #ffffff;
background: #1f86ff;
border-radius: 12rpx;
}
}
</style>
...@@ -119,12 +119,24 @@ ...@@ -119,12 +119,24 @@
<script setup> <script setup>
import { reactive, computed } from "vue"; import { reactive, computed } from "vue";
import { getUserResumeApi, rejectApplicationApi, getApplicationByIdApi } from "@/api/postion"; import {
getUserResumeApi,
rejectApplicationApi,
resumeInappropriateApi,
getApplicationByIdApi,
getUserResumeByApplicationIdApi
} from "@/api/postion";
import { getCityNameByCodeApi } from "@/api/common";
import { getEnumText, getEumData } from "@/utils/utils.js"; import { getEnumText, getEumData } from "@/utils/utils.js";
import evn from "@/utils/config.js"; import evn from "@/utils/config.js";
import { useMessage } from "wot-design-uni"; import { useMessage } from "wot-design-uni";
// 投递id
let id = null; let id = null;
//工作id
let jobIdTemp = null;
//用户id
let userIdTemp = null;
const resumeData = reactive({ const resumeData = reactive({
preferredCityName: "", preferredCityName: "",
personalAdvantage: "", personalAdvantage: "",
...@@ -149,46 +161,64 @@ const resumeData = reactive({ ...@@ -149,46 +161,64 @@ const resumeData = reactive({
}); });
const applicationData = ref({}); const applicationData = ref({});
// 数据回显 // 数据回显
const getUserResume = ({ userId, jobId }) => { const getUserResume = ({ userId, jobId, applicationId }) => {
console.log("jobId", jobId); // console.log("jobId", jobId);=
// jobId = !jobId || jobId == "undefined" ? null : jobId;
// getUserResumeApi({ userId, jobId }).then(async res => {
let apiFn;
jobId = !jobId || jobId == "undefined" ? null : jobId; if (Number(applicationId)) {
getUserResumeApi({ userId, jobId }).then(async res => { apiFn = getUserResumeByApplicationIdApi(applicationId);
} else {
apiFn = getUserResumeApi(userId);
}
apiFn.then(async res => {
console.log(res);
const { const {
personalAdvantage, personalAdvantages,
preferredPosition,
maxSalary, maxSalary,
minSalary, minSalary,
preferredCityName,
workExperience, workExperience,
educationExperience positionNames,
} = res.data.resume; educationExperience,
operator,
cityCode
} = res.data.userResume;
const { workAge, education, avatarPath, phone } = res.data.userInfo;
applicationData.value = res.data.jobApplication; resumeData.personalAdvantage = personalAdvantages; //个人优势
const { realName, workExperience: workExperienceYear, educationLevel, avatarPath } = res.data.user; resumeData.maxSalary = maxSalary && maxSalary / 1000 + "k"; //薪水
resumeData.preferredCityName = preferredCityName;
resumeData.personalAdvantage = personalAdvantage; // 求职状态回
// resumeData.preferredPosition = preferredPosition.split(",").join("|");
const educationLevelText = await getEnumText("EnumEducation", educationLevel);
resumeData.realName = realName;
resumeData.avatarPath = avatarPath;
resumeData.educationLevel = educationLevelText;
resumeData.workExperienceYear = workExperienceYear;
resumeData.maxSalary = maxSalary && maxSalary / 1000 + "k";
resumeData.minSalary = minSalary && minSalary / 1000 + "k"; resumeData.minSalary = minSalary && minSalary / 1000 + "k";
const educationExperienceJson = JSON.parse(educationExperience || "[]"); resumeData.preferredPosition = positionNames;
console.log(educationExperienceJson); resumeData.preferredCityName = (await getCityNameByCodeApi(cityCode)).data.cityName;
resumeData.schoolName = educationExperienceJson[0]?.schoolName; resumeData.realName = operator;
resumeData.major = educationExperienceJson[0]?.major; const educationExperienceJson = JSON.parse(educationExperience || "[]"); //教育精力
resumeData.workExperience = JSON.parse(workExperience || "[]");
resumeData.educationExperience = educationExperienceJson; resumeData.educationExperience = educationExperienceJson;
resumeData.workExperienceYear = workAge; //工作年限
const educationLevelText = await getEnumText("EnumEducation", education);
resumeData.educationLevel = educationLevelText;
resumeData.avatarPath = avatarPath;
resumeData.schoolName = educationExperienceJson[0]?.schoolName; //学校
resumeData.major = educationExperienceJson[0]?.major; //专业
resumeData.workExperience = JSON.parse(workExperience || "[]"); //工作经历
applicationData.value = res.data.application || { status: 0 };
applicationData.value.userPhone = phone;
/*
const { realName, workExperience: workExperienceYear, educationLevel, avatarPath } = res.data.user;
console.log(educationExperienceJson);
*/
}); });
}; };
const pageType = ref(null); const pageType = ref(null);
onLoad(({ userId, jobId, applicationId, type }) => { onLoad(({ userId, jobId, applicationId, type }) => {
pageType.value = type; pageType.value = type;
id = applicationId; id = applicationId;
getUserResume({ userId, jobId }); jobIdTemp = jobId;
userIdTemp = userId;
getUserResume({ userId, jobId, applicationId });
}); });
function navigateTo(url) { function navigateTo(url) {
...@@ -255,16 +285,20 @@ const refuse = () => { ...@@ -255,16 +285,20 @@ const refuse = () => {
title: "拒绝" title: "拒绝"
}) })
.then(() => { .then(() => {
console.log("点击了确定按钮"); console.log(id);
rejectApplicationApi(id).then(res => { const result = id ? rejectApplicationApi(id) : resumeInappropriateApi({ userId: userIdTemp, positionId: jobIdTemp });
result.then(res => {
if (res.code === 200) { if (res.code === 200) {
uni.showToast({ uni.showToast({
title: "已拒绝", title: "已拒绝",
icon: "none" icon: "none"
}); });
status.value = 4; status.value = 4;
applicationData.value.status = 4;
} }
}); });
// resumeInappropriateApi
}) })
.catch(() => {}); .catch(() => {});
}; };
...@@ -274,7 +308,7 @@ const invitation = () => { ...@@ -274,7 +308,7 @@ const invitation = () => {
id = applicationData.value.id; id = applicationData.value.id;
} }
uni.navigateTo({ uni.navigateTo({
url: "/pages/recommend/invitation/index?id=" + id url: `/pages/recommend/invitation/index?id=${id}&jobId=${jobIdTemp}&userId=${userIdTemp}`
}); });
}; };
</script> </script>
...@@ -383,17 +417,17 @@ const invitation = () => { ...@@ -383,17 +417,17 @@ const invitation = () => {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 99;
gap: 32rpx; gap: 32rpx;
width: 100%; width: 100%;
border-top: 2rpx solid #1f23290f; border-top: 2rpx solid #1f23290f;
z-index: 99;
.f-btn-box { .f-btn-box {
z-index: 99;
display: flex; display: flex;
justify-content: space-around;
align-items: center; align-items: center;
background: #fff; justify-content: space-around;
z-index: 99;
padding: 16rpx 0; padding: 16rpx 0;
background: #ffffff;
} }
button { button {
width: 294rpx; width: 294rpx;
......
<template>
<view class="container">
<view class="header">
<view class="title"> 工作/实习经历 </view>
<view class="desc mt20"> 从最近的一份工作/实习经历填写哦 </view>
</view>
<view class="form">
<!-- 公司名称 -->
<view class="form-item">
<view class="form-info">
<view class="label">公司名称</view>
<input type="text" v-model="params.companyName" placeholder="请输入" />
</view>
</view>
<!-- 在职时间 -->
<view class="form-item" bindtap="goToSelectJobType">
<view class="form-info">
<view class="label">在职时间</view>
<view class="time-wrapper flex-r-c mt20">
<wd-datetime-picker
:default-value="new Date().getTime()"
:maxDate="new Date().getTime()"
:minDate="new Date('1960/01/01').getTime()"
type="year-month"
v-model="params.startDate"
class="my-datetime-picker"
/>
<view class="line"></view>
<wd-datetime-picker
:default-value="new Date().getTime()"
:minDate="params.startDate"
:maxDate="new Date().getTime()"
type="year-month"
v-model="params.endDate"
/>
</view>
</view>
</view>
<!-- 职位类型 -->
<wd-col-picker
label="期望职位"
v-model="postionValue"
:columns="postionOpstion"
value-key="name"
label-key="name"
:column-change="columnChangePostion"
@confirm="handleConfirmPostion"
use-default-slot
>
<view class="form-item">
<view class="form-info">
<view class="label">职位类型</view>
<view :class="['cont', 'mt20', !jobTypeText ? 'placeholder-style' : '']">{{
jobTypeText || "请选择"
}}</view>
</view>
<view class="arrow"></view>
</view>
</wd-col-picker>
<!-- 工作内容 -->
<view class="form-item">
<view class="form-info">
<view class="label">工作内容</view>
<textarea v-model="params.content" placeholder="请输入" />
</view>
</view>
</view>
<!-- <view class="btn-wrapper" wx:if="{{isEdit && leng > 1}}">
<button class="del-btn ml32" bindtap="delWorkExperience">删除</button>
<button class="save-btn save-btn-samll" bindtap="save">保存</button>
</view> -->
<view class="btn-wrapper">
<button class="save-btn" @tap="save">保存</button>
</view>
</view>
</template>
<script setup>
import { ref } from "vue";
import { dictJobTypeApi } from "@/api/common";
import { saveWorkExperienceApi } from "@/api/user";
import _ from "lodash";
const jobTypeText = ref("");
const params = reactive({
companyName: "",
startDate: 0,
endDate: 0,
position: "",
content: ""
});
const postionValue = ref([]);
const postionOpstion = ref([]);
dictJobTypeApi({}).then(res => {
postionOpstion.value.push(res.data);
});
const columnChangePostion = ({ selectedItem, resolve, finish }) => {
if (selectedItem.children) {
resolve(selectedItem.children);
} else {
finish();
}
};
const handleConfirmPostion = ({ selectedItems }) => {
console.log(selectedItems);
jobTypeText.value = _.last(selectedItems).name;
};
const save = () => {
params.position = jobTypeText.value;
console.log(params);
saveWorkExperienceApi(JSON.stringify([params])).then(res => {
console.log(res);
if (res.code == 200) {
uni.showToast({
title: "保存成功",
icon: "success"
});
}
});
};
</script>
<style lang="scss" scoped>
.container {
min-height: 100vh;
padding: 0 32rpx;
background-color: #ffffff;
}
.container .header {
padding: 30rpx 0;
}
.container .header .title {
font-size: 32rpx;
font-weight: 600;
color: #213452;
}
.container .header .desc {
font-size: 24rpx;
color: #5c7396;
}
.form-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 36rpx 0;
border-bottom: 1rpx solid #e9e9e9;
}
.form-item .form-info {
width: 92%;
}
.form-item .form-info .label {
font-size: 24rpx;
color: #616c7a;
}
.form-item .form-info .cont {
font-size: 28rpx;
font-weight: 600;
color: #213452;
}
/* 保存按钮 */
.btn-wrapper {
position: fixed;
right: 0;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
width: 100%;
padding: 12rpx 0;
border-top: 1rpx solid #ebebeb;
}
.btn-wrapper .save-btn {
width: 600rpx;
height: 72rpx;
font-size: 32rpx;
line-height: 72rpx;
color: #ffffff;
background: #1892ff;
border-radius: 8rpx;
}
.mt20 {
margin-top: 20rpx;
}
.ml32 {
margin-left: 32rpx;
}
.right-icon {
width: 48rpx;
height: 48rpx;
}
.color-grey {
font-size: 28rpx;
color: #a0afc3;
}
.placeholder-style {
font-size: 28rpx !important;
color: #a0afc3 !important;
}
.flex-r-c {
display: flex;
align-items: center;
justify-content: space-between;
}
.line {
width: 40rpx;
height: 2rpx;
margin: 0 80rpx;
background-color: #8693a3;
}
.overflow-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.btn-wrapper .del-btn {
width: 276rpx;
height: 72rpx;
font-size: 32rpx;
line-height: 72rpx;
color: #1892ff;
background: #ffffff;
border: 2rpx solid #1892ff;
border-radius: 8rpx;
}
.btn-wrapper .save-btn-samll {
width: 380rpx;
height: 72rpx;
}
:deep(.my-datetime-picker) {
.wd-icon-arrow-right {
display: none;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment