main.vue 6.6 KB

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