|
@@ -8,22 +8,90 @@
|
|
|
<div class="china cursor-pointer" @click="emit('click', '/headhunting')">中国</div>
|
|
|
</div>
|
|
|
<div class="d-flex align-center">
|
|
|
- <div v-for="(k, index) in navList" :key="index" class="list-item cursor-pointer font-size-15" :class="{'mr-5': index !== navList.length - 1}" @click="emit('click', k.path)">
|
|
|
+ <div v-for="(k, index) in navList" :key="index" class="list-item cursor-pointer font-size-15" :class="{'mr-5': index !== navList.length - 1}" @click="handleClick(k)">
|
|
|
{{ k.title }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 联系我们 -->
|
|
|
+ <CtDialog :visible="showDialog" titleClass="text-h6" :footer="true" :widthType="2" title="联系我们" @submit="handleSubmit" @close="handleClose">
|
|
|
+ <CtForm ref="formPageRef" :items="formItems"></CtForm>
|
|
|
+ </CtDialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
defineOptions({ name: 'headhunting-nav'})
|
|
|
+import { ref } from 'vue'
|
|
|
+import { huntSubmit } from '@/api/headhunting'
|
|
|
+import Curtain from '@/plugins/curtain'
|
|
|
|
|
|
const emit = defineEmits(['click'])
|
|
|
const navList = [
|
|
|
{ title: '我们的服务', path: '/headhunting/service' },
|
|
|
- { title: '候选人', path: '/login' }
|
|
|
+ { title: '候选人', path: '/login' },
|
|
|
+ { title: '联系我们', key: 'contact' }
|
|
|
]
|
|
|
+
|
|
|
+const formPageRef = ref()
|
|
|
+const formItems = ref({
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ type: 'text',
|
|
|
+ key: 'name',
|
|
|
+ value: '',
|
|
|
+ label: '姓名 *',
|
|
|
+ clearable: true,
|
|
|
+ outlined: true,
|
|
|
+ rules: [v => !!v || '请输入姓名']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'phoneNumber',
|
|
|
+ key: 'phone',
|
|
|
+ value: '',
|
|
|
+ clearable: true,
|
|
|
+ label: '联系手机号 *',
|
|
|
+ rules: [v => !!v || '请填写联系手机号']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'text',
|
|
|
+ key: 'enterpriseName',
|
|
|
+ value: '',
|
|
|
+ label: '企业名称 *',
|
|
|
+ clearable: true,
|
|
|
+ outlined: true,
|
|
|
+ rules: [v => !!v || '请输入企业名称']
|
|
|
+ },
|
|
|
+ ]
|
|
|
+})
|
|
|
+
|
|
|
+const showDialog = ref(false)
|
|
|
+const handleClick = (k) => {
|
|
|
+ if (k.path) emit('click', k.path)
|
|
|
+ if (k.key === 'contact') showDialog.value = true
|
|
|
+}
|
|
|
+
|
|
|
+// 联系我们
|
|
|
+const handleClose = () => {
|
|
|
+ showDialog.value = false
|
|
|
+ formItems.value.options.forEach(e => e.value = '')
|
|
|
+}
|
|
|
+
|
|
|
+const handleSubmit = async () => {
|
|
|
+ const { valid } = await formPageRef.value.formRef.validate()
|
|
|
+ if (!valid) return
|
|
|
+ const obj = {}
|
|
|
+ formItems.value.options.forEach(e => obj[e.key] = e.value)
|
|
|
+ await huntSubmit(obj)
|
|
|
+ handleClose()
|
|
|
+ Curtain('message', {
|
|
|
+ message: '提交成功,我们会尽快与您联系',
|
|
|
+ name: 'submit',
|
|
|
+ color: '#00897B',
|
|
|
+ iconFontSize: 300
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|