sjNav.vue 4.8 KB

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