报名招聘会添加loading状态
This commit is contained in:
@@ -105,9 +105,9 @@
|
||||
</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 class="btn-wq button-click" :class="{ 'btn-desbel': fairInfo.isSignUp==1 || isLoading }"
|
||||
@click="applyExhibitors" :disabled="isLoading">
|
||||
{{ isLoading ? '报名中...' : fairInfo.isSignUp==1 ? '已报名' : '报名招聘会' }}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -161,6 +161,8 @@
|
||||
// person个人 ent企业
|
||||
const signRole = ref('ent');
|
||||
const CompanySignPopup = ref(null)
|
||||
// 报名loading状态
|
||||
const isLoading = ref(false)
|
||||
|
||||
const jobFairId = ref(null)
|
||||
|
||||
@@ -253,6 +255,7 @@
|
||||
|
||||
// 报名招聘会
|
||||
function applyExhibitors() {
|
||||
if (isLoading.value) return
|
||||
if (fairInfo.value.isSignUp == 1) {
|
||||
$api.msg('请勿重复报名');
|
||||
return
|
||||
@@ -262,6 +265,7 @@
|
||||
const headers = token ? {
|
||||
Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`
|
||||
} : {};
|
||||
isLoading.value = true
|
||||
|
||||
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
|
||||
if (resData.code == 200) {
|
||||
@@ -271,6 +275,7 @@
|
||||
signRole.value = userInfo.userType;
|
||||
signDialogisshow.value = true
|
||||
CompanySignPopup.value.open()
|
||||
isLoading.value = false
|
||||
}else{
|
||||
$api.myRequest("/jobfair/public/job-fair-sign-up-person/sign-up", {
|
||||
personId: userInfo.value.info.userId,
|
||||
@@ -289,6 +294,7 @@
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
isLoading.value = false
|
||||
})
|
||||
|
||||
}
|
||||
@@ -299,7 +305,10 @@
|
||||
// url: '/packageB/login'
|
||||
// })
|
||||
// }, 1000)
|
||||
isLoading.value = false
|
||||
}
|
||||
}).catch(() => {
|
||||
isLoading.value = false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user