header.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <nav class="client-head">
  3. <div class="client-container head-layout">
  4. <!-- H5 -->
  5. <div class="head-container-box mta-hidden-sm">
  6. <a :href="`${baseUrl}`" class="client-head-img"></a>
  7. <!-- H5菜单 -->
  8. <h5Nav :class="navClass" @click="navChange"></h5Nav>
  9. <!-- 手机按钮 -->
  10. <div class="phone-nav-btn mta-hidden-sm" :class="{open: isOpen, close: !isOpen}" @click="changeHeadNav"></div>
  11. </div>
  12. <!-- PC -->
  13. <div class="head-container-box mta-hidden-xs">
  14. <a :href="`${baseUrl}`" class="client-head-img"></a>
  15. <!-- PC菜单 -->
  16. <qgNav></qgNav>
  17. <div class="head-right">
  18. <a rel="nofollow" href="https://cdnks.mtavip.com/a/registerLogin" target="_blank">登录</a>
  19. <el-popover
  20. placement="bottom"
  21. trigger="hover"
  22. popper-class="head-popper-box system-popper-box"
  23. >
  24. <nuxt-link :to="item.url" v-for="(item,index) in systemList" :key="index" class="head-popper-item">
  25. <i></i>
  26. <p>
  27. <span class="head-popper-title">{{ item.title }}</span>
  28. <span class="head-popper-des">{{ item.des }}</span>
  29. </p>
  30. </nuxt-link>
  31. <a class="right-tel-btn" slot="reference">免费注册</a>
  32. </el-popover>
  33. </div>
  34. </div>
  35. </div>
  36. </nav>
  37. </template>
  38. <script>
  39. import mtaLink from '~/components/mtaLink/index';
  40. import qgNav from "~/components/qgNav";
  41. import H5Nav from "~/components/qgNav/H5Nav";
  42. import {mapGetters} from 'vuex';
  43. let _ = require('lodash');
  44. export default {
  45. name: 'mtaHeader',
  46. components: {
  47. mtaLink,
  48. qgNav,
  49. H5Nav
  50. },
  51. computed: {
  52. activeNav() {
  53. return this.getActiveNav;
  54. },
  55. isOpen() {
  56. return this.navClass === 'head-nav-up'
  57. },
  58. baseUrl() {
  59. return this.getBaseUrl;
  60. },
  61. ...mapGetters(['getActiveNav', 'getBaseUrl'])
  62. },
  63. data() {
  64. return {
  65. systemList: [
  66. {
  67. title: '考试系统',
  68. des: '简单好用的SaaS考试系统',
  69. url: 'https://cdnks.mtavip.com/a/register?flug=1'
  70. },
  71. {
  72. title: '培训系统',
  73. des: '学练考评一站式培训系统',
  74. url: 'https://cdnks.mtavip.com/a/register?flug=2'
  75. },
  76. ],
  77. navClass: 'head-nav-up',
  78. headerArr: [
  79. {
  80. content: '首页',
  81. keyPath: '/',
  82. },
  83. {
  84. content: '考试系统',
  85. keyPath: '/examsystem',
  86. children: [],
  87. },
  88. {
  89. content: '培训系统',
  90. keyPath: '/trainsystem',
  91. children: [],
  92. },
  93. /* {
  94. content: '课程资源',
  95. keyPath: '/resources',
  96. children: [],
  97. },*/
  98. {
  99. content: '体验中心',
  100. keyPath: '/tiyanCenter',
  101. children: [],
  102. },
  103. {
  104. content: '课程开发',
  105. keyPath: '/courseware',
  106. children: [],
  107. },
  108. {
  109. content: '客户案例',
  110. keyPath: '/news',
  111. children: [],
  112. },
  113. /* {
  114. content: '帮助中心',
  115. keyPath: '/helpCenter',
  116. children: [],
  117. },*/
  118. {
  119. content: '关于我们',
  120. keyPath: '/introduction',
  121. children: [],
  122. },
  123. ],
  124. };
  125. },
  126. methods: {
  127. // 点击按钮菜单变化
  128. changeHeadNav() {
  129. if (this.navClass === 'head-nav-up') {
  130. this.navClass = 'head-nav-down'
  131. } else {
  132. this.navClass = 'head-nav-up'
  133. }
  134. },
  135. navChange() {
  136. this.navClass = 'head-nav-up'
  137. },
  138. },
  139. };
  140. </script>