header.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <link rel="stylesheet" href="./css/reset.css">
  7. <link rel="stylesheet" href="./css/header.css">
  8. <link rel="stylesheet" href="../css/element-uiCss.css">
  9. <script src="../js/vue.min.js"></script>
  10. <script src="../js/element-ui.js"></script>
  11. <script src="./js/setRem.js"></script>
  12. </head>
  13. <body>
  14. <div id="app">
  15. <div class="headerView">
  16. <div class="headerView-left">
  17. <div class="header-logo">
  18. <img id="logo" src="./image/logos.jpg" class="img" alt="">
  19. <!-- <img id="logo" src="./image/logo.jpg" class="img" alt=""> -->
  20. <!-- <img src="./image/logo.png" class="img" alt=""> -->
  21. </div>
  22. <div class="header-list" @mouseleave="mouseleave('left')">
  23. <div class="header-item" @mouseenter="mouseenter('product', true)" @mouseleave="mouseleave('product')">产品矩形</div>
  24. <div v-for="(item, index) in leftItemList" :key="index" @mouseenter="mouseenter('left', index)" :class="`${item.class}`">
  25. <a :href="item.value" target="_top" :class="`${ leftItemIndex == index ? 'item-hover' : '' }`"> {{ item.label }} </a>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="headerView-right">
  30. <div class="header-list" @mouseleave="mouseleave('right')" v-if="showRight">
  31. <div :class="`header-item`" @mouseenter="mouseenter('right', 1)" v-if="urlFiled != 'workshop'">
  32. <a :href="rightCilckUrl[urlFiled] && rightCilckUrl[urlFiled].signIn" :class="`${ rightItemIndex == 1 ? 'item-hover' : '' }`" target="_top">立即注册</a>
  33. </div>
  34. <div :class="`header-item`" @mouseenter="mouseenter('right', 0)">
  35. <a :href="rightCilckUrl[urlFiled] && rightCilckUrl[urlFiled].logIn" :class="`${ rightItemIndex == 0 ? 'item-hover' : '' }`" target="_top">后台登陆</a>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <!-- 产品矩形 -->
  41. <div class="headerProduct" v-if="productFlag" @mouseenter="mouseenter('product', true)" @mouseleave="mouseleave('product')">
  42. <div class="content">
  43. <div class="product">
  44. <div class="product-title">火石企业办公套件</div>
  45. <div class="product-list" @mouseleave="mouseleave('other')">
  46. <div :class="`product-item ${otherItemIndex == index ? 'hove' : ''}`" v-for="(item, index) in otherList" :key="index" @click="toPath(item)" @mouseenter="mouseenter('other', index)">
  47. <a :href="item.path" target="_top">{{ item.label }}</a>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </body>
  55. <script>
  56. new Vue({
  57. el: "#app",
  58. data: {
  59. leftItemIndex: null,
  60. rightItemIndex: null,
  61. otherItemIndex: null,
  62. productFlag: false,
  63. productTimer: null,
  64. leftItemList: [
  65. { label: '客户评价', value: '../index.html#customer', class: 'header-item' },
  66. { label: '手机版', value: '../mobile.html', class: 'header-item' },
  67. { label: '产品定价', value: '../index.html#pricing', class: 'header-item' },
  68. { label: '关于我们', value: '../about.html', class: 'header-item' },
  69. { label: '企业动态', value: '../dynamic.html', class: 'header-item' },
  70. ],
  71. otherList: [
  72. { label: '工时管家', path: '../index.html' },
  73. { label: '随访管家', path: '../followup.html' },
  74. { label: '项目管家', path: '../project.html' },
  75. { label: '客户管家', path: '../customerNew.html' },
  76. { label: '生产车间管家', path: '../workshop.html' },
  77. ],
  78. showRight: true,
  79. urlFiled: 'index',
  80. rightCilckUrl: {
  81. index: { signIn: 'http://worktime.ttkuaiban.com/#/register', logIn: 'http://worktime.ttkuaiban.com/#/login' },
  82. followup: { signIn: 'http://clinic.ttkuaiban.com/#/register', logIn: 'http://clinic.ttkuaiban.com/#/login' },
  83. project: { signIn: 'http://worktime.ttkuaiban.com/#/register', logIn: 'http://worktime.ttkuaiban.com/#/login' },
  84. customerNew: { signIn: '#', logIn: '#' },
  85. workshop: { signIn: '', logIn: 'http://workshop.ttkuaiban.com' },
  86. mobile: { signIn: 'http://worktime.ttkuaiban.com/#/register', logIn: 'http://worktime.ttkuaiban.com/#/login' },
  87. }
  88. },
  89. mounted () {
  90. this.processingData()
  91. },
  92. methods: {
  93. processingData() {
  94. const urls = window.parent.location.href
  95. const filed = urls.match(/\/([^\/]+)\.html$/) && urls.match(/\/([^\/]+)\.html$/)[1];
  96. const strList = ['dynamic', 'about']
  97. this.urlFiled = filed
  98. this.showRight = !strList.includes(filed)
  99. },
  100. toPath(item) {
  101. console.log(item, '<==== 看看数据')
  102. },
  103. mouseenter(type, index) {
  104. if(type == 'left') {
  105. this.leftItemIndex = index
  106. }
  107. if(type == 'right') {
  108. this.rightItemIndex = index
  109. }
  110. if(type == 'other') {
  111. this.otherItemIndex = index
  112. }
  113. if(type == 'product') {
  114. if(this.productTimer) {
  115. clearTimeout(this.productTimer)
  116. }
  117. this.productFlag = true
  118. }
  119. },
  120. mouseleave(type) {
  121. if(type == 'left') {
  122. this.leftItemIndex = null
  123. }
  124. if(type == 'right') {
  125. this.rightItemIndex = null
  126. }
  127. if(type == 'other') {
  128. this.otherItemIndex = null
  129. }
  130. if(type == 'product') {
  131. this.productTimer = setTimeout(() => {
  132. this.productFlag = false
  133. }, 200)
  134. }
  135. }
  136. },
  137. })
  138. </script>
  139. </html>