header.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 productRectangle" @mouseenter="mouseenter('product', true)" @mouseleave="mouseleave('product')"><span :class="`${ productFlag && 'item-hover' }`">产品矩阵</span></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) ? rightCilckUrl[urlFiled] && rightCilckUrl[urlFiled].signIn : 'http://worktime.ttkuaiban.com/#/register'" :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) ? rightCilckUrl[urlFiled] && rightCilckUrl[urlFiled].logIn : 'http://worktime.ttkuaiban.com/#/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. <img :src="otherItemIndex == index ? item.hoverIcon : item.icon" alt="">
  48. <a :href="item.path" target="_top">{{ item.label }}</a>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </body>
  56. <script>
  57. new Vue({
  58. el: "#app",
  59. data: {
  60. leftItemIndex: null,
  61. rightItemIndex: null,
  62. otherItemIndex: null,
  63. productFlag: false,
  64. productTimer: null,
  65. leftItemList: [
  66. { label: '客户评价', value: '../index.html#customer', class: 'header-item' },
  67. { label: '手机版', value: '../mobile.html', class: 'header-item' },
  68. { label: '产品定价', value: '../index.html#pricing', class: 'header-item' },
  69. { label: '关于我们', value: '../about.html', class: 'header-item' },
  70. { label: '企业动态', value: '../dynamic.html', class: 'header-item' },
  71. { label: '知识园地', value: '../knowledgeField.html', class: 'header-item' },
  72. ],
  73. otherList: [
  74. { label: '工时管家', path: '../index.html', icon: './image/icon/client.png', hoverIcon: './image/icon/workHourHover.png' },
  75. { label: '随访管家', path: '../followup.html', icon: './image/icon/client.png', hoverIcon: './image/icon/workHourHover.png' },
  76. { label: '项目管家', path: '../project.html', icon: './image/icon/project.png', hoverIcon: './image/icon/workHourHover.png' },
  77. { label: '客户管家', path: '../customerNew.html', icon: './image/icon/follow.png', hoverIcon: './image/icon/workHourHover.png' },
  78. { label: '生产车间管家', path: '../workshop.html', icon: './image/icon/production.png', hoverIcon: './image/icon/workHourHover.png' },
  79. ],
  80. showRight: true,
  81. urlFiled: 'index',
  82. rightCilckUrl: {
  83. index: { signIn: 'http://worktime.ttkuaiban.com/#/register', logIn: 'http://worktime.ttkuaiban.com/#/login' },
  84. followup: { signIn: 'http://clinic.ttkuaiban.com/#/register', logIn: 'http://clinic.ttkuaiban.com/#/login' },
  85. project: { signIn: 'http://worktime.ttkuaiban.com/#/register', logIn: 'http://worktime.ttkuaiban.com/#/login' },
  86. customerNew: { signIn: 'http://crm.ttkuaiban.com/register', logIn: 'http://crm.ttkuaiban.com/login' },
  87. workshop: { signIn: '', logIn: 'http://workshop.ttkuaiban.com' },
  88. mobile: { signIn: 'http://worktime.ttkuaiban.com/#/register', logIn: 'http://worktime.ttkuaiban.com/#/login' },
  89. }
  90. },
  91. mounted () {
  92. this.processingData()
  93. },
  94. methods: {
  95. processingData() {
  96. const urls = window.parent.location.href
  97. const filed = urls.match(/\/([^\/]+)\.html$/) && urls.match(/\/([^\/]+)\.html$/)[1];
  98. const strList = ['dynamic', 'about']
  99. this.urlFiled = filed
  100. this.showRight = !strList.includes(filed)
  101. },
  102. toPath(item) {
  103. console.log(item, '<==== 看看数据')
  104. },
  105. mouseenter(type, index) {
  106. if(type == 'left') {
  107. this.leftItemIndex = index
  108. }
  109. if(type == 'right') {
  110. this.rightItemIndex = index
  111. }
  112. if(type == 'other') {
  113. this.otherItemIndex = index
  114. }
  115. if(type == 'product') {
  116. if(this.productTimer) {
  117. clearTimeout(this.productTimer)
  118. }
  119. this.productFlag = true
  120. }
  121. },
  122. mouseleave(type) {
  123. if(type == 'left') {
  124. this.leftItemIndex = null
  125. }
  126. if(type == 'right') {
  127. this.rightItemIndex = null
  128. }
  129. if(type == 'other') {
  130. this.otherItemIndex = null
  131. }
  132. if(type == 'product') {
  133. this.productTimer = setTimeout(() => {
  134. this.productFlag = false
  135. }, 200)
  136. }
  137. }
  138. },
  139. })
  140. </script>
  141. </html>