main.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div id="main">
  3. <header-view v-if="!isInFrame"></header-view>
  4. <main-header></main-header>
  5. <main-nav></main-nav>
  6. <christmas></christmas>
  7. <nuxt/>
  8. <footer-view></footer-view>
  9. <right-bar></right-bar>
  10. </div>
  11. </template>
  12. <script>
  13. import { Header, Footer, RightBar, Christmas } from '~components/default'
  14. import { MainHeader, MainNav } from '~components/main'
  15. export default {
  16. name: 'main',
  17. components: {
  18. HeaderView: Header,
  19. FooterView: Footer,
  20. Christmas,
  21. RightBar,
  22. MainHeader,
  23. MainNav
  24. },
  25. // data () {
  26. // return {
  27. // isInFrame: false
  28. // }
  29. // },
  30. head () {
  31. return {
  32. title: this.title,
  33. meta: [
  34. {hid: 'description', name: 'description', content: this.description},
  35. {hid: 'keywords', name: 'keywords', content: this.keywords}
  36. ]
  37. }
  38. },
  39. computed: {
  40. isInFrame () {
  41. let cookies = this.$store.state.option.cookies
  42. let cookieArr = cookies.split(';')
  43. let cookieObj = {}
  44. for (let i = 0; i < cookieArr.length; i++) {
  45. let tmpArr = cookieArr[i].split('=') || []
  46. if (tmpArr.length === 2) {
  47. cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
  48. }
  49. }
  50. return cookieObj.type === 'erp' || this.$route.query.type === 'erp'
  51. },
  52. title () {
  53. let path = this.$route.path
  54. if (path === '/product/kind/home') {
  55. return '电子元器件器件选型参数型号查询器件类别分类大全-优软商城'
  56. } else if (path.startsWith('/product/kind/')) {
  57. return this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号大全-优软商城'
  58. } else if (path.startsWith('/product/component/')) {
  59. return this.componentDetail.brand.nameCn + this.componentDetail.code + '参数|供应商|数据手册中文资料|规格书-优软商城'
  60. } else if (path.startsWith('/product/brand/brandList/')) {
  61. return 'IC电子元器件品牌中心品牌大全-优软商城'
  62. } else if (path.startsWith('/product/brand/')) {
  63. return this.brandDetail.nameEn + '(' + this.brandDetail.nameCn + ')产品分类及产品型号大全-优软商城'
  64. } else if (path === '/provider/factories') {
  65. return 'IC电子元器件厂家原厂直销原厂专卖店大全-优软商城'
  66. } else if (path === '/provider/home') {
  67. return 'IC电子元器件代理商经销商专营店大全-优软商城'
  68. } else if (path === '/news') {
  69. return 'IC电子元器件行业市场资讯新闻-优软商城'
  70. } else if (path.startsWith('/news/')) {
  71. return this.newsDetail.title + '-电子元器件行业资讯-优软商城' || 'IC电子元器件行业市场资讯新闻-优软商城'
  72. } else if (path === '/search') {
  73. return this.$route.query.w + '-产品搜索-优软商城'
  74. } else if (path === '/searchStore') {
  75. return this.$route.query.w + '-店铺搜索-优软商城'
  76. } else {
  77. return '【优软商城】IC电子元器件现货采购交易平台商城'
  78. }
  79. },
  80. description () {
  81. let path = this.$route.path
  82. if (path === '/product/kind/home') {
  83. return '优软商城电子元器件器件型号查询器件类别分类大全,优软商城提供元器件智能选型服务,能让您完美的找到热门型号的替代型号产品,一键搜索功能让您快速找到您想要的型号。'
  84. } else if (path.startsWith('/product/kind/')) {
  85. return '优软商城' + this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号大全,能让您快速的找到' + this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号。'
  86. } else if (path.startsWith('/product/component/')) {
  87. return '优软商城提供' + this.componentDetail.brand.nameCn + this.componentDetail.code + '数据手册中文资料规格书下载,' + this.componentDetail.code + '供应商及参数报价。'
  88. } else if (path.startsWith('/product/brand/brandList/')) {
  89. return 'IC电子元器件品牌中心品牌大全,优软商城品牌中心汇聚国内国际电子元器件品牌,全力打造国家级元器件电商品台。'
  90. } else if (path.startsWith('/product/brand/')) {
  91. return this.brandDetail.brief
  92. } else if (path === '/provider/factories') {
  93. return 'IC电子元器件厂家原厂直销原厂专卖店大全,优软商城原厂专区提供IC电子元器件厂家原厂直销原厂专卖店大全。'
  94. } else if (path === '/provider/home') {
  95. return 'IC电子元器件代理商经销商专营店大全,优软商城代理经销专区提供IC电子元器件代理商经销商专卖店大全。'
  96. } else if (path === '/news') {
  97. return '优软商城电子元器件采购网提供精准的电子快讯,电子资讯,电子元器件资讯。'
  98. } else if (path.startsWith('/news/')) {
  99. return this.newsDetail.summary
  100. } else {
  101. return '优软商城(usoftmall.com)是中国领先的IC电子元器件现货采购交易网上商城,提供上千万种电子元器件现货采购交易,采购电子元器件就上优软商城!'
  102. }
  103. },
  104. keywords () {
  105. let path = this.$route.path
  106. if (path === '/product/kind/home') {
  107. return '电子元器件分类,电子元器件参数,电子元器件型号,电子元器件类别'
  108. } else if (path.startsWith('/product/kind/')) {
  109. return this.kinds[this.kinds.length - 1].nameCn
  110. } else if (path.startsWith('/product/component/')) {
  111. return this.componentDetail.code + '供应商,' + this.componentDetail.code + '数据手册,' + this.componentDetail.code + '规格书'
  112. } else if (path.startsWith('/product/brand/brandList/')) {
  113. return 'ic,元器件,品牌'
  114. } else if (path.startsWith('/product/brand/')) {
  115. return this.brandDetail.nameEn + '(' + this.brandDetail.nameCn
  116. } else if (path === '/provider/factories') {
  117. return '电子元器件原厂,电子元器件厂家'
  118. } else if (path === '/provider/home') {
  119. return 'ic代理商,ic经销商,电子元器件代理商 , 电子元器件经销商'
  120. } else if (path === '/news') {
  121. return '元器件新闻,电子资讯,电子元器件资讯'
  122. } else if (path.startsWith('/news/')) {
  123. return ''
  124. } else {
  125. return '优软商城'
  126. }
  127. },
  128. kinds () {
  129. return this.$store.state.product.kind.kindsParentWithBother.data
  130. },
  131. componentDetail () {
  132. return this.$store.state.componentDetail.detail.data
  133. },
  134. brandDetail () {
  135. return this.$store.state.brandDetail.detail.data
  136. },
  137. newsDetail () {
  138. return this.$store.state.newsData.detailNews.detailNews.data
  139. }
  140. }
  141. }
  142. </script>