default.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. let cookies = this.$store.state.option.cookies
  26. let cookieArr = cookies.split(';')
  27. let cookieObj = {}
  28. for (let i = 0; i < cookieArr.length; i++) {
  29. if (cookieArr[i].indexOf('=') > -1) {
  30. let tmpArr = cookieArr[i].split('=')
  31. cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
  32. }
  33. }
  34. return cookieObj.type === 'erp'
  35. },
  36. title () {
  37. let path = this.$route.path
  38. if (path.startsWith('/help/helpList/')) {
  39. return this.helpTitle.item + '-优软商城'
  40. } else if (path.startsWith('/help/helpDetail')) {
  41. return this.helpDetail.title + '-优软商城'
  42. } else if (path.startsWith('/help')) {
  43. return '帮助中心-优软商城'
  44. } else {
  45. return '【优软商城】IC电子元器件现货采购交易平台商城'
  46. }
  47. },
  48. helpTitle () {
  49. return this.$store.state.help.title.data
  50. },
  51. helpDetail () {
  52. return this.$store.state.help.detail.data
  53. }
  54. }
  55. }
  56. </script>