投递简历添加确认弹窗
This commit is contained in:
@@ -40,6 +40,22 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 机构类型选择(仅单位角色显示) -->
|
||||
<view v-if="userType === 0" class="org-type-select">
|
||||
<view class="org-type-title">请选择机构类型</view>
|
||||
<view class="org-type-options">
|
||||
<view
|
||||
v-for="option in orgTypeOptions"
|
||||
:key="option.value"
|
||||
class="org-type-item"
|
||||
:class="{ active: orgType === option.value }"
|
||||
@click="selectOrgType(option.value)"
|
||||
>
|
||||
<view class="org-type-text">{{ option.label }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 授权说明 -->
|
||||
<view class="auth-tips">
|
||||
<view class="tip-item">
|
||||
@@ -99,21 +115,50 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, inject } from 'vue';
|
||||
import { ref, inject, onMounted } from 'vue';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
import useDictStore from '@/stores/useDictStore';
|
||||
import { tabbarManager } from '@/utils/tabbarManager';
|
||||
|
||||
const { $api } = inject('globalFunction');
|
||||
const { loginSetToken } = useUserStore();
|
||||
const dictStore = useDictStore();
|
||||
|
||||
const popup = ref(null);
|
||||
const userType = ref(null); // 用户角色:1-求职者,0-企业
|
||||
const orgType = ref(null); // 机构类型
|
||||
const orgTypeOptions = ref([]); // 机构类型选项
|
||||
const emit = defineEmits(['success', 'cancel']);
|
||||
|
||||
// 获取机构类型字典
|
||||
const getOrgTypeDict = async () => {
|
||||
try {
|
||||
const options = await dictStore.getDictSelectOption('org_type');
|
||||
orgTypeOptions.value = options;
|
||||
} catch (error) {
|
||||
console.error('获取机构类型字典失败:', error);
|
||||
// 使用备用数据
|
||||
orgTypeOptions.value = [
|
||||
{ label: '有限责任公司', value: '1' },
|
||||
{ label: '股份有限公司', value: '2' },
|
||||
{ label: '个人独资企业', value: '3' },
|
||||
{ label: '合伙企业', value: '4' },
|
||||
{ label: '外商投资企业', value: '5' },
|
||||
{ label: '其他', value: '6' }
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
// 组件挂载时获取字典数据
|
||||
onMounted(() => {
|
||||
getOrgTypeDict();
|
||||
});
|
||||
|
||||
// 打开弹窗
|
||||
const open = () => {
|
||||
popup.value?.open();
|
||||
userType.value = null; // 重置角色选择
|
||||
orgType.value = null; // 重置机构类型选择
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
@@ -125,6 +170,12 @@ const close = () => {
|
||||
// 选择角色
|
||||
const selectRole = (type) => {
|
||||
userType.value = type;
|
||||
orgType.value = null; // 切换角色时重置机构类型选择
|
||||
};
|
||||
|
||||
// 选择机构类型
|
||||
const selectOrgType = (type) => {
|
||||
orgType.value = type;
|
||||
};
|
||||
|
||||
// 验证角色是否已选择
|
||||
@@ -133,6 +184,13 @@ const validateRole = () => {
|
||||
$api.msg('请先选择您的角色');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 验证机构类型是否已选择(仅单位角色)
|
||||
if (userType.value === 0 && orgType.value === null) {
|
||||
$api.msg('请选择机构类型');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -147,6 +205,12 @@ const getPhoneNumber = (e) => {
|
||||
$api.msg('请先选择您的角色');
|
||||
return true;
|
||||
}
|
||||
|
||||
// 验证机构类型是否已选择(仅单位角色)
|
||||
if (userType.value === 0 && orgType.value === null) {
|
||||
$api.msg('请选择机构类型');
|
||||
return true;
|
||||
}
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (loginRes) => {
|
||||
@@ -161,7 +225,8 @@ const getPhoneNumber = (e) => {
|
||||
code,
|
||||
encryptedData,
|
||||
iv,
|
||||
userType: userType.value
|
||||
userType: userType.value,
|
||||
orgType: orgType.value
|
||||
}, 'post').then((resData) => {
|
||||
uni.hideLoading();
|
||||
console.log(resData, 'resume.idCard');
|
||||
@@ -250,7 +315,8 @@ const wxLogin = () => {
|
||||
// 调用后端接口进行登录
|
||||
$api.createRequest('/app/appLogin', {
|
||||
code: loginRes.code,
|
||||
userType: userType.value
|
||||
userType: userType.value,
|
||||
orgType: orgType.value
|
||||
}, 'post').then((resData) => {
|
||||
if (resData.token) {
|
||||
loginSetToken(resData.token).then((resume) => {
|
||||
@@ -372,7 +438,7 @@ defineExpose({
|
||||
overflow: hidden
|
||||
|
||||
.modal-content
|
||||
padding: 60rpx 40rpx 40rpx
|
||||
padding: 40rpx 40rpx 40rpx
|
||||
position: relative
|
||||
|
||||
.close-btn
|
||||
@@ -388,11 +454,11 @@ defineExpose({
|
||||
|
||||
.auth-header
|
||||
text-align: center
|
||||
margin-bottom: 40rpx
|
||||
margin-bottom: 20rpx
|
||||
|
||||
.auth-logo
|
||||
width: 120rpx
|
||||
height: 120rpx
|
||||
width: 90rpx
|
||||
height: 90rpx
|
||||
margin: 0 auto 24rpx
|
||||
|
||||
.auth-title
|
||||
@@ -407,7 +473,6 @@ defineExpose({
|
||||
|
||||
.role-select
|
||||
margin-bottom: 32rpx
|
||||
|
||||
.role-title
|
||||
font-size: 28rpx
|
||||
font-weight: 500
|
||||
@@ -446,6 +511,41 @@ defineExpose({
|
||||
color: #333333
|
||||
font-weight: 500
|
||||
|
||||
.org-type-select
|
||||
margin-bottom: 22rpx
|
||||
|
||||
.org-type-title
|
||||
font-size: 28rpx
|
||||
font-weight: 500
|
||||
color: #333333
|
||||
margin-bottom: 20rpx
|
||||
text-align: center
|
||||
|
||||
.org-type-options
|
||||
display: flex
|
||||
flex-wrap: wrap
|
||||
gap: 16rpx
|
||||
|
||||
.org-type-item
|
||||
display:inline-block
|
||||
background: #F7F8FA
|
||||
border: 2rpx solid #E5E5E5
|
||||
border-radius: 10rpx
|
||||
padding: 10rpx 10rpx
|
||||
transition: all 0.3s ease
|
||||
cursor: pointer
|
||||
text-align: center
|
||||
|
||||
&.active
|
||||
background: #F0F5FF
|
||||
border-color: #256BFA
|
||||
box-shadow: 0 4rpx 12rpx rgba(37, 107, 250, 0.15)
|
||||
|
||||
.org-type-text
|
||||
font-size: 22rpx
|
||||
color: #333333
|
||||
font-weight: 500
|
||||
|
||||
.auth-tips
|
||||
background: #F7F8FA
|
||||
border-radius: 16rpx
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
export default {
|
||||
// baseUrl: 'http://39.98.44.136:8080', // 测试
|
||||
baseUrl: 'https://www.xjksly.cn/api/ks', // 正式环境
|
||||
// baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
|
||||
// baseUrl: 'https://www.xjksly.cn/api/ks', // 正式环境
|
||||
baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
|
||||
|
||||
// LCBaseUrl:'http://10.110.145.145:9100',//内网端口
|
||||
// LCBaseUrlInner:'http://10.110.145.145:10100',//招聘、培训、帮扶
|
||||
|
||||
@@ -222,6 +222,18 @@
|
||||
</view>
|
||||
</template>
|
||||
<VideoPlayer ref="videoPalyerRef" />
|
||||
|
||||
<!-- 确认弹窗 -->
|
||||
<view v-if="showConfirmDialog" class="confirm-dialog">
|
||||
<view class="dialog-content">
|
||||
<view class="dialog-title">确认投递</view>
|
||||
<view class="dialog-message">确定要投递此职位吗?</view>
|
||||
<view class="dialog-buttons">
|
||||
<view class="btn-cancel button-click" @click="cancelApply">取消</view>
|
||||
<view class="btn-confirm button-click" @click="confirmApply">确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
@@ -266,6 +278,7 @@ const raderData = ref({
|
||||
});
|
||||
const videoPalyerRef = ref(null);
|
||||
const explainUrlRef = ref('');
|
||||
const showConfirmDialog = ref(false);
|
||||
|
||||
// 申请人列表直接使用接口返回的applyUsers数组
|
||||
|
||||
@@ -422,24 +435,28 @@ function jobApply() {
|
||||
$api.msg('请您先登录');
|
||||
return;
|
||||
}
|
||||
// 显示确认弹窗
|
||||
showConfirmDialog.value = true;
|
||||
}
|
||||
|
||||
// 确认投递
|
||||
function confirmApply() {
|
||||
const jobId = jobInfo.value.jobId;
|
||||
$api.createRequest(`/app/job/apply/${jobId}`, {}, 'GET').then((resData) => {
|
||||
getDetail(jobId);
|
||||
$api.msg('申请成功');
|
||||
const jobUrl = jobInfo.value.jobUrl;
|
||||
// return window.open(jobUrl);
|
||||
});
|
||||
// if (jobInfo.value.isApply) {
|
||||
// const jobUrl = jobInfo.value.jobUrl;
|
||||
// return window.open(jobUrl);
|
||||
// } else {
|
||||
// $api.createRequest(`/app/job/apply/${jobId}`, {}, 'GET').then((resData) => {
|
||||
// getDetail(jobId);
|
||||
// $api.msg('申请成功');
|
||||
// const jobUrl = jobInfo.value.jobUrl;
|
||||
// return window.open(jobUrl);
|
||||
// });
|
||||
// }
|
||||
$api.msg('申请成功');
|
||||
const jobUrl = jobInfo.value.jobUrl;
|
||||
// return window.open(jobUrl);
|
||||
showConfirmDialog.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消投递
|
||||
function cancelApply() {
|
||||
const jobId = jobInfo.value.jobId;
|
||||
$api.createRequest(`/app/job/applyJobCencal`, { jobId }, 'DELETE').then((resData) => {
|
||||
$api.msg('取消投递成功');
|
||||
showConfirmDialog.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消/收藏岗位
|
||||
@@ -966,4 +983,70 @@ for i in 0..100
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
// 确认弹窗样式
|
||||
.confirm-dialog {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
width: 80%;
|
||||
max-width: 500rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dialog-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.dialog-message {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 40rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dialog-buttons {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.btn-cancel, .btn-confirm {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.btn-cancel {
|
||||
background-color: #f5f5f5;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
background-color: #256BFA;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user