index.vue 5.8 KB

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