sjNav.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <div class="phone-popper-box">
  3. <nuxt-link to="/" class="xwzx-row" :class="{'menu-active': curActive === 'shouye'}">首页</nuxt-link>
  4. <nuxt-link to="/examsystem" class="xwzx-row" :class="{'menu-active': curActive === 'examsystem'}">考试系统</nuxt-link>
  5. <nuxt-link to="/trainsystem" class="xwzx-row" :class="{'menu-active': curActive === 'trainsystem'}">培训系统</nuxt-link>
  6. <el-collapse accordion>
  7. <el-collapse-item title="课程定制服务" :class="{'menu-active': curActive === 'courseware'}">
  8. <nuxt-link :to="item.url" v-for="(item,index) in kckfList" :key="index" class="cpfw-popper-item">
  9. <i></i>
  10. <p>
  11. <span class="phone-popper-title">{{ item.title }}</span>
  12. <span class="phone-popper-des">{{ item.des }}</span>
  13. </p>
  14. </nuxt-link>
  15. </el-collapse-item>
  16. </el-collapse>
  17. <nuxt-link to="/news" class="xwzx-row" :class="{'menu-active': curActive === 'news'}">新闻资讯</nuxt-link>
  18. <nuxt-link to="/introduction" :class="{'menu-active': curActive === 'introduction'}">关于我们</nuxt-link>
  19. </div>
  20. </template>
  21. <script>
  22. export default {
  23. name: "sjNav",
  24. data() {
  25. return {
  26. kckfList: [
  27. {
  28. img: '#',
  29. title: '梗概',
  30. des: '为企业量身定做专属课程',
  31. url: '/courseware/synopsis'
  32. },
  33. {
  34. img: '#',
  35. title: '课程定制',
  36. des: '海量精品课程专业定制',
  37. url: '/courseware/custom'
  38. },
  39. {
  40. img: '#',
  41. title: '平台运营',
  42. des: '完善的平台运营体系',
  43. url: '/courseware/platform'
  44. },
  45. {
  46. img: '#',
  47. title: '课程大赛',
  48. des: '助力企业推动培训学习进程',
  49. url: '/courseware/compete'
  50. }
  51. ],
  52. }
  53. },
  54. computed: {
  55. curActive() {
  56. const courseware = this.kckfList.map(item => item.url);
  57. const routerPath = this.$route.path
  58. // 首页
  59. if (routerPath === '/' || routerPath === '/index') {
  60. return 'shouye'
  61. } else if (routerPath === '/examsystem') {
  62. return 'examsystem'
  63. }else if (routerPath === '/trainsystem') {
  64. return 'trainsystem'
  65. } else if (routerPath === '/news') {
  66. return 'news'
  67. } else if (routerPath === '/introduction') {
  68. return 'introduction'
  69. } else if (courseware.some(path => path === routerPath)) {
  70. return 'courseware'
  71. }
  72. }
  73. },
  74. watch: {
  75. '$route.path': {
  76. handler(newVal) {
  77. console.log(newVal)
  78. this.$emit('navChange')
  79. },
  80. immediate: true,
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .phone-popper-box {
  87. position: absolute;
  88. top: 61px;
  89. background: #fff;
  90. width: 100%;
  91. left: 0;
  92. padding: 0 15px;
  93. box-sizing: border-box;
  94. overflow: auto;
  95. height: calc(100vh - 112px);
  96. >a,.el-collapse-item__header{
  97. height: 60px;
  98. line-height: 60px;
  99. display: block;
  100. font-size: 16px;
  101. color: #101010;
  102. font-weight: 700;
  103. }
  104. .el-collapse{border-top:0;}
  105. .el-collapse-item__header{ display: flex;}
  106. // 新闻资讯
  107. .xwzx-row{border-bottom: 1px solid #EBEEF5;}
  108. // 产品服务 - 二级菜单
  109. .cpfw-popper-item{
  110. width: 100%;height: 80px;border-radius: 5px;background-color: rgba(187, 187, 187, 0.2);
  111. margin-bottom: 10px;display: flex;align-items: center;padding: 20px;box-sizing: border-box;
  112. i{width: 34px;height: 34px;background-size: contain;display: inline-block;margin-right: 16px;background-repeat:no-repeat;background-position: center;}
  113. .phone-popper-title{font-size: 14px;color: #333;margin-bottom: 4px;display: inline-block;}
  114. .phone-popper-des{display:block;font-size: 12px;color: #9c9c9c;}
  115. // 列表
  116. &:nth-child(1){i{background-image:url("~static/images/client/component/head-cp-icon1.png");} }
  117. &:nth-child(2){i{background-image:url("~static/images/client/component/head-cp-icon2.png");} }
  118. &:nth-child(3){i{background-image:url("~static/images/client/component/head-cp-icon3.png");} }
  119. &:nth-child(4){i{background-image:url("~static/images/client/component/head-cp-icon4.png");} }
  120. }
  121. // 解决方案 - 二级菜单
  122. .jjfa-popper-content{
  123. width: 100%;border-radius: 5px;background-color: rgba(187, 187, 187, 0.2);margin-bottom: 10px;padding: 10px;box-sizing: border-box;
  124. h3{font-size: 14px;color: #333;display: block;font-weight: 700;margin-left: 8px;}
  125. .jjfa-link-box{width: 100%;display: flex;flex-wrap: wrap;}
  126. a{width: 33.33%;padding: 5px 8px;box-sizing: border-box}
  127. .jjfa-popper-title{width:100%;height: 24px;line-height: 24px;text-align:center;display:inline-block;
  128. font-size: 12px;color: rgba(16, 16, 16, 100);border-radius: 5px;border: 1px solid rgba(187, 187, 187, 100);}
  129. }
  130. // 菜单选中
  131. .menu-active {
  132. color: #2b5cfd;
  133. div.el-collapse-item__header {
  134. color: #2b5cfd;
  135. }
  136. }
  137. }
  138. </style>