feat : 新增上传简历功能
This commit is contained in:
@@ -7,31 +7,56 @@
|
||||
</template>
|
||||
<view class="mys-container">
|
||||
<!-- 个人信息 -->
|
||||
<view class="card-top" style="margin-top: 12rpx; padding: 0; background: none">
|
||||
<view
|
||||
class="card-top"
|
||||
style="margin-top: 12rpx; padding: 0; background: none"
|
||||
>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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.avatar" :src="userInfo.avatar"></image>
|
||||
<image v-else-if="userInfo.sex == '0'" src="@/static/icon/boy.png"></image>
|
||||
<image
|
||||
v-else-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-if="userInfo.sex === '0'"
|
||||
src="@/static/icon/boy1.png"
|
||||
></image>
|
||||
<image v-else src="@/static/icon/girl1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
@@ -43,19 +68,34 @@
|
||||
<view class="mys-info btn-feel">
|
||||
<view class="mys-h4">
|
||||
<view>求职期望</view>
|
||||
<image class="icon" src="@/static/icon/edit1.png" @click="navTo('/packageA/pages/jobExpect/jobExpect')"></image>
|
||||
<image
|
||||
class="icon"
|
||||
src="@/static/icon/edit1.png"
|
||||
@click="navTo('/packageA/pages/jobExpect/jobExpect')"
|
||||
></image>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>期望薪资:</text>
|
||||
<text>{{ userInfo.salaryMin / 1000 }}k-{{ userInfo.salaryMax / 1000 }}k</text>
|
||||
<text
|
||||
>{{ userInfo.salaryMin / 1000 }}k-{{
|
||||
userInfo.salaryMax / 1000
|
||||
}}k</text
|
||||
>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>期望工作地:</text>
|
||||
<text>青岛市-</text>
|
||||
<dict-Label dictType="area" :value="Number(userInfo.area)"></dict-Label>
|
||||
<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">
|
||||
<view
|
||||
class="cards button-click"
|
||||
v-for="(title, index) in userInfo.jobTitle"
|
||||
:key="index"
|
||||
>
|
||||
{{ title }}
|
||||
</view>
|
||||
</view>
|
||||
@@ -65,19 +105,35 @@
|
||||
<view class="mys-info" style="padding: 0">
|
||||
<view class="mys-h4 btn-feel">
|
||||
<text>工作经历</text>
|
||||
<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="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 btn-feel" v-for="item in userInfo.workExp" :key="item.id">
|
||||
<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>
|
||||
<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>
|
||||
<text class="datetext">{{ item.startTime }}--{{ item.endTime || "至今" }}</text>
|
||||
<text class="datetext"
|
||||
>{{ item.startTime }}--{{ item.endTime || "至今" }}</text
|
||||
>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>{{ item.duty }}</text>
|
||||
@@ -88,7 +144,9 @@
|
||||
</view>
|
||||
<template #footer>
|
||||
<view class="footer-container">
|
||||
<view class="footer-button btn-feel">上传简历</view>
|
||||
<view class="footer-button btn-feel" @click="chooseResume"
|
||||
>上传简历</view
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
</AppLayout>
|
||||
@@ -104,6 +162,65 @@ import useDictStore from "@/stores/useDictStore";
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
const { getUserResume } = useUserStore();
|
||||
const { getDictData, oneDictData } = useDictStore();
|
||||
import config from "@/config.js";
|
||||
|
||||
function chooseResume() {
|
||||
uni.chooseImage({
|
||||
sizeType: ["original", "compressed"],
|
||||
sourceType: ["album", "camera"],
|
||||
count: 1,
|
||||
success: ({ tempFilePaths, tempFiles }) => {
|
||||
uploadResume(tempFilePaths[0], true)
|
||||
.then((res) => {
|
||||
res = JSON.parse(res);
|
||||
getUserResume();
|
||||
$api.msg("上传成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
$api.msg("上传失败");
|
||||
});
|
||||
},
|
||||
fail: (error) => {},
|
||||
});
|
||||
}
|
||||
|
||||
function uploadResume(tempFilePath, loading) {
|
||||
if (loading) {
|
||||
uni.showLoading({
|
||||
title: "请稍后",
|
||||
mask: true,
|
||||
});
|
||||
}
|
||||
let Authorization = "";
|
||||
if (useUserStore().token) {
|
||||
Authorization = `${useUserStore().token}`;
|
||||
}
|
||||
const header = {};
|
||||
header["Authorization"] = encodeURIComponent(Authorization);
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: config.baseUrl + "/app/oss/uploadToObs",
|
||||
filePath: tempFilePath,
|
||||
name: "file",
|
||||
header,
|
||||
success: (uploadFileRes) => {
|
||||
if (uploadFileRes.statusCode === 200) {
|
||||
resolve(uploadFileRes.data);
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err);
|
||||
},
|
||||
complete: () => {
|
||||
if (loading) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
Reference in New Issue
Block a user