main.vue 6.3 KB

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