header.html 5.7 KB

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