feat : 新增编辑,添加,删除工作经历功能, 修改我的简历页,
perf : 全局navTo方法新增延迟(更好的表现动画)
This commit is contained in:
@@ -206,6 +206,9 @@ function getFormCompletionPercent(form) {
|
||||
height: 80rpx;
|
||||
border-bottom: 2rpx solid #EBEBEB
|
||||
position: relative;
|
||||
.triangle {
|
||||
pointer-events: none;
|
||||
}
|
||||
.triangle::before
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
|
||||
@@ -39,12 +39,10 @@
|
||||
<view class="mys-line">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="mys-info">
|
||||
<view class="mys-info btn-feel">
|
||||
<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>
|
||||
<image class="icon " src="@/static/icon/edit1.png" @click="navTo('/packageA/pages/jobExpect/jobExpect')"></image>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>期望薪资:</text>
|
||||
@@ -64,15 +62,17 @@
|
||||
</view>
|
||||
<view class="card-top" style="margin-top: 24rpx">
|
||||
<view class="mys-info" style="padding: 0">
|
||||
<view class="mys-h4">
|
||||
<view class="mys-h4 btn-feel">
|
||||
<text>工作经历</text>
|
||||
<view class="mys-edit-icon">
|
||||
<image class="button-click" src="@/static/icon/edit1.png" @click="navTo('/packageA/pages/jobExpect/jobExpect')"></image>
|
||||
<view class="mys-edit-icon btn-feel" @click="navTo('/packageA/pages/workExp/workExp')">
|
||||
<image class=" icon button-click btn-feel" src="@/static/icon/plus.png" ></image>
|
||||
<view class="txt">添加</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="exp-item" v-for="item in userInfo.workExp" :key="item.id">
|
||||
<view class="fl_box fl_justbet mar_top10">
|
||||
<text class="fs_16">{{ item.company }}</text>
|
||||
<view class="exp-item btn-feel" v-for="item in userInfo.workExp" :key="item.id">
|
||||
<view class="fl_box fl_justbet mar_top15">
|
||||
<view class="fs_16">{{ item.company }}</view>
|
||||
<image class="icon btn-feel" src="@/static/icon/edit1.png" @click="navTo(`/packageA/pages/workExp/workExp?id=${item.id}`)"></image>
|
||||
</view>
|
||||
<view class="mys-text fl_box fl_justbet">
|
||||
<text class="color_333333 fs_14">{{ item.position }}</text>
|
||||
@@ -87,7 +87,7 @@
|
||||
</view>
|
||||
<template #footer>
|
||||
<view class="footer-container">
|
||||
<view class="footer-button">上传简历</view>
|
||||
<view class="footer-button btn-feel">上传简历</view>
|
||||
</view>
|
||||
</template>
|
||||
</AppLayout>
|
||||
@@ -212,10 +212,25 @@ image{
|
||||
display: flex;
|
||||
justify-content: space-between
|
||||
align-items: center
|
||||
.mys-edit-icon{
|
||||
display: inline-block
|
||||
.icon{
|
||||
width: 40rpx;
|
||||
height: 40rpx
|
||||
}
|
||||
.mys-edit-icon{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.txt{
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
font-weight: 400;
|
||||
}
|
||||
.icon{
|
||||
width: 28rpx;
|
||||
height: 28rpx
|
||||
margin-right: 5rpx;
|
||||
margin-top: 2rpx
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
.datetext{
|
||||
@@ -247,7 +262,10 @@ image{
|
||||
.exp-item{
|
||||
padding-bottom: 28rpx;
|
||||
border-bottom: 2rpx dashed #EEEEEE;
|
||||
|
||||
.icon{
|
||||
width 40rpx;
|
||||
height 40rpx
|
||||
}
|
||||
}
|
||||
.exp-item:nth-last-child(1){
|
||||
border-bottom: none;
|
||||
|
||||
@@ -250,8 +250,15 @@ function selectAvatar() {
|
||||
sourceType: ["album", "camera"],
|
||||
count: 1,
|
||||
success: ({ tempFilePaths, tempFiles }) => {
|
||||
console.log(`选择的图片:${tempFilePaths}`);
|
||||
console.warn("没有做后续上传逻辑!!!!!!!");
|
||||
$api
|
||||
.uploadFile(tempFilePaths[0], true)
|
||||
.then((res) => {
|
||||
res = JSON.parse(res);
|
||||
if (res.msg) fromValue.avatar = res.msg;
|
||||
})
|
||||
.catch((err) => {
|
||||
$api.msg("上传失败");
|
||||
});
|
||||
},
|
||||
fail: (error) => {},
|
||||
});
|
||||
@@ -284,6 +291,7 @@ function selectAvatar() {
|
||||
.avatar{
|
||||
width:110rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.content-input
|
||||
|
||||
245
packageA/pages/workExp/workExp.vue
Normal file
245
packageA/pages/workExp/workExp.vue
Normal file
@@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<AppLayout title="工作经历" 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 blue" @click="confirm">确认</view>
|
||||
</template>
|
||||
<view class="content">
|
||||
<view class="content-input">
|
||||
<view class="input-titile">公司</view>
|
||||
<input class="input-con" v-model="fromValue.company" placeholder="请输入公司名称" />
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile">岗位</view>
|
||||
<input class="input-con" v-model="fromValue.position" placeholder="请输入岗位" />
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile">时间</view>
|
||||
<view class="flex-box">
|
||||
<view class="input-box btn-feel" @click="changestartTime">
|
||||
<input v-model="fromValue.startTime" class="input-con triangle" disabled placeholder="开始时间" />
|
||||
<image class="icon" src="@/static/icon/arrow-down.png" />
|
||||
</view>
|
||||
<view class="gap">-</view>
|
||||
<view class="input-box btn-feel" @click="changeendTime">
|
||||
<input v-model="fromValue.endTime" class="input-con triangle" disabled placeholder="至今" />
|
||||
<image class="icon" src="@/static/icon/arrow-down.png" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-input">
|
||||
<view class="input-titile">工作内容</view>
|
||||
<textarea class="text-area" placeholder="请输入工作内容" v-model="fromValue.duty"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 时间选择器组件 -->
|
||||
<DatePicker ref="datePicker" />
|
||||
<template #footer v-if="fromValue.id">
|
||||
<view class="footer-container">
|
||||
<view class="footer-button btn-feel" @click="delCurrent">删除该工作经历</view>
|
||||
</view>
|
||||
</template>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted, computed } from "vue";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
const { $api, navTo, navBack } = inject("globalFunction");
|
||||
import { storeToRefs } from "pinia";
|
||||
import useUserStore from "@/stores/useUserStore";
|
||||
import useDictStore from "@/stores/useDictStore";
|
||||
import DatePicker from "@/components/DatePicker/DatePicker.vue";
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
const { getUserResume } = useUserStore();
|
||||
const { dictLabel, oneDictData } = useDictStore();
|
||||
|
||||
// 初始化数据
|
||||
const fromValue = reactive({
|
||||
position: "",
|
||||
company: "",
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
duty: "",
|
||||
id: undefined,
|
||||
});
|
||||
|
||||
// 获取时间选择器组件的引用
|
||||
const datePicker = ref();
|
||||
|
||||
onLoad((e) => {
|
||||
initLoad(e?.id);
|
||||
});
|
||||
|
||||
const confirm = async () => {
|
||||
// 验证必填字段
|
||||
if (!fromValue.company) {
|
||||
return $api.msg("请输入公司名称");
|
||||
}
|
||||
if (!fromValue.position) {
|
||||
return $api.msg("请输入岗位");
|
||||
}
|
||||
if (!fromValue.startTime) {
|
||||
return $api.msg("请选择开始时间");
|
||||
}
|
||||
// 验证时间逻辑:结束时间不能早于开始时间
|
||||
if (fromValue.endTime && new Date(fromValue.endTime) < new Date(fromValue.startTime)) {
|
||||
return $api.msg("结束时间不能早于开始时间");
|
||||
}
|
||||
let res;
|
||||
try {
|
||||
if (fromValue.id) {
|
||||
res = await $api.createRequest("/app/user/experience/edit", fromValue, "post");
|
||||
} else {
|
||||
res = await $api.createRequest("/app/user/experience/save", fromValue, "post");
|
||||
}
|
||||
$api.msg("保存成功");
|
||||
getUserResume().then(() => {
|
||||
navBack();
|
||||
});
|
||||
} catch (error) {
|
||||
$api.msg("保存失败");
|
||||
}
|
||||
};
|
||||
|
||||
function delCurrent() {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确认要删除此条工作经历吗?",
|
||||
showCancel: true,
|
||||
success: async ({ confirm, cancel }) => {
|
||||
if (confirm) {
|
||||
await $api.createRequest("/app/user/experience/delete", { id: fromValue.id }, "post");
|
||||
$api.msg("删除成功");
|
||||
getUserResume().then(() => {
|
||||
navBack();
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function initLoad(id) {
|
||||
if (!id) return;
|
||||
$api
|
||||
.createRequest(`/app/user/experience/getSingle/${id}`, {}, "get")
|
||||
.then((res) => {
|
||||
Object.assign(fromValue, res.data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("获取工作经历失败:", err);
|
||||
});
|
||||
}
|
||||
|
||||
// 选择开始时间
|
||||
const changestartTime = () => {
|
||||
console.log(1);
|
||||
datePicker.value.open({
|
||||
title: "选择开始时间",
|
||||
defaultDate: fromValue.startTime,
|
||||
success: (selectedDate) => {
|
||||
fromValue.startTime = selectedDate;
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 选择结束时间
|
||||
const changeendTime = () => {
|
||||
datePicker.value.open({
|
||||
title: "选择结束时间",
|
||||
defaultDate: fromValue.endTime,
|
||||
success: (selectedDate) => {
|
||||
fromValue.endTime = selectedDate;
|
||||
// 如果结束时间早于新的开始时间,清空结束时间
|
||||
if (fromValue.startTime && new Date(fromValue.startTime) > new Date(selectedDate)) {
|
||||
fromValue.endTime = "";
|
||||
$api.msg("结束时间不能小于开始时间!");
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btn.blue {
|
||||
color: #1677ff;
|
||||
}
|
||||
.content {
|
||||
padding: 28rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
height: calc(100% - 120rpx);
|
||||
}
|
||||
|
||||
.flex-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.gap {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
flex: 0.25;
|
||||
text-align: center;
|
||||
}
|
||||
.icon {
|
||||
width: 75rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
.input-box {
|
||||
flex: 0.375;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.content-input {
|
||||
margin-bottom: 48rpx;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 2rpx solid #ebebeb;
|
||||
&:nth-last-of-type(1) {
|
||||
border-bottom: none;
|
||||
}
|
||||
.input-titile {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #6a6a6a;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.input-con {
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
line-height: 80rpx;
|
||||
height: 80rpx;
|
||||
position: relative;
|
||||
}
|
||||
.triangle {
|
||||
pointer-events: none;
|
||||
}
|
||||
.text-area {
|
||||
width: 100%;
|
||||
height: 700rpx;
|
||||
background: #f5f5f5;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.footer-container {
|
||||
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;
|
||||
.footer-button {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background: #f93a4a;
|
||||
border-radius: 8rpx;
|
||||
color: #ffffff;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user