H5Nav.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <div class="phone-popper-box">
  3. <nuxt-link to="/" :class="{'menu-active': curActive === 'shouye'}">首页</nuxt-link>
  4. <el-collapse>
  5. <el-collapse-item title="产品与服务" :class="{'menu-active': curActive === 'chanpinyufuwu'}">
  6. <nuxt-link :to="item.url" v-for="(item,index) in chanpinfuwu" :key="index" class="cpfw-popper-item">
  7. <i></i>
  8. <p>
  9. <span class="phone-popper-title">{{ item.title }}</span>
  10. <span class="phone-popper-des">{{ item.des }}</span>
  11. </p>
  12. </nuxt-link>
  13. </el-collapse-item>
  14. <el-collapse-item title="解决方案" :class="{'menu-active': curActive === 'jiejuefangan'}">
  15. <div class="jjfa-popper-content">
  16. <h3>场景解决方案</h3>
  17. <div class="jjfa-link-box">
  18. <nuxt-link :to="item.url" v-for="item in changjing" :key="item.url">
  19. <span class="jjfa-popper-title">{{item.title}}</span>
  20. </nuxt-link>
  21. </div>
  22. </div>
  23. <div class="jjfa-popper-content">
  24. <h3>行业解决方案</h3>
  25. <div class="jjfa-link-box">
  26. <nuxt-link :to="item.url" v-for="item in hangye" :key="item.url">
  27. <span class="jjfa-popper-title">{{item.title}}</span>
  28. </nuxt-link>
  29. </div>
  30. </div>
  31. </el-collapse-item>
  32. </el-collapse>
  33. <nuxt-link to="/news" class="xwzx-row" :class="{'menu-active': curActive === 'news'}">新闻资讯</nuxt-link>
  34. <nuxt-link to="/introduction" :class="{'menu-active': curActive === 'introduction'}">关于我们</nuxt-link>
  35. </div>
  36. </template>
  37. <script>
  38. export default {
  39. name: "H5Nav",
  40. data() {
  41. return {
  42. chanpinfuwu: [
  43. {
  44. img: '#',
  45. title: '考试系统',
  46. des: '一款简单、好用的考试系统',
  47. url: '/product/exam'
  48. },
  49. {
  50. img: '#',
  51. title: '培训系统',
  52. des: '企业一站式在线培训系统',
  53. url: '/product/peixun'
  54. },
  55. {
  56. img: '#',
  57. title: '课程定制',
  58. des: '为企业量身定做专属课程',
  59. url: '/product/courseCustom'
  60. },
  61. {
  62. img: '#',
  63. title: '通用课程',
  64. des: '企业优质通用课程资源',
  65. url: '/product/courseResource'
  66. }
  67. ],
  68. changjing: [
  69. {
  70. img: '#',
  71. title: '严肃考试',
  72. des: '智能防作弊解决方案',
  73. url: '/solution/exam',
  74. },
  75. {
  76. img: '#',
  77. title: '企业培训',
  78. des: '企业在线培训解决方案',
  79. url: '/solution/peixun'
  80. },
  81. {
  82. img: '#',
  83. title: '万人高并发',
  84. des: '系统高并发解决方案',
  85. url: '/solution/erupt'
  86. },
  87. {
  88. img: '#',
  89. title: '私有化部署',
  90. des: '企业私有化解决方案',
  91. url: '/solution/privatization'
  92. }
  93. ],
  94. hangye: [
  95. {
  96. img: '#',
  97. title: '政府机构',
  98. des: '政府机构培训解决方案',
  99. url: '/solution/government'
  100. },
  101. {
  102. img: '#',
  103. title: '教育机构',
  104. des: '教育培行业解决方案',
  105. url: '/solution/education'
  106. },
  107. {
  108. img: '#',
  109. title: '能源化工',
  110. des: '能源化工行业解决方案',
  111. url: '/solution/energy'
  112. },
  113. {
  114. img: '#',
  115. title: '金融保险',
  116. des: '金融保险行业解决方案',
  117. url: '/solution/financial'
  118. },
  119. {
  120. img: '#',
  121. title: '食品餐饮',
  122. des: '食品餐饮行业解决方案',
  123. url: '/solution/biteAndSup'
  124. },
  125. {
  126. img: '#',
  127. title: '交通运输',
  128. des: '交通运输行业解决方案',
  129. url: '/solution/transportation'
  130. },
  131. {
  132. img: '#',
  133. title: '医疗行业',
  134. des: '医疗行业解决方案',
  135. url: '/solution/medical'
  136. }
  137. ],
  138. }
  139. },
  140. computed: {
  141. curActive() {
  142. const chanpinyufuwu = this.chanpinfuwu.map(item => item.url);
  143. const jiejuefangan = this.changjing.map(item => item.url);
  144. const jiejuefangan2 = this.hangye.map(item => item.url);
  145. const routerPath = this.$route.path
  146. // 首页
  147. if (routerPath === '/' || routerPath === '/index') {
  148. return 'shouye'
  149. } else if (routerPath === '/news') {
  150. return 'news'
  151. } else if (routerPath === '/introduction') {
  152. return 'introduction'
  153. } else if (chanpinyufuwu.some(path => path === routerPath)) {
  154. return 'chanpinyufuwu'
  155. } else if (jiejuefangan.some(path => path === routerPath)) {
  156. return 'jiejuefangan'
  157. } else if (jiejuefangan2.some(path => path === routerPath)) {
  158. return 'jiejuefangan'
  159. }
  160. }
  161. },
  162. watch: {
  163. '$route.path': {
  164. handler(newVal) {
  165. console.log(newVal)
  166. this.$emit('navChange')
  167. },
  168. immediate: true,
  169. }
  170. }
  171. }
  172. </script>
  173. <style lang="scss">
  174. .phone-popper-box {
  175. position: absolute;
  176. top: 61px;
  177. background: #fff;
  178. width: 100%;
  179. left: 0;
  180. padding: 0 15px;
  181. box-sizing: border-box;
  182. overflow: auto;
  183. height: calc(100vh - 112px);
  184. >a,.el-collapse-item__header{
  185. height: 60px;
  186. line-height: 60px;
  187. display: block;
  188. font-size: 16px;
  189. color: #101010;
  190. font-weight: 700;
  191. }
  192. .el-collapse-item__header{ display: flex;}
  193. // 新闻资讯
  194. .xwzx-row{border-bottom: 1px solid #EBEEF5;}
  195. // 产品服务 - 二级菜单
  196. .cpfw-popper-item{
  197. width: 100%;height: 80px;border-radius: 5px;background-color: rgba(187, 187, 187, 0.2);
  198. margin-bottom: 10px;display: flex;align-items: center;padding: 20px;box-sizing: border-box;
  199. i{width: 34px;height: 34px;background-size: contain;display: inline-block;margin-right: 16px;background-repeat:no-repeat;background-position: center;}
  200. .phone-popper-title{font-size: 14px;color: #333;margin-bottom: 4px;display: inline-block;}
  201. .phone-popper-des{display:block;font-size: 12px;color: #9c9c9c;}
  202. // 列表
  203. &:nth-child(1){i{background-image:url("~static/images/client/component/head-cp-icon1.png");} }
  204. &:nth-child(2){i{background-image:url("~static/images/client/component/head-cp-icon2.png");} }
  205. &:nth-child(3){i{background-image:url("~static/images/client/component/head-cp-icon3.png");} }
  206. &:nth-child(4){i{background-image:url("~static/images/client/component/head-cp-icon4.png");} }
  207. }
  208. // 解决方案 - 二级菜单
  209. .jjfa-popper-content{
  210. width: 100%;border-radius: 5px;background-color: rgba(187, 187, 187, 0.2);margin-bottom: 10px;padding: 10px;box-sizing: border-box;
  211. h3{font-size: 14px;color: #333;display: block;font-weight: 700;margin-left: 8px;}
  212. .jjfa-link-box{width: 100%;display: flex;flex-wrap: wrap;}
  213. a{width: 33.33%;padding: 5px 8px;box-sizing: border-box}
  214. .jjfa-popper-title{width:100%;height: 24px;line-height: 24px;text-align:center;display:inline-block;
  215. font-size: 12px;color: rgba(16, 16, 16, 100);border-radius: 5px;border: 1px solid rgba(187, 187, 187, 100);}
  216. }
  217. // 菜单选中
  218. .menu-active {
  219. color: #00b96b;
  220. div.el-collapse-item__header {
  221. color: #00b96b;
  222. }
  223. }
  224. }
  225. </style>