index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!-- 门墩儿猎寻服务 -->
  2. <template>
  3. <div class="headhunting">
  4. <div class="headhunting-title">高端人才猎寻</div>
  5. <div class="headhunting-guidance" @click="showDialog = true">免费咨询</div>
  6. <div class="headhunting-title">高端人才猎寻</div>
  7. <!-- <div class="headhunting-content pa-8 py-12">
  8. <formItem ref="formRef"></formItem>
  9. <div class="text-center">
  10. <v-btn color="#474747" rounded class="buttons" @click="handleSubmit">提交</v-btn>
  11. </div>
  12. </div> -->
  13. <CtDialog
  14. :visible="showDialog"
  15. :widthType="2"
  16. titleClass="text-h6"
  17. title="门墩儿猎寻服务"
  18. @submit="handleSubmit"
  19. >
  20. <formItem ref="formRef"></formItem>
  21. </CtDialog>
  22. </div>
  23. </template>
  24. <script setup>
  25. import { ref } from 'vue'
  26. import formItem from './components/form.vue'
  27. import Curtain from '@/plugins/curtain'
  28. import { huntSubmit } from '@/api/headhunting'
  29. import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
  30. defineOptions({ name: 'headhunting-index'})
  31. const showDialog = ref(false)
  32. // 提交
  33. const formRef = ref()
  34. const handleSubmit = async () => {
  35. try {
  36. const obj = await formRef.value.getQuery()
  37. if (!obj) return
  38. const params = JSON.parse(JSON.stringify(obj))
  39. await huntSubmit(params)
  40. showDialog.value = false
  41. Curtain('message', {
  42. message: t('headhunting.submitSuccess'),
  43. icon: 'mdi mdi-check-circle-outline',
  44. iconColor: 'green',
  45. })
  46. } catch (error) {
  47. console.error('error', error)
  48. }
  49. }
  50. </script>
  51. <style scoped lang="scss">
  52. .headhunting {
  53. position: relative;
  54. width: 100%;
  55. height: 100%;
  56. // background-color: var(--default-bgc);
  57. background-image: url('https://minio.citupro.com/dev/menduner/%E9%97%A8%E5%A2%A9%E7%8C%8E%E5%AF%BB%E6%9C%8D%E5%8A%A1%E8%83%8C%E6%99%AF%E5%9B%BE%E7%89%87.jpg');
  58. background-size: cover;
  59. }
  60. // .headhunting::before {
  61. // content: ""; /* 必须添加,因为伪元素是空的 */
  62. // position: absolute; /* 绝对定位,相对于最近的已定位(即非static)祖先元素 */
  63. // top: 0; /* 遮罩层顶部与元素顶部对齐 */
  64. // left: 0; /* 遮罩层左侧与元素左侧对齐 */
  65. // right: 0; /* 遮罩层右侧与元素右侧对齐 */
  66. // bottom: 0; /* 遮罩层底部与元素底部对齐 */
  67. // background-color: rgba(0, 0, 0, 0.1); /* 遮罩层颜色,半透明黑色 */
  68. // // z-index: -1; /* 确保遮罩层在背景图片之下(通常不需要,因为伪元素默认就在内容之下) */
  69. // }
  70. .headhunting-title {
  71. position: absolute;
  72. top: 45px;
  73. left: 100px;
  74. font-size: 24px;
  75. font-weight: bold;
  76. }
  77. .headhunting-guidance {
  78. position: absolute;
  79. top: 45px;
  80. right: 200px;
  81. font-size: 18px;
  82. color: #666;
  83. cursor: pointer;
  84. }
  85. .headhunting-content {
  86. position: absolute;
  87. bottom: 30px;
  88. left: 250px;
  89. width: 350px;
  90. }
  91. </style>