uservendor.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <div id="main" class="uservendor">
  3. <header-view v-if="!isInFrame"></header-view>
  4. <vendor-header></vendor-header>
  5. <nuxt/>
  6. <footer-view></footer-view>
  7. <right-bar></right-bar>
  8. </div>
  9. </template>
  10. <script>
  11. import { Header, Footer, RightBar } from '~components/default'
  12. import { VendorHeader } from '~components/main'
  13. export default {
  14. name: 'main',
  15. components: {
  16. HeaderView: Header,
  17. FooterView: Footer,
  18. RightBar,
  19. VendorHeader
  20. },
  21. head () {
  22. return {
  23. title: this.title,
  24. meta: [
  25. {hid: 'description', name: 'description', content: this.description},
  26. {hid: 'keywords', name: 'keywords', content: this.keywords}
  27. ]
  28. }
  29. },
  30. computed: {
  31. isMobile: function () {
  32. return this.$store.state.option.isMobile
  33. },
  34. isInFrame () {
  35. if (this.$route.query.type === 'erp') {
  36. this.$store.commit('option/ADD_COOKIES', 'type=erp;')
  37. return true
  38. } else {
  39. let cookies = this.$store.state.option.cookies
  40. let cookieArr = cookies.split(';')
  41. let cookieObj = {}
  42. for (let i = 0; i < cookieArr.length; i++) {
  43. let tmpArr = cookieArr[i].split('=') || []
  44. if (tmpArr.length === 2) {
  45. cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
  46. }
  47. }
  48. return cookieObj.type === 'erp'
  49. }
  50. },
  51. title () {
  52. return '卖家中心-优软商城'
  53. },
  54. description () {
  55. return '优软商城,电子元器件搜索引擎'
  56. },
  57. keywords () {
  58. return '软商城,B2B,B2C,行业门户,网上贸易,电子商务,网上贸易,网上交易,交易市场,在线交易,供求信息,采购,求购信息,供应信息'
  59. },
  60. kinds () {
  61. return this.$store.state.product.kind.kindsParentWithBother.data
  62. },
  63. componentDetail () {
  64. return this.$store.state.componentDetail.detail.data
  65. },
  66. brandDetail () {
  67. return this.$store.state.brandDetail.detail.data
  68. },
  69. newsDetail () {
  70. return this.$store.state.newsData.detailNews.detailNews.data
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .uservendor {
  77. background: #f7f7f7;
  78. }
  79. </style>