فهرست منبع

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 10 ماه پیش
والد
کامیت
08ca8bf809

+ 66 - 0
src/views/recruit/personal/shareJob/components/quickLogin.vue

@@ -0,0 +1,66 @@
+<!--  -->
+<template>
+  <div class="my-5">
+    <phoneFrom ref="phoneRef" @handleEnter="handleLogin"></phoneFrom>
+    <v-btn :loading="loginLoading" color="primary" class="white--text mt-5" min-width="350" @click="handleLogin">
+      {{ $t('login.register') }}
+    </v-btn>
+  </div>
+</template>
+
+<script setup>
+import phoneFrom from '@/components/VerificationCode'
+import { useUserStore } from '@/store/user'; const userStore = useUserStore()
+import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
+import Snackbar from '@/plugins/snackbar'
+import { ref } from 'vue'
+defineOptions({name: 'shareJob-login'})
+const emit = defineEmits(['loginSuccess'])
+
+// 验证码登录
+const phoneRef = ref()
+const loginLoading = ref(false)
+
+const timer = ref(null)
+const baseInfo = ref(null)
+const handleLogin = async () => {
+  localStorage.removeItem('currentRole')
+  const { valid } = await phoneRef.value.phoneForm.validate()
+  if (!valid) return
+  loginLoading.value = true
+  try {
+    const params = { ...phoneRef.value.loginData } // 只能验证码登录
+    await userStore.handleSmsLogin(params)
+    // 查询用户基本信息
+    timer.value = setInterval(() => { getUserInfoVerify() }, 1000)
+    // 十秒后停止获取清除timer
+    setTimeout(() => { if (!baseInfo.value) getUserInfoFail() }, 10000);
+  } catch (error) {
+    console.error('error', error)
+  }
+}
+
+// 查询用户基本信息失败 
+const getUserInfoVerify = () => {
+  if (baseInfo.value) {
+    clearInterval(timer.value)
+    timer.value = null
+    loginLoading.value = false
+    const keyArr = ['name', 'phone', 'jobStatus', 'expType', 'eduType'] // 必填人才信息
+    const baseInfoReady = keyArr.every(e => baseInfo.value[e] && baseInfo.value[e] !== 0) // 校验必填人才信息
+    const obj = { baseInfoReady, baseInfo: baseInfo.value, keyArr }
+    emit('loginSuccess', obj)
+  }
+  baseInfo.value = JSON.parse(localStorage.getItem('baseInfo'))
+}
+
+// 查询用户基本信息失败 
+const getUserInfoFail = () => {
+  clearInterval(timer.value)
+  timer.value = null
+  loginLoading.value = false
+  Snackbar.success(t('login.getUserInfoFailed')+','+t('login.loginAgain'))
+}
+</script>
+<style lang="scss" scoped>
+</style>

+ 2 - 2
src/views/recruit/personal/shareJob/index.vue

@@ -84,7 +84,7 @@
       title="快速登录"
       @close="showQuickResumeDialog = false"
     >
-      <login :jobId="jobId" @loginSuccess="loginSuccess"></login>
+      <quickLogin :jobId="jobId" @loginSuccess="loginSuccess"></quickLogin>
     </CtDialog>
   </div>
 </template>
@@ -95,7 +95,7 @@ import { onMounted, ref } from 'vue';
 import { getPositionDetails, jobCvRelCheckSend, getPersonJobUnfavorite, getPersonJobFavorite, getJobFavoriteCheck } from '@/api/position'
 import { dealDictObjData } from '@/utils/position'
 import handleDeliveryCom from './components/handleDeliveryCom.vue'
-import login from './components/login.vue'
+import quickLogin from './components/quickLogin.vue'
 import { getPersonalToken } from '@/utils/auth'
 import Snackbar from '@/plugins/snackbar'
 import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()

+ 10 - 0
src/views/recruit/personal/shareJob/sendResume/form/baseInfo.vue

@@ -0,0 +1,10 @@
+<!--  -->
+<template>
+  <div>vue3PageInit</div>
+</template>
+
+<script setup>
+defineOptions({name: 'shareJob-form-baseInfo'})
+</script>
+<style lang="scss" scoped>
+</style>

+ 1 - 1
src/views/recruit/personal/shareJob/components/baseInfo.vue → src/views/recruit/personal/shareJob/sendResume/form/upload.vue

@@ -4,7 +4,7 @@
 </template>
 
 <script setup>
-defineOptions({name: 'shareJob-baseInfo'})
+defineOptions({name: 'shareJob-form-upload'})
 </script>
 <style lang="scss" scoped>
 </style>

+ 10 - 0
src/views/recruit/personal/shareJob/sendResume/select.vue

@@ -0,0 +1,10 @@
+<!-- 选择简历 -->
+<template>
+  <div>vue3PageInit</div>
+</template>
+
+<script setup>
+defineOptions({name: 'shareJob-sendResume-select'})
+</script>
+<style lang="scss" scoped>
+</style>

+ 10 - 0
src/views/recruit/personal/shareJob/sendResume/upload.vue

@@ -0,0 +1,10 @@
+<!-- 上传简历 -->
+<template>
+  <div>vue3PageInit</div>
+</template>
+
+<script setup>
+defineOptions({name: 'shareJob-sendResume-upload'})
+</script>
+<style lang="scss" scoped>
+</style>