default.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div id="app">
  3. <header-view v-if="!isInFrame"></header-view>
  4. <nuxt/>
  5. <footer-view></footer-view>
  6. <right-bar></right-bar>
  7. </div>
  8. </template>
  9. <script>
  10. import { Header, Footer, RightBar } from '~components/default'
  11. export default {
  12. name: 'app',
  13. components: {
  14. HeaderView: Header,
  15. FooterView: Footer,
  16. RightBar
  17. },
  18. head () {
  19. return {
  20. title: this.title
  21. }
  22. },
  23. computed: {
  24. isInFrame () {
  25. if (this.$route.path === '/' || this.$route.path === '') {
  26. this.$store.dispatch('userType/setUserType', {type: this.$route.query.type || 'mall'})
  27. }
  28. return this.$store.state.userType.type.type.data === 'erp'
  29. },
  30. title () {
  31. let path = this.$route.path
  32. if (path.startsWith('/help/helpList/')) {
  33. return this.helpTitle.item + '-优软商城'
  34. } else if (path.startsWith('/help/helpDetail')) {
  35. return this.helpDetail.title + '-优软商城'
  36. } else if (path.startsWith('/help')) {
  37. return '帮助中心-优软商城'
  38. } else {
  39. return '【优软商城】IC电子元器件现货采购交易平台商城'
  40. }
  41. },
  42. helpTitle () {
  43. return this.$store.state.help.title.data
  44. },
  45. helpDetail () {
  46. return this.$store.state.help.detail.data
  47. }
  48. }
  49. }
  50. </script>