default.vue 1.5 KB

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