瀏覽代碼

门墩儿猎头-联系我们

Xiao_123 6 月之前
父節點
當前提交
59413986d1
共有 2 個文件被更改,包括 78 次插入8 次删除
  1. 70 2
      src/views/headhunting/components/nav.vue
  2. 8 6
      src/views/mall/purchasePackage/components/packageList.vue

+ 70 - 2
src/views/headhunting/components/nav.vue

@@ -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">

+ 8 - 6
src/views/mall/purchasePackage/components/packageList.vue

@@ -1,14 +1,14 @@
 <!--  -->
 <template>
   <div class="d-flex mt-5 list">
-    <div v-for="(val, i) in packDataList" :key="i" class="list-item cursor-pointer" :class="{'active': active === i }" @click="handleClickItem(val, i)">
+    <div v-for="(val, i) in packDataList" :key="i" class="list-item cursor-pointer elevation-2" :class="{'active': active === i }" @click="handleClickItem(val, i)">
       <div v-if="val.id === userStore.userInfo?.vipFlag && userStore.userInfo?.vipExpireDate && userStore.userInfo?.vipExpireDate > Date.now()" class="recommend long">我的套餐</div>
       <div v-if="val.recommend" class="recommend">推荐</div>
       <div class="text-center font-weight-bold">{{ val.name }}</div>
       <div class="text-center my-5">
         <div v-if="val.price && !val.cycle">
-          <span class="font-weight-bold font-size-20">{{ val.price }}</span>
+          <span class="font-weight-bold font-size-20">{{ val.price / 100 }}</span>
           <!-- /年 -->
         </div>
         <div v-if="val.cycle">¥<span class="font-weight-bold font-size-18 font-size-20">{{ val.price }}</span><span class="font-size-14 mr-3">起</span>  {{ val.cycle }}</div>
@@ -47,7 +47,8 @@
         <v-btn
           color="error"
           variant="outlined"
-          rounded 
+          rounded
+          :disabled="Number(val.id) < Number(userStore.userInfo?.vipFlag)"
           :loading="val.loading"
           @click="createOrder(val)"
         >开通会员</v-btn>
@@ -106,10 +107,10 @@ const packDataList = ref([])
 const getData = async () => {
   const data = await getMembershipPackageList()
   if (!data?.length) return
-  let vipFlagIndex = null
+  // let vipFlagIndex = null
   const list = data.map((item, index) => {
     item.id = item.id?.toString()
-    if (item.id === userStore.userInfo?.vipFlag) vipFlagIndex = index // 低于当前套餐的(套餐)不展示
+    // if (item.id === userStore.userInfo?.vipFlag) vipFlagIndex = index // 低于当前套餐的(套餐)不展示
     if (item.recommend) active.value = index // 推荐套餐
     return {
       ...item,
@@ -119,7 +120,8 @@ const getData = async () => {
     }
   })
   // 低于当前套餐的(套餐)不展示
-  packDataList.value = vipFlagIndex ? list.slice(vipFlagIndex) : list
+  // packDataList.value = vipFlagIndex ? list.slice(vipFlagIndex) : list
+  packDataList.value = list
 }
 getData()