header.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <div class="flex w-full h-[100px] title fixed top-0 left-0 bottom-0 z-20 bg-[#fff]"
  3. style="border-bottom: 1px solid #E1E1E1;">
  4. <div class="flex-[1]"></div>
  5. <div class="h-[100px] bg-[#fff] flex items-center justify-between w-[1200px]"
  6. style="border-bottom: 1px solid #E1E1E1;">
  7. <!-- 头部title -->
  8. <div class="flex items-center">
  9. <img src="~/public/favicon.ico" class="w-[50px] h-[50px] mr-[10px]" alt="">
  10. <div class="flex flex-col">
  11. <span class="text-[#333333] text-[24px] font-medium">惠融易客</span>
  12. <span class="text-[16px] font-light">
  13. HUIRONG CRM
  14. </span>
  15. </div>
  16. </div>
  17. <!-- 右边 -->
  18. <ul class='flex items-center'>
  19. <li v-for="i in headerTitle" :key="i.go" @mouseenter="mouseenterFn(i.go)" @mouseleave="mouseleaveFn"
  20. :class="headerClass == i.go ? 'text-[#1f4df5!important]' : ''" @click="titleRight(i.go)"
  21. class="pr-[70px] text-[#999999] cursor-pointer text-[18px]">
  22. {{ i.title }}
  23. </li>
  24. <li class="px-[16px] text-[#999999] font-medium" @click="loginBtn">
  25. <!-- <n-button type="info" class="bg-[#165DFF] text-[18px] w-[130px] h-[42px]" style="border-radius: 6px;" >
  26. 登录/注册
  27. </n-button> -->
  28. <van-button type="primary"> 登录/注册</van-button>
  29. </li>
  30. </ul>
  31. </div>
  32. <div class="flex-[1]">
  33. </div>
  34. </div>
  35. </template>
  36. <script lang="ts" setup>
  37. const headerTitle = reactive([
  38. {
  39. title: '首页',
  40. go: 'home'
  41. },
  42. {
  43. title: '解决方案',
  44. go: 'solution'
  45. },
  46. {
  47. title: '联系我们',
  48. go: 'contact'
  49. },
  50. {
  51. title: '申请试用',
  52. go: 'probation'
  53. }
  54. ]
  55. )
  56. const headerClass = ref<string>('')
  57. const mouseenterFn = (i: string) => {
  58. // console.log('mouseenterFn')
  59. headerClass.value = i
  60. }
  61. const mouseleaveFn = () => {
  62. headerClass.value = ''
  63. }
  64. const titleRight = (i: string) => {
  65. if (i == 'probation') {
  66. // btn()
  67. return
  68. }
  69. document.querySelector('#' + i)?.scrollIntoView()
  70. }
  71. const loginBtn = () => {
  72. console.log('跳转')
  73. // window.location.replace('http://p.daicrm.com/#/login')
  74. window.open('http://p.daicrm.com/#/login')
  75. // window.location.href('http://p.daicrm.com/#/login')
  76. }
  77. </script>