index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <div class="header-nav">
  3. <nuxt-link to="/" :class="{active : curActive === 'shouye'}">首页</nuxt-link>
  4. <el-popover
  5. placement="bottom"
  6. trigger="hover"
  7. popper-class="head-popper-box cp-popper-box"
  8. >
  9. <nuxt-link :to="item.url" v-for="(item,index) in chanpinfuwu" :key="index" class="head-popper-item">
  10. <i></i>
  11. <p>
  12. <span class="head-popper-title">{{ item.title }}</span>
  13. <span class="head-popper-des">{{ item.des }}</span>
  14. </p>
  15. </nuxt-link>
  16. <span class="head-nav-btn" slot="reference" :class="{active: curActive === 'chanpinyufuwu'}">产品与服务<i class="el-icon-arrow-down el-icon--right"></i></span>
  17. </el-popover>
  18. <el-popover
  19. placement="bottom"
  20. trigger="hover"
  21. popper-class="head-popper-box jj-popper-box"
  22. >
  23. <div class="head-popper-content">
  24. <div>
  25. <h3>场景解决方案</h3>
  26. <div class="head-popper-cj-row">
  27. <nuxt-link :to="item.url" v-for="(item,index) in changjing" :key="index" class="head-popper-item">
  28. <i></i>
  29. <p>
  30. <span class="head-popper-title">{{ item.title }}</span>
  31. <span class="head-popper-des">{{ item.des }}</span>
  32. </p>
  33. </nuxt-link>
  34. </div>
  35. </div>
  36. <em></em>
  37. <div>
  38. <h3>行业解决方案</h3>
  39. <div class="head-popper-hy-row">
  40. <nuxt-link :to="item.url" v-for="(item,index) in hangye" :key="index" class="head-popper-item">
  41. <i></i>
  42. <p>
  43. <span class="head-popper-title">{{ item.title }}</span>
  44. <span class="head-popper-des">{{ item.des }}</span>
  45. </p>
  46. </nuxt-link>
  47. </div>
  48. </div>
  49. </div>
  50. <span class="head-nav-btn" slot="reference" :class="{active: curActive === 'jiejuefangan'}">解决方案<i class="el-icon-arrow-down el-icon--right"></i></span>
  51. </el-popover>
  52. <nuxt-link to="/news" :class="{active: curActive === 'news'}">新闻资讯</nuxt-link>
  53. <nuxt-link to="/introduction" :class="{active: curActive === 'introduction'}">关于我们</nuxt-link>
  54. </div>
  55. </template>
  56. <script>
  57. export default {
  58. name: "qg-nav",
  59. data() {
  60. return {
  61. chanpinfuwu: [
  62. {
  63. title: '考试系统',
  64. des: '一款简单、好用的考试系统',
  65. url: '/product/exam'
  66. },
  67. {
  68. title: '培训系统',
  69. des: '企业一站式在线培训系统',
  70. url: '/product/peixun'
  71. },
  72. {
  73. title: '课程定制',
  74. des: '为企业量身定做专属课程',
  75. url: '/product/courseCustom'
  76. },
  77. {
  78. title: '课程资源',
  79. des: '企业优质通用课程资源',
  80. url: '/product/courseResource'
  81. }
  82. ],
  83. changjing: [
  84. {
  85. img: '#',
  86. title: '严肃考试',
  87. des: '智能防作弊解决方案',
  88. url: '/solution/exam',
  89. },
  90. {
  91. img: '#',
  92. title: '企业培训',
  93. des: '企业在线培训解决方案',
  94. url: '/solution/peixun'
  95. },
  96. {
  97. img: '#',
  98. title: '万人高并发',
  99. des: '系统高并发解决方案',
  100. url: '/solution/erupt'
  101. },
  102. {
  103. img: '#',
  104. title: '私有化部署',
  105. des: '企业私有化解决方案',
  106. url: '/solution/privatization'
  107. }
  108. ],
  109. hangye: [
  110. {
  111. img: '#',
  112. title: '机关事业单位',
  113. des: '机关事业单位培训解决方案',
  114. url: '/solution/government'
  115. },
  116. {
  117. img: '#',
  118. title: '教育机构',
  119. des: '教育培行业解决方案',
  120. url: '/solution/education'
  121. },
  122. {
  123. img: '#',
  124. title: '能源化工',
  125. des: '能源化工行业解决方案',
  126. url: '/solution/energy'
  127. },
  128. {
  129. img: '#',
  130. title: '金融保险',
  131. des: '金融保险行业解决方案',
  132. url: '/solution/financial'
  133. },
  134. {
  135. img: '#',
  136. title: '食品餐饮',
  137. des: '食品餐饮行业解决方案',
  138. url: '/solution/biteAndSup'
  139. },
  140. {
  141. img: '#',
  142. title: '交通运输',
  143. des: '交通运输行业解决方案',
  144. url: '/solution/transportation'
  145. },
  146. {
  147. img: '#',
  148. title: '医疗行业',
  149. des: '医疗行业解决方案',
  150. url: '/solution/medical'
  151. }
  152. ],
  153. }
  154. },
  155. computed: {
  156. curActive() {
  157. const chanpinyufuwu = this.chanpinfuwu.map(item => item.url);
  158. const jiejuefangan = this.changjing.map(item => item.url);
  159. const jiejuefangan2 = this.hangye.map(item => item.url);
  160. const routerPath = this.$route.path
  161. // 首页
  162. if (routerPath === '/' || routerPath === '/index') {
  163. return 'shouye'
  164. } else if (routerPath === '/news') {
  165. return 'news'
  166. } else if (routerPath === '/introduction') {
  167. return 'introduction'
  168. } else if (chanpinyufuwu.some(path => path === routerPath)) {
  169. return 'chanpinyufuwu'
  170. } else if (jiejuefangan.some(path => path === routerPath)) {
  171. return 'jiejuefangan'
  172. } else if (jiejuefangan2.some(path => path === routerPath)) {
  173. return 'jiejuefangan'
  174. }
  175. }
  176. }
  177. }
  178. </script>