index.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div>
  3. <headCarousel></headCarousel>
  4. <div class="stickyBox py-5">
  5. <headSearch @handleSearch="handleSearch"></headSearch>
  6. </div>
  7. <hotJobs></hotJobs>
  8. <div class="default-width">
  9. <homeJobTypeCard></homeJobTypeCard>
  10. <advertisementPage class="my-3"></advertisementPage>
  11. <hotPromotedPositions></hotPromotedPositions>
  12. <PopularEnterprises class="mt-10"></PopularEnterprises>
  13. </div>
  14. </div>
  15. <!-- 快速填写简易人才信息-弹窗 -->
  16. <simplePage v-if="showSimplePage" :closeable="true" closeText="暂时跳过" @close="handleInfoClose" @simpleInfoReady="handleUpdateInfo"></simplePage>
  17. </template>
  18. <script setup>
  19. defineOptions({ name:'personal-index'})
  20. import simplePage from '@/views/recruit/personal/shareJob/sendResume/simple.vue'
  21. import headCarousel from './components/headCarousel.vue'
  22. import headSearch from '@/components/headSearch'
  23. import hotJobs from './components/hotJobs.vue'
  24. import homeJobTypeCard from './components/homeJobTypeCard'
  25. import hotPromotedPositions from './components/hotPromotedPositions.vue'
  26. import PopularEnterprises from './components/popularEnterprises.vue'
  27. import advertisementPage from './components/advertisement/index.vue'
  28. import { useRouter } from 'vue-router'
  29. import { nextTick, ref } from 'vue'
  30. import { useUserStore } from '@/store/user'
  31. import { getToken } from '@/utils/auth'
  32. const store = useUserStore()
  33. const router = useRouter()
  34. const simple = ref(localStorage.getItem('simpleCompleteDialogHaveBeenShow'))
  35. const showSimplePage = ref(false) // 只提示一次
  36. if (!getToken()) showSimplePage.value = false
  37. nextTick(() => {
  38. if (getToken()) {
  39. showSimplePage.value = simple.value && JSON.parse(simple.value) ? true : false
  40. }
  41. })
  42. const handleSearch = (val) => {
  43. if (val) router.push(`/recruit/personal/position?content=${val}`)
  44. }
  45. const handleInfoClose = () => {
  46. localStorage.setItem('simpleCompleteDialogHaveBeenShow', false)
  47. }
  48. // 更新用户基本信息
  49. const handleUpdateInfo = async () => {
  50. handleInfoClose()
  51. await store.getUserBaseInfos(null)
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .stickyBox {
  56. position: sticky;
  57. top: 48px;
  58. z-index: 999;
  59. background-color: var(--default-bgc);
  60. }
  61. </style>